@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";
|
|
@@ -1346,15 +1346,16 @@ import { ComplexSet } from "@dxos/util";
|
|
|
1346
1346
|
// src/packlets/spaces/data-space-manager.ts
|
|
1347
1347
|
import { interpretAsDocumentId } from "@automerge/automerge-repo";
|
|
1348
1348
|
import { Event as Event2, synchronized, trackLeaks } from "@dxos/async";
|
|
1349
|
-
import {
|
|
1349
|
+
import { SpaceProperties } from "@dxos/client-protocol";
|
|
1350
1350
|
import { Context as Context4, LifecycleState, Resource as Resource2, cancelWithContext } from "@dxos/context";
|
|
1351
1351
|
import { createAdmissionCredentials, getCredentialAssertion } from "@dxos/credentials";
|
|
1352
|
-
import {
|
|
1352
|
+
import { Type } from "@dxos/echo";
|
|
1353
|
+
import { getTypeReference } from "@dxos/echo/internal";
|
|
1353
1354
|
import { AuthStatus, CredentialServerExtension, DatabaseRoot, FIND_PARAMS, findInlineObjectOfType } from "@dxos/echo-pipeline";
|
|
1354
1355
|
import { SpaceDocVersion, createIdFromSpaceKey, encodeReference } from "@dxos/echo-protocol";
|
|
1355
1356
|
import { writeMessages } from "@dxos/feed-store";
|
|
1356
1357
|
import { assertArgument, assertState, failedInvariant, invariant as invariant3 } from "@dxos/invariant";
|
|
1357
|
-
import { PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1358
|
+
import { ObjectId, PublicKey as PublicKey4 } from "@dxos/keys";
|
|
1358
1359
|
import { log as log5 } from "@dxos/log";
|
|
1359
1360
|
import { AlreadyJoinedError, trace as Trace } from "@dxos/protocols";
|
|
1360
1361
|
import { Invitation, SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1486,7 +1487,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1486
1487
|
const rootHandle = rootUrl ? await this._echoHost.automergeRepo.find(rootUrl, FIND_PARAMS) : void 0;
|
|
1487
1488
|
await rootHandle?.whenReady();
|
|
1488
1489
|
const rootDoc = rootHandle?.doc();
|
|
1489
|
-
const properties = rootDoc && findInlineObjectOfType(rootDoc,
|
|
1490
|
+
const properties = rootDoc && findInlineObjectOfType(rootDoc, Type.getTypename(SpaceProperties));
|
|
1490
1491
|
return {
|
|
1491
1492
|
key: space.key.toHex(),
|
|
1492
1493
|
state: SpaceState[space.state],
|
|
@@ -1513,7 +1514,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1513
1514
|
async _open() {
|
|
1514
1515
|
log5("open", void 0, {
|
|
1515
1516
|
F: __dxlog_file7,
|
|
1516
|
-
L:
|
|
1517
|
+
L: 217,
|
|
1517
1518
|
S: this,
|
|
1518
1519
|
C: (f, a) => f(...a)
|
|
1519
1520
|
});
|
|
@@ -1521,7 +1522,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1521
1522
|
id: this._instanceId
|
|
1522
1523
|
}), {
|
|
1523
1524
|
F: __dxlog_file7,
|
|
1524
|
-
L:
|
|
1525
|
+
L: 218,
|
|
1525
1526
|
S: this,
|
|
1526
1527
|
C: (f, a) => f(...a)
|
|
1527
1528
|
});
|
|
@@ -1529,7 +1530,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1529
1530
|
spaces: this._metadataStore.spaces.length
|
|
1530
1531
|
}, {
|
|
1531
1532
|
F: __dxlog_file7,
|
|
1532
|
-
L:
|
|
1533
|
+
L: 219,
|
|
1533
1534
|
S: this,
|
|
1534
1535
|
C: (f, a) => f(...a)
|
|
1535
1536
|
});
|
|
@@ -1539,7 +1540,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1539
1540
|
spaceMetadata
|
|
1540
1541
|
}, {
|
|
1541
1542
|
F: __dxlog_file7,
|
|
1542
|
-
L:
|
|
1543
|
+
L: 223,
|
|
1543
1544
|
S: this,
|
|
1544
1545
|
C: (f, a) => f(...a)
|
|
1545
1546
|
});
|
|
@@ -1550,7 +1551,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1550
1551
|
err
|
|
1551
1552
|
}, {
|
|
1552
1553
|
F: __dxlog_file7,
|
|
1553
|
-
L:
|
|
1554
|
+
L: 226,
|
|
1554
1555
|
S: this,
|
|
1555
1556
|
C: (f, a) => f(...a)
|
|
1556
1557
|
});
|
|
@@ -1561,7 +1562,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1561
1562
|
id: this._instanceId
|
|
1562
1563
|
}), {
|
|
1563
1564
|
F: __dxlog_file7,
|
|
1564
|
-
L:
|
|
1565
|
+
L: 232,
|
|
1565
1566
|
S: this,
|
|
1566
1567
|
C: (f, a) => f(...a)
|
|
1567
1568
|
});
|
|
@@ -1569,7 +1570,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1569
1570
|
async _close() {
|
|
1570
1571
|
log5("close", void 0, {
|
|
1571
1572
|
F: __dxlog_file7,
|
|
1572
|
-
L:
|
|
1573
|
+
L: 237,
|
|
1573
1574
|
S: this,
|
|
1574
1575
|
C: (f, a) => f(...a)
|
|
1575
1576
|
});
|
|
@@ -1600,7 +1601,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1600
1601
|
spaceKey
|
|
1601
1602
|
}, {
|
|
1602
1603
|
F: __dxlog_file7,
|
|
1603
|
-
L:
|
|
1604
|
+
L: 270,
|
|
1604
1605
|
S: this,
|
|
1605
1606
|
C: (f, a) => f(...a)
|
|
1606
1607
|
});
|
|
@@ -1608,7 +1609,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1608
1609
|
if (options.documents) {
|
|
1609
1610
|
invariant3(Object.keys(options.documents).every((documentId) => /^[a-zA-Z0-9]+$/.test(documentId)), "Invalid document IDs", {
|
|
1610
1611
|
F: __dxlog_file7,
|
|
1611
|
-
L:
|
|
1612
|
+
L: 275,
|
|
1612
1613
|
S: this,
|
|
1613
1614
|
A: [
|
|
1614
1615
|
"Object.keys(options.documents).every((documentId) => /^[a-zA-Z0-9]+$/.test(documentId))",
|
|
@@ -1620,7 +1621,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1620
1621
|
documentId
|
|
1621
1622
|
}, {
|
|
1622
1623
|
F: __dxlog_file7,
|
|
1623
|
-
L:
|
|
1624
|
+
L: 282,
|
|
1624
1625
|
S: this,
|
|
1625
1626
|
C: (f, a) => f(...a)
|
|
1626
1627
|
});
|
|
@@ -1639,7 +1640,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1639
1640
|
spaceKey
|
|
1640
1641
|
}, {
|
|
1641
1642
|
F: __dxlog_file7,
|
|
1642
|
-
L:
|
|
1643
|
+
L: 300,
|
|
1643
1644
|
S: this,
|
|
1644
1645
|
C: (f, a) => f(...a)
|
|
1645
1646
|
});
|
|
@@ -1648,7 +1649,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1648
1649
|
const newRootDocId = documentIdMapping[interpretAsDocumentId(options.rootUrl)] ?? failedInvariant();
|
|
1649
1650
|
const rootDocHandle = await this._echoHost.loadDoc(Context4.default(void 0, {
|
|
1650
1651
|
F: __dxlog_file7,
|
|
1651
|
-
L:
|
|
1652
|
+
L: 305
|
|
1652
1653
|
}), newRootDocId);
|
|
1653
1654
|
DatabaseRoot.mapLinks(rootDocHandle, documentIdMapping);
|
|
1654
1655
|
root = await this._echoHost.openSpaceRoot(spaceId, `automerge:${newRootDocId}`);
|
|
@@ -1660,7 +1661,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1660
1661
|
spaceKey
|
|
1661
1662
|
}, {
|
|
1662
1663
|
F: __dxlog_file7,
|
|
1663
|
-
L:
|
|
1664
|
+
L: 314,
|
|
1664
1665
|
S: this,
|
|
1665
1666
|
C: (f, a) => f(...a)
|
|
1666
1667
|
});
|
|
@@ -1670,7 +1671,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1670
1671
|
spaceKey
|
|
1671
1672
|
}, {
|
|
1672
1673
|
F: __dxlog_file7,
|
|
1673
|
-
L:
|
|
1674
|
+
L: 319,
|
|
1674
1675
|
S: this,
|
|
1675
1676
|
C: (f, a) => f(...a)
|
|
1676
1677
|
});
|
|
@@ -1679,7 +1680,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1679
1680
|
const memberCredential = credentials[1];
|
|
1680
1681
|
invariant3(getCredentialAssertion(memberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
1681
1682
|
F: __dxlog_file7,
|
|
1682
|
-
L:
|
|
1683
|
+
L: 325,
|
|
1683
1684
|
S: this,
|
|
1684
1685
|
A: [
|
|
1685
1686
|
"getCredentialAssertion(memberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -1693,7 +1694,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1693
1694
|
spaceKey
|
|
1694
1695
|
}, {
|
|
1695
1696
|
F: __dxlog_file7,
|
|
1696
|
-
L:
|
|
1697
|
+
L: 330,
|
|
1697
1698
|
S: this,
|
|
1698
1699
|
C: (f, a) => f(...a)
|
|
1699
1700
|
});
|
|
@@ -1711,13 +1712,13 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1711
1712
|
spaceId: space.id
|
|
1712
1713
|
}, {
|
|
1713
1714
|
F: __dxlog_file7,
|
|
1714
|
-
L:
|
|
1715
|
+
L: 343,
|
|
1715
1716
|
S: this,
|
|
1716
1717
|
C: (f, a) => f(...a)
|
|
1717
1718
|
});
|
|
1718
1719
|
await space.databaseRoot.handle.whenReady();
|
|
1719
1720
|
}
|
|
1720
|
-
const [_, properties] = findInlineObjectOfType(space.databaseRoot.doc(),
|
|
1721
|
+
const [_, properties] = findInlineObjectOfType(space.databaseRoot.doc(), Type.getTypename(SpaceProperties)) ?? [];
|
|
1721
1722
|
return properties?.data?.[DEFAULT_SPACE_KEY] === this._signingContext.identityKey.toHex();
|
|
1722
1723
|
}
|
|
1723
1724
|
case SpaceDocVersion.LEGACY: {
|
|
@@ -1729,7 +1730,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1729
1730
|
spaceId: space.id
|
|
1730
1731
|
}, {
|
|
1731
1732
|
F: __dxlog_file7,
|
|
1732
|
-
L:
|
|
1733
|
+
L: 357,
|
|
1733
1734
|
S: this,
|
|
1734
1735
|
C: (f, a) => f(...a)
|
|
1735
1736
|
});
|
|
@@ -1741,7 +1742,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1741
1742
|
const document = await this._getSpaceRootDocument(space);
|
|
1742
1743
|
const properties = {
|
|
1743
1744
|
system: {
|
|
1744
|
-
type: encodeReference(getTypeReference(
|
|
1745
|
+
type: encodeReference(getTypeReference(SpaceProperties))
|
|
1745
1746
|
},
|
|
1746
1747
|
data: {
|
|
1747
1748
|
[DEFAULT_SPACE_KEY]: this._signingContext.identityKey.toHex()
|
|
@@ -1764,7 +1765,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1764
1765
|
const automergeIndex = space.automergeSpaceState.rootUrl;
|
|
1765
1766
|
invariant3(automergeIndex, void 0, {
|
|
1766
1767
|
F: __dxlog_file7,
|
|
1767
|
-
L:
|
|
1768
|
+
L: 390,
|
|
1768
1769
|
S: this,
|
|
1769
1770
|
A: [
|
|
1770
1771
|
"automergeIndex",
|
|
@@ -1781,13 +1782,13 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1781
1782
|
opts
|
|
1782
1783
|
}, {
|
|
1783
1784
|
F: __dxlog_file7,
|
|
1784
|
-
L:
|
|
1785
|
+
L: 399,
|
|
1785
1786
|
S: this,
|
|
1786
1787
|
C: (f, a) => f(...a)
|
|
1787
1788
|
});
|
|
1788
1789
|
invariant3(this._lifecycleState === LifecycleState.OPEN, "Not open.", {
|
|
1789
1790
|
F: __dxlog_file7,
|
|
1790
|
-
L:
|
|
1791
|
+
L: 400,
|
|
1791
1792
|
S: this,
|
|
1792
1793
|
A: [
|
|
1793
1794
|
"this._lifecycleState === LifecycleState.OPEN",
|
|
@@ -1796,7 +1797,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1796
1797
|
});
|
|
1797
1798
|
invariant3(!this._spaces.has(opts.spaceKey), "Space already exists.", {
|
|
1798
1799
|
F: __dxlog_file7,
|
|
1799
|
-
L:
|
|
1800
|
+
L: 401,
|
|
1800
1801
|
S: this,
|
|
1801
1802
|
A: [
|
|
1802
1803
|
"!this._spaces.has(opts.spaceKey)",
|
|
@@ -1820,7 +1821,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1820
1821
|
const space = this._spaceManager.spaces.get(options.spaceKey);
|
|
1821
1822
|
invariant3(space, void 0, {
|
|
1822
1823
|
F: __dxlog_file7,
|
|
1823
|
-
L:
|
|
1824
|
+
L: 421,
|
|
1824
1825
|
S: this,
|
|
1825
1826
|
A: [
|
|
1826
1827
|
"space",
|
|
@@ -1833,7 +1834,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1833
1834
|
const credentials = await createAdmissionCredentials(this._signingContext.credentialSigner, options.identityKey, space.key, space.genesisFeedKey, options.role, space.spaceState.membershipChainHeads, options.profile, options.delegationCredentialId);
|
|
1834
1835
|
invariant3(credentials[0].credential, void 0, {
|
|
1835
1836
|
F: __dxlog_file7,
|
|
1836
|
-
L:
|
|
1837
|
+
L: 440,
|
|
1837
1838
|
S: this,
|
|
1838
1839
|
A: [
|
|
1839
1840
|
"credentials[0].credential",
|
|
@@ -1843,7 +1844,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1843
1844
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
1844
1845
|
invariant3(getCredentialAssertion(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
1845
1846
|
F: __dxlog_file7,
|
|
1846
|
-
L:
|
|
1847
|
+
L: 442,
|
|
1847
1848
|
S: this,
|
|
1848
1849
|
A: [
|
|
1849
1850
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -1881,7 +1882,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1881
1882
|
const space = this._spaces.get(spaceKey);
|
|
1882
1883
|
invariant3(space, "Space not found.", {
|
|
1883
1884
|
F: __dxlog_file7,
|
|
1884
|
-
L:
|
|
1885
|
+
L: 479,
|
|
1885
1886
|
S: this,
|
|
1886
1887
|
A: [
|
|
1887
1888
|
"space",
|
|
@@ -1906,7 +1907,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1906
1907
|
metadata
|
|
1907
1908
|
}, {
|
|
1908
1909
|
F: __dxlog_file7,
|
|
1909
|
-
L:
|
|
1910
|
+
L: 498,
|
|
1910
1911
|
S: this,
|
|
1911
1912
|
C: (f, a) => f(...a)
|
|
1912
1913
|
});
|
|
@@ -1950,7 +1951,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1950
1951
|
err
|
|
1951
1952
|
}, {
|
|
1952
1953
|
F: __dxlog_file7,
|
|
1953
|
-
L:
|
|
1954
|
+
L: 540,
|
|
1954
1955
|
S: this,
|
|
1955
1956
|
C: (f, a) => f(...a)
|
|
1956
1957
|
});
|
|
@@ -1960,7 +1961,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1960
1961
|
onAuthFailure: () => {
|
|
1961
1962
|
log5.warn("auth failure", void 0, {
|
|
1962
1963
|
F: __dxlog_file7,
|
|
1963
|
-
L:
|
|
1964
|
+
L: 545,
|
|
1964
1965
|
S: this,
|
|
1965
1966
|
C: (f, a) => f(...a)
|
|
1966
1967
|
});
|
|
@@ -1993,7 +1994,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
1993
1994
|
space: space.key
|
|
1994
1995
|
}, {
|
|
1995
1996
|
F: __dxlog_file7,
|
|
1996
|
-
L:
|
|
1997
|
+
L: 572,
|
|
1997
1998
|
S: this,
|
|
1998
1999
|
C: (f, a) => f(...a)
|
|
1999
2000
|
});
|
|
@@ -2004,7 +2005,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2004
2005
|
open: this._lifecycleState === LifecycleState.OPEN
|
|
2005
2006
|
}, {
|
|
2006
2007
|
F: __dxlog_file7,
|
|
2007
|
-
L:
|
|
2008
|
+
L: 575,
|
|
2008
2009
|
S: this,
|
|
2009
2010
|
C: (f, a) => f(...a)
|
|
2010
2011
|
});
|
|
@@ -2023,7 +2024,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2023
2024
|
space: space.key
|
|
2024
2025
|
}, {
|
|
2025
2026
|
F: __dxlog_file7,
|
|
2026
|
-
L:
|
|
2027
|
+
L: 583,
|
|
2027
2028
|
S: this,
|
|
2028
2029
|
C: (f, a) => f(...a)
|
|
2029
2030
|
});
|
|
@@ -2044,7 +2045,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2044
2045
|
spaceId: dataSpace.id
|
|
2045
2046
|
}, {
|
|
2046
2047
|
F: __dxlog_file7,
|
|
2047
|
-
L:
|
|
2048
|
+
L: 597,
|
|
2048
2049
|
S: this,
|
|
2049
2050
|
C: (f, a) => f(...a)
|
|
2050
2051
|
});
|
|
@@ -2074,7 +2075,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2074
2075
|
space: space.key
|
|
2075
2076
|
}, {
|
|
2076
2077
|
F: __dxlog_file7,
|
|
2077
|
-
L:
|
|
2078
|
+
L: 624,
|
|
2078
2079
|
S: this,
|
|
2079
2080
|
C: (f, a) => f(...a)
|
|
2080
2081
|
});
|
|
@@ -2107,7 +2108,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2107
2108
|
closedSessions
|
|
2108
2109
|
}, {
|
|
2109
2110
|
F: __dxlog_file7,
|
|
2110
|
-
L:
|
|
2111
|
+
L: 650,
|
|
2111
2112
|
S: this,
|
|
2112
2113
|
C: (f, a) => f(...a)
|
|
2113
2114
|
});
|
|
@@ -2122,7 +2123,7 @@ var DataSpaceManager = class extends Resource2 {
|
|
|
2122
2123
|
peerId: peerState.peerId
|
|
2123
2124
|
}, {
|
|
2124
2125
|
F: __dxlog_file7,
|
|
2125
|
-
L:
|
|
2126
|
+
L: 664,
|
|
2126
2127
|
S: this,
|
|
2127
2128
|
C: (f, a) => f(...a)
|
|
2128
2129
|
});
|
|
@@ -2244,6 +2245,7 @@ var SpaceArchiveWriter = class extends Resource3 {
|
|
|
2244
2245
|
this._archive.addTextFile(SpaceArchiveFileStructure.metadata, JSON.stringify(metadata));
|
|
2245
2246
|
const binary = this._archive.toUint8Array();
|
|
2246
2247
|
return {
|
|
2248
|
+
// TODO(wittjosiah): Factor out file name construction.
|
|
2247
2249
|
filename: `${(/* @__PURE__ */ new Date()).toISOString()}-${this._meta.spaceId}.tar`,
|
|
2248
2250
|
contents: binary
|
|
2249
2251
|
};
|
|
@@ -2275,7 +2277,7 @@ var extractSpaceArchive = async (archive) => {
|
|
|
2275
2277
|
});
|
|
2276
2278
|
documents[documentId] = entry2.content ?? failedInvariant2();
|
|
2277
2279
|
}
|
|
2278
|
-
log6
|
|
2280
|
+
log6("extracted space archive", {
|
|
2279
2281
|
metadata,
|
|
2280
2282
|
documents
|
|
2281
2283
|
}, {
|
|
@@ -2385,7 +2387,9 @@ var SpacesServiceImpl = class {
|
|
|
2385
2387
|
await space.deactivate();
|
|
2386
2388
|
break;
|
|
2387
2389
|
default:
|
|
2388
|
-
throw new ApiError(
|
|
2390
|
+
throw new ApiError({
|
|
2391
|
+
message: "Invalid space state"
|
|
2392
|
+
});
|
|
2389
2393
|
}
|
|
2390
2394
|
}
|
|
2391
2395
|
if (edgeReplication !== void 0) {
|
|
@@ -2399,15 +2403,18 @@ var SpacesServiceImpl = class {
|
|
|
2399
2403
|
throw new SpaceNotFoundError(request.spaceKey);
|
|
2400
2404
|
}
|
|
2401
2405
|
if (!space.spaceState.hasMembershipManagementPermission(identity.identityKey)) {
|
|
2402
|
-
throw new AuthorizationError(
|
|
2403
|
-
|
|
2404
|
-
|
|
2406
|
+
throw new AuthorizationError({
|
|
2407
|
+
message: "No member management permission.",
|
|
2408
|
+
context: {
|
|
2409
|
+
spaceKey: space.key,
|
|
2410
|
+
role: space.spaceState.getMemberRole(identity.identityKey)
|
|
2411
|
+
}
|
|
2405
2412
|
});
|
|
2406
2413
|
}
|
|
2407
2414
|
const credentials = await createAdmissionCredentials2(identity.getIdentityCredentialSigner(), request.memberKey, space.key, space.genesisFeedKey, request.newRole, space.spaceState.membershipChainHeads);
|
|
2408
2415
|
invariant5(credentials[0].credential, void 0, {
|
|
2409
2416
|
F: __dxlog_file9,
|
|
2410
|
-
L:
|
|
2417
|
+
L: 123,
|
|
2411
2418
|
S: this,
|
|
2412
2419
|
A: [
|
|
2413
2420
|
"credentials[0].credential",
|
|
@@ -2417,7 +2424,7 @@ var SpacesServiceImpl = class {
|
|
|
2417
2424
|
const spaceMemberCredential = credentials[0].credential.credential;
|
|
2418
2425
|
invariant5(getCredentialAssertion2(spaceMemberCredential)["@type"] === "dxos.halo.credentials.SpaceMember", void 0, {
|
|
2419
2426
|
F: __dxlog_file9,
|
|
2420
|
-
L:
|
|
2427
|
+
L: 125,
|
|
2421
2428
|
S: this,
|
|
2422
2429
|
A: [
|
|
2423
2430
|
"getCredentialAssertion(spaceMemberCredential)['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2435,7 +2442,7 @@ var SpacesServiceImpl = class {
|
|
|
2435
2442
|
ids: spaces.map((space) => space.id)
|
|
2436
2443
|
}), {
|
|
2437
2444
|
F: __dxlog_file9,
|
|
2438
|
-
L:
|
|
2445
|
+
L: 138,
|
|
2439
2446
|
S: this,
|
|
2440
2447
|
C: (f, a) => f(...a)
|
|
2441
2448
|
});
|
|
@@ -2527,7 +2534,7 @@ var SpacesServiceImpl = class {
|
|
|
2527
2534
|
} else {
|
|
2528
2535
|
invariant5(!credential.id, "Id on unsigned credentials is not allowed", {
|
|
2529
2536
|
F: __dxlog_file9,
|
|
2530
|
-
L:
|
|
2537
|
+
L: 236,
|
|
2531
2538
|
S: this,
|
|
2532
2539
|
A: [
|
|
2533
2540
|
"!credential.id",
|
|
@@ -2536,7 +2543,7 @@ var SpacesServiceImpl = class {
|
|
|
2536
2543
|
});
|
|
2537
2544
|
invariant5(this._identityManager.identity, "Identity is not available", {
|
|
2538
2545
|
F: __dxlog_file9,
|
|
2539
|
-
L:
|
|
2546
|
+
L: 237,
|
|
2540
2547
|
S: this,
|
|
2541
2548
|
A: [
|
|
2542
2549
|
"this._identityManager.identity",
|
|
@@ -2546,7 +2553,7 @@ var SpacesServiceImpl = class {
|
|
|
2546
2553
|
const signer = this._identityManager.identity.getIdentityCredentialSigner();
|
|
2547
2554
|
invariant5(credential.issuer.equals(signer.getIssuer()), void 0, {
|
|
2548
2555
|
F: __dxlog_file9,
|
|
2549
|
-
L:
|
|
2556
|
+
L: 239,
|
|
2550
2557
|
S: this,
|
|
2551
2558
|
A: [
|
|
2552
2559
|
"credential.issuer.equals(signer.getIssuer())",
|
|
@@ -2629,7 +2636,7 @@ var SpacesServiceImpl = class {
|
|
|
2629
2636
|
const extracted = await extractSpaceArchive(request.archive);
|
|
2630
2637
|
invariant5(extracted.metadata.echo?.currentRootUrl, "Space archive does not contain a root URL", {
|
|
2631
2638
|
F: __dxlog_file9,
|
|
2632
|
-
L:
|
|
2639
|
+
L: 293,
|
|
2633
2640
|
S: this,
|
|
2634
2641
|
A: [
|
|
2635
2642
|
"extracted.metadata.echo?.currentRootUrl",
|
|
@@ -2649,7 +2656,7 @@ var SpacesServiceImpl = class {
|
|
|
2649
2656
|
const assertion = getCredentialAssertion2(credential);
|
|
2650
2657
|
invariant5(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
2651
2658
|
F: __dxlog_file9,
|
|
2652
|
-
L:
|
|
2659
|
+
L: 304,
|
|
2653
2660
|
S: this,
|
|
2654
2661
|
A: [
|
|
2655
2662
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -2659,7 +2666,7 @@ var SpacesServiceImpl = class {
|
|
|
2659
2666
|
const myIdentity = this._identityManager.identity;
|
|
2660
2667
|
invariant5(myIdentity && credential.subject.id.equals(myIdentity.identityKey), void 0, {
|
|
2661
2668
|
F: __dxlog_file9,
|
|
2662
|
-
L:
|
|
2669
|
+
L: 306,
|
|
2663
2670
|
S: this,
|
|
2664
2671
|
A: [
|
|
2665
2672
|
"myIdentity && credential.subject.id.equals(myIdentity.identityKey)",
|
|
@@ -2728,7 +2735,9 @@ var SpacesServiceImpl = class {
|
|
|
2728
2735
|
}
|
|
2729
2736
|
_requireIdentity() {
|
|
2730
2737
|
if (!this._identityManager.identity) {
|
|
2731
|
-
throw new IdentityNotInitializedError(
|
|
2738
|
+
throw new IdentityNotInitializedError({
|
|
2739
|
+
message: "This device has no HALO identity available. See https://docs.dxos.org/guide/platform/halo"
|
|
2740
|
+
});
|
|
2732
2741
|
}
|
|
2733
2742
|
return this._identityManager.identity;
|
|
2734
2743
|
}
|
|
@@ -4221,7 +4230,7 @@ _ts_decorate5([
|
|
|
4221
4230
|
logInfo2
|
|
4222
4231
|
], NotarizationPlugin.prototype, "_spaceId", void 0);
|
|
4223
4232
|
var handleEdgeError = (error) => {
|
|
4224
|
-
if (!(error instanceof EdgeCallFailedError) || error.
|
|
4233
|
+
if (!(error instanceof EdgeCallFailedError) || error.data) {
|
|
4225
4234
|
log12.catch(error, void 0, {
|
|
4226
4235
|
F: __dxlog_file15,
|
|
4227
4236
|
L: 396,
|
|
@@ -4230,7 +4239,7 @@ var handleEdgeError = (error) => {
|
|
|
4230
4239
|
});
|
|
4231
4240
|
} else {
|
|
4232
4241
|
log12.info("Edge notarization failure", {
|
|
4233
|
-
|
|
4242
|
+
message: error.message
|
|
4234
4243
|
}, {
|
|
4235
4244
|
F: __dxlog_file15,
|
|
4236
4245
|
L: 398,
|
|
@@ -4566,7 +4575,9 @@ var DataSpace = class {
|
|
|
4566
4575
|
}
|
|
4567
4576
|
async initializeDataPipeline() {
|
|
4568
4577
|
if (this._state !== SpaceState4.SPACE_CONTROL_ONLY) {
|
|
4569
|
-
throw new SystemError(
|
|
4578
|
+
throw new SystemError({
|
|
4579
|
+
message: "Invalid operation"
|
|
4580
|
+
});
|
|
4570
4581
|
}
|
|
4571
4582
|
this._state = SpaceState4.SPACE_INITIALIZING;
|
|
4572
4583
|
log13("new state", {
|
|
@@ -5021,7 +5032,9 @@ var DeviceInvitationProtocol = class {
|
|
|
5021
5032
|
try {
|
|
5022
5033
|
const identity = this._getIdentity();
|
|
5023
5034
|
if (identity) {
|
|
5024
|
-
return new AlreadyJoinedError2(
|
|
5035
|
+
return new AlreadyJoinedError2({
|
|
5036
|
+
message: "Currently only one identity per client is supported."
|
|
5037
|
+
});
|
|
5025
5038
|
}
|
|
5026
5039
|
} catch {
|
|
5027
5040
|
}
|
|
@@ -5392,10 +5405,12 @@ var InvitationGuestExtension = class extends RpcExtension2 {
|
|
|
5392
5405
|
C: (f, a) => f(...a)
|
|
5393
5406
|
});
|
|
5394
5407
|
if (this._remoteOptions?.role !== InvitationOptions.Role.HOST) {
|
|
5395
|
-
throw new InvalidInvitationExtensionRoleError(
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5408
|
+
throw new InvalidInvitationExtensionRoleError({
|
|
5409
|
+
context: {
|
|
5410
|
+
expected: InvitationOptions.Role.HOST,
|
|
5411
|
+
remoteOptions: this._remoteOptions,
|
|
5412
|
+
remotePeerId: context.remotePeerId
|
|
5413
|
+
}
|
|
5399
5414
|
});
|
|
5400
5415
|
}
|
|
5401
5416
|
this._callbacks.onOpen(this._ctx, context);
|
|
@@ -5421,7 +5436,7 @@ var InvitationGuestExtension = class extends RpcExtension2 {
|
|
|
5421
5436
|
this._invitationFlowLock = null;
|
|
5422
5437
|
log15.verbose("invitation flow lock released", void 0, {
|
|
5423
5438
|
F: __dxlog_file19,
|
|
5424
|
-
L:
|
|
5439
|
+
L: 133,
|
|
5425
5440
|
S: this,
|
|
5426
5441
|
C: (f, a) => f(...a)
|
|
5427
5442
|
});
|
|
@@ -5727,10 +5742,12 @@ var InvitationHostExtension = class extends RpcExtension3 {
|
|
|
5727
5742
|
C: (f, a) => f(...a)
|
|
5728
5743
|
});
|
|
5729
5744
|
if (this._remoteOptions?.role !== InvitationOptions2.Role.GUEST) {
|
|
5730
|
-
throw new InvalidInvitationExtensionRoleError2(
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5745
|
+
throw new InvalidInvitationExtensionRoleError2({
|
|
5746
|
+
context: {
|
|
5747
|
+
expected: InvitationOptions2.Role.GUEST,
|
|
5748
|
+
remoteOptions: this._remoteOptions,
|
|
5749
|
+
remotePeerId: context.remotePeerId
|
|
5750
|
+
}
|
|
5734
5751
|
});
|
|
5735
5752
|
}
|
|
5736
5753
|
this._callbacks.onStateUpdate(Invitation5.State.CONNECTED);
|
|
@@ -5775,7 +5792,7 @@ var InvitationHostExtension = class extends RpcExtension3 {
|
|
|
5775
5792
|
this._invitationFlowLock = null;
|
|
5776
5793
|
log16.verbose("invitation flow lock released", void 0, {
|
|
5777
5794
|
F: __dxlog_file20,
|
|
5778
|
-
L:
|
|
5795
|
+
L: 301,
|
|
5779
5796
|
S: this,
|
|
5780
5797
|
C: (f, a) => f(...a)
|
|
5781
5798
|
});
|
|
@@ -6558,7 +6575,9 @@ var InvitationsHandler = class {
|
|
|
6558
6575
|
var checkInvitation = (protocol, invitation) => {
|
|
6559
6576
|
const expiresOn = getExpirationTime(invitation);
|
|
6560
6577
|
if (expiresOn && expiresOn.getTime() < Date.now()) {
|
|
6561
|
-
return new InvalidInvitationError(
|
|
6578
|
+
return new InvalidInvitationError({
|
|
6579
|
+
message: "Invitation already expired."
|
|
6580
|
+
});
|
|
6562
6581
|
}
|
|
6563
6582
|
return protocol.checkInvitation(invitation);
|
|
6564
6583
|
};
|
|
@@ -6701,21 +6720,25 @@ var SpaceInvitationProtocol = class {
|
|
|
6701
6720
|
}
|
|
6702
6721
|
checkCanInviteNewMembers() {
|
|
6703
6722
|
if (this._spaceKey == null) {
|
|
6704
|
-
return new InvalidInvitationError2(
|
|
6723
|
+
return new InvalidInvitationError2({
|
|
6724
|
+
message: "No spaceKey was provided for a space invitation."
|
|
6725
|
+
});
|
|
6705
6726
|
}
|
|
6706
6727
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6707
6728
|
if (space == null) {
|
|
6708
6729
|
return new SpaceNotFoundError2(this._spaceKey);
|
|
6709
6730
|
}
|
|
6710
6731
|
if (!space?.inner.spaceState.hasMembershipManagementPermission(this._signingContext.identityKey)) {
|
|
6711
|
-
return new AuthorizationError2(
|
|
6732
|
+
return new AuthorizationError2({
|
|
6733
|
+
message: "No member management permission."
|
|
6734
|
+
});
|
|
6712
6735
|
}
|
|
6713
6736
|
return void 0;
|
|
6714
6737
|
}
|
|
6715
6738
|
getInvitationContext() {
|
|
6716
6739
|
invariant18(this._spaceKey, void 0, {
|
|
6717
6740
|
F: __dxlog_file24,
|
|
6718
|
-
L:
|
|
6741
|
+
L: 60,
|
|
6719
6742
|
S: this,
|
|
6720
6743
|
A: [
|
|
6721
6744
|
"this._spaceKey",
|
|
@@ -6725,7 +6748,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6725
6748
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6726
6749
|
invariant18(space, void 0, {
|
|
6727
6750
|
F: __dxlog_file24,
|
|
6728
|
-
L:
|
|
6751
|
+
L: 62,
|
|
6729
6752
|
S: this,
|
|
6730
6753
|
A: [
|
|
6731
6754
|
"space",
|
|
@@ -6741,7 +6764,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6741
6764
|
async admit(invitation, request, guestProfile) {
|
|
6742
6765
|
invariant18(this._spaceKey && request.space, void 0, {
|
|
6743
6766
|
F: __dxlog_file24,
|
|
6744
|
-
L:
|
|
6767
|
+
L: 75,
|
|
6745
6768
|
S: this,
|
|
6746
6769
|
A: [
|
|
6747
6770
|
"this._spaceKey && request.space",
|
|
@@ -6753,7 +6776,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6753
6776
|
guest: request.space.deviceKey
|
|
6754
6777
|
}, {
|
|
6755
6778
|
F: __dxlog_file24,
|
|
6756
|
-
L:
|
|
6779
|
+
L: 76,
|
|
6757
6780
|
S: this,
|
|
6758
6781
|
C: (f, a) => f(...a)
|
|
6759
6782
|
});
|
|
@@ -6775,7 +6798,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6775
6798
|
async delegate(invitation) {
|
|
6776
6799
|
invariant18(this._spaceKey, void 0, {
|
|
6777
6800
|
F: __dxlog_file24,
|
|
6778
|
-
L:
|
|
6801
|
+
L: 96,
|
|
6779
6802
|
S: this,
|
|
6780
6803
|
A: [
|
|
6781
6804
|
"this._spaceKey",
|
|
@@ -6785,7 +6808,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6785
6808
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6786
6809
|
invariant18(space, void 0, {
|
|
6787
6810
|
F: __dxlog_file24,
|
|
6788
|
-
L:
|
|
6811
|
+
L: 98,
|
|
6789
6812
|
S: this,
|
|
6790
6813
|
A: [
|
|
6791
6814
|
"space",
|
|
@@ -6795,7 +6818,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6795
6818
|
if (invitation.authMethod === Invitation8.AuthMethod.KNOWN_PUBLIC_KEY) {
|
|
6796
6819
|
invariant18(invitation.guestKeypair?.publicKey, void 0, {
|
|
6797
6820
|
F: __dxlog_file24,
|
|
6798
|
-
L:
|
|
6821
|
+
L: 100,
|
|
6799
6822
|
S: this,
|
|
6800
6823
|
A: [
|
|
6801
6824
|
"invitation.guestKeypair?.publicKey",
|
|
@@ -6808,7 +6831,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6808
6831
|
id: invitation.invitationId
|
|
6809
6832
|
}, {
|
|
6810
6833
|
F: __dxlog_file24,
|
|
6811
|
-
L:
|
|
6834
|
+
L: 103,
|
|
6812
6835
|
S: this,
|
|
6813
6836
|
C: (f, a) => f(...a)
|
|
6814
6837
|
});
|
|
@@ -6823,7 +6846,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6823
6846
|
});
|
|
6824
6847
|
invariant18(credential.credential, void 0, {
|
|
6825
6848
|
F: __dxlog_file24,
|
|
6826
|
-
L:
|
|
6849
|
+
L: 121,
|
|
6827
6850
|
S: this,
|
|
6828
6851
|
A: [
|
|
6829
6852
|
"credential.credential",
|
|
@@ -6838,7 +6861,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6838
6861
|
async cancelDelegation(invitation) {
|
|
6839
6862
|
invariant18(this._spaceKey, void 0, {
|
|
6840
6863
|
F: __dxlog_file24,
|
|
6841
|
-
L:
|
|
6864
|
+
L: 127,
|
|
6842
6865
|
S: this,
|
|
6843
6866
|
A: [
|
|
6844
6867
|
"this._spaceKey",
|
|
@@ -6847,7 +6870,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6847
6870
|
});
|
|
6848
6871
|
invariant18(invitation.type === Invitation8.Type.DELEGATED && invitation.delegationCredentialId, void 0, {
|
|
6849
6872
|
F: __dxlog_file24,
|
|
6850
|
-
L:
|
|
6873
|
+
L: 128,
|
|
6851
6874
|
S: this,
|
|
6852
6875
|
A: [
|
|
6853
6876
|
"invitation.type === Invitation.Type.DELEGATED && invitation.delegationCredentialId",
|
|
@@ -6857,7 +6880,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6857
6880
|
const space = this._spaceManager.spaces.get(this._spaceKey);
|
|
6858
6881
|
invariant18(space, void 0, {
|
|
6859
6882
|
F: __dxlog_file24,
|
|
6860
|
-
L:
|
|
6883
|
+
L: 130,
|
|
6861
6884
|
S: this,
|
|
6862
6885
|
A: [
|
|
6863
6886
|
"space",
|
|
@@ -6869,14 +6892,14 @@ var SpaceInvitationProtocol = class {
|
|
|
6869
6892
|
id: invitation.invitationId
|
|
6870
6893
|
}, {
|
|
6871
6894
|
F: __dxlog_file24,
|
|
6872
|
-
L:
|
|
6895
|
+
L: 132,
|
|
6873
6896
|
S: this,
|
|
6874
6897
|
C: (f, a) => f(...a)
|
|
6875
6898
|
});
|
|
6876
6899
|
const credential = await createCancelDelegatedSpaceInvitationCredential(this._signingContext.credentialSigner, space.key, invitation.delegationCredentialId);
|
|
6877
6900
|
invariant18(credential.credential, void 0, {
|
|
6878
6901
|
F: __dxlog_file24,
|
|
6879
|
-
L:
|
|
6902
|
+
L: 139,
|
|
6880
6903
|
S: this,
|
|
6881
6904
|
A: [
|
|
6882
6905
|
"credential.credential",
|
|
@@ -6889,10 +6912,14 @@ var SpaceInvitationProtocol = class {
|
|
|
6889
6912
|
}
|
|
6890
6913
|
checkInvitation(invitation) {
|
|
6891
6914
|
if (invitation.spaceKey == null) {
|
|
6892
|
-
return new InvalidInvitationError2(
|
|
6915
|
+
return new InvalidInvitationError2({
|
|
6916
|
+
message: "No spaceKey was provided for a space invitation."
|
|
6917
|
+
});
|
|
6893
6918
|
}
|
|
6894
6919
|
if (this._spaceManager.spaces.has(invitation.spaceKey)) {
|
|
6895
|
-
return new AlreadyJoinedError3(
|
|
6920
|
+
return new AlreadyJoinedError3({
|
|
6921
|
+
message: "Already joined space."
|
|
6922
|
+
});
|
|
6896
6923
|
}
|
|
6897
6924
|
}
|
|
6898
6925
|
createIntroduction() {
|
|
@@ -6915,7 +6942,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6915
6942
|
async accept(response) {
|
|
6916
6943
|
invariant18(response.space, void 0, {
|
|
6917
6944
|
F: __dxlog_file24,
|
|
6918
|
-
L:
|
|
6945
|
+
L: 174,
|
|
6919
6946
|
S: this,
|
|
6920
6947
|
A: [
|
|
6921
6948
|
"response.space",
|
|
@@ -6926,7 +6953,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6926
6953
|
const assertion = getCredentialAssertion5(credential);
|
|
6927
6954
|
invariant18(assertion["@type"] === "dxos.halo.credentials.SpaceMember", "Invalid credential", {
|
|
6928
6955
|
F: __dxlog_file24,
|
|
6929
|
-
L:
|
|
6956
|
+
L: 177,
|
|
6930
6957
|
S: this,
|
|
6931
6958
|
A: [
|
|
6932
6959
|
"assertion['@type'] === 'dxos.halo.credentials.SpaceMember'",
|
|
@@ -6935,7 +6962,7 @@ var SpaceInvitationProtocol = class {
|
|
|
6935
6962
|
});
|
|
6936
6963
|
invariant18(credential.subject.id.equals(this._signingContext.identityKey), void 0, {
|
|
6937
6964
|
F: __dxlog_file24,
|
|
6938
|
-
L:
|
|
6965
|
+
L: 178,
|
|
6939
6966
|
S: this,
|
|
6940
6967
|
A: [
|
|
6941
6968
|
"credential.subject.id.equals(this._signingContext.identityKey)",
|
|
@@ -6943,7 +6970,9 @@ var SpaceInvitationProtocol = class {
|
|
|
6943
6970
|
]
|
|
6944
6971
|
});
|
|
6945
6972
|
if (this._spaceManager.spaces.has(assertion.spaceKey)) {
|
|
6946
|
-
throw new AlreadyJoinedError3(
|
|
6973
|
+
throw new AlreadyJoinedError3({
|
|
6974
|
+
message: "Already joined space."
|
|
6975
|
+
});
|
|
6947
6976
|
}
|
|
6948
6977
|
await this._spaceManager.acceptSpace({
|
|
6949
6978
|
spaceKey: assertion.spaceKey,
|
|
@@ -8575,16 +8604,24 @@ var StorageDriver = Runtime2.Client.Storage.StorageDriver;
|
|
|
8575
8604
|
var createStorageObjects = (config) => {
|
|
8576
8605
|
const { persistent = false, keyStore, dataStore } = config ?? {};
|
|
8577
8606
|
if (persistent && dataStore === StorageDriver.RAM) {
|
|
8578
|
-
throw new InvalidConfigError(
|
|
8607
|
+
throw new InvalidConfigError({
|
|
8608
|
+
message: "RAM storage cannot be used in persistent mode."
|
|
8609
|
+
});
|
|
8579
8610
|
}
|
|
8580
8611
|
if (!persistent && dataStore !== void 0 && dataStore !== StorageDriver.RAM) {
|
|
8581
|
-
throw new InvalidConfigError(
|
|
8612
|
+
throw new InvalidConfigError({
|
|
8613
|
+
message: "Cannot use a persistent storage in not persistent mode."
|
|
8614
|
+
});
|
|
8582
8615
|
}
|
|
8583
8616
|
if (persistent && keyStore === StorageDriver.RAM) {
|
|
8584
|
-
throw new InvalidConfigError(
|
|
8617
|
+
throw new InvalidConfigError({
|
|
8618
|
+
message: "RAM key storage cannot be used in persistent mode."
|
|
8619
|
+
});
|
|
8585
8620
|
}
|
|
8586
8621
|
if (!persistent && keyStore !== StorageDriver.RAM && keyStore !== void 0) {
|
|
8587
|
-
throw new InvalidConfigError(
|
|
8622
|
+
throw new InvalidConfigError({
|
|
8623
|
+
message: "Cannot use a persistent key storage in not persistent mode."
|
|
8624
|
+
});
|
|
8588
8625
|
}
|
|
8589
8626
|
return {
|
|
8590
8627
|
storage: createStorage({
|
|
@@ -9724,4 +9761,4 @@ export {
|
|
|
9724
9761
|
ServiceRegistry,
|
|
9725
9762
|
ClientServicesHost
|
|
9726
9763
|
};
|
|
9727
|
-
//# sourceMappingURL=chunk-
|
|
9764
|
+
//# sourceMappingURL=chunk-NXGWBEOK.mjs.map
|