@dxos/client-services 0.8.4-main.72ec0f3 → 0.8.4-main.7ace549
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-HJH6BNTN.mjs → chunk-NXGWBEOK.mjs} +137 -100
- package/dist/lib/browser/chunk-NXGWBEOK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-ONQM6RQH.mjs → chunk-AO4R6IID.mjs} +137 -100
- package/dist/lib/node-esm/chunk-AO4R6IID.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts +2 -2
- package/dist/types/src/packlets/invitations/device-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-guest-extenstion.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-host-extension.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts +2 -3
- package/dist/types/src/packlets/invitations/invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts +2 -2
- package/dist/types/src/packlets/invitations/space-invitation-protocol.d.ts.map +1 -1
- package/dist/types/src/packlets/space-export/space-archive-writer.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space-manager.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/spaces-service.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -37
- package/src/packlets/invitations/device-invitation-protocol.ts +3 -3
- package/src/packlets/invitations/invitation-guest-extenstion.ts +6 -4
- package/src/packlets/invitations/invitation-host-extension.ts +6 -4
- package/src/packlets/invitations/invitation-protocol.ts +2 -3
- package/src/packlets/invitations/invitations-handler.ts +1 -1
- package/src/packlets/invitations/space-invitation-protocol.ts +7 -13
- package/src/packlets/space-export/space-archive-reader.ts +1 -1
- package/src/packlets/space-export/space-archive-writer.ts +1 -0
- package/src/packlets/spaces/data-space-manager.ts +10 -6
- package/src/packlets/spaces/data-space.ts +1 -1
- package/src/packlets/spaces/notarization-plugin.ts +2 -2
- package/src/packlets/spaces/spaces-service.ts +10 -7
- package/src/packlets/storage/storage.ts +4 -4
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-HJH6BNTN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ONQM6RQH.mjs.map +0 -7
|
@@ -396,7 +396,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
|
396
396
|
import { TRACE_PROCESSOR } from "@dxos/tracing";
|
|
397
397
|
|
|
398
398
|
// src/version.ts
|
|
399
|
-
var DXOS_VERSION = "0.8.4-main.
|
|
399
|
+
var DXOS_VERSION = "0.8.4-main.7ace549";
|
|
400
400
|
|
|
401
401
|
// src/packlets/services/platform.ts
|
|
402
402
|
import { Platform } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1275,15 +1275,16 @@ import { ComplexSet } from "@dxos/util";
|
|
|
1275
1275
|
// src/packlets/spaces/data-space-manager.ts
|
|
1276
1276
|
import { interpretAsDocumentId } from "@automerge/automerge-repo";
|
|
1277
1277
|
import { Event as Event2, synchronized, trackLeaks } from "@dxos/async";
|
|
1278
|
-
import {
|
|
1278
|
+
import { SpaceProperties } from "@dxos/client-protocol";
|
|
1279
1279
|
import { Context as Context4, LifecycleState, Resource as Resource2, cancelWithContext } from "@dxos/context";
|
|
1280
1280
|
import { createAdmissionCredentials, getCredentialAssertion } from "@dxos/credentials";
|
|
1281
|
-
import {
|
|
1281
|
+
import { Type } from "@dxos/echo";
|
|
1282
|
+
import { getTypeReference } from "@dxos/echo/internal";
|
|
1282
1283
|
import { AuthStatus, CredentialServerExtension, DatabaseRoot, FIND_PARAMS, findInlineObjectOfType } from "@dxos/echo-pipeline";
|
|
1283
1284
|
import { SpaceDocVersion, createIdFromSpaceKey, encodeReference } from "@dxos/echo-protocol";
|
|
1284
1285
|
import { writeMessages } from "@dxos/feed-store";
|
|
1285
1286
|
import { assertArgument, assertState, failedInvariant, invariant as invariant3 } from "@dxos/invariant";
|
|
1286
|
-
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1287
|
+
import { ObjectId, PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1287
1288
|
import { log as log4 } from "@dxos/log";
|
|
1288
1289
|
import { AlreadyJoinedError, trace as Trace } from "@dxos/protocols";
|
|
1289
1290
|
import { Invitation, SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1415,7 +1416,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1415
1416
|
const rootHandle = rootUrl ? await this._echoHost.automergeRepo.find(rootUrl, FIND_PARAMS) : void 0;
|
|
1416
1417
|
await rootHandle?.whenReady();
|
|
1417
1418
|
const rootDoc = rootHandle?.doc();
|
|
1418
|
-
const properties = rootDoc && findInlineObjectOfType(rootDoc,
|
|
1419
|
+
const properties = rootDoc && findInlineObjectOfType(rootDoc, Type.getTypename(SpaceProperties));
|
|
1419
1420
|
return {
|
|
1420
1421
|
key: space.key.toHex(),
|
|
1421
1422
|
state: SpaceState[space.state],
|
|
@@ -1442,7 +1443,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1442
1443
|
async _open() {
|
|
1443
1444
|
log4("open", void 0, {
|
|
1444
1445
|
F: __dxlog_file6,
|
|
1445
|
-
L:
|
|
1446
|
+
L: 217,
|
|
1446
1447
|
S: this,
|
|
1447
1448
|
C: (f, a) => f(...a)
|
|
1448
1449
|
});
|
|
@@ -1450,7 +1451,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1450
1451
|
id: this._instanceId
|
|
1451
1452
|
}), {
|
|
1452
1453
|
F: __dxlog_file6,
|
|
1453
|
-
L:
|
|
1454
|
+
L: 218,
|
|
1454
1455
|
S: this,
|
|
1455
1456
|
C: (f, a) => f(...a)
|
|
1456
1457
|
});
|
|
@@ -1458,7 +1459,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1458
1459
|
spaces: this._metadataStore.spaces.length
|
|
1459
1460
|
}, {
|
|
1460
1461
|
F: __dxlog_file6,
|
|
1461
|
-
L:
|
|
1462
|
+
L: 219,
|
|
1462
1463
|
S: this,
|
|
1463
1464
|
C: (f, a) => f(...a)
|
|
1464
1465
|
});
|
|
@@ -1468,7 +1469,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1468
1469
|
spaceMetadata
|
|
1469
1470
|
}, {
|
|
1470
1471
|
F: __dxlog_file6,
|
|
1471
|
-
L:
|
|
1472
|
+
L: 223,
|
|
1472
1473
|
S: this,
|
|
1473
1474
|
C: (f, a) => f(...a)
|
|
1474
1475
|
});
|
|
@@ -1479,7 +1480,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1479
1480
|
err
|
|
1480
1481
|
}, {
|
|
1481
1482
|
F: __dxlog_file6,
|
|
1482
|
-
L:
|
|
1483
|
+
L: 226,
|
|
1483
1484
|
S: this,
|
|
1484
1485
|
C: (f, a) => f(...a)
|
|
1485
1486
|
});
|
|
@@ -1490,7 +1491,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1490
1491
|
id: this._instanceId
|
|
1491
1492
|
}), {
|
|
1492
1493
|
F: __dxlog_file6,
|
|
1493
|
-
L:
|
|
1494
|
+
L: 232,
|
|
1494
1495
|
S: this,
|
|
1495
1496
|
C: (f, a) => f(...a)
|
|
1496
1497
|
});
|
|
@@ -1498,7 +1499,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1498
1499
|
async _close() {
|
|
1499
1500
|
log4("close", void 0, {
|
|
1500
1501
|
F: __dxlog_file6,
|
|
1501
|
-
L:
|
|
1502
|
+
L: 237,
|
|
1502
1503
|
S: this,
|
|
1503
1504
|
C: (f, a) => f(...a)
|
|
1504
1505
|
});
|
|
@@ -1529,7 +1530,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1529
1530
|
spaceKey
|
|
1530
1531
|
}, {
|
|
1531
1532
|
F: __dxlog_file6,
|
|
1532
|
-
L:
|
|
1533
|
+
L: 270,
|
|
1533
1534
|
S: this,
|
|
1534
1535
|
C: (f, a) => f(...a)
|
|
1535
1536
|
});
|
|
@@ -1537,7 +1538,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1537
1538
|
if (options.documents) {
|
|
1538
1539
|
invariant3(Object.keys(options.documents).every((documentId) => /^[a-zA-Z0-9]+$/.test(documentId)), "Invalid document IDs", {
|
|
1539
1540
|
F: __dxlog_file6,
|
|
1540
|
-
L:
|
|
1541
|
+
L: 275,
|
|
1541
1542
|
S: this,
|
|
1542
1543
|
A: [
|
|
1543
1544
|
"Object.keys(options.documents).every((documentId) => /^[a-zA-Z0-9]+$/.test(documentId))",
|
|
@@ -1549,7 +1550,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1549
1550
|
documentId
|
|
1550
1551
|
}, {
|
|
1551
1552
|
F: __dxlog_file6,
|
|
1552
|
-
L:
|
|
1553
|
+
L: 282,
|
|
1553
1554
|
S: this,
|
|
1554
1555
|
C: (f, a) => f(...a)
|
|
1555
1556
|
});
|
|
@@ -1568,7 +1569,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1568
1569
|
spaceKey
|
|
1569
1570
|
}, {
|
|
1570
1571
|
F: __dxlog_file6,
|
|
1571
|
-
L:
|
|
1572
|
+
L: 300,
|
|
1572
1573
|
S: this,
|
|
1573
1574
|
C: (f, a) => f(...a)
|
|
1574
1575
|
});
|
|
@@ -1577,7 +1578,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1577
1578
|
const newRootDocId = documentIdMapping[interpretAsDocumentId(options.rootUrl)] ?? failedInvariant();
|
|
1578
1579
|
const rootDocHandle = await this._echoHost.loadDoc(Context4.default(void 0, {
|
|
1579
1580
|
F: __dxlog_file6,
|
|
1580
|
-
L:
|
|
1581
|
+
L: 305
|
|
1581
1582
|
}), newRootDocId);
|
|
1582
1583
|
DatabaseRoot.mapLinks(rootDocHandle, documentIdMapping);
|
|
1583
1584
|
root = await this._echoHost.openSpaceRoot(spaceId, `automerge:${newRootDocId}`);
|
|
@@ -1589,7 +1590,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1589
1590
|
spaceKey
|
|
1590
1591
|
}, {
|
|
1591
1592
|
F: __dxlog_file6,
|
|
1592
|
-
L:
|
|
1593
|
+
L: 314,
|
|
1593
1594
|
S: this,
|
|
1594
1595
|
C: (f, a) => f(...a)
|
|
1595
1596
|
});
|
|
@@ -1599,7 +1600,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1599
1600
|
spaceKey
|
|
1600
1601
|
}, {
|
|
1601
1602
|
F: __dxlog_file6,
|
|
1602
|
-
L:
|
|
1603
|
+
L: 319,
|
|
1603
1604
|
S: this,
|
|
1604
1605
|
C: (f, a) => f(...a)
|
|
1605
1606
|
});
|
|
@@ -1608,7 +1609,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1608
1609
|
const memberCredential = credentials[1];
|
|
1609
1610
|
invariant3(getCredentialAssertion(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
1610
1611
|
F: __dxlog_file6,
|
|
1611
|
-
L:
|
|
1612
|
+
L: 325,
|
|
1612
1613
|
S: this,
|
|
1613
1614
|
A: [
|
|
1614
1615
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -1622,7 +1623,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1622
1623
|
spaceKey
|
|
1623
1624
|
}, {
|
|
1624
1625
|
F: __dxlog_file6,
|
|
1625
|
-
L:
|
|
1626
|
+
L: 330,
|
|
1626
1627
|
S: this,
|
|
1627
1628
|
C: (f, a) => f(...a)
|
|
1628
1629
|
});
|
|
@@ -1640,13 +1641,13 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1640
1641
|
spaceId: space.id
|
|
1641
1642
|
}, {
|
|
1642
1643
|
F: __dxlog_file6,
|
|
1643
|
-
L:
|
|
1644
|
+
L: 343,
|
|
1644
1645
|
S: this,
|
|
1645
1646
|
C: (f, a) => f(...a)
|
|
1646
1647
|
});
|
|
1647
1648
|
await space.databaseRoot.handle.whenReady();
|
|
1648
1649
|
}
|
|
1649
|
-
const [_, properties] = findInlineObjectOfType(space.databaseRoot.doc(),
|
|
1650
|
+
const [_, properties] = findInlineObjectOfType(space.databaseRoot.doc(), Type.getTypename(SpaceProperties)) ?? [];
|
|
1650
1651
|
return properties?.data?.[DEFAULT_SPACE_KEY] === this._signingContext.identityKey.toHex();
|
|
1651
1652
|
}
|
|
1652
1653
|
case SpaceDocVersion.LEGACY: {
|
|
@@ -1658,7 +1659,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1658
1659
|
spaceId: space.id
|
|
1659
1660
|
}, {
|
|
1660
1661
|
F: __dxlog_file6,
|
|
1661
|
-
L:
|
|
1662
|
+
L: 357,
|
|
1662
1663
|
S: this,
|
|
1663
1664
|
C: (f, a) => f(...a)
|
|
1664
1665
|
});
|
|
@@ -1670,7 +1671,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1670
1671
|
const document = await this._getSpaceRootDocument(space);
|
|
1671
1672
|
const properties = {
|
|
1672
1673
|
system: {
|
|
1673
|
-
type: encodeReference(getTypeReference(
|
|
1674
|
+
type: encodeReference(getTypeReference(SpaceProperties))
|
|
1674
1675
|
},
|
|
1675
1676
|
data: {
|
|
1676
1677
|
[DEFAULT_SPACE_KEY]: this._signingContext.identityKey.toHex()
|
|
@@ -1693,7 +1694,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1693
1694
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
1694
1695
|
invariant3(automergeIndex, void 0, {
|
|
1695
1696
|
F: __dxlog_file6,
|
|
1696
|
-
L:
|
|
1697
|
+
L: 390,
|
|
1697
1698
|
S: this,
|
|
1698
1699
|
A: [
|
|
1699
1700
|
"automergeIndex",
|
|
@@ -1710,13 +1711,13 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1710
1711
|
opts
|
|
1711
1712
|
}, {
|
|
1712
1713
|
F: __dxlog_file6,
|
|
1713
|
-
L:
|
|
1714
|
+
L: 399,
|
|
1714
1715
|
S: this,
|
|
1715
1716
|
C: (f, a) => f(...a)
|
|
1716
1717
|
});
|
|
1717
1718
|
invariant3(this._lifecycleState === LifecycleState.OPEN, "Not open.", {
|
|
1718
1719
|
F: __dxlog_file6,
|
|
1719
|
-
L:
|
|
1720
|
+
L: 400,
|
|
1720
1721
|
S: this,
|
|
1721
1722
|
A: [
|
|
1722
1723
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -1725,7 +1726,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1725
1726
|
});
|
|
1726
1727
|
invariant3(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
1727
1728
|
F: __dxlog_file6,
|
|
1728
|
-
L:
|
|
1729
|
+
L: 401,
|
|
1729
1730
|
S: this,
|
|
1730
1731
|
A: [
|
|
1731
1732
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -1749,7 +1750,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1749
1750
|
const space = this._spaceManager.spaces.get(options.spaceKey);
|
|
1750
1751
|
invariant3(space, void 0, {
|
|
1751
1752
|
F: __dxlog_file6,
|
|
1752
|
-
L:
|
|
1753
|
+
L: 421,
|
|
1753
1754
|
S: this,
|
|
1754
1755
|
A: [
|
|
1755
1756
|
"space",
|
|
@@ -1762,7 +1763,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1762
1763
|
const credentials = await createAdmissionCredentials(this._signingContext.credentialSigner, options.identityKey, space.key, space.genesisFeedKey, options.role, space.spaceState.membershipChainHeads, options.profile, options.delegationCredentialId);
|
|
1763
1764
|
invariant3(credentials[0].credential, void 0, {
|
|
1764
1765
|
F: __dxlog_file6,
|
|
1765
|
-
L:
|
|
1766
|
+
L: 440,
|
|
1766
1767
|
S: this,
|
|
1767
1768
|
A: [
|
|
1768
1769
|
"credentials[0].credential",
|
|
@@ -1772,7 +1773,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1772
1773
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
1773
1774
|
invariant3(getCredentialAssertion(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
1774
1775
|
F: __dxlog_file6,
|
|
1775
|
-
L:
|
|
1776
|
+
L: 442,
|
|
1776
1777
|
S: this,
|
|
1777
1778
|
A: [
|
|
1778
1779
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -1810,7 +1811,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1810
1811
|
const space = this._spaces.get(spaceKey);
|
|
1811
1812
|
invariant3(space, "Space not found.", {
|
|
1812
1813
|
F: __dxlog_file6,
|
|
1813
|
-
L:
|
|
1814
|
+
L: 479,
|
|
1814
1815
|
S: this,
|
|
1815
1816
|
A: [
|
|
1816
1817
|
"space",
|
|
@@ -1835,7 +1836,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1835
1836
|
metadata
|
|
1836
1837
|
}, {
|
|
1837
1838
|
F: __dxlog_file6,
|
|
1838
|
-
L:
|
|
1839
|
+
L: 498,
|
|
1839
1840
|
S: this,
|
|
1840
1841
|
C: (f, a) => f(...a)
|
|
1841
1842
|
});
|
|
@@ -1879,7 +1880,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1879
1880
|
err
|
|
1880
1881
|
}, {
|
|
1881
1882
|
F: __dxlog_file6,
|
|
1882
|
-
L:
|
|
1883
|
+
L: 540,
|
|
1883
1884
|
S: this,
|
|
1884
1885
|
C: (f, a) => f(...a)
|
|
1885
1886
|
});
|
|
@@ -1889,7 +1890,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1889
1890
|
onAuthFailure: () => {
|
|
1890
1891
|
log4.warn("auth failure", void 0, {
|
|
1891
1892
|
F: __dxlog_file6,
|
|
1892
|
-
L:
|
|
1893
|
+
L: 545,
|
|
1893
1894
|
S: this,
|
|
1894
1895
|
C: (f, a) => f(...a)
|
|
1895
1896
|
});
|
|
@@ -1922,7 +1923,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1922
1923
|
space: space.key
|
|
1923
1924
|
}, {
|
|
1924
1925
|
F: __dxlog_file6,
|
|
1925
|
-
L:
|
|
1926
|
+
L: 572,
|
|
1926
1927
|
S: this,
|
|
1927
1928
|
C: (f, a) => f(...a)
|
|
1928
1929
|
});
|
|
@@ -1933,7 +1934,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1933
1934
|
open: this._lifecycleState === LifecycleState.OPEN
|
|
1934
1935
|
}, {
|
|
1935
1936
|
F: __dxlog_file6,
|
|
1936
|
-
L:
|
|
1937
|
+
L: 575,
|
|
1937
1938
|
S: this,
|
|
1938
1939
|
C: (f, a) => f(...a)
|
|
1939
1940
|
});
|
|
@@ -1952,7 +1953,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1952
1953
|
space: space.key
|
|
1953
1954
|
}, {
|
|
1954
1955
|
F: __dxlog_file6,
|
|
1955
|
-
L:
|
|
1956
|
+
L: 583,
|
|
1956
1957
|
S: this,
|
|
1957
1958
|
C: (f, a) => f(...a)
|
|
1958
1959
|
});
|
|
@@ -1973,7 +1974,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1973
1974
|
spaceId: dataSpace.id
|
|
1974
1975
|
}, {
|
|
1975
1976
|
F: __dxlog_file6,
|
|
1976
|
-
L:
|
|
1977
|
+
L: 597,
|
|
1977
1978
|
S: this,
|
|
1978
1979
|
C: (f, a) => f(...a)
|
|
1979
1980
|
});
|
|
@@ -2003,7 +2004,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2003
2004
|
space: space.key
|
|
2004
2005
|
}, {
|
|
2005
2006
|
F: __dxlog_file6,
|
|
2006
|
-
L:
|
|
2007
|
+
L: 624,
|
|
2007
2008
|
S: this,
|
|
2008
2009
|
C: (f, a) => f(...a)
|
|
2009
2010
|
});
|
|
@@ -2036,7 +2037,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2036
2037
|
closedSessions
|
|
2037
2038
|
}, {
|
|
2038
2039
|
F: __dxlog_file6,
|
|
2039
|
-
L:
|
|
2040
|
+
L: 650,
|
|
2040
2041
|
S: this,
|
|
2041
2042
|
C: (f, a) => f(...a)
|
|
2042
2043
|
});
|
|
@@ -2051,7 +2052,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2051
2052
|
peerId: peerState.peerId
|
|
2052
2053
|
}, {
|
|
2053
2054
|
F: __dxlog_file6,
|
|
2054
|
-
L:
|
|
2055
|
+
L: 664,
|
|
2055
2056
|
S: this,
|
|
2056
2057
|
C: (f, a) => f(...a)
|
|
2057
2058
|
});
|
|
@@ -2173,6 +2174,7 @@ var SpaceArchiveWriter = class extends Resource3 {
|
|
|
2173
2174
|
this._archive.addTextFile(SpaceArchiveFileStructure.metadata, JSON.stringify(metadata));
|
|
2174
2175
|
const binary = this._archive.toUint8Array();
|
|
2175
2176
|
return {
|
|
2177
|
+
// TODO(wittjosiah): Factor out file name construction.
|
|
2176
2178
|
filename: `${(/* @__PURE__ */ new Date()).toISOString()}-${this._meta.spaceId}.tar`,
|
|
2177
2179
|
contents: binary
|
|
2178
2180
|
};
|
|
@@ -2204,7 +2206,7 @@ var extractSpaceArchive = async (archive) => {
|
|
|
2204
2206
|
});
|
|
2205
2207
|
documents[documentId] = entry2.content ?? failedInvariant2();
|
|
2206
2208
|
}
|
|
2207
|
-
log5
|
|
2209
|
+
log5("extracted space archive", {
|
|
2208
2210
|
metadata,
|
|
2209
2211
|
documents
|
|
2210
2212
|
}, {
|
|
@@ -2314,7 +2316,9 @@ var SpacesServiceImpl = class {
|
|
|
2314
2316
|
await space.deactivate();
|
|
2315
2317
|
break;
|
|
2316
2318
|
default:
|
|
2317
|
-
throw new ApiError(
|
|
2319
|
+
throw new ApiError({
|
|
2320
|
+
message: "Invalid space state"
|
|
2321
|
+
});
|
|
2318
2322
|
}
|
|
2319
2323
|
}
|
|
2320
2324
|
if (edgeReplication !== void 0) {
|
|
@@ -2328,15 +2332,18 @@ var SpacesServiceImpl = class {
|
|
|
2328
2332
|
throw new SpaceNotFoundError(request.spaceKey);
|
|
2329
2333
|
}
|
|
2330
2334
|
if (!space.spaceState.hasMembershipManagementPermission(identity.identityKey)) {
|
|
2331
|
-
throw new AuthorizationError(
|
|
2332
|
-
|
|
2333
|
-
|
|
2335
|
+
throw new AuthorizationError({
|
|
2336
|
+
message: "No member management permission.",
|
|
2337
|
+
context: {
|
|
2338
|
+
spaceKey: space.key,
|
|
2339
|
+
role: space.spaceState.getMemberRole(identity.identityKey)
|
|
2340
|
+
}
|
|
2334
2341
|
});
|
|
2335
2342
|
}
|
|
2336
2343
|
const credentials = await createAdmissionCredentials2(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
|
|
2337
2344
|
invariant5(credentials[0].credential, void 0, {
|
|
2338
2345
|
F: __dxlog_file8,
|
|
2339
|
-
L:
|
|
2346
|
+
L: 123,
|
|
2340
2347
|
S: this,
|
|
2341
2348
|
A: [
|
|
2342
2349
|
"credentials[0].credential",
|
|
@@ -2346,7 +2353,7 @@ var SpacesServiceImpl = class {
|
|
|
2346
2353
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2347
2354
|
invariant5(getCredentialAssertion2(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2348
2355
|
F: __dxlog_file8,
|
|
2349
|
-
L:
|
|
2356
|
+
L: 125,
|
|
2350
2357
|
S: this,
|
|
2351
2358
|
A: [
|
|
2352
2359
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2364,7 +2371,7 @@ var SpacesServiceImpl = class {
|
|
|
2364
2371
|
ids: spaces.map((space) => space.id)
|
|
2365
2372
|
}), {
|
|
2366
2373
|
F: __dxlog_file8,
|
|
2367
|
-
L:
|
|
2374
|
+
L: 138,
|
|
2368
2375
|
S: this,
|
|
2369
2376
|
C: (f, a) => f(...a)
|
|
2370
2377
|
});
|
|
@@ -2456,7 +2463,7 @@ var SpacesServiceImpl = class {
|
|
|
2456
2463
|
} else {
|
|
2457
2464
|
invariant5(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
2458
2465
|
F: __dxlog_file8,
|
|
2459
|
-
L:
|
|
2466
|
+
L: 236,
|
|
2460
2467
|
S: this,
|
|
2461
2468
|
A: [
|
|
2462
2469
|
"!credential.id",
|
|
@@ -2465,7 +2472,7 @@ var SpacesServiceImpl = class {
|
|
|
2465
2472
|
});
|
|
2466
2473
|
invariant5(this._identityManager.identity, "Identity is not available", {
|
|
2467
2474
|
F: __dxlog_file8,
|
|
2468
|
-
L:
|
|
2475
|
+
L: 237,
|
|
2469
2476
|
S: this,
|
|
2470
2477
|
A: [
|
|
2471
2478
|
"this._identityManager.identity",
|
|
@@ -2475,7 +2482,7 @@ var SpacesServiceImpl = class {
|
|
|
2475
2482
|
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
2476
2483
|
invariant5(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
2477
2484
|
F: __dxlog_file8,
|
|
2478
|
-
L:
|
|
2485
|
+
L: 239,
|
|
2479
2486
|
S: this,
|
|
2480
2487
|
A: [
|
|
2481
2488
|
"credential.issuer.equals(signer.getIssuer())",
|
|
@@ -2558,7 +2565,7 @@ var SpacesServiceImpl = class {
|
|
|
2558
2565
|
const extracted = await extractSpaceArchive(request.archive);
|
|
2559
2566
|
invariant5(extracted.metadata.echo?.currentRootUrl, "Space archive does not contain a root URL", {
|
|
2560
2567
|
F: __dxlog_file8,
|
|
2561
|
-
L:
|
|
2568
|
+
L: 293,
|
|
2562
2569
|
S: this,
|
|
2563
2570
|
A: [
|
|
2564
2571
|
"extracted.metadata.echo?.currentRootUrl",
|
|
@@ -2578,7 +2585,7 @@ var SpacesServiceImpl = class {
|
|
|
2578
2585
|
const assertion = getCredentialAssertion2(credential);
|
|
2579
2586
|
invariant5(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
2580
2587
|
F: __dxlog_file8,
|
|
2581
|
-
L:
|
|
2588
|
+
L: 304,
|
|
2582
2589
|
S: this,
|
|
2583
2590
|
A: [
|
|
2584
2591
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2588,7 +2595,7 @@ var SpacesServiceImpl = class {
|
|
|
2588
2595
|
const myIdentity = this._identityManager.identity;
|
|
2589
2596
|
invariant5(myIdentity && credential.subject.id.equals(myIdentity.identityKey), void 0, {
|
|
2590
2597
|
F: __dxlog_file8,
|
|
2591
|
-
L:
|
|
2598
|
+
L: 306,
|
|
2592
2599
|
S: this,
|
|
2593
2600
|
A: [
|
|
2594
2601
|
"myIdentity && credential.subject.id.equals(myIdentity.identityKey)",
|
|
@@ -2657,7 +2664,9 @@ var SpacesServiceImpl = class {
|
|
|
2657
2664
|
}
|
|
2658
2665
|
_requireIdentity() {
|
|
2659
2666
|
if (!this._identityManager.identity) {
|
|
2660
|
-
throw new IdentityNotInitializedError(
|
|
2667
|
+
throw new IdentityNotInitializedError({
|
|
2668
|
+
message: "This device has no HALO identity available. See https://docs.dxos.org/guide/platform/halo"
|
|
2669
|
+
});
|
|
2661
2670
|
}
|
|
2662
2671
|
return this._identityManager.identity;
|
|
2663
2672
|
}
|
|
@@ -4150,7 +4159,7 @@ _ts_decorate5([
|
|
|
4150
4159
|
logInfo2
|
|
4151
4160
|
], NotarizationPlugin.prototype, "_spaceId", void 0);
|
|
4152
4161
|
var handleEdgeError = (error) => {
|
|
4153
|
-
if (!(error instanceof EdgeCallFailedError) || error.
|
|
4162
|
+
if (!(error instanceof EdgeCallFailedError) || error.data) {
|
|
4154
4163
|
log11.catch(error, void 0, {
|
|
4155
4164
|
F: __dxlog_file14,
|
|
4156
4165
|
L: 396,
|
|
@@ -4159,7 +4168,7 @@ var handleEdgeError = (error) => {
|
|
|
4159
4168
|
});
|
|
4160
4169
|
} else {
|
|
4161
4170
|
log11.info("Edge notarization failure", {
|
|
4162
|
-
|
|
4171
|
+
message: error.message
|
|
4163
4172
|
}, {
|
|
4164
4173
|
F: __dxlog_file14,
|
|
4165
4174
|
L: 398,
|
|
@@ -4495,7 +4504,9 @@ var DataSpace = class {
|
|
|
4495
4504
|
}
|
|
4496
4505
|
async initializeDataPipeline() {
|
|
4497
4506
|
if (this._state !== SpaceState4.SPACE_CONTROL_ONLY) {
|
|
4498
|
-
throw new SystemError(
|
|
4507
|
+
throw new SystemError({
|
|
4508
|
+
message: "Invalid operation"
|
|
4509
|
+
});
|
|
4499
4510
|
}
|
|
4500
4511
|
this._state = SpaceState4.SPACE_INITIALIZING;
|
|
4501
4512
|
log12("new state", {
|
|
@@ -4950,7 +4961,9 @@ var DeviceInvitationProtocol = class {
|
|
|
4950
4961
|
try {
|
|
4951
4962
|
const identity = this._getIdentity();
|
|
4952
4963
|
if (identity) {
|
|
4953
|
-
return new AlreadyJoinedError2(
|
|
4964
|
+
return new AlreadyJoinedError2({
|
|
4965
|
+
message: "Currently only one identity per client is supported."
|
|
4966
|
+
});
|
|
4954
4967
|
}
|
|
4955
4968
|
} catch {
|
|
4956
4969
|
}
|
|
@@ -5321,10 +5334,12 @@ var InvitationGuestExtension = class extends RpcExtension2 {
|
|
|
5321
5334
|
C: (f, a) => f(...a)
|
|
5322
5335
|
});
|
|
5323
5336
|
if (this._remoteOptions?.role !== InvitationOptions.Role.HOST) {
|
|
5324
|
-
throw new InvalidInvitationExtensionRoleError(
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5337
|
+
throw new InvalidInvitationExtensionRoleError({
|
|
5338
|
+
context: {
|
|
5339
|
+
expected: InvitationOptions.Role.HOST,
|
|
5340
|
+
remoteOptions: this._remoteOptions,
|
|
5341
|
+
remotePeerId: context.remotePeerId
|
|
5342
|
+
}
|
|
5328
5343
|
});
|
|
5329
5344
|
}
|
|
5330
5345
|
this._callbacks.onOpen(this._ctx, context);
|
|
@@ -5350,7 +5365,7 @@ var InvitationGuestExtension = class extends RpcExtension2 {
|
|
|
5350
5365
|
this._invitationFlowLock = null;
|
|
5351
5366
|
log14.verbose("invitation flow lock released", void 0, {
|
|
5352
5367
|
F: __dxlog_file18,
|
|
5353
|
-
L:
|
|
5368
|
+
L: 133,
|
|
5354
5369
|
S: this,
|
|
5355
5370
|
C: (f, a) => f(...a)
|
|
5356
5371
|
});
|
|
@@ -5656,10 +5671,12 @@ var InvitationHostExtension = class extends RpcExtension3 {
|
|
|
5656
5671
|
C: (f, a) => f(...a)
|
|
5657
5672
|
});
|
|
5658
5673
|
if (this._remoteOptions?.role !== InvitationOptions2.Role.GUEST) {
|
|
5659
|
-
throw new InvalidInvitationExtensionRoleError2(
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5674
|
+
throw new InvalidInvitationExtensionRoleError2({
|
|
5675
|
+
context: {
|
|
5676
|
+
expected: InvitationOptions2.Role.GUEST,
|
|
5677
|
+
remoteOptions: this._remoteOptions,
|
|
5678
|
+
remotePeerId: context.remotePeerId
|
|
5679
|
+
}
|
|
5663
5680
|
});
|
|
5664
5681
|
}
|
|
5665
5682
|
this._callbacks.onStateUpdate(Invitation5.State.CONNECTED);
|
|
@@ -5704,7 +5721,7 @@ var InvitationHostExtension = class extends RpcExtension3 {
|
|
|
5704
5721
|
this._invitationFlowLock = null;
|
|
5705
5722
|
log15.verbose("invitation flow lock released", void 0, {
|
|
5706
5723
|
F: __dxlog_file19,
|
|
5707
|
-
L:
|
|
5724
|
+
L: 301,
|
|
5708
5725
|
S: this,
|
|
5709
5726
|
C: (f, a) => f(...a)
|
|
5710
5727
|
});
|
|
@@ -6487,7 +6504,9 @@ var InvitationsHandler = class {
|
|
|
6487
6504
|
var checkInvitation = (protocol, invitation) => {
|
|
6488
6505
|
const expiresOn = getExpirationTime(invitation);
|
|
6489
6506
|
if (expiresOn && expiresOn.getTime() < Date.now()) {
|
|
6490
|
-
return new InvalidInvitationError(
|
|
6507
|
+
return new InvalidInvitationError({
|
|
6508
|
+
message: "Invitation already expired."
|
|
6509
|
+
});
|
|
6491
6510
|
}
|
|
6492
6511
|
return protocol.checkInvitation(invitation);
|
|
6493
6512
|
};
|
|
@@ -6630,21 +6649,25 @@ var SpaceInvitationProtocol = class {
|
|
|
6630
6649
|
}
|
|
6631
6650
|
checkCanInviteNewMembers() {
|
|
6632
6651
|
if (this._spaceKey == null) {
|
|
6633
|
-
return new InvalidInvitationError2(
|
|
6652
|
+
return new InvalidInvitationError2({
|
|
6653
|
+
message: "No spaceKey was provided for a space invitation."
|
|
6654
|
+
});
|
|
6634
6655
|
}
|
|
6635
6656
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6636
6657
|
if (space == null) {
|
|
6637
6658
|
return new SpaceNotFoundError2(this._spaceKey);
|
|
6638
6659
|
}
|
|
6639
6660
|
if (!space?.inner.spaceState.hasMembershipManagementPermission(this._signingContext.identityKey)) {
|
|
6640
|
-
return new AuthorizationError2(
|
|
6661
|
+
return new AuthorizationError2({
|
|
6662
|
+
message: "No member management permission."
|
|
6663
|
+
});
|
|
6641
6664
|
}
|
|
6642
6665
|
return void 0;
|
|
6643
6666
|
}
|
|
6644
6667
|
getInvitationContext() {
|
|
6645
6668
|
invariant18(this._spaceKey, void 0, {
|
|
6646
6669
|
F: __dxlog_file23,
|
|
6647
|
-
L:
|
|
6670
|
+
L: 60,
|
|
6648
6671
|
S: this,
|
|
6649
6672
|
A: [
|
|
6650
6673
|
"this._spaceKey",
|
|
@@ -6654,7 +6677,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6654
6677
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6655
6678
|
invariant18(space, void 0, {
|
|
6656
6679
|
F: __dxlog_file23,
|
|
6657
|
-
L:
|
|
6680
|
+
L: 62,
|
|
6658
6681
|
S: this,
|
|
6659
6682
|
A: [
|
|
6660
6683
|
"space",
|
|
@@ -6670,7 +6693,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6670
6693
|
async admit(invitation, request, guestProfile) {
|
|
6671
6694
|
invariant18(this._spaceKey && request.space, void 0, {
|
|
6672
6695
|
F: __dxlog_file23,
|
|
6673
|
-
L:
|
|
6696
|
+
L: 75,
|
|
6674
6697
|
S: this,
|
|
6675
6698
|
A: [
|
|
6676
6699
|
"this._spaceKey && request.space",
|
|
@@ -6682,7 +6705,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6682
6705
|
guest: request.space.deviceKey
|
|
6683
6706
|
}, {
|
|
6684
6707
|
F: __dxlog_file23,
|
|
6685
|
-
L:
|
|
6708
|
+
L: 76,
|
|
6686
6709
|
S: this,
|
|
6687
6710
|
C: (f, a) => f(...a)
|
|
6688
6711
|
});
|
|
@@ -6704,7 +6727,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6704
6727
|
async delegate(invitation) {
|
|
6705
6728
|
invariant18(this._spaceKey, void 0, {
|
|
6706
6729
|
F: __dxlog_file23,
|
|
6707
|
-
L:
|
|
6730
|
+
L: 96,
|
|
6708
6731
|
S: this,
|
|
6709
6732
|
A: [
|
|
6710
6733
|
"this._spaceKey",
|
|
@@ -6714,7 +6737,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6714
6737
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6715
6738
|
invariant18(space, void 0, {
|
|
6716
6739
|
F: __dxlog_file23,
|
|
6717
|
-
L:
|
|
6740
|
+
L: 98,
|
|
6718
6741
|
S: this,
|
|
6719
6742
|
A: [
|
|
6720
6743
|
"space",
|
|
@@ -6724,7 +6747,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6724
6747
|
if (invitation.authMethod === Invitation8.AuthMethod.KNOWN_PUBLIC_KEY) {
|
|
6725
6748
|
invariant18(invitation.guestKeypair?.publicKey, void 0, {
|
|
6726
6749
|
F: __dxlog_file23,
|
|
6727
|
-
L:
|
|
6750
|
+
L: 100,
|
|
6728
6751
|
S: this,
|
|
6729
6752
|
A: [
|
|
6730
6753
|
"invitation.guestKeypair?.publicKey",
|
|
@@ -6737,7 +6760,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6737
6760
|
id: invitation.invitationId
|
|
6738
6761
|
}, {
|
|
6739
6762
|
F: __dxlog_file23,
|
|
6740
|
-
L:
|
|
6763
|
+
L: 103,
|
|
6741
6764
|
S: this,
|
|
6742
6765
|
C: (f, a) => f(...a)
|
|
6743
6766
|
});
|
|
@@ -6752,7 +6775,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6752
6775
|
});
|
|
6753
6776
|
invariant18(credential.credential, void 0, {
|
|
6754
6777
|
F: __dxlog_file23,
|
|
6755
|
-
L:
|
|
6778
|
+
L: 121,
|
|
6756
6779
|
S: this,
|
|
6757
6780
|
A: [
|
|
6758
6781
|
"credential.credential",
|
|
@@ -6767,7 +6790,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6767
6790
|
async cancelDelegation(invitation) {
|
|
6768
6791
|
invariant18(this._spaceKey, void 0, {
|
|
6769
6792
|
F: __dxlog_file23,
|
|
6770
|
-
L:
|
|
6793
|
+
L: 127,
|
|
6771
6794
|
S: this,
|
|
6772
6795
|
A: [
|
|
6773
6796
|
"this._spaceKey",
|
|
@@ -6776,7 +6799,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6776
6799
|
});
|
|
6777
6800
|
invariant18(invitation.type === Invitation8.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
|
|
6778
6801
|
F: __dxlog_file23,
|
|
6779
|
-
L:
|
|
6802
|
+
L: 128,
|
|
6780
6803
|
S: this,
|
|
6781
6804
|
A: [
|
|
6782
6805
|
"invitation.type === Invitation.Type.DELEGATED && invitation.delegationCredentialId",
|
|
@@ -6786,7 +6809,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6786
6809
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6787
6810
|
invariant18(space, void 0, {
|
|
6788
6811
|
F: __dxlog_file23,
|
|
6789
|
-
L:
|
|
6812
|
+
L: 130,
|
|
6790
6813
|
S: this,
|
|
6791
6814
|
A: [
|
|
6792
6815
|
"space",
|
|
@@ -6798,14 +6821,14 @@ var SpaceInvitationProtocol = class {
|
|
|
6798
6821
|
id: invitation.invitationId
|
|
6799
6822
|
}, {
|
|
6800
6823
|
F: __dxlog_file23,
|
|
6801
|
-
L:
|
|
6824
|
+
L: 132,
|
|
6802
6825
|
S: this,
|
|
6803
6826
|
C: (f, a) => f(...a)
|
|
6804
6827
|
});
|
|
6805
6828
|
const credential = await createCancelDelegatedSpaceInvitationCredential(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
|
|
6806
6829
|
invariant18(credential.credential, void 0, {
|
|
6807
6830
|
F: __dxlog_file23,
|
|
6808
|
-
L:
|
|
6831
|
+
L: 139,
|
|
6809
6832
|
S: this,
|
|
6810
6833
|
A: [
|
|
6811
6834
|
"credential.credential",
|
|
@@ -6818,10 +6841,14 @@ var SpaceInvitationProtocol = class {
|
|
|
6818
6841
|
}
|
|
6819
6842
|
checkInvitation(invitation) {
|
|
6820
6843
|
if (invitation.spaceKey == null) {
|
|
6821
|
-
return new InvalidInvitationError2(
|
|
6844
|
+
return new InvalidInvitationError2({
|
|
6845
|
+
message: "No spaceKey was provided for a space invitation."
|
|
6846
|
+
});
|
|
6822
6847
|
}
|
|
6823
6848
|
if (this._spaceManager.spaces.has(invitation.spaceKey)) {
|
|
6824
|
-
return new AlreadyJoinedError3(
|
|
6849
|
+
return new AlreadyJoinedError3({
|
|
6850
|
+
message: "Already joined space."
|
|
6851
|
+
});
|
|
6825
6852
|
}
|
|
6826
6853
|
}
|
|
6827
6854
|
createIntroduction() {
|
|
@@ -6844,7 +6871,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6844
6871
|
async accept(response) {
|
|
6845
6872
|
invariant18(response.space, void 0, {
|
|
6846
6873
|
F: __dxlog_file23,
|
|
6847
|
-
L:
|
|
6874
|
+
L: 174,
|
|
6848
6875
|
S: this,
|
|
6849
6876
|
A: [
|
|
6850
6877
|
"response.space",
|
|
@@ -6855,7 +6882,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6855
6882
|
const assertion = getCredentialAssertion5(credential);
|
|
6856
6883
|
invariant18(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
6857
6884
|
F: __dxlog_file23,
|
|
6858
|
-
L:
|
|
6885
|
+
L: 177,
|
|
6859
6886
|
S: this,
|
|
6860
6887
|
A: [
|
|
6861
6888
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -6864,7 +6891,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6864
6891
|
});
|
|
6865
6892
|
invariant18(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
|
|
6866
6893
|
F: __dxlog_file23,
|
|
6867
|
-
L:
|
|
6894
|
+
L: 178,
|
|
6868
6895
|
S: this,
|
|
6869
6896
|
A: [
|
|
6870
6897
|
"credential.subject.id.equals(this._signingContext.identityKey)",
|
|
@@ -6872,7 +6899,9 @@ var SpaceInvitationProtocol = class {
|
|
|
6872
6899
|
]
|
|
6873
6900
|
});
|
|
6874
6901
|
if (this._spaceManager.spaces.has(assertion.spaceKey)) {
|
|
6875
|
-
throw new AlreadyJoinedError3(
|
|
6902
|
+
throw new AlreadyJoinedError3({
|
|
6903
|
+
message: "Already joined space."
|
|
6904
|
+
});
|
|
6876
6905
|
}
|
|
6877
6906
|
await this._spaceManager.acceptSpace({
|
|
6878
6907
|
spaceKey: assertion.spaceKey,
|
|
@@ -8444,16 +8473,24 @@ var StorageDriver = Runtime2.Client.Storage.StorageDriver;
|
|
|
8444
8473
|
var createStorageObjects = (config) => {
|
|
8445
8474
|
const { persistent = false, keyStore, dataStore } = config ?? {};
|
|
8446
8475
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
8447
|
-
throw new InvalidConfigError(
|
|
8476
|
+
throw new InvalidConfigError({
|
|
8477
|
+
message: "RAM storage cannot be used in persistent mode."
|
|
8478
|
+
});
|
|
8448
8479
|
}
|
|
8449
8480
|
if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
|
|
8450
|
-
throw new InvalidConfigError(
|
|
8481
|
+
throw new InvalidConfigError({
|
|
8482
|
+
message: "Cannot use a persistent storage in not persistent mode."
|
|
8483
|
+
});
|
|
8451
8484
|
}
|
|
8452
8485
|
if (persistent && keyStore === StorageDriver.RAM) {
|
|
8453
|
-
throw new InvalidConfigError(
|
|
8486
|
+
throw new InvalidConfigError({
|
|
8487
|
+
message: "RAM key storage cannot be used in persistent mode."
|
|
8488
|
+
});
|
|
8454
8489
|
}
|
|
8455
8490
|
if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
|
|
8456
|
-
throw new InvalidConfigError(
|
|
8491
|
+
throw new InvalidConfigError({
|
|
8492
|
+
message: "Cannot use a persistent key storage in not persistent mode."
|
|
8493
|
+
});
|
|
8457
8494
|
}
|
|
8458
8495
|
return {
|
|
8459
8496
|
storage: createStorage({
|
|
@@ -9593,4 +9630,4 @@ export {
|
|
|
9593
9630
|
ServiceRegistry,
|
|
9594
9631
|
ClientServicesHost
|
|
9595
9632
|
};
|
|
9596
|
-
//# sourceMappingURL=chunk-
|
|
9633
|
+
//# sourceMappingURL=chunk-AO4R6IID.mjs.map
|