@dxos/echo-pipeline 0.1.58-main.e460f33 → 0.1.58-main.e4cedde
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-YHBA7EZB.mjs → chunk-VYZEP2BZ.mjs} +34 -33
- package/dist/lib/browser/{chunk-YHBA7EZB.mjs.map → chunk-VYZEP2BZ.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +57 -1
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/index.cjs +101 -37
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +38 -37
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/errors/errors.d.ts +26 -0
- package/dist/types/src/errors/errors.d.ts.map +1 -0
- package/dist/types/src/errors/index.d.ts +2 -0
- package/dist/types/src/errors/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
- package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/errors/errors.ts +52 -0
- package/src/errors/index.ts +5 -0
- package/src/index.ts +1 -0
- package/src/metadata/metadata-store.ts +2 -1
- package/src/space/data-pipeline.ts +2 -1
|
@@ -423,10 +423,11 @@ var DataServiceImpl = class {
|
|
|
423
423
|
// packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
|
|
424
424
|
import CRC32 from "crc-32";
|
|
425
425
|
import { synchronized, Event } from "@dxos/async";
|
|
426
|
+
import { DataCorruptionError } from "@dxos/errors";
|
|
426
427
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
427
428
|
import { PublicKey as PublicKey3 } from "@dxos/keys";
|
|
428
429
|
import { log as log3 } from "@dxos/log";
|
|
429
|
-
import {
|
|
430
|
+
import { STORAGE_VERSION, schema as schema4 } from "@dxos/protocols";
|
|
430
431
|
import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
|
|
431
432
|
import { ComplexMap as ComplexMap3, arrayToBuffer, forEachAsync, isNotNullOrUndefined } from "@dxos/util";
|
|
432
433
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
@@ -485,7 +486,7 @@ var MetadataStore = class {
|
|
|
485
486
|
name: file.filename
|
|
486
487
|
}, {
|
|
487
488
|
F: __dxlog_file4,
|
|
488
|
-
L:
|
|
489
|
+
L: 82,
|
|
489
490
|
S: this,
|
|
490
491
|
C: (f, a) => f(...a)
|
|
491
492
|
});
|
|
@@ -518,7 +519,7 @@ var MetadataStore = class {
|
|
|
518
519
|
checksum
|
|
519
520
|
}, {
|
|
520
521
|
F: __dxlog_file4,
|
|
521
|
-
L:
|
|
522
|
+
L: 114,
|
|
522
523
|
S: this,
|
|
523
524
|
C: (f, a) => f(...a)
|
|
524
525
|
});
|
|
@@ -550,7 +551,7 @@ var MetadataStore = class {
|
|
|
550
551
|
err
|
|
551
552
|
}, {
|
|
552
553
|
F: __dxlog_file4,
|
|
553
|
-
L:
|
|
554
|
+
L: 145,
|
|
554
555
|
S: this,
|
|
555
556
|
C: (f, a) => f(...a)
|
|
556
557
|
});
|
|
@@ -567,7 +568,7 @@ var MetadataStore = class {
|
|
|
567
568
|
err
|
|
568
569
|
}, {
|
|
569
570
|
F: __dxlog_file4,
|
|
570
|
-
L:
|
|
571
|
+
L: 157,
|
|
571
572
|
S: this,
|
|
572
573
|
C: (f, a) => f(...a)
|
|
573
574
|
});
|
|
@@ -597,7 +598,7 @@ var MetadataStore = class {
|
|
|
597
598
|
err
|
|
598
599
|
}, {
|
|
599
600
|
F: __dxlog_file4,
|
|
600
|
-
L:
|
|
601
|
+
L: 186,
|
|
601
602
|
S: this,
|
|
602
603
|
C: (f, a) => f(...a)
|
|
603
604
|
});
|
|
@@ -618,7 +619,7 @@ var MetadataStore = class {
|
|
|
618
619
|
const space = this.spaces.find((space2) => space2.key === spaceKey);
|
|
619
620
|
invariant4(space, "Space not found", {
|
|
620
621
|
F: __dxlog_file4,
|
|
621
|
-
L:
|
|
622
|
+
L: 208,
|
|
622
623
|
S: this,
|
|
623
624
|
A: [
|
|
624
625
|
"space",
|
|
@@ -642,7 +643,7 @@ var MetadataStore = class {
|
|
|
642
643
|
async clear() {
|
|
643
644
|
log3("clearing all metadata", void 0, {
|
|
644
645
|
F: __dxlog_file4,
|
|
645
|
-
L:
|
|
646
|
+
L: 227,
|
|
646
647
|
S: this,
|
|
647
648
|
C: (f, a) => f(...a)
|
|
648
649
|
});
|
|
@@ -655,7 +656,7 @@ var MetadataStore = class {
|
|
|
655
656
|
async setIdentityRecord(record) {
|
|
656
657
|
invariant4(!this._metadata.identity, "Cannot overwrite existing identity in metadata", {
|
|
657
658
|
F: __dxlog_file4,
|
|
658
|
-
L:
|
|
659
|
+
L: 237,
|
|
659
660
|
S: this,
|
|
660
661
|
A: [
|
|
661
662
|
"!this._metadata.identity",
|
|
@@ -669,7 +670,7 @@ var MetadataStore = class {
|
|
|
669
670
|
async addSpace(record) {
|
|
670
671
|
invariant4(!(this._metadata.spaces ?? []).find((space) => space.key === record.key), "Cannot overwrite existing space in metadata", {
|
|
671
672
|
F: __dxlog_file4,
|
|
672
|
-
L:
|
|
673
|
+
L: 245,
|
|
673
674
|
S: this,
|
|
674
675
|
A: [
|
|
675
676
|
"!(this._metadata.spaces ?? []).find((space) => space.key === record.key)",
|
|
@@ -1392,9 +1393,9 @@ import { Event as Event4, scheduleTask as scheduleTask2, sleep as sleep2, synchr
|
|
|
1392
1393
|
import { Context as Context4 } from "@dxos/context";
|
|
1393
1394
|
import { checkCredentialType } from "@dxos/credentials";
|
|
1394
1395
|
import { getStateMachineFromItem, ItemManager, TYPE_PROPERTIES } from "@dxos/echo-db";
|
|
1396
|
+
import { CancelledError } from "@dxos/errors";
|
|
1395
1397
|
import { invariant as invariant8 } from "@dxos/invariant";
|
|
1396
1398
|
import { log as log8, omit } from "@dxos/log";
|
|
1397
|
-
import { CancelledError } from "@dxos/protocols";
|
|
1398
1399
|
import { Timeframe as Timeframe3 } from "@dxos/timeframe";
|
|
1399
1400
|
import { TimeSeriesCounter, TimeUsageCounter, trace } from "@dxos/tracing";
|
|
1400
1401
|
import { tracer } from "@dxos/util";
|
|
@@ -1466,7 +1467,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1466
1467
|
write: (data, options) => {
|
|
1467
1468
|
invariant8(this._pipeline, "Pipeline is not initialized.", {
|
|
1468
1469
|
F: __dxlog_file9,
|
|
1469
|
-
L:
|
|
1470
|
+
L: 154,
|
|
1470
1471
|
S: this,
|
|
1471
1472
|
A: [
|
|
1472
1473
|
"this._pipeline",
|
|
@@ -1475,7 +1476,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1475
1476
|
});
|
|
1476
1477
|
invariant8(this.currentEpoch, "Epoch is not initialized.", {
|
|
1477
1478
|
F: __dxlog_file9,
|
|
1478
|
-
L:
|
|
1479
|
+
L: 155,
|
|
1479
1480
|
S: this,
|
|
1480
1481
|
A: [
|
|
1481
1482
|
"this.currentEpoch",
|
|
@@ -1501,7 +1502,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1501
1502
|
}
|
|
1502
1503
|
log8("close", void 0, {
|
|
1503
1504
|
F: __dxlog_file9,
|
|
1504
|
-
L:
|
|
1505
|
+
L: 179,
|
|
1505
1506
|
S: this,
|
|
1506
1507
|
C: (f, a) => f(...a)
|
|
1507
1508
|
});
|
|
@@ -1516,7 +1517,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1516
1517
|
} catch (err) {
|
|
1517
1518
|
log8.catch(err, void 0, {
|
|
1518
1519
|
F: __dxlog_file9,
|
|
1519
|
-
L:
|
|
1520
|
+
L: 192,
|
|
1520
1521
|
S: this,
|
|
1521
1522
|
C: (f, a) => f(...a)
|
|
1522
1523
|
});
|
|
@@ -1541,7 +1542,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1541
1542
|
let messageCounter = 0;
|
|
1542
1543
|
invariant8(this._pipeline, "Pipeline is not initialized.", {
|
|
1543
1544
|
F: __dxlog_file9,
|
|
1544
|
-
L:
|
|
1545
|
+
L: 217,
|
|
1545
1546
|
S: this,
|
|
1546
1547
|
A: [
|
|
1547
1548
|
"this._pipeline",
|
|
@@ -1557,7 +1558,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1557
1558
|
seq
|
|
1558
1559
|
}, {
|
|
1559
1560
|
F: __dxlog_file9,
|
|
1560
|
-
L:
|
|
1561
|
+
L: 223,
|
|
1561
1562
|
S: this,
|
|
1562
1563
|
C: (f, a) => f(...a)
|
|
1563
1564
|
});
|
|
@@ -1569,7 +1570,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1569
1570
|
feedKey
|
|
1570
1571
|
}, {
|
|
1571
1572
|
F: __dxlog_file9,
|
|
1572
|
-
L:
|
|
1573
|
+
L: 229,
|
|
1573
1574
|
S: this,
|
|
1574
1575
|
C: (f, a) => f(...a)
|
|
1575
1576
|
});
|
|
@@ -1592,7 +1593,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1592
1593
|
spaceKey: this._params.spaceKey.toHex()
|
|
1593
1594
|
}, {
|
|
1594
1595
|
F: __dxlog_file9,
|
|
1595
|
-
L:
|
|
1596
|
+
L: 246,
|
|
1596
1597
|
S: this,
|
|
1597
1598
|
C: (f, a) => f(...a)
|
|
1598
1599
|
});
|
|
@@ -1601,7 +1602,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1601
1602
|
} catch (err) {
|
|
1602
1603
|
log8.catch(err, void 0, {
|
|
1603
1604
|
F: __dxlog_file9,
|
|
1604
|
-
L:
|
|
1605
|
+
L: 256,
|
|
1605
1606
|
S: this,
|
|
1606
1607
|
C: (f, a) => f(...a)
|
|
1607
1608
|
});
|
|
@@ -1616,7 +1617,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1616
1617
|
_createSnapshot() {
|
|
1617
1618
|
invariant8(this.databaseHost, "Database backend is not initialized.", {
|
|
1618
1619
|
F: __dxlog_file9,
|
|
1619
|
-
L:
|
|
1620
|
+
L: 270,
|
|
1620
1621
|
S: this,
|
|
1621
1622
|
A: [
|
|
1622
1623
|
"this.databaseHost",
|
|
@@ -1645,7 +1646,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1645
1646
|
} catch (err) {
|
|
1646
1647
|
log8.warn("Failed to cache properties", err, {
|
|
1647
1648
|
F: __dxlog_file9,
|
|
1648
|
-
L:
|
|
1649
|
+
L: 299,
|
|
1649
1650
|
S: this,
|
|
1650
1651
|
C: (f, a) => f(...a)
|
|
1651
1652
|
});
|
|
@@ -1674,14 +1675,14 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1674
1675
|
if (err instanceof CancelledError) {
|
|
1675
1676
|
log8("Epoch processing cancelled.", void 0, {
|
|
1676
1677
|
F: __dxlog_file9,
|
|
1677
|
-
L:
|
|
1678
|
+
L: 335,
|
|
1678
1679
|
S: this,
|
|
1679
1680
|
C: (f, a) => f(...a)
|
|
1680
1681
|
});
|
|
1681
1682
|
} else {
|
|
1682
1683
|
log8.catch(err, void 0, {
|
|
1683
1684
|
F: __dxlog_file9,
|
|
1684
|
-
L:
|
|
1685
|
+
L: 337,
|
|
1685
1686
|
S: this,
|
|
1686
1687
|
C: (f, a) => f(...a)
|
|
1687
1688
|
});
|
|
@@ -1701,7 +1702,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1701
1702
|
async _processEpoch(ctx, epoch) {
|
|
1702
1703
|
invariant8(this._isOpen, "Space is closed.", {
|
|
1703
1704
|
F: __dxlog_file9,
|
|
1704
|
-
L:
|
|
1705
|
+
L: 356,
|
|
1705
1706
|
S: this,
|
|
1706
1707
|
A: [
|
|
1707
1708
|
"this._isOpen",
|
|
@@ -1710,7 +1711,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1710
1711
|
});
|
|
1711
1712
|
invariant8(this._pipeline, void 0, {
|
|
1712
1713
|
F: __dxlog_file9,
|
|
1713
|
-
L:
|
|
1714
|
+
L: 357,
|
|
1714
1715
|
S: this,
|
|
1715
1716
|
A: [
|
|
1716
1717
|
"this._pipeline",
|
|
@@ -1722,7 +1723,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1722
1723
|
epoch: omit(epoch, "proof")
|
|
1723
1724
|
}, {
|
|
1724
1725
|
F: __dxlog_file9,
|
|
1725
|
-
L:
|
|
1726
|
+
L: 360,
|
|
1726
1727
|
S: this,
|
|
1727
1728
|
C: (f, a) => f(...a)
|
|
1728
1729
|
});
|
|
@@ -1732,7 +1733,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1732
1733
|
}
|
|
1733
1734
|
log8("restarting pipeline from epoch", void 0, {
|
|
1734
1735
|
F: __dxlog_file9,
|
|
1735
|
-
L:
|
|
1736
|
+
L: 366,
|
|
1736
1737
|
S: this,
|
|
1737
1738
|
C: (f, a) => f(...a)
|
|
1738
1739
|
});
|
|
@@ -1743,7 +1744,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1743
1744
|
async waitUntilTimeframe(timeframe) {
|
|
1744
1745
|
invariant8(this._pipeline, "Pipeline is not initialized.", {
|
|
1745
1746
|
F: __dxlog_file9,
|
|
1746
|
-
L:
|
|
1747
|
+
L: 373,
|
|
1747
1748
|
S: this,
|
|
1748
1749
|
A: [
|
|
1749
1750
|
"this._pipeline",
|
|
@@ -1755,7 +1756,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1755
1756
|
async createEpoch() {
|
|
1756
1757
|
invariant8(this._pipeline, void 0, {
|
|
1757
1758
|
F: __dxlog_file9,
|
|
1758
|
-
L:
|
|
1759
|
+
L: 379,
|
|
1759
1760
|
S: this,
|
|
1760
1761
|
A: [
|
|
1761
1762
|
"this._pipeline",
|
|
@@ -1764,7 +1765,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1764
1765
|
});
|
|
1765
1766
|
invariant8(this.currentEpoch, void 0, {
|
|
1766
1767
|
F: __dxlog_file9,
|
|
1767
|
-
L:
|
|
1768
|
+
L: 380,
|
|
1768
1769
|
S: this,
|
|
1769
1770
|
A: [
|
|
1770
1771
|
"this.currentEpoch",
|
|
@@ -1795,7 +1796,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1795
1796
|
} catch (err) {
|
|
1796
1797
|
log8.catch(err, void 0, {
|
|
1797
1798
|
F: __dxlog_file9,
|
|
1798
|
-
L:
|
|
1799
|
+
L: 410,
|
|
1799
1800
|
S: this,
|
|
1800
1801
|
C: (f, a) => f(...a)
|
|
1801
1802
|
});
|
|
@@ -2672,4 +2673,4 @@ export {
|
|
|
2672
2673
|
SpaceProtocolSession,
|
|
2673
2674
|
SpaceManager
|
|
2674
2675
|
};
|
|
2675
|
-
//# sourceMappingURL=chunk-
|
|
2676
|
+
//# sourceMappingURL=chunk-VYZEP2BZ.mjs.map
|