@fluid-experimental/tree 0.58.2001 → 0.59.2000-61729
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/README.md +159 -46
- package/dist/ChangeCompression.d.ts +39 -0
- package/dist/ChangeCompression.d.ts.map +1 -0
- package/dist/ChangeCompression.js +117 -0
- package/dist/ChangeCompression.js.map +1 -0
- package/{lib/default-edits/PersistedTypes.d.ts → dist/ChangeTypes.d.ts} +58 -105
- package/dist/ChangeTypes.d.ts.map +1 -0
- package/dist/{default-edits/PersistedTypes.js → ChangeTypes.js} +21 -76
- package/dist/ChangeTypes.js.map +1 -0
- package/dist/Checkout.d.ts +39 -27
- package/dist/Checkout.d.ts.map +1 -1
- package/dist/Checkout.js +61 -32
- package/dist/Checkout.js.map +1 -1
- package/dist/Common.d.ts +175 -38
- package/dist/Common.d.ts.map +1 -1
- package/dist/Common.js +240 -103
- package/dist/Common.js.map +1 -1
- package/dist/EagerCheckout.d.ts +24 -0
- package/dist/EagerCheckout.d.ts.map +1 -0
- package/dist/{BasicCheckout.js → EagerCheckout.js} +9 -6
- package/dist/EagerCheckout.js.map +1 -0
- package/dist/EditLog.d.ts +77 -63
- package/dist/EditLog.d.ts.map +1 -1
- package/dist/EditLog.js +85 -48
- package/dist/EditLog.js.map +1 -1
- package/dist/EditUtilities.d.ts +168 -0
- package/dist/EditUtilities.d.ts.map +1 -0
- package/dist/EditUtilities.js +373 -0
- package/dist/EditUtilities.js.map +1 -0
- package/dist/EventTypes.d.ts +73 -0
- package/dist/EventTypes.d.ts.map +1 -0
- package/dist/EventTypes.js +78 -0
- package/dist/EventTypes.js.map +1 -0
- package/dist/Forest.d.ts +29 -7
- package/dist/Forest.d.ts.map +1 -1
- package/dist/Forest.js +60 -36
- package/dist/Forest.js.map +1 -1
- package/dist/HistoryEditFactory.d.ts +20 -0
- package/dist/HistoryEditFactory.d.ts.map +1 -0
- package/dist/HistoryEditFactory.js +226 -0
- package/dist/HistoryEditFactory.js.map +1 -0
- package/dist/IdConversion.d.ts +12 -0
- package/dist/IdConversion.d.ts.map +1 -0
- package/dist/IdConversion.js +98 -0
- package/dist/IdConversion.js.map +1 -0
- package/dist/Identifiers.d.ts +89 -2
- package/dist/Identifiers.d.ts.map +1 -1
- package/dist/Identifiers.js +10 -0
- package/dist/Identifiers.js.map +1 -1
- package/dist/InitialTree.d.ts +2 -2
- package/dist/InitialTree.d.ts.map +1 -1
- package/dist/InitialTree.js +2 -1
- package/dist/InitialTree.js.map +1 -1
- package/dist/LazyCheckout.d.ts +28 -0
- package/dist/LazyCheckout.d.ts.map +1 -0
- package/dist/LazyCheckout.js +44 -0
- package/dist/LazyCheckout.js.map +1 -0
- package/dist/LogViewer.d.ts +129 -85
- package/dist/LogViewer.d.ts.map +1 -1
- package/dist/LogViewer.js +111 -85
- package/dist/LogViewer.js.map +1 -1
- package/dist/MergeHealth.d.ts +221 -0
- package/dist/MergeHealth.d.ts.map +1 -0
- package/dist/MergeHealth.js +263 -0
- package/dist/MergeHealth.js.map +1 -0
- package/dist/NodeIdUtilities.d.ts +105 -0
- package/dist/NodeIdUtilities.d.ts.map +1 -0
- package/dist/NodeIdUtilities.js +60 -0
- package/dist/NodeIdUtilities.js.map +1 -0
- package/dist/PayloadUtilities.d.ts +42 -0
- package/dist/PayloadUtilities.d.ts.map +1 -0
- package/dist/PayloadUtilities.js +114 -0
- package/dist/PayloadUtilities.js.map +1 -0
- package/dist/ReconciliationPath.d.ts +18 -13
- package/dist/ReconciliationPath.d.ts.map +1 -1
- package/dist/ReconciliationPath.js.map +1 -1
- package/dist/RevisionValueCache.d.ts +11 -2
- package/dist/RevisionValueCache.d.ts.map +1 -1
- package/dist/RevisionValueCache.js +2 -3
- package/dist/RevisionValueCache.js.map +1 -1
- package/dist/RevisionView.d.ts +83 -0
- package/dist/RevisionView.d.ts.map +1 -0
- package/dist/RevisionView.js +182 -0
- package/dist/RevisionView.js.map +1 -0
- package/dist/SerializationUtilities.d.ts +36 -0
- package/dist/SerializationUtilities.d.ts.map +1 -0
- package/dist/SerializationUtilities.js +102 -0
- package/dist/SerializationUtilities.js.map +1 -0
- package/dist/SharedTree.d.ts +439 -0
- package/dist/SharedTree.d.ts.map +1 -0
- package/dist/SharedTree.js +1109 -0
- package/dist/SharedTree.js.map +1 -0
- package/dist/SharedTreeEncoder.d.ts +102 -0
- package/dist/SharedTreeEncoder.d.ts.map +1 -0
- package/dist/SharedTreeEncoder.js +313 -0
- package/dist/SharedTreeEncoder.js.map +1 -0
- package/dist/StringInterner.d.ts +46 -0
- package/dist/StringInterner.d.ts.map +1 -0
- package/dist/StringInterner.js +61 -0
- package/dist/StringInterner.js.map +1 -0
- package/dist/Summary.d.ts +40 -0
- package/dist/Summary.d.ts.map +1 -0
- package/dist/Summary.js +23 -0
- package/dist/Summary.js.map +1 -0
- package/dist/SummaryBackCompatibility.d.ts +22 -22
- package/dist/SummaryBackCompatibility.d.ts.map +1 -1
- package/dist/SummaryBackCompatibility.js +30 -33
- package/dist/SummaryBackCompatibility.js.map +1 -1
- package/dist/SummaryTestUtilities.d.ts +31 -0
- package/dist/SummaryTestUtilities.d.ts.map +1 -0
- package/dist/SummaryTestUtilities.js +37 -0
- package/dist/SummaryTestUtilities.js.map +1 -0
- package/dist/Transaction.d.ts +71 -0
- package/dist/Transaction.d.ts.map +1 -0
- package/dist/Transaction.js +92 -0
- package/dist/Transaction.js.map +1 -0
- package/dist/TransactionInternal.d.ts +540 -0
- package/dist/TransactionInternal.d.ts.map +1 -0
- package/dist/TransactionInternal.js +626 -0
- package/dist/TransactionInternal.js.map +1 -0
- package/dist/TreeCompressor.d.ts +36 -0
- package/dist/TreeCompressor.d.ts.map +1 -0
- package/dist/TreeCompressor.js +137 -0
- package/dist/TreeCompressor.js.map +1 -0
- package/dist/TreeNodeHandle.d.ts +12 -18
- package/dist/TreeNodeHandle.d.ts.map +1 -1
- package/dist/TreeNodeHandle.js +13 -23
- package/dist/TreeNodeHandle.js.map +1 -1
- package/dist/TreeView.d.ts +166 -0
- package/dist/TreeView.d.ts.map +1 -0
- package/dist/TreeView.js +218 -0
- package/dist/TreeView.js.map +1 -0
- package/dist/TreeViewUtilities.d.ts +21 -0
- package/dist/TreeViewUtilities.d.ts.map +1 -0
- package/dist/TreeViewUtilities.js +77 -0
- package/dist/TreeViewUtilities.js.map +1 -0
- package/dist/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
- package/dist/UndoRedoHandler.d.ts.map +1 -0
- package/dist/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +5 -9
- package/dist/UndoRedoHandler.js.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts +127 -0
- package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
- package/dist/id-compressor/AppendOnlySortedMap.js +283 -0
- package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -0
- package/dist/id-compressor/IdCompressor.d.ts +389 -0
- package/dist/id-compressor/IdCompressor.d.ts.map +1 -0
- package/dist/id-compressor/IdCompressor.js +1353 -0
- package/dist/id-compressor/IdCompressor.js.map +1 -0
- package/dist/id-compressor/IdRange.d.ts +11 -0
- package/dist/id-compressor/IdRange.d.ts.map +1 -0
- package/dist/id-compressor/IdRange.js +29 -0
- package/dist/id-compressor/IdRange.js.map +1 -0
- package/dist/id-compressor/NumericUuid.d.ts +63 -0
- package/dist/id-compressor/NumericUuid.d.ts.map +1 -0
- package/dist/id-compressor/NumericUuid.js +377 -0
- package/dist/id-compressor/NumericUuid.js.map +1 -0
- package/dist/id-compressor/index.d.ts +12 -0
- package/dist/id-compressor/index.d.ts.map +1 -0
- package/dist/id-compressor/index.js +26 -0
- package/dist/id-compressor/index.js.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts +156 -0
- package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
- package/dist/id-compressor/persisted-types/0.0.1.js +7 -0
- package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -0
- package/dist/id-compressor/persisted-types/index.d.ts +6 -0
- package/dist/id-compressor/persisted-types/index.d.ts.map +1 -0
- package/dist/id-compressor/persisted-types/index.js +18 -0
- package/dist/id-compressor/persisted-types/index.js.map +1 -0
- package/dist/index.d.ts +29 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -35
- package/dist/index.js.map +1 -1
- package/dist/persisted-types/0.0.2.d.ts +385 -0
- package/dist/persisted-types/0.0.2.d.ts.map +1 -0
- package/dist/persisted-types/0.0.2.js +113 -0
- package/dist/persisted-types/0.0.2.js.map +1 -0
- package/dist/persisted-types/0.1.1.d.ts +314 -0
- package/dist/persisted-types/0.1.1.d.ts.map +1 -0
- package/dist/persisted-types/0.1.1.js +153 -0
- package/dist/persisted-types/0.1.1.js.map +1 -0
- package/dist/persisted-types/index.d.ts +7 -0
- package/dist/persisted-types/index.d.ts.map +1 -0
- package/dist/persisted-types/index.js +20 -0
- package/dist/persisted-types/index.js.map +1 -0
- package/docs/0-1-1-Compression.md +228 -0
- package/docs/Breaking-Change-Migration.md +52 -0
- package/docs/Compression.md +2 -2
- package/docs/Telemetry.md +43 -0
- package/docs/Write-Format.md +19 -0
- package/lib/ChangeCompression.d.ts +39 -0
- package/lib/ChangeCompression.d.ts.map +1 -0
- package/lib/ChangeCompression.js +111 -0
- package/lib/ChangeCompression.js.map +1 -0
- package/{dist/default-edits/PersistedTypes.d.ts → lib/ChangeTypes.d.ts} +58 -105
- package/lib/ChangeTypes.d.ts.map +1 -0
- package/lib/{default-edits/PersistedTypes.js → ChangeTypes.js} +15 -68
- package/lib/ChangeTypes.js.map +1 -0
- package/lib/Checkout.d.ts +39 -27
- package/lib/Checkout.d.ts.map +1 -1
- package/lib/Checkout.js +53 -24
- package/lib/Checkout.js.map +1 -1
- package/lib/Common.d.ts +175 -38
- package/lib/Common.d.ts.map +1 -1
- package/lib/Common.js +226 -101
- package/lib/Common.js.map +1 -1
- package/lib/EagerCheckout.d.ts +24 -0
- package/lib/EagerCheckout.d.ts.map +1 -0
- package/lib/{BasicCheckout.js → EagerCheckout.js} +7 -4
- package/lib/EagerCheckout.js.map +1 -0
- package/lib/EditLog.d.ts +77 -63
- package/lib/EditLog.d.ts.map +1 -1
- package/lib/EditLog.js +83 -47
- package/lib/EditLog.js.map +1 -1
- package/lib/EditUtilities.d.ts +168 -0
- package/lib/EditUtilities.d.ts.map +1 -0
- package/lib/EditUtilities.js +353 -0
- package/lib/EditUtilities.js.map +1 -0
- package/lib/EventTypes.d.ts +73 -0
- package/lib/EventTypes.d.ts.map +1 -0
- package/lib/EventTypes.js +75 -0
- package/lib/EventTypes.js.map +1 -0
- package/lib/Forest.d.ts +29 -7
- package/lib/Forest.d.ts.map +1 -1
- package/lib/Forest.js +58 -35
- package/lib/Forest.js.map +1 -1
- package/lib/HistoryEditFactory.d.ts +20 -0
- package/lib/HistoryEditFactory.d.ts.map +1 -0
- package/lib/{default-edits/HistoryEditFactory.js → HistoryEditFactory.js} +78 -39
- package/lib/HistoryEditFactory.js.map +1 -0
- package/lib/IdConversion.d.ts +12 -0
- package/lib/IdConversion.d.ts.map +1 -0
- package/lib/IdConversion.js +91 -0
- package/lib/IdConversion.js.map +1 -0
- package/lib/Identifiers.d.ts +89 -2
- package/lib/Identifiers.d.ts.map +1 -1
- package/lib/Identifiers.js +8 -1
- package/lib/Identifiers.js.map +1 -1
- package/lib/InitialTree.d.ts +2 -2
- package/lib/InitialTree.d.ts.map +1 -1
- package/lib/InitialTree.js +2 -1
- package/lib/InitialTree.js.map +1 -1
- package/lib/LazyCheckout.d.ts +28 -0
- package/lib/LazyCheckout.d.ts.map +1 -0
- package/lib/LazyCheckout.js +40 -0
- package/lib/LazyCheckout.js.map +1 -0
- package/lib/LogViewer.d.ts +129 -85
- package/lib/LogViewer.d.ts.map +1 -1
- package/lib/LogViewer.js +103 -77
- package/lib/LogViewer.js.map +1 -1
- package/lib/MergeHealth.d.ts +221 -0
- package/lib/MergeHealth.d.ts.map +1 -0
- package/lib/MergeHealth.js +258 -0
- package/lib/MergeHealth.js.map +1 -0
- package/lib/NodeIdUtilities.d.ts +105 -0
- package/lib/NodeIdUtilities.d.ts.map +1 -0
- package/lib/NodeIdUtilities.js +53 -0
- package/lib/NodeIdUtilities.js.map +1 -0
- package/lib/PayloadUtilities.d.ts +42 -0
- package/lib/PayloadUtilities.d.ts.map +1 -0
- package/lib/PayloadUtilities.js +110 -0
- package/lib/PayloadUtilities.js.map +1 -0
- package/lib/ReconciliationPath.d.ts +18 -13
- package/lib/ReconciliationPath.d.ts.map +1 -1
- package/lib/ReconciliationPath.js.map +1 -1
- package/lib/RevisionValueCache.d.ts +11 -2
- package/lib/RevisionValueCache.d.ts.map +1 -1
- package/lib/RevisionValueCache.js +2 -3
- package/lib/RevisionValueCache.js.map +1 -1
- package/lib/RevisionView.d.ts +83 -0
- package/lib/RevisionView.d.ts.map +1 -0
- package/lib/RevisionView.js +175 -0
- package/lib/RevisionView.js.map +1 -0
- package/lib/SerializationUtilities.d.ts +36 -0
- package/lib/SerializationUtilities.d.ts.map +1 -0
- package/lib/SerializationUtilities.js +95 -0
- package/lib/SerializationUtilities.js.map +1 -0
- package/lib/SharedTree.d.ts +439 -0
- package/lib/SharedTree.d.ts.map +1 -0
- package/lib/SharedTree.js +1104 -0
- package/lib/SharedTree.js.map +1 -0
- package/lib/SharedTreeEncoder.d.ts +102 -0
- package/lib/SharedTreeEncoder.d.ts.map +1 -0
- package/lib/SharedTreeEncoder.js +308 -0
- package/lib/SharedTreeEncoder.js.map +1 -0
- package/lib/StringInterner.d.ts +46 -0
- package/lib/StringInterner.d.ts.map +1 -0
- package/lib/StringInterner.js +57 -0
- package/lib/StringInterner.js.map +1 -0
- package/lib/Summary.d.ts +40 -0
- package/lib/Summary.d.ts.map +1 -0
- package/lib/Summary.js +19 -0
- package/lib/Summary.js.map +1 -0
- package/lib/SummaryBackCompatibility.d.ts +22 -22
- package/lib/SummaryBackCompatibility.d.ts.map +1 -1
- package/lib/SummaryBackCompatibility.js +29 -32
- package/lib/SummaryBackCompatibility.js.map +1 -1
- package/lib/SummaryTestUtilities.d.ts +31 -0
- package/lib/SummaryTestUtilities.d.ts.map +1 -0
- package/lib/SummaryTestUtilities.js +32 -0
- package/lib/SummaryTestUtilities.js.map +1 -0
- package/lib/Transaction.d.ts +71 -0
- package/lib/Transaction.d.ts.map +1 -0
- package/lib/Transaction.js +88 -0
- package/lib/Transaction.js.map +1 -0
- package/lib/TransactionInternal.d.ts +540 -0
- package/lib/TransactionInternal.d.ts.map +1 -0
- package/lib/TransactionInternal.js +622 -0
- package/lib/TransactionInternal.js.map +1 -0
- package/lib/TreeCompressor.d.ts +36 -0
- package/lib/TreeCompressor.d.ts.map +1 -0
- package/lib/TreeCompressor.js +133 -0
- package/lib/TreeCompressor.js.map +1 -0
- package/lib/TreeNodeHandle.d.ts +12 -18
- package/lib/TreeNodeHandle.d.ts.map +1 -1
- package/lib/TreeNodeHandle.js +14 -24
- package/lib/TreeNodeHandle.js.map +1 -1
- package/lib/TreeView.d.ts +166 -0
- package/lib/TreeView.d.ts.map +1 -0
- package/lib/TreeView.js +214 -0
- package/lib/TreeView.js.map +1 -0
- package/lib/TreeViewUtilities.d.ts +21 -0
- package/lib/TreeViewUtilities.d.ts.map +1 -0
- package/lib/TreeViewUtilities.js +71 -0
- package/lib/TreeViewUtilities.js.map +1 -0
- package/lib/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
- package/lib/UndoRedoHandler.d.ts.map +1 -0
- package/lib/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +3 -7
- package/lib/UndoRedoHandler.js.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts +127 -0
- package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
- package/lib/id-compressor/AppendOnlySortedMap.js +278 -0
- package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -0
- package/lib/id-compressor/IdCompressor.d.ts +389 -0
- package/lib/id-compressor/IdCompressor.d.ts.map +1 -0
- package/lib/id-compressor/IdCompressor.js +1343 -0
- package/lib/id-compressor/IdCompressor.js.map +1 -0
- package/lib/id-compressor/IdRange.d.ts +11 -0
- package/lib/id-compressor/IdRange.d.ts.map +1 -0
- package/lib/id-compressor/IdRange.js +25 -0
- package/lib/id-compressor/IdRange.js.map +1 -0
- package/lib/id-compressor/NumericUuid.d.ts +63 -0
- package/lib/id-compressor/NumericUuid.d.ts.map +1 -0
- package/lib/id-compressor/NumericUuid.js +365 -0
- package/lib/id-compressor/NumericUuid.js.map +1 -0
- package/lib/id-compressor/index.d.ts +12 -0
- package/lib/id-compressor/index.d.ts.map +1 -0
- package/lib/id-compressor/index.js +12 -0
- package/lib/id-compressor/index.js.map +1 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts +156 -0
- package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
- package/lib/{test/Snapshot.tests.d.ts → id-compressor/persisted-types/0.0.1.js} +1 -1
- package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -0
- package/lib/id-compressor/persisted-types/index.d.ts +6 -0
- package/lib/id-compressor/persisted-types/index.d.ts.map +1 -0
- package/lib/id-compressor/persisted-types/index.js +6 -0
- package/lib/id-compressor/persisted-types/index.js.map +1 -0
- package/lib/index.d.ts +29 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +23 -6
- package/lib/index.js.map +1 -1
- package/lib/persisted-types/0.0.2.d.ts +385 -0
- package/lib/persisted-types/0.0.2.d.ts.map +1 -0
- package/lib/persisted-types/0.0.2.js +110 -0
- package/lib/persisted-types/0.0.2.js.map +1 -0
- package/lib/persisted-types/0.1.1.d.ts +314 -0
- package/lib/persisted-types/0.1.1.d.ts.map +1 -0
- package/lib/persisted-types/0.1.1.js +150 -0
- package/lib/persisted-types/0.1.1.js.map +1 -0
- package/lib/persisted-types/index.d.ts +7 -0
- package/lib/persisted-types/index.d.ts.map +1 -0
- package/lib/persisted-types/index.js +8 -0
- package/lib/persisted-types/index.js.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.d.ts +6 -0
- package/lib/test/AppendOnlySortedMap.tests.d.ts.map +1 -0
- package/lib/test/AppendOnlySortedMap.tests.js +169 -0
- package/lib/test/AppendOnlySortedMap.tests.js.map +1 -0
- package/lib/test/{SnapshotUtilities.tests.d.ts → ChangeCompression.tests.d.ts} +1 -1
- package/lib/test/ChangeCompression.tests.d.ts.map +1 -0
- package/lib/test/ChangeCompression.tests.js +145 -0
- package/lib/test/ChangeCompression.tests.js.map +1 -0
- package/lib/test/Checkout.tests.d.ts +2 -3
- package/lib/test/Checkout.tests.d.ts.map +1 -1
- package/lib/test/Checkout.tests.js +126 -69
- package/lib/test/Checkout.tests.js.map +1 -1
- package/lib/test/Common.tests.js +60 -2
- package/lib/test/Common.tests.js.map +1 -1
- package/lib/test/{BasicCheckout.tests.d.ts → EagerCheckout.tests.d.ts} +1 -1
- package/lib/test/EagerCheckout.tests.d.ts.map +1 -0
- package/lib/test/EagerCheckout.tests.js +20 -0
- package/lib/test/EagerCheckout.tests.js.map +1 -0
- package/lib/test/Edit.tests.js +22 -14
- package/lib/test/Edit.tests.js.map +1 -1
- package/lib/test/{Anchors.glassBox.tests.d.ts → EditLog.perf.tests.d.ts} +1 -1
- package/lib/test/EditLog.perf.tests.d.ts.map +1 -0
- package/lib/test/EditLog.perf.tests.js +30 -0
- package/lib/test/EditLog.perf.tests.js.map +1 -0
- package/lib/test/EditLog.tests.js +10 -6
- package/lib/test/EditLog.tests.js.map +1 -1
- package/lib/test/EditUtilities.tests.d.ts +6 -0
- package/lib/test/EditUtilities.tests.d.ts.map +1 -0
- package/lib/test/EditUtilities.tests.js +503 -0
- package/lib/test/EditUtilities.tests.js.map +1 -0
- package/lib/test/Forest.perf.tests.d.ts +6 -0
- package/lib/test/Forest.perf.tests.d.ts.map +1 -0
- package/lib/test/Forest.perf.tests.js +133 -0
- package/lib/test/Forest.perf.tests.js.map +1 -0
- package/lib/test/Forest.tests.js +54 -27
- package/lib/test/Forest.tests.js.map +1 -1
- package/lib/test/GenericTransaction.tests.js +12 -3
- package/lib/test/GenericTransaction.tests.js.map +1 -1
- package/lib/test/HistoryEditFactory.tests.d.ts +6 -0
- package/lib/test/HistoryEditFactory.tests.d.ts.map +1 -0
- package/lib/test/HistoryEditFactory.tests.js +90 -0
- package/lib/test/HistoryEditFactory.tests.js.map +1 -0
- package/lib/test/IdCompressor.perf.tests.d.ts +6 -0
- package/lib/test/IdCompressor.perf.tests.d.ts.map +1 -0
- package/lib/test/IdCompressor.perf.tests.js +304 -0
- package/lib/test/IdCompressor.perf.tests.js.map +1 -0
- package/lib/test/IdCompressor.tests.d.ts +6 -0
- package/lib/test/IdCompressor.tests.d.ts.map +1 -0
- package/lib/test/IdCompressor.tests.js +1075 -0
- package/lib/test/IdCompressor.tests.js.map +1 -0
- package/lib/test/IdConversion.tests.d.ts +6 -0
- package/lib/test/IdConversion.tests.d.ts.map +1 -0
- package/lib/test/IdConversion.tests.js +36 -0
- package/lib/test/IdConversion.tests.js.map +1 -0
- package/lib/test/LazyCheckout.tests.d.ts +6 -0
- package/lib/test/LazyCheckout.tests.d.ts.map +1 -0
- package/lib/test/LazyCheckout.tests.js +22 -0
- package/lib/test/LazyCheckout.tests.js.map +1 -0
- package/lib/test/LogViewer.tests.js +276 -191
- package/lib/test/LogViewer.tests.js.map +1 -1
- package/lib/test/{SharedTreeWithAnchors.tests.d.ts → MergeHealthTelemetryHeartbeat.tests.d.ts} +1 -1
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +1 -0
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +342 -0
- package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +1 -0
- package/lib/test/NumericUuid.perf.tests.d.ts +6 -0
- package/lib/test/NumericUuid.perf.tests.d.ts.map +1 -0
- package/lib/test/NumericUuid.perf.tests.js +68 -0
- package/lib/test/NumericUuid.perf.tests.js.map +1 -0
- package/lib/test/NumericUuid.tests.d.ts +6 -0
- package/lib/test/NumericUuid.tests.d.ts.map +1 -0
- package/lib/test/NumericUuid.tests.js +191 -0
- package/lib/test/NumericUuid.tests.js.map +1 -0
- package/lib/test/RevisionView.tests.d.ts +6 -0
- package/lib/test/RevisionView.tests.d.ts.map +1 -0
- package/lib/test/RevisionView.tests.js +133 -0
- package/lib/test/RevisionView.tests.js.map +1 -0
- package/lib/test/SharedTree.perf.tests.d.ts +6 -0
- package/lib/test/SharedTree.perf.tests.d.ts.map +1 -0
- package/lib/test/SharedTree.perf.tests.js +39 -0
- package/lib/test/SharedTree.perf.tests.js.map +1 -0
- package/lib/test/SharedTree.tests.js +15 -3
- package/lib/test/SharedTree.tests.js.map +1 -1
- package/lib/test/StringInterner.tests.d.ts +6 -0
- package/lib/test/StringInterner.tests.d.ts.map +1 -0
- package/lib/test/StringInterner.tests.js +71 -0
- package/lib/test/StringInterner.tests.js.map +1 -0
- package/lib/test/Summary.tests.d.ts +8 -0
- package/lib/test/Summary.tests.d.ts.map +1 -0
- package/lib/test/Summary.tests.js +407 -0
- package/lib/test/Summary.tests.js.map +1 -0
- package/lib/test/Transaction.tests.js +109 -329
- package/lib/test/Transaction.tests.js.map +1 -1
- package/lib/test/TransactionInternal.tests.d.ts +6 -0
- package/lib/test/TransactionInternal.tests.d.ts.map +1 -0
- package/lib/test/TransactionInternal.tests.js +568 -0
- package/lib/test/TransactionInternal.tests.js.map +1 -0
- package/lib/test/TreeCompression.tests.d.ts +6 -0
- package/lib/test/TreeCompression.tests.d.ts.map +1 -0
- package/lib/test/TreeCompression.tests.js +292 -0
- package/lib/test/TreeCompression.tests.js.map +1 -0
- package/lib/test/TreeView.tests.d.ts +6 -0
- package/lib/test/TreeView.tests.d.ts.map +1 -0
- package/lib/test/TreeView.tests.js +176 -0
- package/lib/test/TreeView.tests.js.map +1 -0
- package/lib/test/UndoRedoHandler.tests.js +2 -2
- package/lib/test/UndoRedoHandler.tests.js.map +1 -1
- package/lib/test/Virtualization.tests.js +146 -62
- package/lib/test/Virtualization.tests.js.map +1 -1
- package/lib/test/fuzz/Generators.d.ts +19 -0
- package/lib/test/fuzz/Generators.d.ts.map +1 -0
- package/lib/test/fuzz/Generators.js +420 -0
- package/lib/test/fuzz/Generators.js.map +1 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +20 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.js +217 -0
- package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -0
- package/lib/test/fuzz/Types.d.ts +133 -0
- package/lib/test/fuzz/Types.d.ts.map +1 -0
- package/lib/test/{GenericTransactionWithAnchors.tests.d.ts → fuzz/Types.js} +2 -2
- package/lib/test/fuzz/Types.js.map +1 -0
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts +180 -0
- package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -0
- package/lib/test/utilities/IdCompressorTestUtilities.js +528 -0
- package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -0
- package/lib/test/utilities/MockTransaction.d.ts +26 -7
- package/lib/test/utilities/MockTransaction.d.ts.map +1 -1
- package/lib/test/utilities/MockTransaction.js +40 -11
- package/lib/test/utilities/MockTransaction.js.map +1 -1
- package/lib/test/utilities/PendingLocalStateTests.d.ts +12 -0
- package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -0
- package/lib/test/utilities/PendingLocalStateTests.js +105 -0
- package/lib/test/utilities/PendingLocalStateTests.js.map +1 -0
- package/lib/test/utilities/SharedTreeTests.d.ts +3 -4
- package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
- package/lib/test/utilities/SharedTreeTests.js +696 -439
- package/lib/test/utilities/SharedTreeTests.js.map +1 -1
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts +11 -0
- package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js +370 -0
- package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -0
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts +10 -0
- package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -0
- package/lib/test/utilities/SummaryLoadPerfTests.js +102 -0
- package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -0
- package/lib/test/utilities/SummarySizeTests.d.ts +11 -0
- package/lib/test/utilities/SummarySizeTests.d.ts.map +1 -0
- package/lib/test/utilities/SummarySizeTests.js +158 -0
- package/lib/test/utilities/SummarySizeTests.js.map +1 -0
- package/lib/test/utilities/TestCommon.d.ts +9 -0
- package/lib/test/utilities/TestCommon.d.ts.map +1 -0
- package/lib/test/utilities/TestCommon.js +13 -0
- package/lib/test/utilities/TestCommon.js.map +1 -0
- package/lib/test/utilities/TestNode.d.ts +140 -0
- package/lib/test/utilities/TestNode.d.ts.map +1 -0
- package/lib/test/utilities/TestNode.js +292 -0
- package/lib/test/utilities/TestNode.js.map +1 -0
- package/lib/test/utilities/TestUtilities.d.ts +84 -70
- package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
- package/lib/test/utilities/TestUtilities.js +218 -143
- package/lib/test/utilities/TestUtilities.js.map +1 -1
- package/lib/test/utilities/UndoRedoTests.d.ts +4 -5
- package/lib/test/utilities/UndoRedoTests.d.ts.map +1 -1
- package/lib/test/utilities/UndoRedoTests.js +138 -149
- package/lib/test/utilities/UndoRedoTests.js.map +1 -1
- package/package.json +22 -17
- package/src/ChangeCompression.ts +159 -0
- package/src/{default-edits/PersistedTypes.ts → ChangeTypes.ts} +62 -125
- package/src/Checkout.ts +82 -53
- package/src/Common.ts +317 -117
- package/src/EagerCheckout.ts +38 -0
- package/src/EditLog.ts +153 -100
- package/src/EditUtilities.ts +559 -0
- package/src/EventTypes.ts +74 -0
- package/src/Forest.ts +81 -73
- package/src/{default-edits/HistoryEditFactory.ts → HistoryEditFactory.ts} +103 -53
- package/src/IdConversion.ts +125 -0
- package/src/Identifiers.ts +101 -1
- package/src/InitialTree.ts +5 -4
- package/src/LazyCheckout.ts +51 -0
- package/src/LogViewer.ts +242 -166
- package/src/MergeHealth.ts +447 -0
- package/src/NodeIdUtilities.ts +156 -0
- package/src/PayloadUtilities.ts +124 -0
- package/src/ReconciliationPath.ts +18 -13
- package/src/RevisionValueCache.ts +14 -5
- package/src/RevisionView.ts +252 -0
- package/src/SerializationUtilities.ts +130 -0
- package/src/SharedTree.ts +1501 -0
- package/src/SharedTreeEncoder.ts +493 -0
- package/src/StringInterner.ts +72 -0
- package/src/Summary.ts +48 -0
- package/src/SummaryBackCompatibility.ts +47 -57
- package/src/SummaryTestUtilities.ts +54 -0
- package/src/Transaction.ts +120 -0
- package/src/TransactionInternal.ts +1087 -0
- package/src/TreeCompressor.ts +213 -0
- package/src/TreeNodeHandle.ts +19 -32
- package/src/TreeView.ts +322 -0
- package/src/TreeViewUtilities.ts +77 -0
- package/src/{default-edits/UndoRedoHandler.ts → UndoRedoHandler.ts} +8 -13
- package/src/id-compressor/AppendOnlySortedMap.ts +325 -0
- package/src/id-compressor/IdCompressor.md +3 -0
- package/src/id-compressor/IdCompressor.ts +1848 -0
- package/src/id-compressor/IdRange.ts +33 -0
- package/src/id-compressor/NumericUuid.ts +414 -0
- package/src/id-compressor/index.ts +13 -0
- package/src/id-compressor/persisted-types/0.0.1.ts +179 -0
- package/src/id-compressor/persisted-types/README.md +3 -0
- package/src/id-compressor/persisted-types/index.ts +6 -0
- package/src/index.ts +118 -59
- package/src/persisted-types/0.0.2.ts +442 -0
- package/src/persisted-types/0.1.1.ts +476 -0
- package/src/persisted-types/README.md +22 -0
- package/src/persisted-types/index.ts +9 -0
- package/.mocharc.js +0 -41
- package/api/tree.api.md +0 -729
- package/dist/BasicCheckout.d.ts +0 -23
- package/dist/BasicCheckout.d.ts.map +0 -1
- package/dist/BasicCheckout.js.map +0 -1
- package/dist/Snapshot.d.ts +0 -198
- package/dist/Snapshot.d.ts.map +0 -1
- package/dist/Snapshot.js +0 -267
- package/dist/Snapshot.js.map +0 -1
- package/dist/SnapshotUtilities.d.ts +0 -29
- package/dist/SnapshotUtilities.d.ts.map +0 -1
- package/dist/SnapshotUtilities.js +0 -73
- package/dist/SnapshotUtilities.js.map +0 -1
- package/dist/anchored-edits/AnchorResolution.d.ts +0 -144
- package/dist/anchored-edits/AnchorResolution.d.ts.map +0 -1
- package/dist/anchored-edits/AnchorResolution.js +0 -162
- package/dist/anchored-edits/AnchorResolution.js.map +0 -1
- package/dist/anchored-edits/Factory.d.ts +0 -56
- package/dist/anchored-edits/Factory.d.ts.map +0 -1
- package/dist/anchored-edits/Factory.js +0 -79
- package/dist/anchored-edits/Factory.js.map +0 -1
- package/dist/anchored-edits/PersistedTypes.d.ts +0 -245
- package/dist/anchored-edits/PersistedTypes.d.ts.map +0 -1
- package/dist/anchored-edits/PersistedTypes.js +0 -131
- package/dist/anchored-edits/PersistedTypes.js.map +0 -1
- package/dist/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
- package/dist/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
- package/dist/anchored-edits/SharedTreeWithAnchors.js +0 -115
- package/dist/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
- package/dist/anchored-edits/TransactionWithAnchors.d.ts +0 -28
- package/dist/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
- package/dist/anchored-edits/TransactionWithAnchors.js +0 -36
- package/dist/anchored-edits/TransactionWithAnchors.js.map +0 -1
- package/dist/anchored-edits/index.d.ts +0 -10
- package/dist/anchored-edits/index.d.ts.map +0 -1
- package/dist/anchored-edits/index.js +0 -34
- package/dist/anchored-edits/index.js.map +0 -1
- package/dist/default-edits/EditUtilities.d.ts +0 -57
- package/dist/default-edits/EditUtilities.d.ts.map +0 -1
- package/dist/default-edits/EditUtilities.js +0 -192
- package/dist/default-edits/EditUtilities.js.map +0 -1
- package/dist/default-edits/Factory.d.ts +0 -56
- package/dist/default-edits/Factory.d.ts.map +0 -1
- package/dist/default-edits/Factory.js +0 -79
- package/dist/default-edits/Factory.js.map +0 -1
- package/dist/default-edits/HistoryEditFactory.d.ts +0 -19
- package/dist/default-edits/HistoryEditFactory.d.ts.map +0 -1
- package/dist/default-edits/HistoryEditFactory.js +0 -187
- package/dist/default-edits/HistoryEditFactory.js.map +0 -1
- package/dist/default-edits/PersistedTypes.d.ts.map +0 -1
- package/dist/default-edits/PersistedTypes.js.map +0 -1
- package/dist/default-edits/SharedTree.d.ts +0 -111
- package/dist/default-edits/SharedTree.d.ts.map +0 -1
- package/dist/default-edits/SharedTree.js +0 -124
- package/dist/default-edits/SharedTree.js.map +0 -1
- package/dist/default-edits/Summary.d.ts +0 -15
- package/dist/default-edits/Summary.d.ts.map +0 -1
- package/dist/default-edits/Summary.js +0 -35
- package/dist/default-edits/Summary.js.map +0 -1
- package/dist/default-edits/Transaction.d.ts +0 -41
- package/dist/default-edits/Transaction.d.ts.map +0 -1
- package/dist/default-edits/Transaction.js +0 -225
- package/dist/default-edits/Transaction.js.map +0 -1
- package/dist/default-edits/UndoRedoHandler.d.ts.map +0 -1
- package/dist/default-edits/UndoRedoHandler.js.map +0 -1
- package/dist/default-edits/index.d.ts +0 -13
- package/dist/default-edits/index.d.ts.map +0 -1
- package/dist/default-edits/index.js +0 -41
- package/dist/default-edits/index.js.map +0 -1
- package/dist/generic/GenericEditUtilities.d.ts +0 -26
- package/dist/generic/GenericEditUtilities.d.ts.map +0 -1
- package/dist/generic/GenericEditUtilities.js +0 -45
- package/dist/generic/GenericEditUtilities.js.map +0 -1
- package/dist/generic/GenericSharedTree.d.ts +0 -221
- package/dist/generic/GenericSharedTree.d.ts.map +0 -1
- package/dist/generic/GenericSharedTree.js +0 -447
- package/dist/generic/GenericSharedTree.js.map +0 -1
- package/dist/generic/GenericTransaction.d.ts +0 -87
- package/dist/generic/GenericTransaction.d.ts.map +0 -1
- package/dist/generic/GenericTransaction.js +0 -144
- package/dist/generic/GenericTransaction.js.map +0 -1
- package/dist/generic/PersistedTypes.d.ts +0 -194
- package/dist/generic/PersistedTypes.d.ts.map +0 -1
- package/dist/generic/PersistedTypes.js +0 -42
- package/dist/generic/PersistedTypes.js.map +0 -1
- package/dist/generic/Summary.d.ts +0 -63
- package/dist/generic/Summary.d.ts.map +0 -1
- package/dist/generic/Summary.js +0 -64
- package/dist/generic/Summary.js.map +0 -1
- package/dist/generic/index.d.ts +0 -10
- package/dist/generic/index.d.ts.map +0 -1
- package/dist/generic/index.js +0 -26
- package/dist/generic/index.js.map +0 -1
- package/docs/Future.md +0 -155
- package/lib/BasicCheckout.d.ts +0 -23
- package/lib/BasicCheckout.d.ts.map +0 -1
- package/lib/BasicCheckout.js.map +0 -1
- package/lib/Snapshot.d.ts +0 -198
- package/lib/Snapshot.d.ts.map +0 -1
- package/lib/Snapshot.js +0 -263
- package/lib/Snapshot.js.map +0 -1
- package/lib/SnapshotUtilities.d.ts +0 -29
- package/lib/SnapshotUtilities.d.ts.map +0 -1
- package/lib/SnapshotUtilities.js +0 -67
- package/lib/SnapshotUtilities.js.map +0 -1
- package/lib/anchored-edits/AnchorResolution.d.ts +0 -144
- package/lib/anchored-edits/AnchorResolution.d.ts.map +0 -1
- package/lib/anchored-edits/AnchorResolution.js +0 -152
- package/lib/anchored-edits/AnchorResolution.js.map +0 -1
- package/lib/anchored-edits/Factory.d.ts +0 -56
- package/lib/anchored-edits/Factory.d.ts.map +0 -1
- package/lib/anchored-edits/Factory.js +0 -74
- package/lib/anchored-edits/Factory.js.map +0 -1
- package/lib/anchored-edits/PersistedTypes.d.ts +0 -245
- package/lib/anchored-edits/PersistedTypes.d.ts.map +0 -1
- package/lib/anchored-edits/PersistedTypes.js +0 -128
- package/lib/anchored-edits/PersistedTypes.js.map +0 -1
- package/lib/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
- package/lib/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
- package/lib/anchored-edits/SharedTreeWithAnchors.js +0 -110
- package/lib/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
- package/lib/anchored-edits/TransactionWithAnchors.d.ts +0 -28
- package/lib/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
- package/lib/anchored-edits/TransactionWithAnchors.js +0 -32
- package/lib/anchored-edits/TransactionWithAnchors.js.map +0 -1
- package/lib/anchored-edits/index.d.ts +0 -10
- package/lib/anchored-edits/index.d.ts.map +0 -1
- package/lib/anchored-edits/index.js +0 -11
- package/lib/anchored-edits/index.js.map +0 -1
- package/lib/default-edits/EditUtilities.d.ts +0 -57
- package/lib/default-edits/EditUtilities.d.ts.map +0 -1
- package/lib/default-edits/EditUtilities.js +0 -181
- package/lib/default-edits/EditUtilities.js.map +0 -1
- package/lib/default-edits/Factory.d.ts +0 -56
- package/lib/default-edits/Factory.d.ts.map +0 -1
- package/lib/default-edits/Factory.js +0 -74
- package/lib/default-edits/Factory.js.map +0 -1
- package/lib/default-edits/HistoryEditFactory.d.ts +0 -19
- package/lib/default-edits/HistoryEditFactory.d.ts.map +0 -1
- package/lib/default-edits/HistoryEditFactory.js.map +0 -1
- package/lib/default-edits/PersistedTypes.d.ts.map +0 -1
- package/lib/default-edits/PersistedTypes.js.map +0 -1
- package/lib/default-edits/SharedTree.d.ts +0 -111
- package/lib/default-edits/SharedTree.d.ts.map +0 -1
- package/lib/default-edits/SharedTree.js +0 -100
- package/lib/default-edits/SharedTree.js.map +0 -1
- package/lib/default-edits/Summary.d.ts +0 -15
- package/lib/default-edits/Summary.d.ts.map +0 -1
- package/lib/default-edits/Summary.js +0 -31
- package/lib/default-edits/Summary.js.map +0 -1
- package/lib/default-edits/Transaction.d.ts +0 -41
- package/lib/default-edits/Transaction.d.ts.map +0 -1
- package/lib/default-edits/Transaction.js +0 -221
- package/lib/default-edits/Transaction.js.map +0 -1
- package/lib/default-edits/UndoRedoHandler.d.ts.map +0 -1
- package/lib/default-edits/UndoRedoHandler.js.map +0 -1
- package/lib/default-edits/index.d.ts +0 -13
- package/lib/default-edits/index.d.ts.map +0 -1
- package/lib/default-edits/index.js +0 -14
- package/lib/default-edits/index.js.map +0 -1
- package/lib/generic/GenericEditUtilities.d.ts +0 -26
- package/lib/generic/GenericEditUtilities.d.ts.map +0 -1
- package/lib/generic/GenericEditUtilities.js +0 -38
- package/lib/generic/GenericEditUtilities.js.map +0 -1
- package/lib/generic/GenericSharedTree.d.ts +0 -221
- package/lib/generic/GenericSharedTree.d.ts.map +0 -1
- package/lib/generic/GenericSharedTree.js +0 -443
- package/lib/generic/GenericSharedTree.js.map +0 -1
- package/lib/generic/GenericTransaction.d.ts +0 -87
- package/lib/generic/GenericTransaction.d.ts.map +0 -1
- package/lib/generic/GenericTransaction.js +0 -140
- package/lib/generic/GenericTransaction.js.map +0 -1
- package/lib/generic/PersistedTypes.d.ts +0 -194
- package/lib/generic/PersistedTypes.d.ts.map +0 -1
- package/lib/generic/PersistedTypes.js +0 -39
- package/lib/generic/PersistedTypes.js.map +0 -1
- package/lib/generic/Summary.d.ts +0 -63
- package/lib/generic/Summary.d.ts.map +0 -1
- package/lib/generic/Summary.js +0 -58
- package/lib/generic/Summary.js.map +0 -1
- package/lib/generic/index.d.ts +0 -10
- package/lib/generic/index.d.ts.map +0 -1
- package/lib/generic/index.js +0 -11
- package/lib/generic/index.js.map +0 -1
- package/lib/test/Anchors.glassBox.tests.d.ts.map +0 -1
- package/lib/test/Anchors.glassBox.tests.js +0 -410
- package/lib/test/Anchors.glassBox.tests.js.map +0 -1
- package/lib/test/BasicCheckout.tests.d.ts.map +0 -1
- package/lib/test/BasicCheckout.tests.js +0 -8
- package/lib/test/BasicCheckout.tests.js.map +0 -1
- package/lib/test/GenericTransactionWithAnchors.tests.d.ts.map +0 -1
- package/lib/test/GenericTransactionWithAnchors.tests.js +0 -25
- package/lib/test/GenericTransactionWithAnchors.tests.js.map +0 -1
- package/lib/test/SharedTreeWithAnchors.tests.d.ts.map +0 -1
- package/lib/test/SharedTreeWithAnchors.tests.js +0 -420
- package/lib/test/SharedTreeWithAnchors.tests.js.map +0 -1
- package/lib/test/Snapshot.tests.d.ts.map +0 -1
- package/lib/test/Snapshot.tests.js +0 -96
- package/lib/test/Snapshot.tests.js.map +0 -1
- package/lib/test/SnapshotUtilities.tests.d.ts.map +0 -1
- package/lib/test/SnapshotUtilities.tests.js +0 -168
- package/lib/test/SnapshotUtilities.tests.js.map +0 -1
- package/lib/test/undoRedoStackManager.d.ts +0 -26
- package/lib/test/undoRedoStackManager.d.ts.map +0 -1
- package/lib/test/undoRedoStackManager.js +0 -176
- package/lib/test/undoRedoStackManager.js.map +0 -1
- package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts +0 -13
- package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts.map +0 -1
- package/lib/test/utilities/SummaryFormatCompatibilityTests.js +0 -154
- package/lib/test/utilities/SummaryFormatCompatibilityTests.js.map +0 -1
- package/src/BasicCheckout.ts +0 -34
- package/src/Snapshot.ts +0 -363
- package/src/SnapshotUtilities.ts +0 -88
- package/src/anchored-edits/AnchorResolution.ts +0 -442
- package/src/anchored-edits/Factory.ts +0 -94
- package/src/anchored-edits/PersistedTypes.ts +0 -310
- package/src/anchored-edits/SharedTreeWithAnchors.ts +0 -200
- package/src/anchored-edits/TransactionWithAnchors.ts +0 -39
- package/src/anchored-edits/index.ts +0 -21
- package/src/default-edits/EditUtilities.ts +0 -220
- package/src/default-edits/Factory.ts +0 -94
- package/src/default-edits/SharedTree.ts +0 -174
- package/src/default-edits/Summary.ts +0 -44
- package/src/default-edits/Transaction.ts +0 -262
- package/src/default-edits/index.ts +0 -29
- package/src/generic/GenericEditUtilities.ts +0 -46
- package/src/generic/GenericSharedTree.ts +0 -593
- package/src/generic/GenericTransaction.ts +0 -194
- package/src/generic/PersistedTypes.ts +0 -221
- package/src/generic/Summary.ts +0 -113
- package/src/generic/index.ts +0 -41
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
6
|
-
import { IFluidDataStoreRuntime, IChannelStorageService, IChannelAttributes } from '@fluidframework/datastore-definitions';
|
|
7
|
-
import { IFluidSerializer, ISharedObjectEvents, SharedObject } from '@fluidframework/shared-object-base';
|
|
8
|
-
import { ITelemetryLogger } from '@fluidframework/common-definitions';
|
|
9
|
-
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
10
|
-
import { OrderedEditSet } from '../EditLog';
|
|
11
|
-
import { EditId } from '../Identifiers';
|
|
12
|
-
import { Snapshot } from '../Snapshot';
|
|
13
|
-
import { LogViewer } from '../LogViewer';
|
|
14
|
-
import { Edit } from './PersistedTypes';
|
|
15
|
-
import { SharedTreeSummarizer, SharedTreeSummaryBase } from './Summary';
|
|
16
|
-
import { GenericTransaction } from './GenericTransaction';
|
|
17
|
-
/**
|
|
18
|
-
* An event emitted by a `SharedTree` to indicate a state change. See {@link ISharedTreeEvents} for event argument information.
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export declare enum SharedTreeEvent {
|
|
22
|
-
/**
|
|
23
|
-
* An edit has been committed to the log.
|
|
24
|
-
* This happens when either:
|
|
25
|
-
* 1. A locally generated edit is added to the log.
|
|
26
|
-
* 2. A remotely generated edit is added to the log.
|
|
27
|
-
* Note that, for locally generated edits, this event will not be emitted again when that edit is sequenced.
|
|
28
|
-
* Passed the EditId of the committed edit, i.e. supports callbacks of type {@link EditCommittedHandler}.
|
|
29
|
-
*/
|
|
30
|
-
EditCommitted = "committedEdit"
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* An event emitted by a `SharedTree` for diagnostic purposes.
|
|
34
|
-
* See {@link ISharedTreeEvents} for event argument information.
|
|
35
|
-
*/
|
|
36
|
-
export declare enum SharedTreeDiagnosticEvent {
|
|
37
|
-
/**
|
|
38
|
-
* A single catch up blob has been uploaded.
|
|
39
|
-
*/
|
|
40
|
-
CatchUpBlobUploaded = "uploadedCatchUpBlob",
|
|
41
|
-
/**
|
|
42
|
-
* A valid edit (local or remote) has been applied.
|
|
43
|
-
* Passed the EditId of the applied edit.
|
|
44
|
-
* Note that this may be called multiple times, due to concurrent edits causing reordering,
|
|
45
|
-
* and/or due to not caching the output of every edit.
|
|
46
|
-
*/
|
|
47
|
-
AppliedEdit = "appliedEdit",
|
|
48
|
-
/**
|
|
49
|
-
* An invalid edit (local or remote) has been dropped.
|
|
50
|
-
* Passed the EditId of the dropped edit.
|
|
51
|
-
* Note that this may be called multiple times, due to concurrent edits causing reordering,
|
|
52
|
-
* and/or due to not caching the output of every edit.
|
|
53
|
-
*/
|
|
54
|
-
DroppedInvalidEdit = "droppedInvalidEdit",
|
|
55
|
-
/**
|
|
56
|
-
* A malformed edit (local or remote) has been dropped.
|
|
57
|
-
* Passed the EditId of the dropped edit.
|
|
58
|
-
* Note that this may be called multiple times, due to concurrent edits causing reordering,
|
|
59
|
-
* and/or due to not caching the output of every edit.
|
|
60
|
-
*/
|
|
61
|
-
DroppedMalformedEdit = "droppedMalformedEdit"
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The arguments included when the EditCommitted SharedTreeEvent is emitted.
|
|
65
|
-
* @public
|
|
66
|
-
*/
|
|
67
|
-
export interface EditCommittedEventArguments<TSharedTree> {
|
|
68
|
-
/** The ID of the edit committed. */
|
|
69
|
-
editId: EditId;
|
|
70
|
-
/** Whether or not this is a local edit. */
|
|
71
|
-
local: boolean;
|
|
72
|
-
/** The tree the edit was committed on. Required for local edit events handled by SharedTreeUndoRedoHandler. */
|
|
73
|
-
tree: TSharedTree;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Events which may be emitted by `SharedTree`. See {@link SharedTreeEvent} for documentation of event semantics.
|
|
77
|
-
*/
|
|
78
|
-
export interface ISharedTreeEvents<TSharedTree> extends ISharedObjectEvents {
|
|
79
|
-
(event: 'committedEdit', listener: EditCommittedHandler<TSharedTree>): any;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Expected type for a handler of the `EditCommitted` event.
|
|
83
|
-
*/
|
|
84
|
-
export declare type EditCommittedHandler<TSharedTree> = (args: EditCommittedEventArguments<TSharedTree>) => void;
|
|
85
|
-
/**
|
|
86
|
-
* A distributed tree.
|
|
87
|
-
* @public
|
|
88
|
-
*/
|
|
89
|
-
export declare abstract class GenericSharedTree<TChange> extends SharedObject<ISharedTreeEvents<TChange>> {
|
|
90
|
-
private readonly expensiveValidation;
|
|
91
|
-
protected readonly summarizeHistory: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* The log of completed edits for this SharedTree.
|
|
94
|
-
*/
|
|
95
|
-
private editLog;
|
|
96
|
-
/**
|
|
97
|
-
* As an implementation detail, SharedTree uses a log viewer that caches snapshots at different revisions.
|
|
98
|
-
* It is not exposed to avoid accidental correctness issues, but `logViewer` is exposed in order to give clients a way
|
|
99
|
-
* to access the revision history.
|
|
100
|
-
*/
|
|
101
|
-
private cachingLogViewer;
|
|
102
|
-
/**
|
|
103
|
-
* Viewer for trees defined by editLog. This allows access to views of the tree at different revisions (various points in time).
|
|
104
|
-
*/
|
|
105
|
-
get logViewer(): LogViewer;
|
|
106
|
-
protected readonly logger: ITelemetryLogger;
|
|
107
|
-
readonly transactionFactory: (snapshot: Snapshot) => GenericTransaction<TChange>;
|
|
108
|
-
/** Indicates if the client is the oldest member of the quorum. */
|
|
109
|
-
private currentIsOldest;
|
|
110
|
-
private readonly processEditResult;
|
|
111
|
-
/**
|
|
112
|
-
* Create a new SharedTreeFactory.
|
|
113
|
-
* @param runtime - The runtime the SharedTree will be associated with
|
|
114
|
-
* @param id - Unique ID for the SharedTree
|
|
115
|
-
* @param expensiveValidation - Enable expensive asserts.
|
|
116
|
-
* @param summarizeHistory - Determines if the history is included in summaries.
|
|
117
|
-
*/
|
|
118
|
-
constructor(runtime: IFluidDataStoreRuntime, id: string, transactionFactory: (snapshot: Snapshot) => GenericTransaction<TChange>, attributes: IChannelAttributes, expensiveValidation?: boolean, summarizeHistory?: boolean);
|
|
119
|
-
/**
|
|
120
|
-
* Re-computes currentIsOldest and emits an event if it has changed.
|
|
121
|
-
* TODO:#55900: Get rid of copy-pasted OldestClientObserver code
|
|
122
|
-
*/
|
|
123
|
-
private readonly updateOldest;
|
|
124
|
-
/**
|
|
125
|
-
* Computes the oldest client in the quorum, true by default if the container is detached and false by default if the client isn't connected.
|
|
126
|
-
* TODO:#55900: Get rid of copy-pasted OldestClientObserver code
|
|
127
|
-
*/
|
|
128
|
-
private computeIsOldest;
|
|
129
|
-
/**
|
|
130
|
-
* @returns the current view of the tree.
|
|
131
|
-
*/
|
|
132
|
-
get currentView(): Snapshot;
|
|
133
|
-
/**
|
|
134
|
-
* @returns the edit history of the tree.
|
|
135
|
-
*/
|
|
136
|
-
get edits(): OrderedEditSet<TChange>;
|
|
137
|
-
/**
|
|
138
|
-
* Convenience helper for applying an edit containing the given changes.
|
|
139
|
-
* Opens an edit, applies the given changes, and closes the edit. See (`openEdit()`/`applyChanges()`/`closeEdit()`).
|
|
140
|
-
*
|
|
141
|
-
* For convenient imperative variants of edits, see `editor`.
|
|
142
|
-
* @internal
|
|
143
|
-
*/
|
|
144
|
-
applyEdit(...changes: TChange[]): EditId;
|
|
145
|
-
private deserializeHandle;
|
|
146
|
-
/**
|
|
147
|
-
* Uploads the edit chunk and sends the chunk starting revision along with the resulting handle as an op.
|
|
148
|
-
*/
|
|
149
|
-
private uploadEditChunk;
|
|
150
|
-
/**
|
|
151
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
152
|
-
*/
|
|
153
|
-
summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
|
|
154
|
-
/**
|
|
155
|
-
* Saves this SharedTree into a serialized summary.
|
|
156
|
-
*
|
|
157
|
-
* @param options - Optional serializer and summarizer to use. If not passed in, SharedTree's serializer and summarizer are used.
|
|
158
|
-
* @internal
|
|
159
|
-
*/
|
|
160
|
-
saveSerializedSummary(options?: {
|
|
161
|
-
serializer?: IFluidSerializer;
|
|
162
|
-
summarizer?: SharedTreeSummarizer<TChange>;
|
|
163
|
-
}): string;
|
|
164
|
-
/**
|
|
165
|
-
* Saves this SharedTree into a summary.
|
|
166
|
-
* @internal
|
|
167
|
-
*/
|
|
168
|
-
saveSummary(): SharedTreeSummaryBase;
|
|
169
|
-
/**
|
|
170
|
-
* Generates a SharedTree summary for the current state of the tree.
|
|
171
|
-
* Will never be called when local edits are present.
|
|
172
|
-
*/
|
|
173
|
-
protected abstract generateSummary(editLog: OrderedEditSet<TChange>): SharedTreeSummaryBase;
|
|
174
|
-
/**
|
|
175
|
-
* Initialize shared tree with a summary.
|
|
176
|
-
* @internal
|
|
177
|
-
*/
|
|
178
|
-
loadSummary(summary: SharedTreeSummaryBase): void;
|
|
179
|
-
private static eventFromEditResult;
|
|
180
|
-
private createEditLogFromSummary;
|
|
181
|
-
/**
|
|
182
|
-
* Upload any full chunks that have yet to be uploaded.
|
|
183
|
-
*/
|
|
184
|
-
private uploadCatchUpBlobs;
|
|
185
|
-
/**
|
|
186
|
-
* Compares this shared tree to another for equality.
|
|
187
|
-
*
|
|
188
|
-
* Equality means that the histories as captured by the EditLogs are equal.
|
|
189
|
-
*
|
|
190
|
-
* Equality does not include:
|
|
191
|
-
* - if an edit is open
|
|
192
|
-
* - the shared tree's id
|
|
193
|
-
* - local vs sequenced status of edits
|
|
194
|
-
* - registered event listeners
|
|
195
|
-
* - state of caches
|
|
196
|
-
* */
|
|
197
|
-
equals<TOtherChangeTypes>(sharedTree: GenericSharedTree<TOtherChangeTypes>): boolean;
|
|
198
|
-
/**
|
|
199
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
200
|
-
*/
|
|
201
|
-
protected loadCore(storage: IChannelStorageService): Promise<void>;
|
|
202
|
-
/**
|
|
203
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
204
|
-
*/
|
|
205
|
-
protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
|
|
206
|
-
/**
|
|
207
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
208
|
-
*/
|
|
209
|
-
protected onDisconnect(): void;
|
|
210
|
-
private processSequencedEdit;
|
|
211
|
-
/**
|
|
212
|
-
* Add an `Edit` directly.
|
|
213
|
-
* External users should use one of the more specialized functions, like applyEdit which handles constructing the actual `Edit` object.
|
|
214
|
-
* This is exposed as it is useful for testing, particularly with invalid and malformed Edits.
|
|
215
|
-
* @internal
|
|
216
|
-
*/
|
|
217
|
-
processLocalEdit(edit: Edit<TChange>): void;
|
|
218
|
-
getRuntime(): IFluidDataStoreRuntime;
|
|
219
|
-
protected applyStashedOp(): void;
|
|
220
|
-
}
|
|
221
|
-
//# sourceMappingURL=GenericSharedTree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericSharedTree.d.ts","sourceRoot":"","sources":["../../src/generic/GenericSharedTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAEN,gBAAgB,EAChB,mBAAmB,EAEnB,YAAY,EACZ,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAAW,cAAc,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAwC,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/E,OAAO,EACN,IAAI,EAOJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAa,oBAAoB,EAAqB,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiB1D;;;GAGG;AACH,oBAAY,eAAe;IAC1B;;;;;;;OAOG;IACH,aAAa,kBAAkB;CAC/B;AAED;;;GAGG;AACH,oBAAY,yBAAyB;IACpC;;OAEG;IACH,mBAAmB,wBAAwB;IAC3C;;;;;OAKG;IACH,WAAW,gBAAgB;IAC3B;;;;;OAKG;IACH,kBAAkB,uBAAuB;IACzC;;;;;OAKG;IACH,oBAAoB,yBAAyB;CAC7C;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B,CAAC,WAAW;IACvD,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,KAAK,EAAE,OAAO,CAAC;IACf,+GAA+G;IAC/G,IAAI,EAAE,WAAW,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,WAAW,CAAE,SAAQ,mBAAmB;IAC1E,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,CAAC,WAAW,CAAC,OAAE;CACtE;AAED;;GAEG;AACH,oBAAY,oBAAoB,CAAC,WAAW,IAAI,CAAC,IAAI,EAAE,2BAA2B,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;AAIzG;;;GAGG;AACH,8BAAsB,iBAAiB,CAAC,OAAO,CAAE,SAAQ,YAAY,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IA4C/F,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,SAAS,CAAC,QAAQ,CAAC,gBAAgB;IA5CpC;;OAEG;IACH,OAAO,CAAC,OAAO,CAAmB;IAElC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB,CAA4B;IAEpD;;OAEG;IACH,IAAW,SAAS,IAAI,SAAS,CAEhC;IAED,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAE5C,SAAgB,kBAAkB,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAExF,kEAAkE;IAClE,OAAO,CAAC,eAAe,CAAU;IAEjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAGhC;IAEF;;;;;;OAMG;gBAEF,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,kBAAkB,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,kBAAkB,CAAC,OAAO,CAAC,EACvE,UAAU,EAAE,kBAAkB,EACb,mBAAmB,UAAQ,EACzB,gBAAgB,UAAO;IAuB3C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,YAAY,CAU3B;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe;IA+BvB;;OAEG;IACH,IAAW,WAAW,IAAI,QAAQ,CAEjC;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,cAAc,CAAC,OAAO,CAAC,CAE1C;IAED;;;;;;OAMG;IACI,SAAS,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,MAAM;IAM/C,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;YACW,eAAe;IAmB7B;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAIzE;;;;;OAKG;IACI,qBAAqB,CAAC,OAAO,CAAC,EAAE;QACtC,UAAU,CAAC,EAAE,gBAAgB,CAAC;QAC9B,UAAU,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;KAC3C,GAAG,MAAM;IAUV;;;OAGG;IACI,WAAW,IAAI,qBAAqB;IAkB3C;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,qBAAqB;IAE3F;;;OAGG;IACI,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAgCxD,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAWlC,OAAO,CAAC,wBAAwB;IA2BhC;;OAEG;YACW,kBAAkB;IAOhC;;;;;;;;;;;SAWK;IACE,MAAM,CAAC,iBAAiB,EAAE,UAAU,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,GAAG,OAAO;IAQ3F;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBxE;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAmB/E;;OAEG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B,OAAO,CAAC,oBAAoB;IAmC5B;;;;;OAKG;IACI,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI;IAuB3C,UAAU,IAAI,sBAAsB;IAI3C,SAAS,CAAC,cAAc;CAGxB"}
|
|
@@ -1,447 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.GenericSharedTree = exports.SharedTreeDiagnosticEvent = exports.SharedTreeEvent = void 0;
|
|
8
|
-
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
-
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
10
|
-
const shared_object_base_1 = require("@fluidframework/shared-object-base");
|
|
11
|
-
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
12
|
-
const Common_1 = require("../Common");
|
|
13
|
-
const EditLog_1 = require("../EditLog");
|
|
14
|
-
const Snapshot_1 = require("../Snapshot");
|
|
15
|
-
const InitialTree_1 = require("../InitialTree");
|
|
16
|
-
const LogViewer_1 = require("../LogViewer");
|
|
17
|
-
const SummaryBackCompatibility_1 = require("../SummaryBackCompatibility");
|
|
18
|
-
const PersistedTypes_1 = require("./PersistedTypes");
|
|
19
|
-
const Summary_1 = require("./Summary");
|
|
20
|
-
const GenericEditUtilities_1 = require("./GenericEditUtilities");
|
|
21
|
-
/**
|
|
22
|
-
* Filename where the snapshot is stored.
|
|
23
|
-
*/
|
|
24
|
-
const snapshotFileName = 'header';
|
|
25
|
-
const initialSummary = {
|
|
26
|
-
version: SummaryBackCompatibility_1.readFormatVersion,
|
|
27
|
-
currentTree: InitialTree_1.initialTree,
|
|
28
|
-
editHistory: {
|
|
29
|
-
editChunks: [],
|
|
30
|
-
editIds: [],
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* An event emitted by a `SharedTree` to indicate a state change. See {@link ISharedTreeEvents} for event argument information.
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
var SharedTreeEvent;
|
|
38
|
-
(function (SharedTreeEvent) {
|
|
39
|
-
/**
|
|
40
|
-
* An edit has been committed to the log.
|
|
41
|
-
* This happens when either:
|
|
42
|
-
* 1. A locally generated edit is added to the log.
|
|
43
|
-
* 2. A remotely generated edit is added to the log.
|
|
44
|
-
* Note that, for locally generated edits, this event will not be emitted again when that edit is sequenced.
|
|
45
|
-
* Passed the EditId of the committed edit, i.e. supports callbacks of type {@link EditCommittedHandler}.
|
|
46
|
-
*/
|
|
47
|
-
SharedTreeEvent["EditCommitted"] = "committedEdit";
|
|
48
|
-
})(SharedTreeEvent = exports.SharedTreeEvent || (exports.SharedTreeEvent = {}));
|
|
49
|
-
/**
|
|
50
|
-
* An event emitted by a `SharedTree` for diagnostic purposes.
|
|
51
|
-
* See {@link ISharedTreeEvents} for event argument information.
|
|
52
|
-
*/
|
|
53
|
-
var SharedTreeDiagnosticEvent;
|
|
54
|
-
(function (SharedTreeDiagnosticEvent) {
|
|
55
|
-
/**
|
|
56
|
-
* A single catch up blob has been uploaded.
|
|
57
|
-
*/
|
|
58
|
-
SharedTreeDiagnosticEvent["CatchUpBlobUploaded"] = "uploadedCatchUpBlob";
|
|
59
|
-
/**
|
|
60
|
-
* A valid edit (local or remote) has been applied.
|
|
61
|
-
* Passed the EditId of the applied edit.
|
|
62
|
-
* Note that this may be called multiple times, due to concurrent edits causing reordering,
|
|
63
|
-
* and/or due to not caching the output of every edit.
|
|
64
|
-
*/
|
|
65
|
-
SharedTreeDiagnosticEvent["AppliedEdit"] = "appliedEdit";
|
|
66
|
-
/**
|
|
67
|
-
* An invalid edit (local or remote) has been dropped.
|
|
68
|
-
* Passed the EditId of the dropped edit.
|
|
69
|
-
* Note that this may be called multiple times, due to concurrent edits causing reordering,
|
|
70
|
-
* and/or due to not caching the output of every edit.
|
|
71
|
-
*/
|
|
72
|
-
SharedTreeDiagnosticEvent["DroppedInvalidEdit"] = "droppedInvalidEdit";
|
|
73
|
-
/**
|
|
74
|
-
* A malformed edit (local or remote) has been dropped.
|
|
75
|
-
* Passed the EditId of the dropped edit.
|
|
76
|
-
* Note that this may be called multiple times, due to concurrent edits causing reordering,
|
|
77
|
-
* and/or due to not caching the output of every edit.
|
|
78
|
-
*/
|
|
79
|
-
SharedTreeDiagnosticEvent["DroppedMalformedEdit"] = "droppedMalformedEdit";
|
|
80
|
-
})(SharedTreeDiagnosticEvent = exports.SharedTreeDiagnosticEvent || (exports.SharedTreeDiagnosticEvent = {}));
|
|
81
|
-
const sharedTreeTelemetryProperties = { all: { isSharedTreeEvent: true } };
|
|
82
|
-
/**
|
|
83
|
-
* A distributed tree.
|
|
84
|
-
* @public
|
|
85
|
-
*/
|
|
86
|
-
class GenericSharedTree extends shared_object_base_1.SharedObject {
|
|
87
|
-
/**
|
|
88
|
-
* Create a new SharedTreeFactory.
|
|
89
|
-
* @param runtime - The runtime the SharedTree will be associated with
|
|
90
|
-
* @param id - Unique ID for the SharedTree
|
|
91
|
-
* @param expensiveValidation - Enable expensive asserts.
|
|
92
|
-
* @param summarizeHistory - Determines if the history is included in summaries.
|
|
93
|
-
*/
|
|
94
|
-
constructor(runtime, id, transactionFactory, attributes, expensiveValidation = false, summarizeHistory = true) {
|
|
95
|
-
super(id, runtime, attributes);
|
|
96
|
-
this.expensiveValidation = expensiveValidation;
|
|
97
|
-
this.summarizeHistory = summarizeHistory;
|
|
98
|
-
this.processEditResult = (editResult, editId) => {
|
|
99
|
-
// TODO:#44859: Invalid results should be handled by the app
|
|
100
|
-
this.emit(GenericSharedTree.eventFromEditResult(editResult), editId);
|
|
101
|
-
};
|
|
102
|
-
/**
|
|
103
|
-
* Re-computes currentIsOldest and emits an event if it has changed.
|
|
104
|
-
* TODO:#55900: Get rid of copy-pasted OldestClientObserver code
|
|
105
|
-
*/
|
|
106
|
-
this.updateOldest = () => {
|
|
107
|
-
const oldest = this.computeIsOldest();
|
|
108
|
-
if (this.currentIsOldest !== oldest) {
|
|
109
|
-
this.currentIsOldest = oldest;
|
|
110
|
-
if (oldest) {
|
|
111
|
-
this.emit('becameOldest');
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.emit('lostOldest');
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
this.expensiveValidation = expensiveValidation;
|
|
119
|
-
this.transactionFactory = transactionFactory;
|
|
120
|
-
// This code is somewhat duplicated from OldestClientObserver because it currently depends on the container runtime
|
|
121
|
-
// which SharedTree does not have access to.
|
|
122
|
-
// TODO:#55900: Get rid of copy-pasted OldestClientObserver code
|
|
123
|
-
const quorum = this.runtime.getQuorum();
|
|
124
|
-
this.currentIsOldest = this.computeIsOldest();
|
|
125
|
-
quorum.on('addMember', this.updateOldest);
|
|
126
|
-
quorum.on('removeMember', this.updateOldest);
|
|
127
|
-
runtime.on('connected', this.updateOldest);
|
|
128
|
-
runtime.on('disconnected', this.updateOldest);
|
|
129
|
-
this.logger = telemetry_utils_1.ChildLogger.create(runtime.logger, 'SharedTree', sharedTreeTelemetryProperties);
|
|
130
|
-
const { editLog, cachingLogViewer } = this.createEditLogFromSummary(initialSummary, this.processEditResult);
|
|
131
|
-
this.editLog = editLog;
|
|
132
|
-
this.cachingLogViewer = cachingLogViewer;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Viewer for trees defined by editLog. This allows access to views of the tree at different revisions (various points in time).
|
|
136
|
-
*/
|
|
137
|
-
get logViewer() {
|
|
138
|
-
return this.cachingLogViewer;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Computes the oldest client in the quorum, true by default if the container is detached and false by default if the client isn't connected.
|
|
142
|
-
* TODO:#55900: Get rid of copy-pasted OldestClientObserver code
|
|
143
|
-
*/
|
|
144
|
-
computeIsOldest() {
|
|
145
|
-
// If the container is detached, we are the only ones that know about it and are the oldest by default.
|
|
146
|
-
if (this.runtime.attachState === container_definitions_1.AttachState.Detached) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
// If we're not connected we can't be the oldest connected client.
|
|
150
|
-
if (!this.runtime.connected) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
Common_1.assert(this.runtime.clientId !== undefined, 'Client id should be set if connected.');
|
|
154
|
-
const quorum = this.runtime.getQuorum();
|
|
155
|
-
const selfSequencedClient = quorum.getMember(this.runtime.clientId);
|
|
156
|
-
// When in readonly mode our clientId will not be present in the quorum.
|
|
157
|
-
if (selfSequencedClient === undefined) {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
const members = quorum.getMembers();
|
|
161
|
-
for (const sequencedClient of members.values()) {
|
|
162
|
-
if (sequencedClient.sequenceNumber < selfSequencedClient.sequenceNumber) {
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
// No member of the quorum was older
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* @returns the current view of the tree.
|
|
171
|
-
*/
|
|
172
|
-
get currentView() {
|
|
173
|
-
return this.logViewer.getSnapshotInSession(Number.POSITIVE_INFINITY);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* @returns the edit history of the tree.
|
|
177
|
-
*/
|
|
178
|
-
get edits() {
|
|
179
|
-
return this.editLog;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Convenience helper for applying an edit containing the given changes.
|
|
183
|
-
* Opens an edit, applies the given changes, and closes the edit. See (`openEdit()`/`applyChanges()`/`closeEdit()`).
|
|
184
|
-
*
|
|
185
|
-
* For convenient imperative variants of edits, see `editor`.
|
|
186
|
-
* @internal
|
|
187
|
-
*/
|
|
188
|
-
applyEdit(...changes) {
|
|
189
|
-
const edit = GenericEditUtilities_1.newEdit(changes);
|
|
190
|
-
this.processLocalEdit(edit);
|
|
191
|
-
return edit.id;
|
|
192
|
-
}
|
|
193
|
-
deserializeHandle(serializedHandle) {
|
|
194
|
-
const deserializeHandle = this.serializer.parse(serializedHandle);
|
|
195
|
-
Common_1.assert(typeof deserializeHandle === 'object');
|
|
196
|
-
return deserializeHandle;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Uploads the edit chunk and sends the chunk starting revision along with the resulting handle as an op.
|
|
200
|
-
*/
|
|
201
|
-
async uploadEditChunk(edits, startRevision) {
|
|
202
|
-
try {
|
|
203
|
-
const editHandle = await this.runtime.uploadBlob(common_utils_1.IsoBuffer.from(JSON.stringify({ edits })));
|
|
204
|
-
this.submitLocalMessage({
|
|
205
|
-
editHandle: shared_object_base_1.serializeHandles(editHandle, this.serializer, this.handle),
|
|
206
|
-
startRevision,
|
|
207
|
-
type: PersistedTypes_1.SharedTreeOpType.Handle,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
// If chunk load fails, we will try again later in loadCore on the oldest client so we log the error instead of throwing.
|
|
212
|
-
this.logger.sendErrorEvent({
|
|
213
|
-
eventName: 'EditChunkUploadFailure',
|
|
214
|
-
}, error);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
|
|
219
|
-
*/
|
|
220
|
-
summarizeCore(serializer) {
|
|
221
|
-
return shared_object_base_1.createSingleBlobSummary(snapshotFileName, this.saveSerializedSummary({ serializer }));
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* Saves this SharedTree into a serialized summary.
|
|
225
|
-
*
|
|
226
|
-
* @param options - Optional serializer and summarizer to use. If not passed in, SharedTree's serializer and summarizer are used.
|
|
227
|
-
* @internal
|
|
228
|
-
*/
|
|
229
|
-
saveSerializedSummary(options) {
|
|
230
|
-
const { serializer, summarizer } = options || {};
|
|
231
|
-
return Summary_1.serialize(summarizer ? summarizer(this.editLog, this.currentView) : this.saveSummary(), serializer || this.serializer, this.handle);
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Saves this SharedTree into a summary.
|
|
235
|
-
* @internal
|
|
236
|
-
*/
|
|
237
|
-
saveSummary() {
|
|
238
|
-
// If local changes exist, emulate the sequencing of those changes.
|
|
239
|
-
// Doing so is necessary so edits created during DataObject.initializingFirstTime are included.
|
|
240
|
-
// Doing so is safe because it is guaranteed that the DDS has not yet been attached. This is because summary creation is only
|
|
241
|
-
// ever invoked on a DataObject containing local changes when it is attached for the first time. In post-attach flows, an extra
|
|
242
|
-
// instance of the DataObject is created for generating summaries and will never have local edits.
|
|
243
|
-
if (this.editLog.numberOfLocalEdits > 0) {
|
|
244
|
-
Common_1.assert(this.runtime.attachState !== container_definitions_1.AttachState.Attached, 'Summarizing should not occur with local edits except on first attach.');
|
|
245
|
-
this.editLog.sequenceLocalEdits();
|
|
246
|
-
}
|
|
247
|
-
Common_1.assert(this.editLog.numberOfLocalEdits === 0, 'generateSummary must not be called with local edits');
|
|
248
|
-
return this.generateSummary(this.editLog);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Initialize shared tree with a summary.
|
|
252
|
-
* @internal
|
|
253
|
-
*/
|
|
254
|
-
loadSummary(summary) {
|
|
255
|
-
const { editLog, cachingLogViewer } = this.createEditLogFromSummary(summary, this.processEditResult);
|
|
256
|
-
this.editLog = editLog;
|
|
257
|
-
this.cachingLogViewer = cachingLogViewer;
|
|
258
|
-
if (this.runtime.connected) {
|
|
259
|
-
const noChunksReadyForUpload = this.editLog.getEditChunksReadyForUpload()[Symbol.iterator]().next().done;
|
|
260
|
-
if (noChunksReadyForUpload === undefined || !noChunksReadyForUpload) {
|
|
261
|
-
// A client does not become a member of the quorum until it is within the collaboration window.
|
|
262
|
-
//
|
|
263
|
-
// The collaboration window is the range from the minimum sequence number enforced by the server and head.
|
|
264
|
-
// When a client sends an op, they include the last sequence number the client has processed. We call this the reference
|
|
265
|
-
// sequence number.
|
|
266
|
-
//
|
|
267
|
-
// If there are no members in the quorum, we send a no op op in order to have this client added as a member to the quorum.
|
|
268
|
-
// This is required so we can ensure only the oldest client will upload blobs during summary load.
|
|
269
|
-
if (this.runtime.getQuorum().getMembers().size === 0) {
|
|
270
|
-
const noop = {
|
|
271
|
-
type: PersistedTypes_1.SharedTreeOpType.NoOp,
|
|
272
|
-
};
|
|
273
|
-
this.submitLocalMessage(noop);
|
|
274
|
-
}
|
|
275
|
-
else if (this.currentIsOldest) {
|
|
276
|
-
void this.uploadCatchUpBlobs();
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
// If this client becomes the oldest, it should take care of uploading catch up blobs.
|
|
280
|
-
this.on('becameOldest', () => void this.uploadCatchUpBlobs());
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
static eventFromEditResult(editStatus) {
|
|
284
|
-
switch (editStatus) {
|
|
285
|
-
case PersistedTypes_1.EditStatus.Applied:
|
|
286
|
-
return SharedTreeDiagnosticEvent.AppliedEdit;
|
|
287
|
-
case PersistedTypes_1.EditStatus.Invalid:
|
|
288
|
-
return SharedTreeDiagnosticEvent.DroppedInvalidEdit;
|
|
289
|
-
default:
|
|
290
|
-
return SharedTreeDiagnosticEvent.DroppedMalformedEdit;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
createEditLogFromSummary(summary, callback) {
|
|
294
|
-
const convertedSummary = SummaryBackCompatibility_1.convertSummaryToReadFormat(summary);
|
|
295
|
-
if (typeof convertedSummary === 'string') {
|
|
296
|
-
Common_1.fail(convertedSummary);
|
|
297
|
-
}
|
|
298
|
-
const { editHistory, currentTree } = convertedSummary;
|
|
299
|
-
const currentView = Snapshot_1.Snapshot.fromTree(currentTree);
|
|
300
|
-
const editLog = new EditLog_1.EditLog(editHistory, this.logger);
|
|
301
|
-
const logViewer = new LogViewer_1.CachingLogViewer(editLog, Snapshot_1.Snapshot.fromTree(InitialTree_1.initialTree),
|
|
302
|
-
// TODO:#47830: Store multiple checkpoints in summary.
|
|
303
|
-
[[editLog.length, { snapshot: currentView }]], this.expensiveValidation, callback, this.logger, this.transactionFactory, 0);
|
|
304
|
-
return { editLog, cachingLogViewer: logViewer };
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Upload any full chunks that have yet to be uploaded.
|
|
308
|
-
*/
|
|
309
|
-
async uploadCatchUpBlobs() {
|
|
310
|
-
for (const [startRevision, chunk] of this.editLog.getEditChunksReadyForUpload()) {
|
|
311
|
-
await this.uploadEditChunk(chunk, startRevision);
|
|
312
|
-
this.emit(SharedTreeDiagnosticEvent.CatchUpBlobUploaded);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Compares this shared tree to another for equality.
|
|
317
|
-
*
|
|
318
|
-
* Equality means that the histories as captured by the EditLogs are equal.
|
|
319
|
-
*
|
|
320
|
-
* Equality does not include:
|
|
321
|
-
* - if an edit is open
|
|
322
|
-
* - the shared tree's id
|
|
323
|
-
* - local vs sequenced status of edits
|
|
324
|
-
* - registered event listeners
|
|
325
|
-
* - state of caches
|
|
326
|
-
* */
|
|
327
|
-
equals(sharedTree) {
|
|
328
|
-
if (!this.currentView.equals(sharedTree.currentView)) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
return this.editLog.equals(sharedTree.editLog);
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
|
|
335
|
-
*/
|
|
336
|
-
async loadCore(storage) {
|
|
337
|
-
const summaryLoadPerformanceEvent = telemetry_utils_1.PerformanceEvent.start(this.logger, { eventName: 'SummaryLoad' });
|
|
338
|
-
try {
|
|
339
|
-
const newBlob = await storage.readBlob(snapshotFileName);
|
|
340
|
-
const blobData = common_utils_1.bufferToString(newBlob, 'utf8');
|
|
341
|
-
const summary = SummaryBackCompatibility_1.deserialize(blobData, this.serializer);
|
|
342
|
-
if (typeof summary === 'string') {
|
|
343
|
-
Common_1.fail(summary);
|
|
344
|
-
}
|
|
345
|
-
this.loadSummary(summary);
|
|
346
|
-
summaryLoadPerformanceEvent.end({ historySize: this.edits.length });
|
|
347
|
-
}
|
|
348
|
-
catch (error) {
|
|
349
|
-
summaryLoadPerformanceEvent.cancel(undefined, error);
|
|
350
|
-
throw error;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
|
|
355
|
-
*/
|
|
356
|
-
processCore(message, local) {
|
|
357
|
-
this.cachingLogViewer.setMinimumSequenceNumber(message.minimumSequenceNumber);
|
|
358
|
-
const { type } = message.contents;
|
|
359
|
-
if (type === PersistedTypes_1.SharedTreeOpType.Handle) {
|
|
360
|
-
const { editHandle, startRevision } = message.contents;
|
|
361
|
-
this.editLog.processEditChunkHandle(this.deserializeHandle(editHandle), startRevision);
|
|
362
|
-
}
|
|
363
|
-
else if (type === PersistedTypes_1.SharedTreeOpType.Edit) {
|
|
364
|
-
const semiSerializedEdit = message.contents.edit;
|
|
365
|
-
// semiSerializedEdit may have handles which have been replaced by `serializer.encode`.
|
|
366
|
-
// Since there is no API to un-replace them except via parse, re-stringify the edit, then parse it.
|
|
367
|
-
// Stringify using JSON, not IFluidSerializer since OPs use JSON directly.
|
|
368
|
-
// TODO:Performance:#48025: Avoid this serialization round trip.
|
|
369
|
-
const stringEdit = JSON.stringify(semiSerializedEdit);
|
|
370
|
-
const parsedEdit = this.serializer.parse(stringEdit);
|
|
371
|
-
const edit = parsedEdit;
|
|
372
|
-
this.processSequencedEdit(edit, message);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
|
|
377
|
-
*/
|
|
378
|
-
onDisconnect() {
|
|
379
|
-
// Do nothing
|
|
380
|
-
}
|
|
381
|
-
processSequencedEdit(edit, message) {
|
|
382
|
-
const { id: editId } = edit;
|
|
383
|
-
const wasLocalEdit = this.editLog.isLocalEdit(editId);
|
|
384
|
-
// If the id of the supplied edit matches a non-local edit already present in the log, this would normally be indicative of an error.
|
|
385
|
-
// However, the @fluidframework packages prior to 0.37.x have a bug which can cause data corruption by sequencing duplicate edits--
|
|
386
|
-
// see discussion on the following github issue: https://github.com/microsoft/FluidFramework/issues/4399
|
|
387
|
-
// To work around this issue, we currently tolerate duplicate ops in loaded documents.
|
|
388
|
-
// This could be strengthened in the future to only apply to documents which may have been impacted.
|
|
389
|
-
const shouldIgnoreEdit = this.editLog.tryGetIndexOfId(editId) !== undefined && !wasLocalEdit;
|
|
390
|
-
if (shouldIgnoreEdit) {
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
this.editLog.addSequencedEdit(edit, message);
|
|
394
|
-
if (!wasLocalEdit) {
|
|
395
|
-
const eventArguments = {
|
|
396
|
-
editId,
|
|
397
|
-
local: false,
|
|
398
|
-
tree: this,
|
|
399
|
-
};
|
|
400
|
-
this.emit(SharedTreeEvent.EditCommitted, eventArguments);
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
// If this client created the edit that filled up a chunk, it is responsible for uploading that chunk.
|
|
404
|
-
const lastPair = this.editLog.getLastEditChunk();
|
|
405
|
-
if (lastPair !== undefined) {
|
|
406
|
-
const [startRevision, chunk] = lastPair;
|
|
407
|
-
const edits = Common_1.assertNotUndefined(chunk.edits);
|
|
408
|
-
if (edits.length === this.editLog.editsPerChunk) {
|
|
409
|
-
void this.uploadEditChunk(edits, startRevision);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Add an `Edit` directly.
|
|
416
|
-
* External users should use one of the more specialized functions, like applyEdit which handles constructing the actual `Edit` object.
|
|
417
|
-
* This is exposed as it is useful for testing, particularly with invalid and malformed Edits.
|
|
418
|
-
* @internal
|
|
419
|
-
*/
|
|
420
|
-
processLocalEdit(edit) {
|
|
421
|
-
const editOp = {
|
|
422
|
-
type: PersistedTypes_1.SharedTreeOpType.Edit,
|
|
423
|
-
edit,
|
|
424
|
-
};
|
|
425
|
-
// IFluidHandles are not allowed in Ops.
|
|
426
|
-
// Ops can contain Fluid's Serializable (for payloads) which allows IFluidHandles.
|
|
427
|
-
// So replace the handles before sending:
|
|
428
|
-
const semiSerialized = this.serializer.encode(editOp, this.handle);
|
|
429
|
-
// TODO:44711: what should be passed in when unattached?
|
|
430
|
-
this.submitLocalMessage(semiSerialized);
|
|
431
|
-
this.editLog.addLocalEdit(edit);
|
|
432
|
-
const eventArguments = {
|
|
433
|
-
editId: edit.id,
|
|
434
|
-
local: true,
|
|
435
|
-
tree: this,
|
|
436
|
-
};
|
|
437
|
-
this.emit(SharedTreeEvent.EditCommitted, eventArguments);
|
|
438
|
-
}
|
|
439
|
-
getRuntime() {
|
|
440
|
-
return this.runtime;
|
|
441
|
-
}
|
|
442
|
-
applyStashedOp() {
|
|
443
|
-
throw new Error('not implemented');
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
exports.GenericSharedTree = GenericSharedTree;
|
|
447
|
-
//# sourceMappingURL=GenericSharedTree.js.map
|