@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericSharedTree.js","sourceRoot":"","sources":["../../src/generic/GenericSharedTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyE;AAQzE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K,CAAC,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;oBAChD,KAAK,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;iBAChD;aACD;SACD;IACF,CAAC;IAED;;;;;OAKG;IACI,gBAAgB,CAAC,IAAmB;QAC1C,MAAM,MAAM,GAA8B;YACzC,IAAI,EAAE,iCAAgB,CAAC,IAAI;YAC3B,IAAI;SACJ,CAAC;QAEF,wCAAwC;QACxC,kFAAkF;QAClF,yCAAyC;QACzC,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAEnE,wDAAwD;QACxD,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAEhC,MAAM,cAAc,GAA4D;YAC/E,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;SACV,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAC1D,CAAC;IAEM,UAAU;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAES,cAAc;QACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpC,CAAC;CACD;AAvcD,8CAucC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString, IsoBuffer } from '@fluidframework/common-utils';\nimport { IFluidHandle } from '@fluidframework/core-interfaces';\nimport { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';\nimport {\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tIChannelAttributes,\n} from '@fluidframework/datastore-definitions';\nimport { AttachState } from '@fluidframework/container-definitions';\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tISharedObjectEvents,\n\tserializeHandles,\n\tSharedObject,\n} from '@fluidframework/shared-object-base';\nimport { ITelemetryLogger } from '@fluidframework/common-definitions';\nimport { ChildLogger, ITelemetryLoggerPropertyBags, PerformanceEvent } from '@fluidframework/telemetry-utils';\nimport { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';\nimport { assert, assertNotUndefined, fail } from '../Common';\nimport { EditLog, OrderedEditSet } from '../EditLog';\nimport { EditId } from '../Identifiers';\nimport { Snapshot } from '../Snapshot';\nimport { initialTree } from '../InitialTree';\nimport { CachingLogViewer, EditStatusCallback, LogViewer } from '../LogViewer';\nimport { convertSummaryToReadFormat, deserialize, readFormatVersion } from '../SummaryBackCompatibility';\nimport {\n\tEdit,\n\tSharedTreeOpType,\n\tSharedTreeEditOp,\n\tSharedTreeHandleOp,\n\tEditWithoutId,\n\tSharedTreeOp,\n\tEditStatus,\n} from './PersistedTypes';\nimport { serialize, SharedTreeSummarizer, SharedTreeSummary, SharedTreeSummaryBase } from './Summary';\nimport { GenericTransaction } from './GenericTransaction';\nimport { newEdit } from './GenericEditUtilities';\n\n/**\n * Filename where the snapshot is stored.\n */\nconst snapshotFileName = 'header';\n\nconst initialSummary: SharedTreeSummary<unknown> = {\n\tversion: readFormatVersion,\n\tcurrentTree: initialTree,\n\teditHistory: {\n\t\teditChunks: [],\n\t\teditIds: [],\n\t},\n};\n\n/**\n * An event emitted by a `SharedTree` to indicate a state change. See {@link ISharedTreeEvents} for event argument information.\n * @public\n */\nexport enum SharedTreeEvent {\n\t/**\n\t * An edit has been committed to the log.\n\t * This happens when either:\n\t * \t1. A locally generated edit is added to the log.\n\t * \t2. A remotely generated edit is added to the log.\n\t * Note that, for locally generated edits, this event will not be emitted again when that edit is sequenced.\n\t * Passed the EditId of the committed edit, i.e. supports callbacks of type {@link EditCommittedHandler}.\n\t */\n\tEditCommitted = 'committedEdit',\n}\n\n/**\n * An event emitted by a `SharedTree` for diagnostic purposes.\n * See {@link ISharedTreeEvents} for event argument information.\n */\nexport enum SharedTreeDiagnosticEvent {\n\t/**\n\t * A single catch up blob has been uploaded.\n\t */\n\tCatchUpBlobUploaded = 'uploadedCatchUpBlob',\n\t/**\n\t * A valid edit (local or remote) has been applied.\n\t * Passed the EditId of the applied edit.\n\t * Note that this may be called multiple times, due to concurrent edits causing reordering,\n\t * and/or due to not caching the output of every edit.\n\t */\n\tAppliedEdit = 'appliedEdit',\n\t/**\n\t * An invalid edit (local or remote) has been dropped.\n\t * Passed the EditId of the dropped edit.\n\t * Note that this may be called multiple times, due to concurrent edits causing reordering,\n\t * and/or due to not caching the output of every edit.\n\t */\n\tDroppedInvalidEdit = 'droppedInvalidEdit',\n\t/**\n\t * A malformed edit (local or remote) has been dropped.\n\t * Passed the EditId of the dropped edit.\n\t * Note that this may be called multiple times, due to concurrent edits causing reordering,\n\t * and/or due to not caching the output of every edit.\n\t */\n\tDroppedMalformedEdit = 'droppedMalformedEdit',\n}\n\n/**\n * The arguments included when the EditCommitted SharedTreeEvent is emitted.\n * @public\n */\nexport interface EditCommittedEventArguments<TSharedTree> {\n\t/** The ID of the edit committed. */\n\teditId: EditId;\n\t/** Whether or not this is a local edit. */\n\tlocal: boolean;\n\t/** The tree the edit was committed on. Required for local edit events handled by SharedTreeUndoRedoHandler. */\n\ttree: TSharedTree;\n}\n\n/**\n * Events which may be emitted by `SharedTree`. See {@link SharedTreeEvent} for documentation of event semantics.\n */\nexport interface ISharedTreeEvents<TSharedTree> extends ISharedObjectEvents {\n\t(event: 'committedEdit', listener: EditCommittedHandler<TSharedTree>);\n}\n\n/**\n * Expected type for a handler of the `EditCommitted` event.\n */\nexport type EditCommittedHandler<TSharedTree> = (args: EditCommittedEventArguments<TSharedTree>) => void;\n\nconst sharedTreeTelemetryProperties: ITelemetryLoggerPropertyBags = { all: { isSharedTreeEvent: true } };\n\n/**\n * A distributed tree.\n * @public\n */\nexport abstract class GenericSharedTree<TChange> extends SharedObject<ISharedTreeEvents<TChange>> {\n\t/**\n\t * The log of completed edits for this SharedTree.\n\t */\n\tprivate editLog: EditLog<TChange>;\n\n\t/**\n\t * As an implementation detail, SharedTree uses a log viewer that caches snapshots at different revisions.\n\t * It is not exposed to avoid accidental correctness issues, but `logViewer` is exposed in order to give clients a way\n\t * to access the revision history.\n\t */\n\tprivate cachingLogViewer: CachingLogViewer<TChange>;\n\n\t/**\n\t * Viewer for trees defined by editLog. This allows access to views of the tree at different revisions (various points in time).\n\t */\n\tpublic get logViewer(): LogViewer {\n\t\treturn this.cachingLogViewer;\n\t}\n\n\tprotected readonly logger: ITelemetryLogger;\n\n\tpublic readonly transactionFactory: (snapshot: Snapshot) => GenericTransaction<TChange>;\n\n\t/** Indicates if the client is the oldest member of the quorum. */\n\tprivate currentIsOldest: boolean;\n\n\tprivate readonly processEditResult = (editResult: EditStatus, editId: EditId): void => {\n\t\t// TODO:#44859: Invalid results should be handled by the app\n\t\tthis.emit(GenericSharedTree.eventFromEditResult(editResult), editId);\n\t};\n\n\t/**\n\t * Create a new SharedTreeFactory.\n\t * @param runtime - The runtime the SharedTree will be associated with\n\t * @param id - Unique ID for the SharedTree\n\t * @param expensiveValidation - Enable expensive asserts.\n\t * @param summarizeHistory - Determines if the history is included in summaries.\n\t */\n\tpublic constructor(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\ttransactionFactory: (snapshot: Snapshot) => GenericTransaction<TChange>,\n\t\tattributes: IChannelAttributes,\n\t\tprivate readonly expensiveValidation = false,\n\t\tprotected readonly summarizeHistory = true\n\t) {\n\t\tsuper(id, runtime, attributes);\n\t\tthis.expensiveValidation = expensiveValidation;\n\t\tthis.transactionFactory = transactionFactory;\n\n\t\t// This code is somewhat duplicated from OldestClientObserver because it currently depends on the container runtime\n\t\t// which SharedTree does not have access to.\n\t\t// TODO:#55900: Get rid of copy-pasted OldestClientObserver code\n\t\tconst quorum = this.runtime.getQuorum();\n\t\tthis.currentIsOldest = this.computeIsOldest();\n\t\tquorum.on('addMember', this.updateOldest);\n\t\tquorum.on('removeMember', this.updateOldest);\n\t\truntime.on('connected', this.updateOldest);\n\t\truntime.on('disconnected', this.updateOldest);\n\n\t\tthis.logger = ChildLogger.create(runtime.logger, 'SharedTree', sharedTreeTelemetryProperties);\n\t\tconst { editLog, cachingLogViewer } = this.createEditLogFromSummary(initialSummary, this.processEditResult);\n\n\t\tthis.editLog = editLog;\n\t\tthis.cachingLogViewer = cachingLogViewer;\n\t}\n\n\t/**\n\t * Re-computes currentIsOldest and emits an event if it has changed.\n\t * TODO:#55900: Get rid of copy-pasted OldestClientObserver code\n\t */\n\tprivate readonly updateOldest = () => {\n\t\tconst oldest = this.computeIsOldest();\n\t\tif (this.currentIsOldest !== oldest) {\n\t\t\tthis.currentIsOldest = oldest;\n\t\t\tif (oldest) {\n\t\t\t\tthis.emit('becameOldest');\n\t\t\t} else {\n\t\t\t\tthis.emit('lostOldest');\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * 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.\n\t * TODO:#55900: Get rid of copy-pasted OldestClientObserver code\n\t */\n\tprivate computeIsOldest(): boolean {\n\t\t// If the container is detached, we are the only ones that know about it and are the oldest by default.\n\t\tif (this.runtime.attachState === AttachState.Detached) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If we're not connected we can't be the oldest connected client.\n\t\tif (!this.runtime.connected) {\n\t\t\treturn false;\n\t\t}\n\n\t\tassert(this.runtime.clientId !== undefined, 'Client id should be set if connected.');\n\n\t\tconst quorum = this.runtime.getQuorum();\n\t\tconst selfSequencedClient = quorum.getMember(this.runtime.clientId);\n\t\t// When in readonly mode our clientId will not be present in the quorum.\n\t\tif (selfSequencedClient === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst members = quorum.getMembers();\n\t\tfor (const sequencedClient of members.values()) {\n\t\t\tif (sequencedClient.sequenceNumber < selfSequencedClient.sequenceNumber) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// No member of the quorum was older\n\t\treturn true;\n\t}\n\n\t/**\n\t * @returns the current view of the tree.\n\t */\n\tpublic get currentView(): Snapshot {\n\t\treturn this.logViewer.getSnapshotInSession(Number.POSITIVE_INFINITY);\n\t}\n\n\t/**\n\t * @returns the edit history of the tree.\n\t */\n\tpublic get edits(): OrderedEditSet<TChange> {\n\t\treturn this.editLog;\n\t}\n\n\t/**\n\t * Convenience helper for applying an edit containing the given changes.\n\t * Opens an edit, applies the given changes, and closes the edit. See (`openEdit()`/`applyChanges()`/`closeEdit()`).\n\t *\n\t * For convenient imperative variants of edits, see `editor`.\n\t * @internal\n\t */\n\tpublic applyEdit(...changes: TChange[]): EditId {\n\t\tconst edit = newEdit(changes);\n\t\tthis.processLocalEdit(edit);\n\t\treturn edit.id;\n\t}\n\n\tprivate deserializeHandle(serializedHandle: string): IFluidHandle<ArrayBufferLike> {\n\t\tconst deserializeHandle = this.serializer.parse(serializedHandle);\n\t\tassert(typeof deserializeHandle === 'object');\n\t\treturn deserializeHandle as IFluidHandle<ArrayBufferLike>;\n\t}\n\n\t/**\n\t * Uploads the edit chunk and sends the chunk starting revision along with the resulting handle as an op.\n\t */\n\tprivate async uploadEditChunk(edits: readonly EditWithoutId<TChange>[], startRevision: number): Promise<void> {\n\t\ttry {\n\t\t\tconst editHandle = await this.runtime.uploadBlob(IsoBuffer.from(JSON.stringify({ edits })));\n\t\t\tthis.submitLocalMessage({\n\t\t\t\teditHandle: serializeHandles(editHandle, this.serializer, this.handle),\n\t\t\t\tstartRevision,\n\t\t\t\ttype: SharedTreeOpType.Handle,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\t// If chunk load fails, we will try again later in loadCore on the oldest client so we log the error instead of throwing.\n\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t{\n\t\t\t\t\teventName: 'EditChunkUploadFailure',\n\t\t\t\t},\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tpublic summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\treturn createSingleBlobSummary(snapshotFileName, this.saveSerializedSummary({ serializer }));\n\t}\n\n\t/**\n\t * Saves this SharedTree into a serialized summary.\n\t *\n\t * @param options - Optional serializer and summarizer to use. If not passed in, SharedTree's serializer and summarizer are used.\n\t * @internal\n\t */\n\tpublic saveSerializedSummary(options?: {\n\t\tserializer?: IFluidSerializer;\n\t\tsummarizer?: SharedTreeSummarizer<TChange>;\n\t}): string {\n\t\tconst { serializer, summarizer } = options || {};\n\n\t\treturn serialize(\n\t\t\tsummarizer ? summarizer(this.editLog, this.currentView) : this.saveSummary(),\n\t\t\tserializer || this.serializer,\n\t\t\tthis.handle\n\t\t);\n\t}\n\n\t/**\n\t * Saves this SharedTree into a summary.\n\t * @internal\n\t */\n\tpublic saveSummary(): SharedTreeSummaryBase {\n\t\t// If local changes exist, emulate the sequencing of those changes.\n\t\t// Doing so is necessary so edits created during DataObject.initializingFirstTime are included.\n\t\t// Doing so is safe because it is guaranteed that the DDS has not yet been attached. This is because summary creation is only\n\t\t// ever invoked on a DataObject containing local changes when it is attached for the first time. In post-attach flows, an extra\n\t\t// instance of the DataObject is created for generating summaries and will never have local edits.\n\t\tif (this.editLog.numberOfLocalEdits > 0) {\n\t\t\tassert(\n\t\t\t\tthis.runtime.attachState !== AttachState.Attached,\n\t\t\t\t'Summarizing should not occur with local edits except on first attach.'\n\t\t\t);\n\t\t\tthis.editLog.sequenceLocalEdits();\n\t\t}\n\n\t\tassert(this.editLog.numberOfLocalEdits === 0, 'generateSummary must not be called with local edits');\n\t\treturn this.generateSummary(this.editLog);\n\t}\n\n\t/**\n\t * Generates a SharedTree summary for the current state of the tree.\n\t * Will never be called when local edits are present.\n\t */\n\tprotected abstract generateSummary(editLog: OrderedEditSet<TChange>): SharedTreeSummaryBase;\n\n\t/**\n\t * Initialize shared tree with a summary.\n\t * @internal\n\t */\n\tpublic loadSummary(summary: SharedTreeSummaryBase): void {\n\t\tconst { editLog, cachingLogViewer } = this.createEditLogFromSummary(summary, this.processEditResult);\n\t\tthis.editLog = editLog;\n\t\tthis.cachingLogViewer = cachingLogViewer;\n\n\t\tif (this.runtime.connected) {\n\t\t\tconst noChunksReadyForUpload = this.editLog.getEditChunksReadyForUpload()[Symbol.iterator]().next().done;\n\t\t\tif (noChunksReadyForUpload === undefined || !noChunksReadyForUpload) {\n\t\t\t\t// A client does not become a member of the quorum until it is within the collaboration window.\n\t\t\t\t//\n\t\t\t\t// The collaboration window is the range from the minimum sequence number enforced by the server and head.\n\t\t\t\t// When a client sends an op, they include the last sequence number the client has processed. We call this the reference\n\t\t\t\t// sequence number.\n\t\t\t\t//\n\t\t\t\t// 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.\n\t\t\t\t// This is required so we can ensure only the oldest client will upload blobs during summary load.\n\t\t\t\tif (this.runtime.getQuorum().getMembers().size === 0) {\n\t\t\t\t\tconst noop: SharedTreeOp = {\n\t\t\t\t\t\ttype: SharedTreeOpType.NoOp,\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.submitLocalMessage(noop);\n\t\t\t\t} else if (this.currentIsOldest) {\n\t\t\t\t\tvoid this.uploadCatchUpBlobs();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If this client becomes the oldest, it should take care of uploading catch up blobs.\n\t\t\tthis.on('becameOldest', () => void this.uploadCatchUpBlobs());\n\t\t}\n\t}\n\n\tprivate static eventFromEditResult(editStatus: EditStatus): SharedTreeDiagnosticEvent {\n\t\tswitch (editStatus) {\n\t\t\tcase EditStatus.Applied:\n\t\t\t\treturn SharedTreeDiagnosticEvent.AppliedEdit;\n\t\t\tcase EditStatus.Invalid:\n\t\t\t\treturn SharedTreeDiagnosticEvent.DroppedInvalidEdit;\n\t\t\tdefault:\n\t\t\t\treturn SharedTreeDiagnosticEvent.DroppedMalformedEdit;\n\t\t}\n\t}\n\n\tprivate createEditLogFromSummary(\n\t\tsummary: SharedTreeSummaryBase,\n\t\tcallback: EditStatusCallback\n\t): { editLog: EditLog<TChange>; cachingLogViewer: CachingLogViewer<TChange> } {\n\t\tconst convertedSummary = convertSummaryToReadFormat<TChange>(summary);\n\t\tif (typeof convertedSummary === 'string') {\n\t\t\tfail(convertedSummary);\n\t\t}\n\t\tconst { editHistory, currentTree } = convertedSummary;\n\t\tconst currentView = Snapshot.fromTree(currentTree);\n\n\t\tconst editLog = new EditLog(editHistory, this.logger);\n\t\tconst logViewer = new CachingLogViewer(\n\t\t\teditLog,\n\t\t\tSnapshot.fromTree(initialTree),\n\t\t\t// TODO:#47830: Store multiple checkpoints in summary.\n\t\t\t[[editLog.length, { snapshot: currentView }]],\n\t\t\tthis.expensiveValidation,\n\t\t\tcallback,\n\t\t\tthis.logger,\n\t\t\tthis.transactionFactory,\n\t\t\t0\n\t\t);\n\n\t\treturn { editLog, cachingLogViewer: logViewer };\n\t}\n\n\t/**\n\t * Upload any full chunks that have yet to be uploaded.\n\t */\n\tprivate async uploadCatchUpBlobs(): Promise<void> {\n\t\tfor (const [startRevision, chunk] of this.editLog.getEditChunksReadyForUpload()) {\n\t\t\tawait this.uploadEditChunk(chunk, startRevision);\n\t\t\tthis.emit(SharedTreeDiagnosticEvent.CatchUpBlobUploaded);\n\t\t}\n\t}\n\n\t/**\n\t * Compares this shared tree to another for equality.\n\t *\n\t * Equality means that the histories as captured by the EditLogs are equal.\n\t *\n\t * Equality does not include:\n\t * - if an edit is open\n\t * - the shared tree's id\n\t * - local vs sequenced status of edits\n\t * - registered event listeners\n\t * - state of caches\n\t * */\n\tpublic equals<TOtherChangeTypes>(sharedTree: GenericSharedTree<TOtherChangeTypes>): boolean {\n\t\tif (!this.currentView.equals(sharedTree.currentView)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this.editLog.equals(sharedTree.editLog);\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst summaryLoadPerformanceEvent = PerformanceEvent.start(this.logger, { eventName: 'SummaryLoad' });\n\n\t\ttry {\n\t\t\tconst newBlob = await storage.readBlob(snapshotFileName);\n\t\t\tconst blobData = bufferToString(newBlob, 'utf8');\n\n\t\t\tconst summary = deserialize(blobData, this.serializer);\n\t\t\tif (typeof summary === 'string') {\n\t\t\t\tfail(summary);\n\t\t\t}\n\t\t\tthis.loadSummary(summary);\n\n\t\t\tsummaryLoadPerformanceEvent.end({ historySize: this.edits.length });\n\t\t} catch (error) {\n\t\t\tsummaryLoadPerformanceEvent.cancel(undefined, error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean): void {\n\t\tthis.cachingLogViewer.setMinimumSequenceNumber(message.minimumSequenceNumber);\n\t\tconst { type } = message.contents;\n\t\tif (type === SharedTreeOpType.Handle) {\n\t\t\tconst { editHandle, startRevision } = message.contents as SharedTreeHandleOp;\n\t\t\tthis.editLog.processEditChunkHandle(this.deserializeHandle(editHandle), startRevision);\n\t\t} else if (type === SharedTreeOpType.Edit) {\n\t\t\tconst semiSerializedEdit = message.contents.edit;\n\t\t\t// semiSerializedEdit may have handles which have been replaced by `serializer.encode`.\n\t\t\t// Since there is no API to un-replace them except via parse, re-stringify the edit, then parse it.\n\t\t\t// Stringify using JSON, not IFluidSerializer since OPs use JSON directly.\n\t\t\t// TODO:Performance:#48025: Avoid this serialization round trip.\n\t\t\tconst stringEdit = JSON.stringify(semiSerializedEdit);\n\t\t\tconst parsedEdit = this.serializer.parse(stringEdit);\n\t\t\tconst edit = parsedEdit as Edit<TChange>;\n\t\t\tthis.processSequencedEdit(edit, message);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect(): void {\n\t\t// Do nothing\n\t}\n\n\tprivate processSequencedEdit(edit: Edit<TChange>, message: ISequencedDocumentMessage): void {\n\t\tconst { id: editId } = edit;\n\t\tconst wasLocalEdit = this.editLog.isLocalEdit(editId);\n\n\t\t// 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.\n\t\t// However, the @fluidframework packages prior to 0.37.x have a bug which can cause data corruption by sequencing duplicate edits--\n\t\t// see discussion on the following github issue: https://github.com/microsoft/FluidFramework/issues/4399\n\t\t// To work around this issue, we currently tolerate duplicate ops in loaded documents.\n\t\t// This could be strengthened in the future to only apply to documents which may have been impacted.\n\t\tconst shouldIgnoreEdit = this.editLog.tryGetIndexOfId(editId) !== undefined && !wasLocalEdit;\n\t\tif (shouldIgnoreEdit) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.editLog.addSequencedEdit(edit, message);\n\t\tif (!wasLocalEdit) {\n\t\t\tconst eventArguments: EditCommittedEventArguments<GenericSharedTree<TChange>> = {\n\t\t\t\teditId,\n\t\t\t\tlocal: false,\n\t\t\t\ttree: this,\n\t\t\t};\n\t\t\tthis.emit(SharedTreeEvent.EditCommitted, eventArguments);\n\t\t} else {\n\t\t\t// If this client created the edit that filled up a chunk, it is responsible for uploading that chunk.\n\t\t\tconst lastPair = this.editLog.getLastEditChunk();\n\t\t\tif (lastPair !== undefined) {\n\t\t\t\tconst [startRevision, chunk] = lastPair;\n\t\t\t\tconst edits = assertNotUndefined(chunk.edits);\n\t\t\t\tif (edits.length === this.editLog.editsPerChunk) {\n\t\t\t\t\tvoid this.uploadEditChunk(edits, startRevision);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Add an `Edit` directly.\n\t * External users should use one of the more specialized functions, like applyEdit which handles constructing the actual `Edit` object.\n\t * This is exposed as it is useful for testing, particularly with invalid and malformed Edits.\n\t * @internal\n\t */\n\tpublic processLocalEdit(edit: Edit<TChange>): void {\n\t\tconst editOp: SharedTreeEditOp<TChange> = {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit,\n\t\t};\n\n\t\t// IFluidHandles are not allowed in Ops.\n\t\t// Ops can contain Fluid's Serializable (for payloads) which allows IFluidHandles.\n\t\t// So replace the handles before sending:\n\t\tconst semiSerialized = this.serializer.encode(editOp, this.handle);\n\n\t\t// TODO:44711: what should be passed in when unattached?\n\t\tthis.submitLocalMessage(semiSerialized);\n\t\tthis.editLog.addLocalEdit(edit);\n\n\t\tconst eventArguments: EditCommittedEventArguments<GenericSharedTree<TChange>> = {\n\t\t\teditId: edit.id,\n\t\t\tlocal: true,\n\t\t\ttree: this,\n\t\t};\n\t\tthis.emit(SharedTreeEvent.EditCommitted, eventArguments);\n\t}\n\n\tpublic getRuntime(): IFluidDataStoreRuntime {\n\t\treturn this.runtime;\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error('not implemented');\n\t}\n}\n"]}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ReconciliationChange, ReconciliationPath } from '../ReconciliationPath';
|
|
6
|
-
import { Snapshot } from '../Snapshot';
|
|
7
|
-
import { EditStatus } from './PersistedTypes';
|
|
8
|
-
/**
|
|
9
|
-
* Result of applying a transaction.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare type EditingResult<TChange> = {
|
|
13
|
-
readonly status: EditStatus.Invalid | EditStatus.Malformed;
|
|
14
|
-
readonly changes: readonly TChange[];
|
|
15
|
-
readonly steps?: undefined;
|
|
16
|
-
readonly before: Snapshot;
|
|
17
|
-
} | ValidEditingResult<TChange>;
|
|
18
|
-
/**
|
|
19
|
-
* Result of applying a valid transaction.
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export interface ValidEditingResult<TChange> {
|
|
23
|
-
readonly status: EditStatus.Applied;
|
|
24
|
-
readonly changes: readonly TChange[];
|
|
25
|
-
readonly steps: readonly {
|
|
26
|
-
resolvedChange: TChange;
|
|
27
|
-
after: Snapshot;
|
|
28
|
-
}[];
|
|
29
|
-
readonly before: Snapshot;
|
|
30
|
-
readonly after: Snapshot;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* A mutable transaction for applying sequences of changes to a Snapshot.
|
|
34
|
-
* Allows viewing the intermediate states.
|
|
35
|
-
*
|
|
36
|
-
* Contains necessary state to apply changes within an edit to a Snapshot.
|
|
37
|
-
*
|
|
38
|
-
* May have any number of changes applied to make up the edit.
|
|
39
|
-
* Use `close` to complete the transaction, returning the array of changes and an EditingResult showing the
|
|
40
|
-
* results of applying the changes as an Edit to the initial Snapshot (passed to the constructor).
|
|
41
|
-
*
|
|
42
|
-
* No data outside the Transaction is modified by Transaction:
|
|
43
|
-
* the results from `close` must be used to actually submit an `Edit`.
|
|
44
|
-
*/
|
|
45
|
-
export declare abstract class GenericTransaction<TChange> {
|
|
46
|
-
protected readonly before: Snapshot;
|
|
47
|
-
protected _view: Snapshot;
|
|
48
|
-
protected _status: EditStatus;
|
|
49
|
-
protected readonly changes: TChange[];
|
|
50
|
-
protected readonly steps: ReconciliationChange<TChange>[];
|
|
51
|
-
protected isOpen: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Create and open an edit of the provided `Snapshot`. After applying 0 or more changes, this editor should be closed via `close()`.
|
|
54
|
-
* @param view - the `Snapshot` at which this edit begins. The first change will be applied against this view.
|
|
55
|
-
*/
|
|
56
|
-
constructor(view: Snapshot);
|
|
57
|
-
/** The most up-to-date `Snapshot` for this edit. This is the state of the tree after all changes applied so far. */
|
|
58
|
-
get view(): Snapshot;
|
|
59
|
-
/** The status code of the most recent attempted change */
|
|
60
|
-
get status(): EditStatus;
|
|
61
|
-
/** @returns the final `EditStatus` and `Snapshot` after all changes are applied. */
|
|
62
|
-
close(): EditingResult<TChange>;
|
|
63
|
-
/**
|
|
64
|
-
* Override to provide additional transaction validation when the transaction is closed.
|
|
65
|
-
* Only invoked when a transaction is otherwise valid.
|
|
66
|
-
*/
|
|
67
|
-
protected abstract validateOnClose(): EditStatus;
|
|
68
|
-
/**
|
|
69
|
-
* A helper to apply a sequence of changes. Changes will be applied one after the other. If a change fails to apply,
|
|
70
|
-
* the remaining changes in `changes` will be ignored.
|
|
71
|
-
* @param changes - the sequence of changes to apply.
|
|
72
|
-
* @param path - the reconciliation path for the first change.
|
|
73
|
-
* @returns this
|
|
74
|
-
*/
|
|
75
|
-
applyChanges(changes: Iterable<TChange>, path?: ReconciliationPath<TChange>): this;
|
|
76
|
-
protected tryResolveChange(change: TChange, path: ReconciliationPath<TChange>): TChange | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Attempt to apply the given change as part of this edit. This method should not be called if a previous change in this edit failed to
|
|
79
|
-
* apply.
|
|
80
|
-
* @param change - the change to apply
|
|
81
|
-
* @param path - the reconciliation path for the change.
|
|
82
|
-
* @returns this
|
|
83
|
-
*/
|
|
84
|
-
applyChange(change: TChange, path?: ReconciliationPath<TChange>): this;
|
|
85
|
-
protected abstract dispatchChange(change: TChange): EditStatus;
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=GenericTransaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTransaction.d.ts","sourceRoot":"","sources":["../../src/generic/GenericTransaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,oBAAY,aAAa,CAAC,OAAO,IAC9B;IACA,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC;IAC3D,QAAQ,CAAC,OAAO,EAAE,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AAE,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,GAAE,kBAAkB,CAAC,OAAO,CAAM,GAAG,IAAI;IAsD7F,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,SAAS;IAInG;;;;;;OAMG;IACI,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,GAAE,kBAAkB,CAAC,OAAO,CAAM,GAAG,IAAI;IAgBjF,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU;CAC9D"}
|
|
@@ -1,144 +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.GenericTransaction = void 0;
|
|
8
|
-
const Common_1 = require("../Common");
|
|
9
|
-
const PersistedTypes_1 = require("./PersistedTypes");
|
|
10
|
-
/**
|
|
11
|
-
* A mutable transaction for applying sequences of changes to a Snapshot.
|
|
12
|
-
* Allows viewing the intermediate states.
|
|
13
|
-
*
|
|
14
|
-
* Contains necessary state to apply changes within an edit to a Snapshot.
|
|
15
|
-
*
|
|
16
|
-
* May have any number of changes applied to make up the edit.
|
|
17
|
-
* Use `close` to complete the transaction, returning the array of changes and an EditingResult showing the
|
|
18
|
-
* results of applying the changes as an Edit to the initial Snapshot (passed to the constructor).
|
|
19
|
-
*
|
|
20
|
-
* No data outside the Transaction is modified by Transaction:
|
|
21
|
-
* the results from `close` must be used to actually submit an `Edit`.
|
|
22
|
-
*/
|
|
23
|
-
class GenericTransaction {
|
|
24
|
-
/**
|
|
25
|
-
* Create and open an edit of the provided `Snapshot`. After applying 0 or more changes, this editor should be closed via `close()`.
|
|
26
|
-
* @param view - the `Snapshot` at which this edit begins. The first change will be applied against this view.
|
|
27
|
-
*/
|
|
28
|
-
constructor(view) {
|
|
29
|
-
this._status = PersistedTypes_1.EditStatus.Applied;
|
|
30
|
-
this.changes = [];
|
|
31
|
-
this.steps = [];
|
|
32
|
-
this.isOpen = true;
|
|
33
|
-
this._view = view;
|
|
34
|
-
this.before = view;
|
|
35
|
-
}
|
|
36
|
-
/** The most up-to-date `Snapshot` for this edit. This is the state of the tree after all changes applied so far. */
|
|
37
|
-
get view() {
|
|
38
|
-
return this._view;
|
|
39
|
-
}
|
|
40
|
-
/** The status code of the most recent attempted change */
|
|
41
|
-
get status() {
|
|
42
|
-
return this._status;
|
|
43
|
-
}
|
|
44
|
-
/** @returns the final `EditStatus` and `Snapshot` after all changes are applied. */
|
|
45
|
-
close() {
|
|
46
|
-
Common_1.assert(this.isOpen, 'transaction has already been closed');
|
|
47
|
-
this.isOpen = false;
|
|
48
|
-
if (this.status === PersistedTypes_1.EditStatus.Applied) {
|
|
49
|
-
this._status = this.validateOnClose();
|
|
50
|
-
}
|
|
51
|
-
if (this.status === PersistedTypes_1.EditStatus.Applied) {
|
|
52
|
-
return {
|
|
53
|
-
status: PersistedTypes_1.EditStatus.Applied,
|
|
54
|
-
before: this.before,
|
|
55
|
-
after: this._view,
|
|
56
|
-
changes: this.changes,
|
|
57
|
-
steps: this.steps,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
status: this.status,
|
|
62
|
-
changes: this.changes,
|
|
63
|
-
before: this.before,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* A helper to apply a sequence of changes. Changes will be applied one after the other. If a change fails to apply,
|
|
68
|
-
* the remaining changes in `changes` will be ignored.
|
|
69
|
-
* @param changes - the sequence of changes to apply.
|
|
70
|
-
* @param path - the reconciliation path for the first change.
|
|
71
|
-
* @returns this
|
|
72
|
-
*/
|
|
73
|
-
applyChanges(changes, path = []) {
|
|
74
|
-
const iter = changes[Symbol.iterator]();
|
|
75
|
-
const firstChange = iter.next().value;
|
|
76
|
-
let iterResult = iter.next();
|
|
77
|
-
if (iterResult.done === true) {
|
|
78
|
-
for (const change of changes) {
|
|
79
|
-
if (this.applyChange(change, path).status !== PersistedTypes_1.EditStatus.Applied) {
|
|
80
|
-
return this;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
if (this.applyChange(firstChange, path).status !== PersistedTypes_1.EditStatus.Applied) {
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
const ongoingEdit = {
|
|
89
|
-
0: this.steps[this.steps.length - 1],
|
|
90
|
-
before: this.view,
|
|
91
|
-
after: this.view,
|
|
92
|
-
length: 1,
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* We use a Proxy instead of `{ ...path, ...objectWithOngoingEdit }` to avoid eagerly demanding all parts of the path, which may
|
|
96
|
-
* require extensive computation.
|
|
97
|
-
*/
|
|
98
|
-
const pathWithOngoingEdit = new Proxy(path, {
|
|
99
|
-
get: (target, prop) => {
|
|
100
|
-
if (prop === 'length') {
|
|
101
|
-
return target.length + 1;
|
|
102
|
-
}
|
|
103
|
-
return prop === String(target.length) ? ongoingEdit : target[prop];
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
while (iterResult.done !== true) {
|
|
107
|
-
if (this.applyChange(iterResult.value, pathWithOngoingEdit).status !== PersistedTypes_1.EditStatus.Applied) {
|
|
108
|
-
return this;
|
|
109
|
-
}
|
|
110
|
-
ongoingEdit[ongoingEdit.length] = this.steps[this.steps.length - 1];
|
|
111
|
-
ongoingEdit.length += 1;
|
|
112
|
-
ongoingEdit.after = this.view;
|
|
113
|
-
iterResult = iter.next();
|
|
114
|
-
}
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
tryResolveChange(change, path) {
|
|
118
|
-
return change;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Attempt to apply the given change as part of this edit. This method should not be called if a previous change in this edit failed to
|
|
122
|
-
* apply.
|
|
123
|
-
* @param change - the change to apply
|
|
124
|
-
* @param path - the reconciliation path for the change.
|
|
125
|
-
* @returns this
|
|
126
|
-
*/
|
|
127
|
-
applyChange(change, path = []) {
|
|
128
|
-
Common_1.assert(this.isOpen, 'Editor must be open to apply changes.');
|
|
129
|
-
if (this.status !== PersistedTypes_1.EditStatus.Applied) {
|
|
130
|
-
Common_1.fail('Cannot apply change to an edit unless all previous changes have applied');
|
|
131
|
-
}
|
|
132
|
-
const resolvedChange = this.tryResolveChange(change, path);
|
|
133
|
-
if (resolvedChange === undefined) {
|
|
134
|
-
this._status = PersistedTypes_1.EditStatus.Invalid;
|
|
135
|
-
return this;
|
|
136
|
-
}
|
|
137
|
-
this.changes.push(change);
|
|
138
|
-
this._status = this.dispatchChange(resolvedChange);
|
|
139
|
-
this.steps.push({ resolvedChange, after: this.view });
|
|
140
|
-
return this;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
exports.GenericTransaction = GenericTransaction;
|
|
144
|
-
//# sourceMappingURL=GenericTransaction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenericTransaction.js","sourceRoot":"","sources":["../../src/generic/GenericTransaction.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sCAAyC;AAGzC,qDAA8C;AA2B9C;;;;;;;;;;;;GAYG;AACH,MAAsB,kBAAkB;IAQvC;;;OAGG;IACH,YAAmB,IAAc;QATvB,YAAO,GAAe,2BAAU,CAAC,OAAO,CAAC;QAChC,YAAO,GAAc,EAAE,CAAC;QACxB,UAAK,GAAoC,EAAE,CAAC;QACrD,WAAM,GAAG,IAAI,CAAC;QAOvB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,oHAAoH;IACpH,IAAW,IAAI;QACd,OAAO,IAAI,CAAC,KAAK,C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AG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAES,gBAAgB,CAAC,MAAe,EAAE,IAAiC;QAC5E,OAAO,MAAM,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACI,WAAW,CAAC,MAAe,EAAE,OAAoC,EAAE;QACzE,eAAM,CAAC,IAAI,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;QAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,2BAAU,CAAC,OAAO,EAAE;YACvC,aAAI,CAAC,yEAAyE,CAAC,CAAC;SAChF;QACD,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,cAAc,KAAK,SAAS,EAAE;YACjC,IAAI,CAAC,OAAO,GAAG,2BAAU,CAAC,OAAO,CAAC;YAClC,OAAO,IAAI,CAAC;SACZ;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IACb,CAAC;CAGD;AAjJD,gDAiJC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from '../Common';\nimport { ReconciliationChange, ReconciliationPath } from '../ReconciliationPath';\nimport { Snapshot } from '../Snapshot';\nimport { EditStatus } from './PersistedTypes';\n\n/**\n * Result of applying a transaction.\n * @public\n */\nexport type EditingResult<TChange> =\n\t| {\n\t\t\treadonly status: EditStatus.Invalid | EditStatus.Malformed;\n\t\t\treadonly changes: readonly TChange[];\n\t\t\treadonly steps?: undefined;\n\t\t\treadonly before: Snapshot;\n\t }\n\t| ValidEditingResult<TChange>;\n\n/**\n * Result of applying a valid transaction.\n * @public\n */\nexport interface ValidEditingResult<TChange> {\n\treadonly status: EditStatus.Applied;\n\treadonly changes: readonly TChange[];\n\treadonly steps: readonly { resolvedChange: TChange; after: Snapshot }[];\n\treadonly before: Snapshot;\n\treadonly after: Snapshot;\n}\n\n/**\n * A mutable transaction for applying sequences of changes to a Snapshot.\n * Allows viewing the intermediate states.\n *\n * Contains necessary state to apply changes within an edit to a Snapshot.\n *\n * May have any number of changes applied to make up the edit.\n * Use `close` to complete the transaction, returning the array of changes and an EditingResult showing the\n * results of applying the changes as an Edit to the initial Snapshot (passed to the constructor).\n *\n * No data outside the Transaction is modified by Transaction:\n * the results from `close` must be used to actually submit an `Edit`.\n */\nexport abstract class GenericTransaction<TChange> {\n\tprotected readonly before: Snapshot;\n\tprotected _view: Snapshot;\n\tprotected _status: EditStatus = EditStatus.Applied;\n\tprotected readonly changes: TChange[] = [];\n\tprotected readonly steps: ReconciliationChange<TChange>[] = [];\n\tprotected isOpen = true;\n\n\t/**\n\t * Create and open an edit of the provided `Snapshot`. After applying 0 or more changes, this editor should be closed via `close()`.\n\t * @param view - the `Snapshot` at which this edit begins. The first change will be applied against this view.\n\t */\n\tpublic constructor(view: Snapshot) {\n\t\tthis._view = view;\n\t\tthis.before = view;\n\t}\n\n\t/** The most up-to-date `Snapshot` for this edit. This is the state of the tree after all changes applied so far. */\n\tpublic get view(): Snapshot {\n\t\treturn this._view;\n\t}\n\n\t/** The status code of the most recent attempted change */\n\tpublic get status(): EditStatus {\n\t\treturn this._status;\n\t}\n\n\t/** @returns the final `EditStatus` and `Snapshot` after all changes are applied. */\n\tpublic close(): EditingResult<TChange> {\n\t\tassert(this.isOpen, 'transaction has already been closed');\n\t\tthis.isOpen = false;\n\t\tif (this.status === EditStatus.Applied) {\n\t\t\tthis._status = this.validateOnClose();\n\t\t}\n\t\tif (this.status === EditStatus.Applied) {\n\t\t\treturn {\n\t\t\t\tstatus: EditStatus.Applied,\n\t\t\t\tbefore: this.before,\n\t\t\t\tafter: this._view,\n\t\t\t\tchanges: this.changes,\n\t\t\t\tsteps: this.steps,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tstatus: this.status,\n\t\t\tchanges: this.changes,\n\t\t\tbefore: this.before,\n\t\t};\n\t}\n\n\t/**\n\t * Override to provide additional transaction validation when the transaction is closed.\n\t * Only invoked when a transaction is otherwise valid.\n\t */\n\tprotected abstract validateOnClose(): EditStatus;\n\n\t/**\n\t * A helper to apply a sequence of changes. Changes will be applied one after the other. If a change fails to apply,\n\t * the remaining changes in `changes` will be ignored.\n\t * @param changes - the sequence of changes to apply.\n\t * @param path - the reconciliation path for the first change.\n\t * @returns this\n\t */\n\tpublic applyChanges(changes: Iterable<TChange>, path: ReconciliationPath<TChange> = []): this {\n\t\tconst iter = changes[Symbol.iterator]();\n\t\tconst firstChange = iter.next().value;\n\t\tlet iterResult = iter.next();\n\t\tif (iterResult.done === true) {\n\t\t\tfor (const change of changes) {\n\t\t\t\tif (this.applyChange(change, path).status !== EditStatus.Applied) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.applyChange(firstChange, path).status !== EditStatus.Applied) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst ongoingEdit = {\n\t\t\t0: this.steps[this.steps.length - 1],\n\t\t\tbefore: this.view,\n\t\t\tafter: this.view,\n\t\t\tlength: 1,\n\t\t};\n\n\t\t/**\n\t\t * We use a Proxy instead of `{ ...path, ...objectWithOngoingEdit }` to avoid eagerly demanding all parts of the path, which may\n\t\t * require extensive computation.\n\t\t */\n\t\tconst pathWithOngoingEdit = new Proxy(path, {\n\t\t\tget: (\n\t\t\t\ttarget: ReconciliationPath<TChange>,\n\t\t\t\tprop: string\n\t\t\t): ReconciliationPath<TChange>[number | 'length'] => {\n\t\t\t\tif (prop === 'length') {\n\t\t\t\t\treturn target.length + 1;\n\t\t\t\t}\n\n\t\t\t\treturn prop === String(target.length) ? ongoingEdit : target[prop];\n\t\t\t},\n\t\t});\n\n\t\twhile (iterResult.done !== true) {\n\t\t\tif (this.applyChange(iterResult.value, pathWithOngoingEdit).status !== EditStatus.Applied) {\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tongoingEdit[ongoingEdit.length] = this.steps[this.steps.length - 1];\n\t\t\tongoingEdit.length += 1;\n\t\t\tongoingEdit.after = this.view;\n\t\t\titerResult = iter.next();\n\t\t}\n\t\treturn this;\n\t}\n\n\tprotected tryResolveChange(change: TChange, path: ReconciliationPath<TChange>): TChange | undefined {\n\t\treturn change;\n\t}\n\n\t/**\n\t * Attempt to apply the given change as part of this edit. This method should not be called if a previous change in this edit failed to\n\t * apply.\n\t * @param change - the change to apply\n\t * @param path - the reconciliation path for the change.\n\t * @returns this\n\t */\n\tpublic applyChange(change: TChange, path: ReconciliationPath<TChange> = []): this {\n\t\tassert(this.isOpen, 'Editor must be open to apply changes.');\n\t\tif (this.status !== EditStatus.Applied) {\n\t\t\tfail('Cannot apply change to an edit unless all previous changes have applied');\n\t\t}\n\t\tconst resolvedChange = this.tryResolveChange(change, path);\n\t\tif (resolvedChange === undefined) {\n\t\t\tthis._status = EditStatus.Invalid;\n\t\t\treturn this;\n\t\t}\n\t\tthis.changes.push(change);\n\t\tthis._status = this.dispatchChange(resolvedChange);\n\t\tthis.steps.push({ resolvedChange, after: this.view });\n\t\treturn this;\n\t}\n\n\tprotected abstract dispatchChange(change: TChange): EditStatus;\n}\n"]}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { Serializable } from '@fluidframework/datastore-definitions';
|
|
6
|
-
import { Definition, DetachedSequenceId, EditId, NodeId, TraitLabel } from '../Identifiers';
|
|
7
|
-
/**
|
|
8
|
-
* Types for Edits in Fluid Ops and Fluid summaries.
|
|
9
|
-
*
|
|
10
|
-
* Types describing locations in the tree are stable in the presence of other concurrent edits.
|
|
11
|
-
*
|
|
12
|
-
* All types are compatible with Fluid Serializable.
|
|
13
|
-
*
|
|
14
|
-
* These types can only be modified in ways that are both backwards and forwards compatible since they
|
|
15
|
-
* are used in edits, and thus are persisted (using Fluid serialization).
|
|
16
|
-
*
|
|
17
|
-
* This means these types cannot be changed in any way that impacts their Fluid serialization
|
|
18
|
-
* except through a very careful process:
|
|
19
|
-
*
|
|
20
|
-
* 1. The planned change must support all old data, and maintain the exact semantics of it.
|
|
21
|
-
* This means that the change is pretty much limited to adding optional fields,
|
|
22
|
-
* or making required fields optional.
|
|
23
|
-
* 2. Support for the new format must be deployed to all users (This means all applications using SharedTree must do this),
|
|
24
|
-
* and this deployment must be confirmed to be stable and will not be rolled back.
|
|
25
|
-
* 3. Usage of the new format may start.
|
|
26
|
-
*
|
|
27
|
-
* Support for the old format can NEVER be removed: it must be maintained indefinably or old documents will break.
|
|
28
|
-
* Because this process puts requirements on applications using shared tree,
|
|
29
|
-
* step 3 should only ever be done in a Major version update,
|
|
30
|
-
* and must be explicitly called out in the release notes
|
|
31
|
-
* stating which versions of SharedTree are supported for documents modified by the new version.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* A collection of changes to the tree that are applied atomically along with a unique identifier for the edit.
|
|
35
|
-
* If any individual change fails to apply, the entire Edit will fail to apply.
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
export interface Edit<TChange> extends EditBase<TChange> {
|
|
39
|
-
/**
|
|
40
|
-
* Unique identifier for this edit. Must never be reused.
|
|
41
|
-
* Used for referencing and de-duplicating edits.
|
|
42
|
-
*/
|
|
43
|
-
readonly id: EditId;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* A collection of changes to the tree that are applied atomically. If any individual change fails to apply,
|
|
47
|
-
* the entire Edit will fail to apply.
|
|
48
|
-
* @public
|
|
49
|
-
*/
|
|
50
|
-
export interface EditWithoutId<TChange> extends EditBase<TChange> {
|
|
51
|
-
/**
|
|
52
|
-
* Used to explicitly state that EditWithoutId cannot contain an id and prevents type Edit from being assigned to type EditWithoutId.
|
|
53
|
-
*/
|
|
54
|
-
readonly id?: never;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* The information included in an edit.
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
export interface EditBase<TChange> {
|
|
61
|
-
/**
|
|
62
|
-
* Actual changes to apply.
|
|
63
|
-
* Applied in order as part of a single transaction.
|
|
64
|
-
*/
|
|
65
|
-
readonly changes: readonly TChange[];
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Json compatible map as object.
|
|
69
|
-
* Keys are TraitLabels,
|
|
70
|
-
* Values are the content of the trait specified by the key.
|
|
71
|
-
* @public
|
|
72
|
-
*/
|
|
73
|
-
export interface TraitMap<TChild> {
|
|
74
|
-
readonly [key: string]: TreeNodeSequence<TChild>;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A sequence of Nodes that make up a trait under a Node
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
80
|
-
export declare type TreeNodeSequence<TChild> = readonly TChild[];
|
|
81
|
-
/**
|
|
82
|
-
* Json compatible representation of a payload storing arbitrary Serializable data.
|
|
83
|
-
*
|
|
84
|
-
* Keys starting with "IFluid" are reserved for special use such as the JavaScript feature detection pattern and should not be used.
|
|
85
|
-
*
|
|
86
|
-
* See {@link comparePayloads} for equality semantics and related details (like what is allowed to be lost when serializing)
|
|
87
|
-
*
|
|
88
|
-
* TODO:#51984: Allow opting into heuristic blobbing in snapshots with a special IFluid key.
|
|
89
|
-
*
|
|
90
|
-
* @public
|
|
91
|
-
*/
|
|
92
|
-
export declare type Payload = Serializable;
|
|
93
|
-
/**
|
|
94
|
-
* The fields required by a node in a tree
|
|
95
|
-
* @public
|
|
96
|
-
*/
|
|
97
|
-
export interface NodeData {
|
|
98
|
-
readonly payload?: Payload;
|
|
99
|
-
/**
|
|
100
|
-
* The meaning of this node.
|
|
101
|
-
* Provides contexts/semantics for this node and its content.
|
|
102
|
-
* Typically use to associate a node with metadata (including a schema) and source code (types, behaviors, etc).
|
|
103
|
-
*/
|
|
104
|
-
readonly definition: Definition;
|
|
105
|
-
/**
|
|
106
|
-
* Identifier which can be used to refer to this Node.
|
|
107
|
-
*/
|
|
108
|
-
readonly identifier: NodeId;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Satisfies `NodeData` and may contain children under traits (which may or may not be `TreeNodes`)
|
|
112
|
-
* @public
|
|
113
|
-
*/
|
|
114
|
-
export interface TreeNode<TChild> extends NodeData {
|
|
115
|
-
readonly traits: TraitMap<TChild>;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Specifies the location of a trait (a labeled sequence of nodes) within the tree.
|
|
119
|
-
* @public
|
|
120
|
-
*/
|
|
121
|
-
export interface TraitLocation {
|
|
122
|
-
readonly parent: NodeId;
|
|
123
|
-
readonly label: TraitLabel;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* JSON-compatible Node type. Objects of type `ChangeNode` will be persisted in `Changes` (under Edits) in the SharedTree history.
|
|
127
|
-
* @public
|
|
128
|
-
*/
|
|
129
|
-
export declare type ChangeNode = TreeNode<ChangeNode>;
|
|
130
|
-
/**
|
|
131
|
-
* Node or sequence of Nodes for use in a Build change.
|
|
132
|
-
*
|
|
133
|
-
* Other formats for sub-sequences of Nodes can be added here, and those formats should be supported in blobs as well.
|
|
134
|
-
* Future formats will include referenced blobs containing sequences of Nodes,
|
|
135
|
-
* template based metadata and identity deduplication, and possibly compressed and binary formats.
|
|
136
|
-
* These optimized formats should also be used within snapshots.
|
|
137
|
-
* @public
|
|
138
|
-
*/
|
|
139
|
-
export declare type BuildNode = TreeNode<BuildNode> | DetachedSequenceId;
|
|
140
|
-
/**
|
|
141
|
-
* The status code of an attempt to apply the changes in an Edit.
|
|
142
|
-
* @public
|
|
143
|
-
*/
|
|
144
|
-
export declare enum EditStatus {
|
|
145
|
-
/**
|
|
146
|
-
* The edit contained one or more malformed changes (e.g. was missing required fields such as `id`),
|
|
147
|
-
* or contained a sequence of changes that could not possibly be applied sequentially without error
|
|
148
|
-
* (e.g. an edit which tries to insert the same detached node twice).
|
|
149
|
-
*/
|
|
150
|
-
Malformed = 0,
|
|
151
|
-
/**
|
|
152
|
-
* The edit contained a well-formed sequence of changes that couldn't be applied to the current view,
|
|
153
|
-
* generally because concurrent changes caused one or more merge conflicts.
|
|
154
|
-
*/
|
|
155
|
-
Invalid = 1,
|
|
156
|
-
/**
|
|
157
|
-
* The edit was applied to the current view successfully.
|
|
158
|
-
*/
|
|
159
|
-
Applied = 2
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Types of ops handled by SharedTree.
|
|
163
|
-
*/
|
|
164
|
-
export declare enum SharedTreeOpType {
|
|
165
|
-
/** An op that includes edit information. */
|
|
166
|
-
Edit = 0,
|
|
167
|
-
/** Includes a Fluid handle that corresponds to an edit chunk. */
|
|
168
|
-
Handle = 1,
|
|
169
|
-
/** An op that does not affect the tree's state. */
|
|
170
|
-
NoOp = 2
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Requirements for SharedTree ops.
|
|
174
|
-
*/
|
|
175
|
-
export interface SharedTreeOp {
|
|
176
|
-
type: SharedTreeOpType;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* A SharedTree op that includes edit information.
|
|
180
|
-
*/
|
|
181
|
-
export interface SharedTreeEditOp<TChange> extends SharedTreeOp {
|
|
182
|
-
edit: Edit<TChange>;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* A SharedTree op that includes edit handle information.
|
|
186
|
-
* The handle corresponds to an edit chunk in the edit log.
|
|
187
|
-
*/
|
|
188
|
-
export interface SharedTreeHandleOp extends SharedTreeOp {
|
|
189
|
-
/** The serialized handle to an uploaded edit chunk. */
|
|
190
|
-
editHandle: string;
|
|
191
|
-
/** The index of the first edit in the chunk that corresponds to the handle. */
|
|
192
|
-
startRevision: number;
|
|
193
|
-
}
|
|
194
|
-
//# sourceMappingURL=PersistedTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersistedTypes.d.ts","sourceRoot":"","sources":["../../src/generic/PersistedTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;GAIG;AACH,MAAM,WAAW,IAAI,CAAC,OAAO,CAAE,SAAQ,QAAQ,CAAC,OAAO,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,OAAO,CAAE,SAAQ,QAAQ,CAAC,OAAO,CAAC;IAChE;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,OAAO;IAChC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,CAAC;CAIrC;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,MAAM;IAC/B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACjD;AAED;;;GAGG;AACH,oBAAY,gBAAgB,CAAC,MAAM,IAAI,SAAS,MAAM,EAAE,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,oBAAY,OAAO,GAAG,YAAY,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACxB,QAA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|
|
|
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.SharedTreeOpType = exports.EditStatus = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* The status code of an attempt to apply the changes in an Edit.
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
var EditStatus;
|
|
13
|
-
(function (EditStatus) {
|
|
14
|
-
/**
|
|
15
|
-
* The edit contained one or more malformed changes (e.g. was missing required fields such as `id`),
|
|
16
|
-
* or contained a sequence of changes that could not possibly be applied sequentially without error
|
|
17
|
-
* (e.g. an edit which tries to insert the same detached node twice).
|
|
18
|
-
*/
|
|
19
|
-
EditStatus[EditStatus["Malformed"] = 0] = "Malformed";
|
|
20
|
-
/**
|
|
21
|
-
* The edit contained a well-formed sequence of changes that couldn't be applied to the current view,
|
|
22
|
-
* generally because concurrent changes caused one or more merge conflicts.
|
|
23
|
-
*/
|
|
24
|
-
EditStatus[EditStatus["Invalid"] = 1] = "Invalid";
|
|
25
|
-
/**
|
|
26
|
-
* The edit was applied to the current view successfully.
|
|
27
|
-
*/
|
|
28
|
-
EditStatus[EditStatus["Applied"] = 2] = "Applied";
|
|
29
|
-
})(EditStatus = exports.EditStatus || (exports.EditStatus = {}));
|
|
30
|
-
/**
|
|
31
|
-
* Types of ops handled by SharedTree.
|
|
32
|
-
*/
|
|
33
|
-
var SharedTreeOpType;
|
|
34
|
-
(function (SharedTreeOpType) {
|
|
35
|
-
/** An op that includes edit information. */
|
|
36
|
-
SharedTreeOpType[SharedTreeOpType["Edit"] = 0] = "Edit";
|
|
37
|
-
/** Includes a Fluid handle that corresponds to an edit chunk. */
|
|
38
|
-
SharedTreeOpType[SharedTreeOpType["Handle"] = 1] = "Handle";
|
|
39
|
-
/** An op that does not affect the tree's state. */
|
|
40
|
-
SharedTreeOpType[SharedTreeOpType["NoOp"] = 2] = "NoOp";
|
|
41
|
-
})(SharedTreeOpType = exports.SharedTreeOpType || (exports.SharedTreeOpType = {}));
|
|
42
|
-
//# sourceMappingURL=PersistedTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersistedTypes.js","sourceRoot":"","sources":["../../src/generic/PersistedTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgKH;;;GAGG;AACH,IAAY,UAgBX;AAhBD,WAAY,UAAU;IACrB;;;;OAIG;IACH,qDAAS,CAAA;IACT;;;OAGG;IACH,iDAAO,CAAA;IACP;;OAEG;IACH,iDAAO,CAAA;AACR,CAAC,EAhBW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAgBrB;AAED;;GAEG;AACH,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC3B,4CAA4C;IAC5C,uDAAI,CAAA;IACJ,iEAAiE;IACjE,2DAAM,CAAA;IACN,mDAAmD;IACnD,uDAAI,CAAA;AACL,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// All types imported into this file inherit the requirements documented below.\n// These imports are ok because they consist only of type aliases for primitive types,\n// and thus have no impact on serialization as long as the primitive type they are an alias for does not change.\n// This does mean that the various UuidString types must remain strings, and must never change the format unless the process for changing\n// persisted types (as documented below) is followed.\nimport { Serializable } from '@fluidframework/datastore-definitions';\nimport { Definition, DetachedSequenceId, EditId, NodeId, TraitLabel } from '../Identifiers';\n\n/**\n * Types for Edits in Fluid Ops and Fluid summaries.\n *\n * Types describing locations in the tree are stable in the presence of other concurrent edits.\n *\n * All types are compatible with Fluid Serializable.\n *\n * These types can only be modified in ways that are both backwards and forwards compatible since they\n * are used in edits, and thus are persisted (using Fluid serialization).\n *\n * This means these types cannot be changed in any way that impacts their Fluid serialization\n * except through a very careful process:\n *\n * 1. The planned change must support all old data, and maintain the exact semantics of it.\n * This means that the change is pretty much limited to adding optional fields,\n * or making required fields optional.\n * 2. Support for the new format must be deployed to all users (This means all applications using SharedTree must do this),\n * and this deployment must be confirmed to be stable and will not be rolled back.\n * 3. Usage of the new format may start.\n *\n * Support for the old format can NEVER be removed: it must be maintained indefinably or old documents will break.\n * Because this process puts requirements on applications using shared tree,\n * step 3 should only ever be done in a Major version update,\n * and must be explicitly called out in the release notes\n * stating which versions of SharedTree are supported for documents modified by the new version.\n */\n\n/**\n * A collection of changes to the tree that are applied atomically along with a unique identifier for the edit.\n * If any individual change fails to apply, the entire Edit will fail to apply.\n * @public\n */\nexport interface Edit<TChange> extends EditBase<TChange> {\n\t/**\n\t * Unique identifier for this edit. Must never be reused.\n\t * Used for referencing and de-duplicating edits.\n\t */\n\treadonly id: EditId;\n}\n\n/**\n * A collection of changes to the tree that are applied atomically. If any individual change fails to apply,\n * the entire Edit will fail to apply.\n * @public\n */\nexport interface EditWithoutId<TChange> extends EditBase<TChange> {\n\t/**\n\t * Used to explicitly state that EditWithoutId cannot contain an id and prevents type Edit from being assigned to type EditWithoutId.\n\t */\n\treadonly id?: never;\n}\n\n/**\n * The information included in an edit.\n * @public\n */\nexport interface EditBase<TChange> {\n\t/**\n\t * Actual changes to apply.\n\t * Applied in order as part of a single transaction.\n\t */\n\treadonly changes: readonly TChange[];\n\n\t// Add more metadata fields as needed in the future.\n\t// Include \"high level\"/\"Domain Specific\"/\"Hierarchal\" edits for application/domain use in implementing domain aware merge heuristics.\n}\n\n/**\n * Json compatible map as object.\n * Keys are TraitLabels,\n * Values are the content of the trait specified by the key.\n * @public\n */\nexport interface TraitMap<TChild> {\n\treadonly [key: string]: TreeNodeSequence<TChild>;\n}\n\n/**\n * A sequence of Nodes that make up a trait under a Node\n * @public\n */\nexport type TreeNodeSequence<TChild> = readonly TChild[];\n\n/**\n * Json compatible representation of a payload storing arbitrary Serializable data.\n *\n * Keys starting with \"IFluid\" are reserved for special use such as the JavaScript feature detection pattern and should not be used.\n *\n * See {@link comparePayloads} for equality semantics and related details (like what is allowed to be lost when serializing)\n *\n * TODO:#51984: Allow opting into heuristic blobbing in snapshots with a special IFluid key.\n *\n * @public\n */\nexport type Payload = Serializable;\n\n/**\n * The fields required by a node in a tree\n * @public\n */\nexport interface NodeData {\n\treadonly payload?: Payload;\n\n\t/**\n\t * The meaning of this node.\n\t * Provides contexts/semantics for this node and its content.\n\t * Typically use to associate a node with metadata (including a schema) and source code (types, behaviors, etc).\n\t */\n\treadonly definition: Definition;\n\n\t/**\n\t * Identifier which can be used to refer to this Node.\n\t */\n\treadonly identifier: NodeId;\n}\n\n/**\n * Satisfies `NodeData` and may contain children under traits (which may or may not be `TreeNodes`)\n * @public\n */\nexport interface TreeNode<TChild> extends NodeData {\n\treadonly traits: TraitMap<TChild>;\n}\n\n/**\n * Specifies the location of a trait (a labeled sequence of nodes) within the tree.\n * @public\n */\nexport interface TraitLocation {\n\treadonly parent: NodeId;\n\treadonly label: TraitLabel;\n}\n\n/**\n * JSON-compatible Node type. Objects of type `ChangeNode` will be persisted in `Changes` (under Edits) in the SharedTree history.\n * @public\n */\nexport type ChangeNode = TreeNode<ChangeNode>;\n\n/**\n * Node or sequence of Nodes for use in a Build change.\n *\n * Other formats for sub-sequences of Nodes can be added here, and those formats should be supported in blobs as well.\n * Future formats will include referenced blobs containing sequences of Nodes,\n * template based metadata and identity deduplication, and possibly compressed and binary formats.\n * These optimized formats should also be used within snapshots.\n * @public\n */\nexport type BuildNode = TreeNode<BuildNode> | DetachedSequenceId;\n\n/**\n * The status code of an attempt to apply the changes in an Edit.\n * @public\n */\nexport enum EditStatus {\n\t/**\n\t * The edit contained one or more malformed changes (e.g. was missing required fields such as `id`),\n\t * or contained a sequence of changes that could not possibly be applied sequentially without error\n\t * (e.g. an edit which tries to insert the same detached node twice).\n\t */\n\tMalformed,\n\t/**\n\t * The edit contained a well-formed sequence of changes that couldn't be applied to the current view,\n\t * generally because concurrent changes caused one or more merge conflicts.\n\t */\n\tInvalid,\n\t/**\n\t * The edit was applied to the current view successfully.\n\t */\n\tApplied,\n}\n\n/**\n * Types of ops handled by SharedTree.\n */\nexport enum SharedTreeOpType {\n\t/** An op that includes edit information. */\n\tEdit,\n\t/** Includes a Fluid handle that corresponds to an edit chunk. */\n\tHandle,\n\t/** An op that does not affect the tree's state. */\n\tNoOp,\n}\n\n/**\n * Requirements for SharedTree ops.\n */\nexport interface SharedTreeOp {\n\ttype: SharedTreeOpType;\n}\n\n/**\n * A SharedTree op that includes edit information.\n */\nexport interface SharedTreeEditOp<TChange> extends SharedTreeOp {\n\tedit: Edit<TChange>;\n}\n\n/**\n * A SharedTree op that includes edit handle information.\n * The handle corresponds to an edit chunk in the edit log.\n */\nexport interface SharedTreeHandleOp extends SharedTreeOp {\n\t/** The serialized handle to an uploaded edit chunk. */\n\teditHandle: string;\n\t/** The index of the first edit in the chunk that corresponds to the handle. */\n\tstartRevision: number;\n}\n"]}
|