@dxos/client-services 0.1.51-main.c8526c2 → 0.1.51-main.d153dea
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-BAHSFG33.mjs → chunk-5W2L64HI.mjs} +38 -35
- package/dist/lib/browser/chunk-5W2L64HI.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/packlets/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +33 -30
- 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 +33 -30
- package/dist/lib/node/packlets/testing/index.cjs.map +3 -3
- package/dist/types/src/packlets/invitations/invitations-handler.d.ts.map +1 -1
- package/package.json +30 -30
- package/src/packlets/invitations/invitations-handler.ts +14 -6
- package/src/packlets/invitations/space-invitation-protocol.test.ts +8 -1
- package/dist/lib/browser/chunk-BAHSFG33.mjs.map +0 -7
|
@@ -969,8 +969,8 @@ var DeviceInvitationProtocol = class {
|
|
|
969
969
|
|
|
970
970
|
// packages/sdk/client-services/src/packlets/invitations/invitations-handler.ts
|
|
971
971
|
import assert6 from "@dxos/node-std/assert";
|
|
972
|
-
import { PushStream, scheduleTask as scheduleTask2,
|
|
973
|
-
import { AuthenticatingInvitationObservable, AUTHENTICATION_CODE_LENGTH, CancellableInvitationObservable, INVITATION_TIMEOUT
|
|
972
|
+
import { PushStream, scheduleTask as scheduleTask2, TimeoutError, Trigger as Trigger3 } from "@dxos/async";
|
|
973
|
+
import { AuthenticatingInvitationObservable, AUTHENTICATION_CODE_LENGTH, CancellableInvitationObservable, INVITATION_TIMEOUT } from "@dxos/client-protocol";
|
|
974
974
|
import { Context as Context4 } from "@dxos/context";
|
|
975
975
|
import { generatePasscode } from "@dxos/credentials";
|
|
976
976
|
import { InvalidInvitationExtensionRoleError as InvalidInvitationExtensionRoleError2 } from "@dxos/errors";
|
|
@@ -1326,7 +1326,7 @@ var InvitationsHandler = class {
|
|
|
1326
1326
|
...protocol.toJSON()
|
|
1327
1327
|
}, {
|
|
1328
1328
|
file: "invitations-handler.ts",
|
|
1329
|
-
line:
|
|
1329
|
+
line: 99,
|
|
1330
1330
|
scope: this,
|
|
1331
1331
|
callSite: (f, a) => f(...a)
|
|
1332
1332
|
});
|
|
@@ -1367,7 +1367,7 @@ var InvitationsHandler = class {
|
|
|
1367
1367
|
id: traceId
|
|
1368
1368
|
}), {
|
|
1369
1369
|
file: "invitations-handler.ts",
|
|
1370
|
-
line:
|
|
1370
|
+
line: 138,
|
|
1371
1371
|
scope: this,
|
|
1372
1372
|
callSite: (f, a) => f(...a)
|
|
1373
1373
|
});
|
|
@@ -1375,7 +1375,7 @@ var InvitationsHandler = class {
|
|
|
1375
1375
|
...protocol.toJSON()
|
|
1376
1376
|
}, {
|
|
1377
1377
|
file: "invitations-handler.ts",
|
|
1378
|
-
line:
|
|
1378
|
+
line: 139,
|
|
1379
1379
|
scope: this,
|
|
1380
1380
|
callSite: (f, a) => f(...a)
|
|
1381
1381
|
});
|
|
@@ -1391,7 +1391,7 @@ var InvitationsHandler = class {
|
|
|
1391
1391
|
...protocol.toJSON()
|
|
1392
1392
|
}, {
|
|
1393
1393
|
file: "invitations-handler.ts",
|
|
1394
|
-
line:
|
|
1394
|
+
line: 142,
|
|
1395
1395
|
scope: this,
|
|
1396
1396
|
callSite: (f, a) => f(...a)
|
|
1397
1397
|
});
|
|
@@ -1403,7 +1403,7 @@ var InvitationsHandler = class {
|
|
|
1403
1403
|
id: traceId
|
|
1404
1404
|
}), {
|
|
1405
1405
|
file: "invitations-handler.ts",
|
|
1406
|
-
line:
|
|
1406
|
+
line: 144,
|
|
1407
1407
|
scope: this,
|
|
1408
1408
|
callSite: (f, a) => f(...a)
|
|
1409
1409
|
});
|
|
@@ -1413,7 +1413,7 @@ var InvitationsHandler = class {
|
|
|
1413
1413
|
...protocol.toJSON()
|
|
1414
1414
|
}, {
|
|
1415
1415
|
file: "invitations-handler.ts",
|
|
1416
|
-
line:
|
|
1416
|
+
line: 147,
|
|
1417
1417
|
scope: this,
|
|
1418
1418
|
callSite: (f, a) => f(...a)
|
|
1419
1419
|
});
|
|
@@ -1424,7 +1424,7 @@ var InvitationsHandler = class {
|
|
|
1424
1424
|
} else {
|
|
1425
1425
|
log5.error("failed", err, {
|
|
1426
1426
|
file: "invitations-handler.ts",
|
|
1427
|
-
line:
|
|
1427
|
+
line: 150,
|
|
1428
1428
|
scope: this,
|
|
1429
1429
|
callSite: (f, a) => f(...a)
|
|
1430
1430
|
});
|
|
@@ -1435,13 +1435,13 @@ var InvitationsHandler = class {
|
|
|
1435
1435
|
error: err
|
|
1436
1436
|
}), {
|
|
1437
1437
|
file: "invitations-handler.ts",
|
|
1438
|
-
line:
|
|
1438
|
+
line: 153,
|
|
1439
1439
|
scope: this,
|
|
1440
1440
|
callSite: (f, a) => f(...a)
|
|
1441
1441
|
});
|
|
1442
1442
|
} finally {
|
|
1443
1443
|
if (type !== Invitation3.Type.MULTIUSE) {
|
|
1444
|
-
await
|
|
1444
|
+
await swarmConnection.close();
|
|
1445
1445
|
await ctx.dispose();
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
@@ -1477,9 +1477,10 @@ var InvitationsHandler = class {
|
|
|
1477
1477
|
});
|
|
1478
1478
|
return extension;
|
|
1479
1479
|
};
|
|
1480
|
+
let swarmConnection;
|
|
1480
1481
|
scheduleTask2(ctx, async () => {
|
|
1481
1482
|
const topic = invitation.swarmKey;
|
|
1482
|
-
|
|
1483
|
+
swarmConnection = await this._networkManager.joinSwarm({
|
|
1483
1484
|
topic,
|
|
1484
1485
|
peerId: topic,
|
|
1485
1486
|
protocolProvider: createTeleportProtocolFactory(async (teleport) => {
|
|
@@ -1510,6 +1511,7 @@ var InvitationsHandler = class {
|
|
|
1510
1511
|
const { timeout = INVITATION_TIMEOUT } = invitation;
|
|
1511
1512
|
assert6(protocol);
|
|
1512
1513
|
const authenticated = new Trigger3();
|
|
1514
|
+
let admitted = false;
|
|
1513
1515
|
let currentState;
|
|
1514
1516
|
const stream = new PushStream();
|
|
1515
1517
|
const setState = (newData) => {
|
|
@@ -1527,7 +1529,7 @@ var InvitationsHandler = class {
|
|
|
1527
1529
|
...protocol.toJSON()
|
|
1528
1530
|
}, {
|
|
1529
1531
|
file: "invitations-handler.ts",
|
|
1530
|
-
line:
|
|
1532
|
+
line: 230,
|
|
1531
1533
|
scope: this,
|
|
1532
1534
|
callSite: (f, a) => f(...a)
|
|
1533
1535
|
});
|
|
@@ -1537,7 +1539,7 @@ var InvitationsHandler = class {
|
|
|
1537
1539
|
} else {
|
|
1538
1540
|
log5.warn("auth failed", err, {
|
|
1539
1541
|
file: "invitations-handler.ts",
|
|
1540
|
-
line:
|
|
1542
|
+
line: 233,
|
|
1541
1543
|
scope: this,
|
|
1542
1544
|
callSite: (f, a) => f(...a)
|
|
1543
1545
|
});
|
|
@@ -1551,7 +1553,7 @@ var InvitationsHandler = class {
|
|
|
1551
1553
|
...protocol.toJSON()
|
|
1552
1554
|
}, {
|
|
1553
1555
|
file: "invitations-handler.ts",
|
|
1554
|
-
line:
|
|
1556
|
+
line: 241,
|
|
1555
1557
|
scope: this,
|
|
1556
1558
|
callSite: (f, a) => f(...a)
|
|
1557
1559
|
});
|
|
@@ -1566,11 +1568,11 @@ var InvitationsHandler = class {
|
|
|
1566
1568
|
currentState
|
|
1567
1569
|
}, {
|
|
1568
1570
|
file: "invitations-handler.ts",
|
|
1569
|
-
line:
|
|
1571
|
+
line: 251,
|
|
1570
1572
|
scope: this,
|
|
1571
1573
|
callSite: (f, a) => f(...a)
|
|
1572
1574
|
});
|
|
1573
|
-
if (
|
|
1575
|
+
if (!admitted) {
|
|
1574
1576
|
stream.error(new Error("Remote peer disconnected."));
|
|
1575
1577
|
}
|
|
1576
1578
|
});
|
|
@@ -1581,7 +1583,7 @@ var InvitationsHandler = class {
|
|
|
1581
1583
|
id: traceId
|
|
1582
1584
|
}), {
|
|
1583
1585
|
file: "invitations-handler.ts",
|
|
1584
|
-
line:
|
|
1586
|
+
line: 260,
|
|
1585
1587
|
scope: this,
|
|
1586
1588
|
callSite: (f, a) => f(...a)
|
|
1587
1589
|
});
|
|
@@ -1593,7 +1595,7 @@ var InvitationsHandler = class {
|
|
|
1593
1595
|
...protocol.toJSON()
|
|
1594
1596
|
}, {
|
|
1595
1597
|
file: "invitations-handler.ts",
|
|
1596
|
-
line:
|
|
1598
|
+
line: 268,
|
|
1597
1599
|
scope: this,
|
|
1598
1600
|
callSite: (f, a) => f(...a)
|
|
1599
1601
|
});
|
|
@@ -1604,7 +1606,7 @@ var InvitationsHandler = class {
|
|
|
1604
1606
|
...protocol.toJSON()
|
|
1605
1607
|
}, {
|
|
1606
1608
|
file: "invitations-handler.ts",
|
|
1607
|
-
line:
|
|
1609
|
+
line: 272,
|
|
1608
1610
|
scope: this,
|
|
1609
1611
|
callSite: (f, a) => f(...a)
|
|
1610
1612
|
});
|
|
@@ -1614,7 +1616,7 @@ var InvitationsHandler = class {
|
|
|
1614
1616
|
response: introductionResponse
|
|
1615
1617
|
}, {
|
|
1616
1618
|
file: "invitations-handler.ts",
|
|
1617
|
-
line:
|
|
1619
|
+
line: 276,
|
|
1618
1620
|
scope: this,
|
|
1619
1621
|
callSite: (f, a) => f(...a)
|
|
1620
1622
|
});
|
|
@@ -1626,7 +1628,7 @@ var InvitationsHandler = class {
|
|
|
1626
1628
|
for (let attempt = 1; attempt <= MAX_OTP_ATTEMPTS; attempt++) {
|
|
1627
1629
|
log5("guest waiting for authentication code...", {}, {
|
|
1628
1630
|
file: "invitations-handler.ts",
|
|
1629
|
-
line:
|
|
1631
|
+
line: 285,
|
|
1630
1632
|
scope: this,
|
|
1631
1633
|
callSite: (f, a) => f(...a)
|
|
1632
1634
|
});
|
|
@@ -1638,7 +1640,7 @@ var InvitationsHandler = class {
|
|
|
1638
1640
|
});
|
|
1639
1641
|
log5("sending authentication request", {}, {
|
|
1640
1642
|
file: "invitations-handler.ts",
|
|
1641
|
-
line:
|
|
1643
|
+
line: 289,
|
|
1642
1644
|
scope: this,
|
|
1643
1645
|
callSite: (f, a) => f(...a)
|
|
1644
1646
|
});
|
|
@@ -1659,7 +1661,7 @@ var InvitationsHandler = class {
|
|
|
1659
1661
|
attempt
|
|
1660
1662
|
}, {
|
|
1661
1663
|
file: "invitations-handler.ts",
|
|
1662
|
-
line:
|
|
1664
|
+
line: 300,
|
|
1663
1665
|
scope: this,
|
|
1664
1666
|
callSite: (f, a) => f(...a)
|
|
1665
1667
|
});
|
|
@@ -1676,18 +1678,19 @@ var InvitationsHandler = class {
|
|
|
1676
1678
|
...protocol.toJSON()
|
|
1677
1679
|
}, {
|
|
1678
1680
|
file: "invitations-handler.ts",
|
|
1679
|
-
line:
|
|
1681
|
+
line: 311,
|
|
1680
1682
|
scope: this,
|
|
1681
1683
|
callSite: (f, a) => f(...a)
|
|
1682
1684
|
});
|
|
1683
1685
|
const admissionRequest = await protocol.createAdmissionRequest();
|
|
1684
1686
|
const admissionResponse = await extension.rpc.InvitationHostService.admit(admissionRequest);
|
|
1687
|
+
admitted = true;
|
|
1685
1688
|
const result = await protocol.accept(admissionResponse, admissionRequest);
|
|
1686
1689
|
log5("admitted by host", {
|
|
1687
1690
|
...protocol.toJSON()
|
|
1688
1691
|
}, {
|
|
1689
1692
|
file: "invitations-handler.ts",
|
|
1690
|
-
line:
|
|
1693
|
+
line: 322,
|
|
1691
1694
|
scope: this,
|
|
1692
1695
|
callSite: (f, a) => f(...a)
|
|
1693
1696
|
});
|
|
@@ -1699,7 +1702,7 @@ var InvitationsHandler = class {
|
|
|
1699
1702
|
id: traceId
|
|
1700
1703
|
}), {
|
|
1701
1704
|
file: "invitations-handler.ts",
|
|
1702
|
-
line:
|
|
1705
|
+
line: 324,
|
|
1703
1706
|
scope: this,
|
|
1704
1707
|
callSite: (f, a) => f(...a)
|
|
1705
1708
|
});
|
|
@@ -1709,7 +1712,7 @@ var InvitationsHandler = class {
|
|
|
1709
1712
|
...protocol.toJSON()
|
|
1710
1713
|
}, {
|
|
1711
1714
|
file: "invitations-handler.ts",
|
|
1712
|
-
line:
|
|
1715
|
+
line: 327,
|
|
1713
1716
|
scope: this,
|
|
1714
1717
|
callSite: (f, a) => f(...a)
|
|
1715
1718
|
});
|
|
@@ -1719,7 +1722,7 @@ var InvitationsHandler = class {
|
|
|
1719
1722
|
} else {
|
|
1720
1723
|
log5("auth failed", err, {
|
|
1721
1724
|
file: "invitations-handler.ts",
|
|
1722
|
-
line:
|
|
1725
|
+
line: 330,
|
|
1723
1726
|
scope: this,
|
|
1724
1727
|
callSite: (f, a) => f(...a)
|
|
1725
1728
|
});
|
|
@@ -1730,7 +1733,7 @@ var InvitationsHandler = class {
|
|
|
1730
1733
|
error: err
|
|
1731
1734
|
}), {
|
|
1732
1735
|
file: "invitations-handler.ts",
|
|
1733
|
-
line:
|
|
1736
|
+
line: 333,
|
|
1734
1737
|
scope: this,
|
|
1735
1738
|
callSite: (f, a) => f(...a)
|
|
1736
1739
|
});
|
|
@@ -1748,7 +1751,7 @@ var InvitationsHandler = class {
|
|
|
1748
1751
|
...protocol.toJSON()
|
|
1749
1752
|
}, {
|
|
1750
1753
|
file: "invitations-handler.ts",
|
|
1751
|
-
line:
|
|
1754
|
+
line: 344,
|
|
1752
1755
|
scope: this,
|
|
1753
1756
|
callSite: (f, a) => f(...a)
|
|
1754
1757
|
});
|
|
@@ -1758,7 +1761,7 @@ var InvitationsHandler = class {
|
|
|
1758
1761
|
} else {
|
|
1759
1762
|
log5("auth failed", err, {
|
|
1760
1763
|
file: "invitations-handler.ts",
|
|
1761
|
-
line:
|
|
1764
|
+
line: 347,
|
|
1762
1765
|
scope: this,
|
|
1763
1766
|
callSite: (f, a) => f(...a)
|
|
1764
1767
|
});
|
|
@@ -2199,7 +2202,7 @@ import { ComplexSet as ComplexSet2 } from "@dxos/util";
|
|
|
2199
2202
|
|
|
2200
2203
|
// packages/sdk/client-services/src/packlets/spaces/notarization-plugin.ts
|
|
2201
2204
|
import assert9 from "@dxos/node-std/assert";
|
|
2202
|
-
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep
|
|
2205
|
+
import { DeferredTask, Event as Event4, scheduleTask as scheduleTask3, sleep, TimeoutError as TimeoutError2, Trigger as Trigger5 } from "@dxos/async";
|
|
2203
2206
|
import { Context as Context5, rejectOnDispose } from "@dxos/context";
|
|
2204
2207
|
import { PublicKey as PublicKey6 } from "@dxos/keys";
|
|
2205
2208
|
import { log as log9 } from "@dxos/log";
|
|
@@ -2309,7 +2312,7 @@ var NotarizationPlugin = class {
|
|
|
2309
2312
|
scope: this,
|
|
2310
2313
|
callSite: (f, a) => f(...a)
|
|
2311
2314
|
});
|
|
2312
|
-
await
|
|
2315
|
+
await sleep(successDelay);
|
|
2313
2316
|
} catch (err) {
|
|
2314
2317
|
if (!ctx.disposed && !err.message.includes(WRITER_NOT_SET_ERROR_CODE)) {
|
|
2315
2318
|
log9.warn("error notarizing (recoverable)", err, {
|
|
@@ -3952,4 +3955,4 @@ export {
|
|
|
3952
3955
|
ClientServicesHost,
|
|
3953
3956
|
LocalClientServices
|
|
3954
3957
|
};
|
|
3955
|
-
//# sourceMappingURL=chunk-
|
|
3958
|
+
//# sourceMappingURL=chunk-5W2L64HI.mjs.map
|