@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.
Files changed (817) hide show
  1. package/README.md +159 -46
  2. package/dist/ChangeCompression.d.ts +39 -0
  3. package/dist/ChangeCompression.d.ts.map +1 -0
  4. package/dist/ChangeCompression.js +117 -0
  5. package/dist/ChangeCompression.js.map +1 -0
  6. package/{lib/default-edits/PersistedTypes.d.ts → dist/ChangeTypes.d.ts} +58 -105
  7. package/dist/ChangeTypes.d.ts.map +1 -0
  8. package/dist/{default-edits/PersistedTypes.js → ChangeTypes.js} +21 -76
  9. package/dist/ChangeTypes.js.map +1 -0
  10. package/dist/Checkout.d.ts +39 -27
  11. package/dist/Checkout.d.ts.map +1 -1
  12. package/dist/Checkout.js +61 -32
  13. package/dist/Checkout.js.map +1 -1
  14. package/dist/Common.d.ts +175 -38
  15. package/dist/Common.d.ts.map +1 -1
  16. package/dist/Common.js +240 -103
  17. package/dist/Common.js.map +1 -1
  18. package/dist/EagerCheckout.d.ts +24 -0
  19. package/dist/EagerCheckout.d.ts.map +1 -0
  20. package/dist/{BasicCheckout.js → EagerCheckout.js} +9 -6
  21. package/dist/EagerCheckout.js.map +1 -0
  22. package/dist/EditLog.d.ts +77 -63
  23. package/dist/EditLog.d.ts.map +1 -1
  24. package/dist/EditLog.js +85 -48
  25. package/dist/EditLog.js.map +1 -1
  26. package/dist/EditUtilities.d.ts +168 -0
  27. package/dist/EditUtilities.d.ts.map +1 -0
  28. package/dist/EditUtilities.js +373 -0
  29. package/dist/EditUtilities.js.map +1 -0
  30. package/dist/EventTypes.d.ts +73 -0
  31. package/dist/EventTypes.d.ts.map +1 -0
  32. package/dist/EventTypes.js +78 -0
  33. package/dist/EventTypes.js.map +1 -0
  34. package/dist/Forest.d.ts +29 -7
  35. package/dist/Forest.d.ts.map +1 -1
  36. package/dist/Forest.js +60 -36
  37. package/dist/Forest.js.map +1 -1
  38. package/dist/HistoryEditFactory.d.ts +20 -0
  39. package/dist/HistoryEditFactory.d.ts.map +1 -0
  40. package/dist/HistoryEditFactory.js +226 -0
  41. package/dist/HistoryEditFactory.js.map +1 -0
  42. package/dist/IdConversion.d.ts +12 -0
  43. package/dist/IdConversion.d.ts.map +1 -0
  44. package/dist/IdConversion.js +98 -0
  45. package/dist/IdConversion.js.map +1 -0
  46. package/dist/Identifiers.d.ts +89 -2
  47. package/dist/Identifiers.d.ts.map +1 -1
  48. package/dist/Identifiers.js +10 -0
  49. package/dist/Identifiers.js.map +1 -1
  50. package/dist/InitialTree.d.ts +2 -2
  51. package/dist/InitialTree.d.ts.map +1 -1
  52. package/dist/InitialTree.js +2 -1
  53. package/dist/InitialTree.js.map +1 -1
  54. package/dist/LazyCheckout.d.ts +28 -0
  55. package/dist/LazyCheckout.d.ts.map +1 -0
  56. package/dist/LazyCheckout.js +44 -0
  57. package/dist/LazyCheckout.js.map +1 -0
  58. package/dist/LogViewer.d.ts +129 -85
  59. package/dist/LogViewer.d.ts.map +1 -1
  60. package/dist/LogViewer.js +111 -85
  61. package/dist/LogViewer.js.map +1 -1
  62. package/dist/MergeHealth.d.ts +221 -0
  63. package/dist/MergeHealth.d.ts.map +1 -0
  64. package/dist/MergeHealth.js +263 -0
  65. package/dist/MergeHealth.js.map +1 -0
  66. package/dist/NodeIdUtilities.d.ts +105 -0
  67. package/dist/NodeIdUtilities.d.ts.map +1 -0
  68. package/dist/NodeIdUtilities.js +60 -0
  69. package/dist/NodeIdUtilities.js.map +1 -0
  70. package/dist/PayloadUtilities.d.ts +42 -0
  71. package/dist/PayloadUtilities.d.ts.map +1 -0
  72. package/dist/PayloadUtilities.js +114 -0
  73. package/dist/PayloadUtilities.js.map +1 -0
  74. package/dist/ReconciliationPath.d.ts +18 -13
  75. package/dist/ReconciliationPath.d.ts.map +1 -1
  76. package/dist/ReconciliationPath.js.map +1 -1
  77. package/dist/RevisionValueCache.d.ts +11 -2
  78. package/dist/RevisionValueCache.d.ts.map +1 -1
  79. package/dist/RevisionValueCache.js +2 -3
  80. package/dist/RevisionValueCache.js.map +1 -1
  81. package/dist/RevisionView.d.ts +83 -0
  82. package/dist/RevisionView.d.ts.map +1 -0
  83. package/dist/RevisionView.js +182 -0
  84. package/dist/RevisionView.js.map +1 -0
  85. package/dist/SerializationUtilities.d.ts +36 -0
  86. package/dist/SerializationUtilities.d.ts.map +1 -0
  87. package/dist/SerializationUtilities.js +102 -0
  88. package/dist/SerializationUtilities.js.map +1 -0
  89. package/dist/SharedTree.d.ts +439 -0
  90. package/dist/SharedTree.d.ts.map +1 -0
  91. package/dist/SharedTree.js +1109 -0
  92. package/dist/SharedTree.js.map +1 -0
  93. package/dist/SharedTreeEncoder.d.ts +102 -0
  94. package/dist/SharedTreeEncoder.d.ts.map +1 -0
  95. package/dist/SharedTreeEncoder.js +313 -0
  96. package/dist/SharedTreeEncoder.js.map +1 -0
  97. package/dist/StringInterner.d.ts +46 -0
  98. package/dist/StringInterner.d.ts.map +1 -0
  99. package/dist/StringInterner.js +61 -0
  100. package/dist/StringInterner.js.map +1 -0
  101. package/dist/Summary.d.ts +40 -0
  102. package/dist/Summary.d.ts.map +1 -0
  103. package/dist/Summary.js +23 -0
  104. package/dist/Summary.js.map +1 -0
  105. package/dist/SummaryBackCompatibility.d.ts +22 -22
  106. package/dist/SummaryBackCompatibility.d.ts.map +1 -1
  107. package/dist/SummaryBackCompatibility.js +30 -33
  108. package/dist/SummaryBackCompatibility.js.map +1 -1
  109. package/dist/SummaryTestUtilities.d.ts +31 -0
  110. package/dist/SummaryTestUtilities.d.ts.map +1 -0
  111. package/dist/SummaryTestUtilities.js +37 -0
  112. package/dist/SummaryTestUtilities.js.map +1 -0
  113. package/dist/Transaction.d.ts +71 -0
  114. package/dist/Transaction.d.ts.map +1 -0
  115. package/dist/Transaction.js +92 -0
  116. package/dist/Transaction.js.map +1 -0
  117. package/dist/TransactionInternal.d.ts +540 -0
  118. package/dist/TransactionInternal.d.ts.map +1 -0
  119. package/dist/TransactionInternal.js +626 -0
  120. package/dist/TransactionInternal.js.map +1 -0
  121. package/dist/TreeCompressor.d.ts +36 -0
  122. package/dist/TreeCompressor.d.ts.map +1 -0
  123. package/dist/TreeCompressor.js +137 -0
  124. package/dist/TreeCompressor.js.map +1 -0
  125. package/dist/TreeNodeHandle.d.ts +12 -18
  126. package/dist/TreeNodeHandle.d.ts.map +1 -1
  127. package/dist/TreeNodeHandle.js +13 -23
  128. package/dist/TreeNodeHandle.js.map +1 -1
  129. package/dist/TreeView.d.ts +166 -0
  130. package/dist/TreeView.d.ts.map +1 -0
  131. package/dist/TreeView.js +218 -0
  132. package/dist/TreeView.js.map +1 -0
  133. package/dist/TreeViewUtilities.d.ts +21 -0
  134. package/dist/TreeViewUtilities.d.ts.map +1 -0
  135. package/dist/TreeViewUtilities.js +77 -0
  136. package/dist/TreeViewUtilities.js.map +1 -0
  137. package/dist/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
  138. package/dist/UndoRedoHandler.d.ts.map +1 -0
  139. package/dist/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +5 -9
  140. package/dist/UndoRedoHandler.js.map +1 -0
  141. package/dist/id-compressor/AppendOnlySortedMap.d.ts +127 -0
  142. package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
  143. package/dist/id-compressor/AppendOnlySortedMap.js +283 -0
  144. package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -0
  145. package/dist/id-compressor/IdCompressor.d.ts +389 -0
  146. package/dist/id-compressor/IdCompressor.d.ts.map +1 -0
  147. package/dist/id-compressor/IdCompressor.js +1353 -0
  148. package/dist/id-compressor/IdCompressor.js.map +1 -0
  149. package/dist/id-compressor/IdRange.d.ts +11 -0
  150. package/dist/id-compressor/IdRange.d.ts.map +1 -0
  151. package/dist/id-compressor/IdRange.js +29 -0
  152. package/dist/id-compressor/IdRange.js.map +1 -0
  153. package/dist/id-compressor/NumericUuid.d.ts +63 -0
  154. package/dist/id-compressor/NumericUuid.d.ts.map +1 -0
  155. package/dist/id-compressor/NumericUuid.js +377 -0
  156. package/dist/id-compressor/NumericUuid.js.map +1 -0
  157. package/dist/id-compressor/index.d.ts +12 -0
  158. package/dist/id-compressor/index.d.ts.map +1 -0
  159. package/dist/id-compressor/index.js +26 -0
  160. package/dist/id-compressor/index.js.map +1 -0
  161. package/dist/id-compressor/persisted-types/0.0.1.d.ts +156 -0
  162. package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
  163. package/dist/id-compressor/persisted-types/0.0.1.js +7 -0
  164. package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -0
  165. package/dist/id-compressor/persisted-types/index.d.ts +6 -0
  166. package/dist/id-compressor/persisted-types/index.d.ts.map +1 -0
  167. package/dist/id-compressor/persisted-types/index.js +18 -0
  168. package/dist/id-compressor/persisted-types/index.js.map +1 -0
  169. package/dist/index.d.ts +29 -9
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +50 -35
  172. package/dist/index.js.map +1 -1
  173. package/dist/persisted-types/0.0.2.d.ts +385 -0
  174. package/dist/persisted-types/0.0.2.d.ts.map +1 -0
  175. package/dist/persisted-types/0.0.2.js +113 -0
  176. package/dist/persisted-types/0.0.2.js.map +1 -0
  177. package/dist/persisted-types/0.1.1.d.ts +314 -0
  178. package/dist/persisted-types/0.1.1.d.ts.map +1 -0
  179. package/dist/persisted-types/0.1.1.js +153 -0
  180. package/dist/persisted-types/0.1.1.js.map +1 -0
  181. package/dist/persisted-types/index.d.ts +7 -0
  182. package/dist/persisted-types/index.d.ts.map +1 -0
  183. package/dist/persisted-types/index.js +20 -0
  184. package/dist/persisted-types/index.js.map +1 -0
  185. package/docs/0-1-1-Compression.md +228 -0
  186. package/docs/Breaking-Change-Migration.md +52 -0
  187. package/docs/Compression.md +2 -2
  188. package/docs/Telemetry.md +43 -0
  189. package/docs/Write-Format.md +19 -0
  190. package/lib/ChangeCompression.d.ts +39 -0
  191. package/lib/ChangeCompression.d.ts.map +1 -0
  192. package/lib/ChangeCompression.js +111 -0
  193. package/lib/ChangeCompression.js.map +1 -0
  194. package/{dist/default-edits/PersistedTypes.d.ts → lib/ChangeTypes.d.ts} +58 -105
  195. package/lib/ChangeTypes.d.ts.map +1 -0
  196. package/lib/{default-edits/PersistedTypes.js → ChangeTypes.js} +15 -68
  197. package/lib/ChangeTypes.js.map +1 -0
  198. package/lib/Checkout.d.ts +39 -27
  199. package/lib/Checkout.d.ts.map +1 -1
  200. package/lib/Checkout.js +53 -24
  201. package/lib/Checkout.js.map +1 -1
  202. package/lib/Common.d.ts +175 -38
  203. package/lib/Common.d.ts.map +1 -1
  204. package/lib/Common.js +226 -101
  205. package/lib/Common.js.map +1 -1
  206. package/lib/EagerCheckout.d.ts +24 -0
  207. package/lib/EagerCheckout.d.ts.map +1 -0
  208. package/lib/{BasicCheckout.js → EagerCheckout.js} +7 -4
  209. package/lib/EagerCheckout.js.map +1 -0
  210. package/lib/EditLog.d.ts +77 -63
  211. package/lib/EditLog.d.ts.map +1 -1
  212. package/lib/EditLog.js +83 -47
  213. package/lib/EditLog.js.map +1 -1
  214. package/lib/EditUtilities.d.ts +168 -0
  215. package/lib/EditUtilities.d.ts.map +1 -0
  216. package/lib/EditUtilities.js +353 -0
  217. package/lib/EditUtilities.js.map +1 -0
  218. package/lib/EventTypes.d.ts +73 -0
  219. package/lib/EventTypes.d.ts.map +1 -0
  220. package/lib/EventTypes.js +75 -0
  221. package/lib/EventTypes.js.map +1 -0
  222. package/lib/Forest.d.ts +29 -7
  223. package/lib/Forest.d.ts.map +1 -1
  224. package/lib/Forest.js +58 -35
  225. package/lib/Forest.js.map +1 -1
  226. package/lib/HistoryEditFactory.d.ts +20 -0
  227. package/lib/HistoryEditFactory.d.ts.map +1 -0
  228. package/lib/{default-edits/HistoryEditFactory.js → HistoryEditFactory.js} +78 -39
  229. package/lib/HistoryEditFactory.js.map +1 -0
  230. package/lib/IdConversion.d.ts +12 -0
  231. package/lib/IdConversion.d.ts.map +1 -0
  232. package/lib/IdConversion.js +91 -0
  233. package/lib/IdConversion.js.map +1 -0
  234. package/lib/Identifiers.d.ts +89 -2
  235. package/lib/Identifiers.d.ts.map +1 -1
  236. package/lib/Identifiers.js +8 -1
  237. package/lib/Identifiers.js.map +1 -1
  238. package/lib/InitialTree.d.ts +2 -2
  239. package/lib/InitialTree.d.ts.map +1 -1
  240. package/lib/InitialTree.js +2 -1
  241. package/lib/InitialTree.js.map +1 -1
  242. package/lib/LazyCheckout.d.ts +28 -0
  243. package/lib/LazyCheckout.d.ts.map +1 -0
  244. package/lib/LazyCheckout.js +40 -0
  245. package/lib/LazyCheckout.js.map +1 -0
  246. package/lib/LogViewer.d.ts +129 -85
  247. package/lib/LogViewer.d.ts.map +1 -1
  248. package/lib/LogViewer.js +103 -77
  249. package/lib/LogViewer.js.map +1 -1
  250. package/lib/MergeHealth.d.ts +221 -0
  251. package/lib/MergeHealth.d.ts.map +1 -0
  252. package/lib/MergeHealth.js +258 -0
  253. package/lib/MergeHealth.js.map +1 -0
  254. package/lib/NodeIdUtilities.d.ts +105 -0
  255. package/lib/NodeIdUtilities.d.ts.map +1 -0
  256. package/lib/NodeIdUtilities.js +53 -0
  257. package/lib/NodeIdUtilities.js.map +1 -0
  258. package/lib/PayloadUtilities.d.ts +42 -0
  259. package/lib/PayloadUtilities.d.ts.map +1 -0
  260. package/lib/PayloadUtilities.js +110 -0
  261. package/lib/PayloadUtilities.js.map +1 -0
  262. package/lib/ReconciliationPath.d.ts +18 -13
  263. package/lib/ReconciliationPath.d.ts.map +1 -1
  264. package/lib/ReconciliationPath.js.map +1 -1
  265. package/lib/RevisionValueCache.d.ts +11 -2
  266. package/lib/RevisionValueCache.d.ts.map +1 -1
  267. package/lib/RevisionValueCache.js +2 -3
  268. package/lib/RevisionValueCache.js.map +1 -1
  269. package/lib/RevisionView.d.ts +83 -0
  270. package/lib/RevisionView.d.ts.map +1 -0
  271. package/lib/RevisionView.js +175 -0
  272. package/lib/RevisionView.js.map +1 -0
  273. package/lib/SerializationUtilities.d.ts +36 -0
  274. package/lib/SerializationUtilities.d.ts.map +1 -0
  275. package/lib/SerializationUtilities.js +95 -0
  276. package/lib/SerializationUtilities.js.map +1 -0
  277. package/lib/SharedTree.d.ts +439 -0
  278. package/lib/SharedTree.d.ts.map +1 -0
  279. package/lib/SharedTree.js +1104 -0
  280. package/lib/SharedTree.js.map +1 -0
  281. package/lib/SharedTreeEncoder.d.ts +102 -0
  282. package/lib/SharedTreeEncoder.d.ts.map +1 -0
  283. package/lib/SharedTreeEncoder.js +308 -0
  284. package/lib/SharedTreeEncoder.js.map +1 -0
  285. package/lib/StringInterner.d.ts +46 -0
  286. package/lib/StringInterner.d.ts.map +1 -0
  287. package/lib/StringInterner.js +57 -0
  288. package/lib/StringInterner.js.map +1 -0
  289. package/lib/Summary.d.ts +40 -0
  290. package/lib/Summary.d.ts.map +1 -0
  291. package/lib/Summary.js +19 -0
  292. package/lib/Summary.js.map +1 -0
  293. package/lib/SummaryBackCompatibility.d.ts +22 -22
  294. package/lib/SummaryBackCompatibility.d.ts.map +1 -1
  295. package/lib/SummaryBackCompatibility.js +29 -32
  296. package/lib/SummaryBackCompatibility.js.map +1 -1
  297. package/lib/SummaryTestUtilities.d.ts +31 -0
  298. package/lib/SummaryTestUtilities.d.ts.map +1 -0
  299. package/lib/SummaryTestUtilities.js +32 -0
  300. package/lib/SummaryTestUtilities.js.map +1 -0
  301. package/lib/Transaction.d.ts +71 -0
  302. package/lib/Transaction.d.ts.map +1 -0
  303. package/lib/Transaction.js +88 -0
  304. package/lib/Transaction.js.map +1 -0
  305. package/lib/TransactionInternal.d.ts +540 -0
  306. package/lib/TransactionInternal.d.ts.map +1 -0
  307. package/lib/TransactionInternal.js +622 -0
  308. package/lib/TransactionInternal.js.map +1 -0
  309. package/lib/TreeCompressor.d.ts +36 -0
  310. package/lib/TreeCompressor.d.ts.map +1 -0
  311. package/lib/TreeCompressor.js +133 -0
  312. package/lib/TreeCompressor.js.map +1 -0
  313. package/lib/TreeNodeHandle.d.ts +12 -18
  314. package/lib/TreeNodeHandle.d.ts.map +1 -1
  315. package/lib/TreeNodeHandle.js +14 -24
  316. package/lib/TreeNodeHandle.js.map +1 -1
  317. package/lib/TreeView.d.ts +166 -0
  318. package/lib/TreeView.d.ts.map +1 -0
  319. package/lib/TreeView.js +214 -0
  320. package/lib/TreeView.js.map +1 -0
  321. package/lib/TreeViewUtilities.d.ts +21 -0
  322. package/lib/TreeViewUtilities.d.ts.map +1 -0
  323. package/lib/TreeViewUtilities.js +71 -0
  324. package/lib/TreeViewUtilities.js.map +1 -0
  325. package/lib/{default-edits/UndoRedoHandler.d.ts → UndoRedoHandler.d.ts} +2 -2
  326. package/lib/UndoRedoHandler.d.ts.map +1 -0
  327. package/lib/{default-edits/UndoRedoHandler.js → UndoRedoHandler.js} +3 -7
  328. package/lib/UndoRedoHandler.js.map +1 -0
  329. package/lib/id-compressor/AppendOnlySortedMap.d.ts +127 -0
  330. package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -0
  331. package/lib/id-compressor/AppendOnlySortedMap.js +278 -0
  332. package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -0
  333. package/lib/id-compressor/IdCompressor.d.ts +389 -0
  334. package/lib/id-compressor/IdCompressor.d.ts.map +1 -0
  335. package/lib/id-compressor/IdCompressor.js +1343 -0
  336. package/lib/id-compressor/IdCompressor.js.map +1 -0
  337. package/lib/id-compressor/IdRange.d.ts +11 -0
  338. package/lib/id-compressor/IdRange.d.ts.map +1 -0
  339. package/lib/id-compressor/IdRange.js +25 -0
  340. package/lib/id-compressor/IdRange.js.map +1 -0
  341. package/lib/id-compressor/NumericUuid.d.ts +63 -0
  342. package/lib/id-compressor/NumericUuid.d.ts.map +1 -0
  343. package/lib/id-compressor/NumericUuid.js +365 -0
  344. package/lib/id-compressor/NumericUuid.js.map +1 -0
  345. package/lib/id-compressor/index.d.ts +12 -0
  346. package/lib/id-compressor/index.d.ts.map +1 -0
  347. package/lib/id-compressor/index.js +12 -0
  348. package/lib/id-compressor/index.js.map +1 -0
  349. package/lib/id-compressor/persisted-types/0.0.1.d.ts +156 -0
  350. package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -0
  351. package/lib/{test/Snapshot.tests.d.ts → id-compressor/persisted-types/0.0.1.js} +1 -1
  352. package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -0
  353. package/lib/id-compressor/persisted-types/index.d.ts +6 -0
  354. package/lib/id-compressor/persisted-types/index.d.ts.map +1 -0
  355. package/lib/id-compressor/persisted-types/index.js +6 -0
  356. package/lib/id-compressor/persisted-types/index.js.map +1 -0
  357. package/lib/index.d.ts +29 -9
  358. package/lib/index.d.ts.map +1 -1
  359. package/lib/index.js +23 -6
  360. package/lib/index.js.map +1 -1
  361. package/lib/persisted-types/0.0.2.d.ts +385 -0
  362. package/lib/persisted-types/0.0.2.d.ts.map +1 -0
  363. package/lib/persisted-types/0.0.2.js +110 -0
  364. package/lib/persisted-types/0.0.2.js.map +1 -0
  365. package/lib/persisted-types/0.1.1.d.ts +314 -0
  366. package/lib/persisted-types/0.1.1.d.ts.map +1 -0
  367. package/lib/persisted-types/0.1.1.js +150 -0
  368. package/lib/persisted-types/0.1.1.js.map +1 -0
  369. package/lib/persisted-types/index.d.ts +7 -0
  370. package/lib/persisted-types/index.d.ts.map +1 -0
  371. package/lib/persisted-types/index.js +8 -0
  372. package/lib/persisted-types/index.js.map +1 -0
  373. package/lib/test/AppendOnlySortedMap.tests.d.ts +6 -0
  374. package/lib/test/AppendOnlySortedMap.tests.d.ts.map +1 -0
  375. package/lib/test/AppendOnlySortedMap.tests.js +169 -0
  376. package/lib/test/AppendOnlySortedMap.tests.js.map +1 -0
  377. package/lib/test/{SnapshotUtilities.tests.d.ts → ChangeCompression.tests.d.ts} +1 -1
  378. package/lib/test/ChangeCompression.tests.d.ts.map +1 -0
  379. package/lib/test/ChangeCompression.tests.js +145 -0
  380. package/lib/test/ChangeCompression.tests.js.map +1 -0
  381. package/lib/test/Checkout.tests.d.ts +2 -3
  382. package/lib/test/Checkout.tests.d.ts.map +1 -1
  383. package/lib/test/Checkout.tests.js +126 -69
  384. package/lib/test/Checkout.tests.js.map +1 -1
  385. package/lib/test/Common.tests.js +60 -2
  386. package/lib/test/Common.tests.js.map +1 -1
  387. package/lib/test/{BasicCheckout.tests.d.ts → EagerCheckout.tests.d.ts} +1 -1
  388. package/lib/test/EagerCheckout.tests.d.ts.map +1 -0
  389. package/lib/test/EagerCheckout.tests.js +20 -0
  390. package/lib/test/EagerCheckout.tests.js.map +1 -0
  391. package/lib/test/Edit.tests.js +22 -14
  392. package/lib/test/Edit.tests.js.map +1 -1
  393. package/lib/test/{Anchors.glassBox.tests.d.ts → EditLog.perf.tests.d.ts} +1 -1
  394. package/lib/test/EditLog.perf.tests.d.ts.map +1 -0
  395. package/lib/test/EditLog.perf.tests.js +30 -0
  396. package/lib/test/EditLog.perf.tests.js.map +1 -0
  397. package/lib/test/EditLog.tests.js +10 -6
  398. package/lib/test/EditLog.tests.js.map +1 -1
  399. package/lib/test/EditUtilities.tests.d.ts +6 -0
  400. package/lib/test/EditUtilities.tests.d.ts.map +1 -0
  401. package/lib/test/EditUtilities.tests.js +503 -0
  402. package/lib/test/EditUtilities.tests.js.map +1 -0
  403. package/lib/test/Forest.perf.tests.d.ts +6 -0
  404. package/lib/test/Forest.perf.tests.d.ts.map +1 -0
  405. package/lib/test/Forest.perf.tests.js +133 -0
  406. package/lib/test/Forest.perf.tests.js.map +1 -0
  407. package/lib/test/Forest.tests.js +54 -27
  408. package/lib/test/Forest.tests.js.map +1 -1
  409. package/lib/test/GenericTransaction.tests.js +12 -3
  410. package/lib/test/GenericTransaction.tests.js.map +1 -1
  411. package/lib/test/HistoryEditFactory.tests.d.ts +6 -0
  412. package/lib/test/HistoryEditFactory.tests.d.ts.map +1 -0
  413. package/lib/test/HistoryEditFactory.tests.js +90 -0
  414. package/lib/test/HistoryEditFactory.tests.js.map +1 -0
  415. package/lib/test/IdCompressor.perf.tests.d.ts +6 -0
  416. package/lib/test/IdCompressor.perf.tests.d.ts.map +1 -0
  417. package/lib/test/IdCompressor.perf.tests.js +304 -0
  418. package/lib/test/IdCompressor.perf.tests.js.map +1 -0
  419. package/lib/test/IdCompressor.tests.d.ts +6 -0
  420. package/lib/test/IdCompressor.tests.d.ts.map +1 -0
  421. package/lib/test/IdCompressor.tests.js +1075 -0
  422. package/lib/test/IdCompressor.tests.js.map +1 -0
  423. package/lib/test/IdConversion.tests.d.ts +6 -0
  424. package/lib/test/IdConversion.tests.d.ts.map +1 -0
  425. package/lib/test/IdConversion.tests.js +36 -0
  426. package/lib/test/IdConversion.tests.js.map +1 -0
  427. package/lib/test/LazyCheckout.tests.d.ts +6 -0
  428. package/lib/test/LazyCheckout.tests.d.ts.map +1 -0
  429. package/lib/test/LazyCheckout.tests.js +22 -0
  430. package/lib/test/LazyCheckout.tests.js.map +1 -0
  431. package/lib/test/LogViewer.tests.js +276 -191
  432. package/lib/test/LogViewer.tests.js.map +1 -1
  433. package/lib/test/{SharedTreeWithAnchors.tests.d.ts → MergeHealthTelemetryHeartbeat.tests.d.ts} +1 -1
  434. package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +1 -0
  435. package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +342 -0
  436. package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +1 -0
  437. package/lib/test/NumericUuid.perf.tests.d.ts +6 -0
  438. package/lib/test/NumericUuid.perf.tests.d.ts.map +1 -0
  439. package/lib/test/NumericUuid.perf.tests.js +68 -0
  440. package/lib/test/NumericUuid.perf.tests.js.map +1 -0
  441. package/lib/test/NumericUuid.tests.d.ts +6 -0
  442. package/lib/test/NumericUuid.tests.d.ts.map +1 -0
  443. package/lib/test/NumericUuid.tests.js +191 -0
  444. package/lib/test/NumericUuid.tests.js.map +1 -0
  445. package/lib/test/RevisionView.tests.d.ts +6 -0
  446. package/lib/test/RevisionView.tests.d.ts.map +1 -0
  447. package/lib/test/RevisionView.tests.js +133 -0
  448. package/lib/test/RevisionView.tests.js.map +1 -0
  449. package/lib/test/SharedTree.perf.tests.d.ts +6 -0
  450. package/lib/test/SharedTree.perf.tests.d.ts.map +1 -0
  451. package/lib/test/SharedTree.perf.tests.js +39 -0
  452. package/lib/test/SharedTree.perf.tests.js.map +1 -0
  453. package/lib/test/SharedTree.tests.js +15 -3
  454. package/lib/test/SharedTree.tests.js.map +1 -1
  455. package/lib/test/StringInterner.tests.d.ts +6 -0
  456. package/lib/test/StringInterner.tests.d.ts.map +1 -0
  457. package/lib/test/StringInterner.tests.js +71 -0
  458. package/lib/test/StringInterner.tests.js.map +1 -0
  459. package/lib/test/Summary.tests.d.ts +8 -0
  460. package/lib/test/Summary.tests.d.ts.map +1 -0
  461. package/lib/test/Summary.tests.js +407 -0
  462. package/lib/test/Summary.tests.js.map +1 -0
  463. package/lib/test/Transaction.tests.js +109 -329
  464. package/lib/test/Transaction.tests.js.map +1 -1
  465. package/lib/test/TransactionInternal.tests.d.ts +6 -0
  466. package/lib/test/TransactionInternal.tests.d.ts.map +1 -0
  467. package/lib/test/TransactionInternal.tests.js +568 -0
  468. package/lib/test/TransactionInternal.tests.js.map +1 -0
  469. package/lib/test/TreeCompression.tests.d.ts +6 -0
  470. package/lib/test/TreeCompression.tests.d.ts.map +1 -0
  471. package/lib/test/TreeCompression.tests.js +292 -0
  472. package/lib/test/TreeCompression.tests.js.map +1 -0
  473. package/lib/test/TreeView.tests.d.ts +6 -0
  474. package/lib/test/TreeView.tests.d.ts.map +1 -0
  475. package/lib/test/TreeView.tests.js +176 -0
  476. package/lib/test/TreeView.tests.js.map +1 -0
  477. package/lib/test/UndoRedoHandler.tests.js +2 -2
  478. package/lib/test/UndoRedoHandler.tests.js.map +1 -1
  479. package/lib/test/Virtualization.tests.js +146 -62
  480. package/lib/test/Virtualization.tests.js.map +1 -1
  481. package/lib/test/fuzz/Generators.d.ts +19 -0
  482. package/lib/test/fuzz/Generators.d.ts.map +1 -0
  483. package/lib/test/fuzz/Generators.js +420 -0
  484. package/lib/test/fuzz/Generators.js.map +1 -0
  485. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +20 -0
  486. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -0
  487. package/lib/test/fuzz/SharedTreeFuzzTests.js +217 -0
  488. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -0
  489. package/lib/test/fuzz/Types.d.ts +133 -0
  490. package/lib/test/fuzz/Types.d.ts.map +1 -0
  491. package/lib/test/{GenericTransactionWithAnchors.tests.d.ts → fuzz/Types.js} +2 -2
  492. package/lib/test/fuzz/Types.js.map +1 -0
  493. package/lib/test/utilities/IdCompressorTestUtilities.d.ts +180 -0
  494. package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -0
  495. package/lib/test/utilities/IdCompressorTestUtilities.js +528 -0
  496. package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -0
  497. package/lib/test/utilities/MockTransaction.d.ts +26 -7
  498. package/lib/test/utilities/MockTransaction.d.ts.map +1 -1
  499. package/lib/test/utilities/MockTransaction.js +40 -11
  500. package/lib/test/utilities/MockTransaction.js.map +1 -1
  501. package/lib/test/utilities/PendingLocalStateTests.d.ts +12 -0
  502. package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -0
  503. package/lib/test/utilities/PendingLocalStateTests.js +105 -0
  504. package/lib/test/utilities/PendingLocalStateTests.js.map +1 -0
  505. package/lib/test/utilities/SharedTreeTests.d.ts +3 -4
  506. package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
  507. package/lib/test/utilities/SharedTreeTests.js +696 -439
  508. package/lib/test/utilities/SharedTreeTests.js.map +1 -1
  509. package/lib/test/utilities/SharedTreeVersioningTests.d.ts +11 -0
  510. package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -0
  511. package/lib/test/utilities/SharedTreeVersioningTests.js +370 -0
  512. package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -0
  513. package/lib/test/utilities/SummaryLoadPerfTests.d.ts +10 -0
  514. package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -0
  515. package/lib/test/utilities/SummaryLoadPerfTests.js +102 -0
  516. package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -0
  517. package/lib/test/utilities/SummarySizeTests.d.ts +11 -0
  518. package/lib/test/utilities/SummarySizeTests.d.ts.map +1 -0
  519. package/lib/test/utilities/SummarySizeTests.js +158 -0
  520. package/lib/test/utilities/SummarySizeTests.js.map +1 -0
  521. package/lib/test/utilities/TestCommon.d.ts +9 -0
  522. package/lib/test/utilities/TestCommon.d.ts.map +1 -0
  523. package/lib/test/utilities/TestCommon.js +13 -0
  524. package/lib/test/utilities/TestCommon.js.map +1 -0
  525. package/lib/test/utilities/TestNode.d.ts +140 -0
  526. package/lib/test/utilities/TestNode.d.ts.map +1 -0
  527. package/lib/test/utilities/TestNode.js +292 -0
  528. package/lib/test/utilities/TestNode.js.map +1 -0
  529. package/lib/test/utilities/TestUtilities.d.ts +84 -70
  530. package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
  531. package/lib/test/utilities/TestUtilities.js +218 -143
  532. package/lib/test/utilities/TestUtilities.js.map +1 -1
  533. package/lib/test/utilities/UndoRedoTests.d.ts +4 -5
  534. package/lib/test/utilities/UndoRedoTests.d.ts.map +1 -1
  535. package/lib/test/utilities/UndoRedoTests.js +138 -149
  536. package/lib/test/utilities/UndoRedoTests.js.map +1 -1
  537. package/package.json +22 -17
  538. package/src/ChangeCompression.ts +159 -0
  539. package/src/{default-edits/PersistedTypes.ts → ChangeTypes.ts} +62 -125
  540. package/src/Checkout.ts +82 -53
  541. package/src/Common.ts +317 -117
  542. package/src/EagerCheckout.ts +38 -0
  543. package/src/EditLog.ts +153 -100
  544. package/src/EditUtilities.ts +559 -0
  545. package/src/EventTypes.ts +74 -0
  546. package/src/Forest.ts +81 -73
  547. package/src/{default-edits/HistoryEditFactory.ts → HistoryEditFactory.ts} +103 -53
  548. package/src/IdConversion.ts +125 -0
  549. package/src/Identifiers.ts +101 -1
  550. package/src/InitialTree.ts +5 -4
  551. package/src/LazyCheckout.ts +51 -0
  552. package/src/LogViewer.ts +242 -166
  553. package/src/MergeHealth.ts +447 -0
  554. package/src/NodeIdUtilities.ts +156 -0
  555. package/src/PayloadUtilities.ts +124 -0
  556. package/src/ReconciliationPath.ts +18 -13
  557. package/src/RevisionValueCache.ts +14 -5
  558. package/src/RevisionView.ts +252 -0
  559. package/src/SerializationUtilities.ts +130 -0
  560. package/src/SharedTree.ts +1501 -0
  561. package/src/SharedTreeEncoder.ts +493 -0
  562. package/src/StringInterner.ts +72 -0
  563. package/src/Summary.ts +48 -0
  564. package/src/SummaryBackCompatibility.ts +47 -57
  565. package/src/SummaryTestUtilities.ts +54 -0
  566. package/src/Transaction.ts +120 -0
  567. package/src/TransactionInternal.ts +1087 -0
  568. package/src/TreeCompressor.ts +213 -0
  569. package/src/TreeNodeHandle.ts +19 -32
  570. package/src/TreeView.ts +322 -0
  571. package/src/TreeViewUtilities.ts +77 -0
  572. package/src/{default-edits/UndoRedoHandler.ts → UndoRedoHandler.ts} +8 -13
  573. package/src/id-compressor/AppendOnlySortedMap.ts +325 -0
  574. package/src/id-compressor/IdCompressor.md +3 -0
  575. package/src/id-compressor/IdCompressor.ts +1848 -0
  576. package/src/id-compressor/IdRange.ts +33 -0
  577. package/src/id-compressor/NumericUuid.ts +414 -0
  578. package/src/id-compressor/index.ts +13 -0
  579. package/src/id-compressor/persisted-types/0.0.1.ts +179 -0
  580. package/src/id-compressor/persisted-types/README.md +3 -0
  581. package/src/id-compressor/persisted-types/index.ts +6 -0
  582. package/src/index.ts +118 -59
  583. package/src/persisted-types/0.0.2.ts +442 -0
  584. package/src/persisted-types/0.1.1.ts +476 -0
  585. package/src/persisted-types/README.md +22 -0
  586. package/src/persisted-types/index.ts +9 -0
  587. package/.mocharc.js +0 -41
  588. package/api/tree.api.md +0 -729
  589. package/dist/BasicCheckout.d.ts +0 -23
  590. package/dist/BasicCheckout.d.ts.map +0 -1
  591. package/dist/BasicCheckout.js.map +0 -1
  592. package/dist/Snapshot.d.ts +0 -198
  593. package/dist/Snapshot.d.ts.map +0 -1
  594. package/dist/Snapshot.js +0 -267
  595. package/dist/Snapshot.js.map +0 -1
  596. package/dist/SnapshotUtilities.d.ts +0 -29
  597. package/dist/SnapshotUtilities.d.ts.map +0 -1
  598. package/dist/SnapshotUtilities.js +0 -73
  599. package/dist/SnapshotUtilities.js.map +0 -1
  600. package/dist/anchored-edits/AnchorResolution.d.ts +0 -144
  601. package/dist/anchored-edits/AnchorResolution.d.ts.map +0 -1
  602. package/dist/anchored-edits/AnchorResolution.js +0 -162
  603. package/dist/anchored-edits/AnchorResolution.js.map +0 -1
  604. package/dist/anchored-edits/Factory.d.ts +0 -56
  605. package/dist/anchored-edits/Factory.d.ts.map +0 -1
  606. package/dist/anchored-edits/Factory.js +0 -79
  607. package/dist/anchored-edits/Factory.js.map +0 -1
  608. package/dist/anchored-edits/PersistedTypes.d.ts +0 -245
  609. package/dist/anchored-edits/PersistedTypes.d.ts.map +0 -1
  610. package/dist/anchored-edits/PersistedTypes.js +0 -131
  611. package/dist/anchored-edits/PersistedTypes.js.map +0 -1
  612. package/dist/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
  613. package/dist/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
  614. package/dist/anchored-edits/SharedTreeWithAnchors.js +0 -115
  615. package/dist/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
  616. package/dist/anchored-edits/TransactionWithAnchors.d.ts +0 -28
  617. package/dist/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
  618. package/dist/anchored-edits/TransactionWithAnchors.js +0 -36
  619. package/dist/anchored-edits/TransactionWithAnchors.js.map +0 -1
  620. package/dist/anchored-edits/index.d.ts +0 -10
  621. package/dist/anchored-edits/index.d.ts.map +0 -1
  622. package/dist/anchored-edits/index.js +0 -34
  623. package/dist/anchored-edits/index.js.map +0 -1
  624. package/dist/default-edits/EditUtilities.d.ts +0 -57
  625. package/dist/default-edits/EditUtilities.d.ts.map +0 -1
  626. package/dist/default-edits/EditUtilities.js +0 -192
  627. package/dist/default-edits/EditUtilities.js.map +0 -1
  628. package/dist/default-edits/Factory.d.ts +0 -56
  629. package/dist/default-edits/Factory.d.ts.map +0 -1
  630. package/dist/default-edits/Factory.js +0 -79
  631. package/dist/default-edits/Factory.js.map +0 -1
  632. package/dist/default-edits/HistoryEditFactory.d.ts +0 -19
  633. package/dist/default-edits/HistoryEditFactory.d.ts.map +0 -1
  634. package/dist/default-edits/HistoryEditFactory.js +0 -187
  635. package/dist/default-edits/HistoryEditFactory.js.map +0 -1
  636. package/dist/default-edits/PersistedTypes.d.ts.map +0 -1
  637. package/dist/default-edits/PersistedTypes.js.map +0 -1
  638. package/dist/default-edits/SharedTree.d.ts +0 -111
  639. package/dist/default-edits/SharedTree.d.ts.map +0 -1
  640. package/dist/default-edits/SharedTree.js +0 -124
  641. package/dist/default-edits/SharedTree.js.map +0 -1
  642. package/dist/default-edits/Summary.d.ts +0 -15
  643. package/dist/default-edits/Summary.d.ts.map +0 -1
  644. package/dist/default-edits/Summary.js +0 -35
  645. package/dist/default-edits/Summary.js.map +0 -1
  646. package/dist/default-edits/Transaction.d.ts +0 -41
  647. package/dist/default-edits/Transaction.d.ts.map +0 -1
  648. package/dist/default-edits/Transaction.js +0 -225
  649. package/dist/default-edits/Transaction.js.map +0 -1
  650. package/dist/default-edits/UndoRedoHandler.d.ts.map +0 -1
  651. package/dist/default-edits/UndoRedoHandler.js.map +0 -1
  652. package/dist/default-edits/index.d.ts +0 -13
  653. package/dist/default-edits/index.d.ts.map +0 -1
  654. package/dist/default-edits/index.js +0 -41
  655. package/dist/default-edits/index.js.map +0 -1
  656. package/dist/generic/GenericEditUtilities.d.ts +0 -26
  657. package/dist/generic/GenericEditUtilities.d.ts.map +0 -1
  658. package/dist/generic/GenericEditUtilities.js +0 -45
  659. package/dist/generic/GenericEditUtilities.js.map +0 -1
  660. package/dist/generic/GenericSharedTree.d.ts +0 -221
  661. package/dist/generic/GenericSharedTree.d.ts.map +0 -1
  662. package/dist/generic/GenericSharedTree.js +0 -447
  663. package/dist/generic/GenericSharedTree.js.map +0 -1
  664. package/dist/generic/GenericTransaction.d.ts +0 -87
  665. package/dist/generic/GenericTransaction.d.ts.map +0 -1
  666. package/dist/generic/GenericTransaction.js +0 -144
  667. package/dist/generic/GenericTransaction.js.map +0 -1
  668. package/dist/generic/PersistedTypes.d.ts +0 -194
  669. package/dist/generic/PersistedTypes.d.ts.map +0 -1
  670. package/dist/generic/PersistedTypes.js +0 -42
  671. package/dist/generic/PersistedTypes.js.map +0 -1
  672. package/dist/generic/Summary.d.ts +0 -63
  673. package/dist/generic/Summary.d.ts.map +0 -1
  674. package/dist/generic/Summary.js +0 -64
  675. package/dist/generic/Summary.js.map +0 -1
  676. package/dist/generic/index.d.ts +0 -10
  677. package/dist/generic/index.d.ts.map +0 -1
  678. package/dist/generic/index.js +0 -26
  679. package/dist/generic/index.js.map +0 -1
  680. package/docs/Future.md +0 -155
  681. package/lib/BasicCheckout.d.ts +0 -23
  682. package/lib/BasicCheckout.d.ts.map +0 -1
  683. package/lib/BasicCheckout.js.map +0 -1
  684. package/lib/Snapshot.d.ts +0 -198
  685. package/lib/Snapshot.d.ts.map +0 -1
  686. package/lib/Snapshot.js +0 -263
  687. package/lib/Snapshot.js.map +0 -1
  688. package/lib/SnapshotUtilities.d.ts +0 -29
  689. package/lib/SnapshotUtilities.d.ts.map +0 -1
  690. package/lib/SnapshotUtilities.js +0 -67
  691. package/lib/SnapshotUtilities.js.map +0 -1
  692. package/lib/anchored-edits/AnchorResolution.d.ts +0 -144
  693. package/lib/anchored-edits/AnchorResolution.d.ts.map +0 -1
  694. package/lib/anchored-edits/AnchorResolution.js +0 -152
  695. package/lib/anchored-edits/AnchorResolution.js.map +0 -1
  696. package/lib/anchored-edits/Factory.d.ts +0 -56
  697. package/lib/anchored-edits/Factory.d.ts.map +0 -1
  698. package/lib/anchored-edits/Factory.js +0 -74
  699. package/lib/anchored-edits/Factory.js.map +0 -1
  700. package/lib/anchored-edits/PersistedTypes.d.ts +0 -245
  701. package/lib/anchored-edits/PersistedTypes.d.ts.map +0 -1
  702. package/lib/anchored-edits/PersistedTypes.js +0 -128
  703. package/lib/anchored-edits/PersistedTypes.js.map +0 -1
  704. package/lib/anchored-edits/SharedTreeWithAnchors.d.ts +0 -120
  705. package/lib/anchored-edits/SharedTreeWithAnchors.d.ts.map +0 -1
  706. package/lib/anchored-edits/SharedTreeWithAnchors.js +0 -110
  707. package/lib/anchored-edits/SharedTreeWithAnchors.js.map +0 -1
  708. package/lib/anchored-edits/TransactionWithAnchors.d.ts +0 -28
  709. package/lib/anchored-edits/TransactionWithAnchors.d.ts.map +0 -1
  710. package/lib/anchored-edits/TransactionWithAnchors.js +0 -32
  711. package/lib/anchored-edits/TransactionWithAnchors.js.map +0 -1
  712. package/lib/anchored-edits/index.d.ts +0 -10
  713. package/lib/anchored-edits/index.d.ts.map +0 -1
  714. package/lib/anchored-edits/index.js +0 -11
  715. package/lib/anchored-edits/index.js.map +0 -1
  716. package/lib/default-edits/EditUtilities.d.ts +0 -57
  717. package/lib/default-edits/EditUtilities.d.ts.map +0 -1
  718. package/lib/default-edits/EditUtilities.js +0 -181
  719. package/lib/default-edits/EditUtilities.js.map +0 -1
  720. package/lib/default-edits/Factory.d.ts +0 -56
  721. package/lib/default-edits/Factory.d.ts.map +0 -1
  722. package/lib/default-edits/Factory.js +0 -74
  723. package/lib/default-edits/Factory.js.map +0 -1
  724. package/lib/default-edits/HistoryEditFactory.d.ts +0 -19
  725. package/lib/default-edits/HistoryEditFactory.d.ts.map +0 -1
  726. package/lib/default-edits/HistoryEditFactory.js.map +0 -1
  727. package/lib/default-edits/PersistedTypes.d.ts.map +0 -1
  728. package/lib/default-edits/PersistedTypes.js.map +0 -1
  729. package/lib/default-edits/SharedTree.d.ts +0 -111
  730. package/lib/default-edits/SharedTree.d.ts.map +0 -1
  731. package/lib/default-edits/SharedTree.js +0 -100
  732. package/lib/default-edits/SharedTree.js.map +0 -1
  733. package/lib/default-edits/Summary.d.ts +0 -15
  734. package/lib/default-edits/Summary.d.ts.map +0 -1
  735. package/lib/default-edits/Summary.js +0 -31
  736. package/lib/default-edits/Summary.js.map +0 -1
  737. package/lib/default-edits/Transaction.d.ts +0 -41
  738. package/lib/default-edits/Transaction.d.ts.map +0 -1
  739. package/lib/default-edits/Transaction.js +0 -221
  740. package/lib/default-edits/Transaction.js.map +0 -1
  741. package/lib/default-edits/UndoRedoHandler.d.ts.map +0 -1
  742. package/lib/default-edits/UndoRedoHandler.js.map +0 -1
  743. package/lib/default-edits/index.d.ts +0 -13
  744. package/lib/default-edits/index.d.ts.map +0 -1
  745. package/lib/default-edits/index.js +0 -14
  746. package/lib/default-edits/index.js.map +0 -1
  747. package/lib/generic/GenericEditUtilities.d.ts +0 -26
  748. package/lib/generic/GenericEditUtilities.d.ts.map +0 -1
  749. package/lib/generic/GenericEditUtilities.js +0 -38
  750. package/lib/generic/GenericEditUtilities.js.map +0 -1
  751. package/lib/generic/GenericSharedTree.d.ts +0 -221
  752. package/lib/generic/GenericSharedTree.d.ts.map +0 -1
  753. package/lib/generic/GenericSharedTree.js +0 -443
  754. package/lib/generic/GenericSharedTree.js.map +0 -1
  755. package/lib/generic/GenericTransaction.d.ts +0 -87
  756. package/lib/generic/GenericTransaction.d.ts.map +0 -1
  757. package/lib/generic/GenericTransaction.js +0 -140
  758. package/lib/generic/GenericTransaction.js.map +0 -1
  759. package/lib/generic/PersistedTypes.d.ts +0 -194
  760. package/lib/generic/PersistedTypes.d.ts.map +0 -1
  761. package/lib/generic/PersistedTypes.js +0 -39
  762. package/lib/generic/PersistedTypes.js.map +0 -1
  763. package/lib/generic/Summary.d.ts +0 -63
  764. package/lib/generic/Summary.d.ts.map +0 -1
  765. package/lib/generic/Summary.js +0 -58
  766. package/lib/generic/Summary.js.map +0 -1
  767. package/lib/generic/index.d.ts +0 -10
  768. package/lib/generic/index.d.ts.map +0 -1
  769. package/lib/generic/index.js +0 -11
  770. package/lib/generic/index.js.map +0 -1
  771. package/lib/test/Anchors.glassBox.tests.d.ts.map +0 -1
  772. package/lib/test/Anchors.glassBox.tests.js +0 -410
  773. package/lib/test/Anchors.glassBox.tests.js.map +0 -1
  774. package/lib/test/BasicCheckout.tests.d.ts.map +0 -1
  775. package/lib/test/BasicCheckout.tests.js +0 -8
  776. package/lib/test/BasicCheckout.tests.js.map +0 -1
  777. package/lib/test/GenericTransactionWithAnchors.tests.d.ts.map +0 -1
  778. package/lib/test/GenericTransactionWithAnchors.tests.js +0 -25
  779. package/lib/test/GenericTransactionWithAnchors.tests.js.map +0 -1
  780. package/lib/test/SharedTreeWithAnchors.tests.d.ts.map +0 -1
  781. package/lib/test/SharedTreeWithAnchors.tests.js +0 -420
  782. package/lib/test/SharedTreeWithAnchors.tests.js.map +0 -1
  783. package/lib/test/Snapshot.tests.d.ts.map +0 -1
  784. package/lib/test/Snapshot.tests.js +0 -96
  785. package/lib/test/Snapshot.tests.js.map +0 -1
  786. package/lib/test/SnapshotUtilities.tests.d.ts.map +0 -1
  787. package/lib/test/SnapshotUtilities.tests.js +0 -168
  788. package/lib/test/SnapshotUtilities.tests.js.map +0 -1
  789. package/lib/test/undoRedoStackManager.d.ts +0 -26
  790. package/lib/test/undoRedoStackManager.d.ts.map +0 -1
  791. package/lib/test/undoRedoStackManager.js +0 -176
  792. package/lib/test/undoRedoStackManager.js.map +0 -1
  793. package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts +0 -13
  794. package/lib/test/utilities/SummaryFormatCompatibilityTests.d.ts.map +0 -1
  795. package/lib/test/utilities/SummaryFormatCompatibilityTests.js +0 -154
  796. package/lib/test/utilities/SummaryFormatCompatibilityTests.js.map +0 -1
  797. package/src/BasicCheckout.ts +0 -34
  798. package/src/Snapshot.ts +0 -363
  799. package/src/SnapshotUtilities.ts +0 -88
  800. package/src/anchored-edits/AnchorResolution.ts +0 -442
  801. package/src/anchored-edits/Factory.ts +0 -94
  802. package/src/anchored-edits/PersistedTypes.ts +0 -310
  803. package/src/anchored-edits/SharedTreeWithAnchors.ts +0 -200
  804. package/src/anchored-edits/TransactionWithAnchors.ts +0 -39
  805. package/src/anchored-edits/index.ts +0 -21
  806. package/src/default-edits/EditUtilities.ts +0 -220
  807. package/src/default-edits/Factory.ts +0 -94
  808. package/src/default-edits/SharedTree.ts +0 -174
  809. package/src/default-edits/Summary.ts +0 -44
  810. package/src/default-edits/Transaction.ts +0 -262
  811. package/src/default-edits/index.ts +0 -29
  812. package/src/generic/GenericEditUtilities.ts +0 -46
  813. package/src/generic/GenericSharedTree.ts +0 -593
  814. package/src/generic/GenericTransaction.ts +0 -194
  815. package/src/generic/PersistedTypes.ts +0 -221
  816. package/src/generic/Summary.ts +0 -113
  817. package/src/generic/index.ts +0 -41
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SharedTreeEncoder.js","sourceRoot":"","sources":["../src/SharedTreeEncoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAEN,gBAAgB,EAKhB,iBAAiB,EACjB,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAEN,cAAc,EAEd,WAAW,EAIX,gBAAgB,EAGhB,kBAAkB,EAGlB,eAAe,EAMf,mBAAmB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AAC;IACH,CAAC;IACD;;OAEG;IACK,qBAAqB,CAC5B,KAA8B,EAC9B,WAAyB,EACzB,WAA4B;QAE5B,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1D,MAAM,cAAc,GAAiC,EAAE,CAAC;QACxD,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YAChC,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;gBACxB,IAAI,CAAC,+CAA+C,CAAC,CAAC;aACtD;iBAAM;gBACN,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;;oBAC7B,cAAc,CAAC,IAAI,CAClB,cAAc,CACb;wBACC,OAAO;wBACP,EAAE,QAAE,OAAO,CAAC,OAAO,EAAE,CAAC,mCAAI,IAAI,CAAC,kDAAkD,CAAC;qBAClF,EACD,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAC7C,CACD,CAAC;gBACH,CAAC,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;QAEH,OAAO;YACN,WAAW,EAAE,2BAA2B,CAAC,WAAW,EAAE,WAAW,CAAC;YAClE,cAAc;YACd,OAAO,EAAE,WAAW,CAAC,MAAM;SAC3B,CAAC;IACH,CAAC;CACD;AAED,SAAS,YAAY,CAAC,KAA0D;IAC/E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluidframework/common-utils';\nimport { assert, fail } from './Common';\nimport { EditLog } from './EditLog';\nimport { convertTreeNodes, newEdit } from './EditUtilities';\nimport { DetachedSequenceId, FinalNodeId, OpSpaceNodeId, TraitLabel } from './Identifiers';\nimport { initialTree } from './InitialTree';\nimport {\n\tContextualizedNodeIdNormalizer,\n\tgetNodeIdContext,\n\tNodeIdContext,\n\tNodeIdConverter,\n\tNodeIdGenerator,\n\tNodeIdNormalizer,\n\tscopeIdNormalizer,\n\tsequencedIdNormalizer,\n} from './NodeIdUtilities';\nimport { getChangeNodeFromView, getChangeNode_0_0_2FromView } from './SerializationUtilities';\nimport {\n\tCompressedChangeInternal,\n\tChangeInternal,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n\tChangeNode,\n\tEdit,\n\tSharedTreeEditOp,\n\tSharedTreeOpType,\n\tSharedTreeSummary,\n\tEditWithoutId,\n\tChangeTypeInternal,\n\tChangeInternal_0_0_2,\n\tSharedTreeEditOp_0_0_2,\n\treservedIdCount,\n\tChangeNode_0_0_2,\n\tEditChunkContents,\n\tEditLogSummary,\n\tEditChunkContents_0_1_1,\n\tFluidEditHandle,\n\tStablePlaceInternal,\n\tSide,\n} from './persisted-types';\nimport { RevisionView } from './RevisionView';\nimport { MutableStringInterner, StringInterner } from './StringInterner';\nimport { SummaryContents } from './Summary';\nimport { InterningTreeCompressor } from './TreeCompressor';\nimport {\n\tcreateSessionId,\n\thasOngoingSession,\n\tIdCompressor,\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n} from './id-compressor';\nimport { ChangeCompressor, compressEdit, decompressEdit } from './ChangeCompression';\nimport { convertEditIds, convertNodeDataIds } from './IdConversion';\n\n/**\n * Object capable of converting between the current internal representation for 0.1.1 edits and their wire format.\n * @internal\n */\nexport class SharedTreeEncoder_0_1_1 {\n\tprivate readonly treeCompressor = new InterningTreeCompressor<never>();\n\tprivate readonly changeCompressor = new ChangeCompressor(this.treeCompressor);\n\n\tpublic constructor(private readonly summarizeHistory: boolean) {}\n\n\t/**\n\t * Encodes an edit op to be sent.\n\t * @param edit - edit to encode.\n\t * @param fluidSerialize - Callback which serializes Fluid handles contained in a JSON-serializable object, returning the result.\n\t * Should be invoked on the edit contents at some point before op encoding is complete.\n\t * This is because edit contents may have Payloads needing to be serialized.\n\t */\n\tpublic encodeEditOp(\n\t\tedit: Edit<ChangeInternal>,\n\t\tfluidSerialize: (\n\t\t\tedit: Edit<CompressedChangeInternal<OpSpaceNodeId>>\n\t\t) => Edit<CompressedChangeInternal<OpSpaceNodeId>>,\n\t\tidRange: IdCreationRange,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner\n\t): SharedTreeEditOp {\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 by encoding before sending:\n\t\tconst semiSerialized = fluidSerialize(\n\t\t\tcompressEdit(this.changeCompressor, interner, scopeIdNormalizer(idNormalizer, idRange.sessionId), edit)\n\t\t);\n\n\t\treturn {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit: semiSerialized,\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tidRange,\n\t\t};\n\t}\n\n\t/**\n\t * Decodes an edit op encoded with `encodeEditOp`.\n\t * @param op - op to decode.\n\t * @param fluidDeserialize - Callback which deserializes Fluid handles contained in a JSON-serializable object.\n\t * Should be invoked on the semi-serialized edit contents at some point before decoding is complete.\n\t * This will rehydrate any serialized Fluid handles into usable IFluidHandle objects.\n\t */\n\tpublic decodeEditOp(\n\t\top: SharedTreeEditOp,\n\t\tfluidDeserialize: (\n\t\t\tsemiSerializedEdit: Edit<CompressedChangeInternal<OpSpaceNodeId>>\n\t\t) => Edit<CompressedChangeInternal<OpSpaceNodeId>>,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner\n\t): Edit<ChangeInternal> {\n\t\tconst { edit: semiSerializedEdit } = op;\n\t\tconst parsedEdit = fluidDeserialize(semiSerializedEdit);\n\t\treturn decompressEdit(\n\t\t\tthis.changeCompressor,\n\t\t\tinterner,\n\t\t\tscopeIdNormalizer(idNormalizer, op.idRange.sessionId),\n\t\t\tparsedEdit\n\t\t);\n\t}\n\n\t/**\n\t * Encodes a summary.\n\t */\n\tpublic encodeSummary(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidContext: NodeIdContext,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tif (this.summarizeHistory) {\n\t\t\treturn this.fullHistorySummarizer(edits, currentView, idNormalizer, interner, serializedIdCompressor);\n\t\t} else {\n\t\t\treturn this.noHistorySummarizer(\n\t\t\t\tedits,\n\t\t\t\tcurrentView,\n\t\t\t\tidContext,\n\t\t\t\tidNormalizer,\n\t\t\t\tinterner,\n\t\t\t\tserializedIdCompressor\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary({\n\t\teditHistory,\n\t\tcurrentTree: compressedTree,\n\t\tinternedStrings,\n\t\tidCompressor: serializedIdCompressor,\n\t\tversion,\n\t}: SharedTreeSummary): SummaryContents {\n\t\tassert(version === WriteFormat.v0_1_1, `Invalid summary version to decode: ${version}, expected: 0.1.1`);\n\t\tassert(typeof editHistory === 'object', '0.1.1 summary encountered with non-object edit history.');\n\n\t\tconst idCompressor = hasOngoingSession(serializedIdCompressor)\n\t\t\t? IdCompressor.deserialize(serializedIdCompressor)\n\t\t\t: IdCompressor.deserialize(serializedIdCompressor, createSessionId()); // TODO attribution\n\n\t\tconst interner = new MutableStringInterner(internedStrings);\n\t\tconst sequencedNormalizer = sequencedIdNormalizer(getNodeIdContext(idCompressor));\n\t\tconst decompressedTree: ChangeNode | undefined =\n\t\t\tcompressedTree !== undefined\n\t\t\t\t? this.treeCompressor.decompress(compressedTree, interner, sequencedNormalizer)\n\t\t\t\t: undefined;\n\t\tconst { editChunks, editIds } = editHistory;\n\t\tassert(editChunks !== undefined, 'Missing editChunks on 0.1.1 summary.');\n\t\tassert(editIds !== undefined, 'Missing editIds on 0.1.1 summary.');\n\n\t\tconst uncompressedChunks = editChunks.map(({ startRevision, chunk }) => ({\n\t\t\tstartRevision,\n\t\t\tchunk: isEditHandle(chunk)\n\t\t\t\t? {\n\t\t\t\t\t\tget: async () => {\n\t\t\t\t\t\t\tconst baseHandle = chunk;\n\t\t\t\t\t\t\tconst contents: EditChunkContents = JSON.parse(\n\t\t\t\t\t\t\t\tIsoBuffer.from(await baseHandle.get()).toString()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// Note: any interned IDs referenced in chunks taken at the time of summarization must be included\n\t\t\t\t\t\t\t// in the summary. So this interner is sufficient.\n\t\t\t\t\t\t\treturn this.decodeEditChunk(contents, sequencedNormalizer, interner);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbaseHandle: chunk,\n\t\t\t\t }\n\t\t\t\t: chunk.map((edit) => decompressEdit(this.changeCompressor, interner, sequencedNormalizer, edit)),\n\t\t}));\n\t\treturn {\n\t\t\tcurrentTree: decompressedTree,\n\t\t\teditHistory: { editIds, editChunks: uncompressedChunks },\n\t\t\tidCompressor,\n\t\t\tinterner,\n\t\t};\n\t}\n\n\t/**\n\t * Does not preserve (persist) history at all.\n\t * Instead, the history returned in the summary will contain a single edit that creates a revision identical to the supplied view.\n\t * Writes summary format 0.1.1 which does not store the currentView for no history summaries.\n\t */\n\tprivate noHistorySummarizer<TChange>(\n\t\t_edits: EditLog<TChange>,\n\t\tcurrentView: RevisionView,\n\t\tidContext: NodeIdContext,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tconst currentTree = getChangeNodeFromView(currentView);\n\t\tconst initialTreeId = idContext.convertToNodeId(initialTree.identifier);\n\t\tconst changes: ChangeInternal[] = [];\n\t\t// Generate a set of changes to set the root node's children to that of the root in the currentTree\n\t\tObject.entries(currentTree.traits).forEach(([label, children]) => {\n\t\t\tconst id = 0 as DetachedSequenceId;\n\t\t\tchanges.push(\n\t\t\t\tChangeInternal.build(children, id),\n\t\t\t\tChangeInternal.insert(\n\t\t\t\t\tid,\n\t\t\t\t\tStablePlaceInternal.atStartOf({ parent: initialTreeId, label: label as TraitLabel })\n\t\t\t\t)\n\t\t\t);\n\t\t});\n\n\t\tif (currentTree.payload !== undefined) {\n\t\t\tchanges.push(ChangeInternal.setPayload(initialTreeId, currentTree.payload));\n\t\t}\n\n\t\tassert(\n\t\t\tcurrentTree.identifier === initialTreeId && currentTree.definition === initialTree.definition,\n\t\t\t'root definition and identifier should be immutable.'\n\t\t);\n\t\tconst edit = newEdit(changes);\n\t\tconst compressedChanges = edit.changes.map((change) =>\n\t\t\tthis.changeCompressor.compress(change, interner, sequencedIdNormalizer(idNormalizer))\n\t\t);\n\t\treturn {\n\t\t\teditHistory: {\n\t\t\t\teditChunks: [{ startRevision: 0, chunk: [{ changes: compressedChanges }] }],\n\t\t\t\teditIds: [edit.id],\n\t\t\t},\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t};\n\t}\n\n\t/**\n\t * Generates a summary with format version 0.1.1. This will prefer handles over edits in edit chunks where possible,\n\t * and string interning and tree compression will be applied.\n\t */\n\tprivate fullHistorySummarizer(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidNormalizer: NodeIdNormalizer<OpSpaceNodeId>,\n\t\tinterner: StringInterner,\n\t\tserializedIdCompressor: SerializedIdCompressorWithNoSession\n\t): SharedTreeSummary {\n\t\tconst sequencedNormalizer = sequencedIdNormalizer(idNormalizer);\n\t\tconst currentTree = this.treeCompressor.compress(\n\t\t\tgetChangeNodeFromView(currentView),\n\t\t\tinterner,\n\t\t\tsequencedNormalizer\n\t\t);\n\n\t\treturn {\n\t\t\tcurrentTree,\n\t\t\teditHistory: edits.getEditLogSummary((edit) =>\n\t\t\t\tcompressEdit(this.changeCompressor, interner, sequencedNormalizer, edit)\n\t\t\t),\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tinternedStrings: interner.getSerializable(),\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t};\n\t}\n\n\tpublic encodeEditChunk(\n\t\tedits: readonly EditWithoutId<ChangeInternal>[],\n\t\tidNormalizer: ContextualizedNodeIdNormalizer<FinalNodeId>,\n\t\tinterner: StringInterner\n\t): EditChunkContents_0_1_1 {\n\t\tconst compressedEdits = edits.map((edit) => compressEdit(this.changeCompressor, interner, idNormalizer, edit));\n\t\treturn {\n\t\t\tversion: WriteFormat.v0_1_1,\n\t\t\tedits: compressedEdits,\n\t\t};\n\t}\n\n\tpublic decodeEditChunk(\n\t\tcontents: EditChunkContents,\n\t\tidNormalizer: ContextualizedNodeIdNormalizer<FinalNodeId>,\n\t\tinterner: StringInterner\n\t): EditWithoutId<ChangeInternal>[] {\n\t\tassert(\n\t\t\tcontents.version === WriteFormat.v0_1_1,\n\t\t\t`Invalid editChunk to decode: ${contents.version}. Expected 0.1.1.`\n\t\t);\n\t\treturn contents.edits.map((edit) => decompressEdit(this.changeCompressor, interner, idNormalizer, edit));\n\t}\n}\n\n/**\n * Object capable of converting between the current internal representation for 0.0.2 edits and their wire format.\n * @internal\n */\nexport class SharedTreeEncoder_0_0_2 {\n\tpublic constructor(private readonly summarizeHistory: boolean) {}\n\n\t/**\n\t * Encodes an edit op to be sent.\n\t * @param edit - edit to encode.\n\t * @param fluidSerialize - Callback which serializes Fluid handles contained in a JSON-serializable object, returning the result.\n\t * Should be invoked on the edit contents at some point before op encoding is complete.\n\t * This is because edit contents may have Payloads needing to be serialized.\n\t */\n\tpublic encodeEditOp(\n\t\tedit: Edit<ChangeInternal>,\n\t\tfluidSerialize: (edit: Edit<ChangeInternal_0_0_2>) => Edit<ChangeInternal_0_0_2>,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeEditOp_0_0_2 {\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 by encoding before sending:\n\t\tconst semiSerialized = fluidSerialize(convertEditIds(edit, (id) => idConverter.convertToStableNodeId(id)));\n\n\t\treturn {\n\t\t\ttype: SharedTreeOpType.Edit,\n\t\t\tedit: semiSerialized,\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n\n\t/**\n\t * Decodes an edit op encoded with `encodeEditOp`.\n\t * @param op - op to decode.\n\t * @param fluidDeserialize - Callback which deserializes Fluid handles contained in a JSON-serializable object.\n\t * Should be invoked on the semi-serialized edit contents at some point before decoding is complete.\n\t * This will rehydrate any serialized Fluid handles into usable IFluidHandle objects.\n\t */\n\tpublic decodeEditOp(\n\t\top: SharedTreeEditOp_0_0_2,\n\t\tfluidDeserialize: (semiSerializedEdit: Edit<ChangeInternal_0_0_2>) => Edit<ChangeInternal_0_0_2>,\n\t\tidGenerator: NodeIdGenerator\n\t): Edit<ChangeInternal> {\n\t\tconst { edit: semiSerializedEdit } = op;\n\t\tconst parsedEdit = fluidDeserialize(semiSerializedEdit);\n\t\treturn convertEditIds(parsedEdit, (id) => idGenerator.generateNodeId(id));\n\t}\n\n\t/**\n\t * Encodes a summary.\n\t */\n\tpublic encodeSummary(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tif (this.summarizeHistory) {\n\t\t\treturn this.fullHistorySummarizer(edits, currentView, idConverter);\n\t\t} else {\n\t\t\treturn this.noHistorySummarizer(edits, currentView, idConverter);\n\t\t}\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary({ currentTree, sequencedEdits }: SharedTreeSummary_0_0_2): SummaryContents {\n\t\tassert(sequencedEdits !== undefined, '0.0.2 summary encountered with missing sequencedEdits field.');\n\t\tconst idCompressor = new IdCompressor(createSessionId(), reservedIdCount);\n\t\tconst idGenerator = getNodeIdContext(idCompressor);\n\t\tconst generateId = (id) => idGenerator.generateNodeId(id);\n\n\t\t// This saves all of the edits in the summary as part of the first chunk.\n\t\tconst temporaryLog = new EditLog<ChangeInternal>();\n\t\tsequencedEdits.forEach((edit) =>\n\t\t\ttemporaryLog.addSequencedEdit(convertEditIds(edit, generateId), {\n\t\t\t\tsequenceNumber: 1,\n\t\t\t\treferenceSequenceNumber: 0,\n\t\t\t})\n\t\t);\n\n\t\treturn {\n\t\t\tcurrentTree: convertTreeNodes<ChangeNode_0_0_2, ChangeNode>(currentTree, (node) =>\n\t\t\t\tconvertNodeDataIds(node, generateId)\n\t\t\t),\n\t\t\tidCompressor,\n\t\t\tinterner: new MutableStringInterner(),\n\t\t\t// This cast is valid because we just constructed this log and gave it only in-session edits.\n\t\t\teditHistory: temporaryLog.getEditLogSummary() as EditLogSummary<ChangeInternal, never>,\n\t\t};\n\t}\n\n\t/**\n\t * Does not preserve (persist) history at all.\n\t * Instead, the history returned in the summary will contain a single edit that creates a revision identical to the supplied view.\n\t * @param stable - Generates the single edit with a stable edit ID. False by default, used for testing.\n\t */\n\tprivate noHistorySummarizer<TChange>(\n\t\t_edits: EditLog<TChange>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tconst currentTree = getChangeNode_0_0_2FromView(currentView, idConverter);\n\t\tconst changes: ChangeInternal_0_0_2[] = [];\n\t\t// Generate a set of changes to set the root node's children to that of the root in the currentTree\n\t\tObject.entries(currentTree.traits).forEach(([label, children]) => {\n\t\t\tconst id = 0 as DetachedSequenceId;\n\t\t\tchanges.push(\n\t\t\t\t{ type: ChangeTypeInternal.Build, source: children, destination: id },\n\t\t\t\t{\n\t\t\t\t\ttype: ChangeTypeInternal.Insert,\n\t\t\t\t\tsource: id,\n\t\t\t\t\tdestination: {\n\t\t\t\t\t\tside: Side.After,\n\t\t\t\t\t\treferenceTrait: { label: label as TraitLabel, parent: initialTree.identifier },\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tif (currentTree.payload !== undefined) {\n\t\t\tchanges.push({\n\t\t\t\ttype: ChangeTypeInternal.SetValue,\n\t\t\t\tnodeToModify: initialTree.identifier,\n\t\t\t\tpayload: currentTree.payload,\n\t\t\t});\n\t\t}\n\n\t\tassert(\n\t\t\tcurrentTree.identifier === initialTree.identifier && currentTree.definition === initialTree.definition,\n\t\t\t'root definition and identifier should be immutable.'\n\t\t);\n\t\tconst edit = newEdit(changes);\n\n\t\treturn {\n\t\t\tcurrentTree,\n\t\t\tsequencedEdits: [\n\t\t\t\t{\n\t\t\t\t\tid: edit.id,\n\t\t\t\t\tchanges: edit.changes,\n\t\t\t\t},\n\t\t\t],\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n\t/**\n\t * Preserves the full history in the generated summary.\n\t */\n\tprivate fullHistorySummarizer(\n\t\tedits: EditLog<ChangeInternal>,\n\t\tcurrentView: RevisionView,\n\t\tidConverter: NodeIdConverter\n\t): SharedTreeSummary_0_0_2 {\n\t\tconst { editChunks, editIds } = edits.getEditLogSummary();\n\n\t\tconst sequencedEdits: Edit<ChangeInternal_0_0_2>[] = [];\n\t\tlet idIndex = 0;\n\t\teditChunks.forEach(({ chunk }) => {\n\t\t\tif (isEditHandle(chunk)) {\n\t\t\t\tfail('Cannot write handles to summary version 0.0.2');\n\t\t\t} else {\n\t\t\t\tchunk.forEach(({ changes }) => {\n\t\t\t\t\tsequencedEdits.push(\n\t\t\t\t\t\tconvertEditIds(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchanges,\n\t\t\t\t\t\t\t\tid: editIds[idIndex++] ?? fail('Number of edits should match number of edit IDs.'),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t(id) => idConverter.convertToStableNodeId(id)\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tcurrentTree: getChangeNode_0_0_2FromView(currentView, idConverter),\n\t\t\tsequencedEdits,\n\t\t\tversion: WriteFormat.v0_0_2,\n\t\t};\n\t}\n}\n\nfunction isEditHandle(chunk: FluidEditHandle | readonly EditWithoutId<unknown>[]): chunk is FluidEditHandle {\n\treturn !Array.isArray(chunk);\n}\n"]}
@@ -0,0 +1,46 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { InternedStringId } from './Identifiers';
6
+ /**
7
+ * Interns strings as integers.
8
+ */
9
+ export interface StringInterner {
10
+ getInternedId(input: string): InternedStringId | undefined;
11
+ getString(internedId: number): string;
12
+ getSerializable(): readonly string[];
13
+ }
14
+ /**
15
+ * Interns strings as integers.
16
+ * Given a string, this class will produce a unique integer associated with that string that can then be used to retrieve the string.
17
+ */
18
+ export declare class MutableStringInterner implements StringInterner {
19
+ private readonly stringToInternedIdMap;
20
+ private readonly internedStrings;
21
+ /**
22
+ * @param inputStrings - A list of strings to intern in the order given. Can be used to rehydrate from a previous
23
+ * `StringInterner`'s {@link StringInterner.getSerializable} return value.
24
+ */
25
+ constructor(inputStrings?: readonly string[]);
26
+ /**
27
+ * @param input - The string to get the associated intern ID for
28
+ * @returns an intern ID that is uniquely associated with the input string
29
+ */
30
+ getOrCreateInternedId(input: string): InternedStringId;
31
+ getInternedId(input: string): InternedStringId | undefined;
32
+ /**
33
+ *
34
+ * @param internId - The intern ID to get the associated string for. Can only retrieve strings that have been used as inputs to
35
+ * calls of `getInternId`.
36
+ * @returns a string that is uniquely associated with the given intern ID
37
+ */
38
+ getString(internId: number): string;
39
+ /**
40
+ * @returns the list of strings interned where the indices map to the associated {@link InternedStringId} of each string
41
+ */
42
+ getSerializable(): readonly string[];
43
+ /** Create a new interned id. Assumes without validation that the input doesn't already have an interned id. */
44
+ private createNewId;
45
+ }
46
+ //# sourceMappingURL=StringInterner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringInterner.d.ts","sourceRoot":"","sources":["../src/StringInterner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAC3D,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,eAAe,IAAI,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IAC3D,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAuC;IAC7E,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgB;IAEhD;;;OAGG;gBACS,YAAY,GAAE,SAAS,MAAM,EAAO;IAMhD;;;OAGG;IACI,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB;IAItD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAIjE;;;;;OAKG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI1C;;OAEG;IACI,eAAe,IAAI,SAAS,MAAM,EAAE;IAI3C,+GAA+G;IAC/G,OAAO,CAAC,WAAW;CAMnB"}
@@ -0,0 +1,57 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { fail } from './Common';
6
+ /**
7
+ * Interns strings as integers.
8
+ * Given a string, this class will produce a unique integer associated with that string that can then be used to retrieve the string.
9
+ */
10
+ export class MutableStringInterner {
11
+ /**
12
+ * @param inputStrings - A list of strings to intern in the order given. Can be used to rehydrate from a previous
13
+ * `StringInterner`'s {@link StringInterner.getSerializable} return value.
14
+ */
15
+ constructor(inputStrings = []) {
16
+ this.stringToInternedIdMap = new Map();
17
+ this.internedStrings = [];
18
+ for (const value of inputStrings) {
19
+ this.getOrCreateInternedId(value);
20
+ }
21
+ }
22
+ /**
23
+ * @param input - The string to get the associated intern ID for
24
+ * @returns an intern ID that is uniquely associated with the input string
25
+ */
26
+ getOrCreateInternedId(input) {
27
+ var _a;
28
+ return (_a = this.getInternedId(input)) !== null && _a !== void 0 ? _a : this.createNewId(input);
29
+ }
30
+ getInternedId(input) {
31
+ return this.stringToInternedIdMap.get(input);
32
+ }
33
+ /**
34
+ *
35
+ * @param internId - The intern ID to get the associated string for. Can only retrieve strings that have been used as inputs to
36
+ * calls of `getInternId`.
37
+ * @returns a string that is uniquely associated with the given intern ID
38
+ */
39
+ getString(internId) {
40
+ var _a;
41
+ return (_a = this.internedStrings[internId]) !== null && _a !== void 0 ? _a : fail(`No string associated with ${internId}.`);
42
+ }
43
+ /**
44
+ * @returns the list of strings interned where the indices map to the associated {@link InternedStringId} of each string
45
+ */
46
+ getSerializable() {
47
+ return this.internedStrings;
48
+ }
49
+ /** Create a new interned id. Assumes without validation that the input doesn't already have an interned id. */
50
+ createNewId(input) {
51
+ const internedId = this.stringToInternedIdMap.size;
52
+ this.stringToInternedIdMap.set(input, internedId);
53
+ this.internedStrings.push(input);
54
+ return internedId;
55
+ }
56
+ }
57
+ //# sourceMappingURL=StringInterner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StringInterner.js","sourceRoot":"","sources":["../src/StringInterner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAYhC;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IAIjC;;;OAGG;IACH,YAAY,eAAkC,EAAE;QAP/B,0BAAqB,GAAG,IAAI,GAAG,EAA4B,CAAC;QAC5D,oBAAe,GAAa,EAAE,CAAC;QAO/C,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;YACjC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;SAClC;IACF,CAAC;IAED;;;OAGG;IACI,qBAAqB,CAAC,KAAa;;QACzC,aAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,mCAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;IAEM,aAAa,CAAC,KAAa;QACjC,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,QAAgB;;QAChC,aAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,mCAAI,IAAI,CAAC,6BAA6B,QAAQ,GAAG,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACI,eAAe;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAED,+GAA+G;IACvG,WAAW,CAAC,KAAa;QAChC,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAwB,CAAC;QACvE,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAClD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,UAAU,CAAC;IACnB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from './Common';\nimport type { InternedStringId } from './Identifiers';\n\n/**\n * Interns strings as integers.\n */\nexport interface StringInterner {\n\tgetInternedId(input: string): InternedStringId | undefined;\n\tgetString(internedId: number): string;\n\tgetSerializable(): readonly string[];\n}\n\n/**\n * Interns strings as integers.\n * Given a string, this class will produce a unique integer associated with that string that can then be used to retrieve the string.\n */\nexport class MutableStringInterner implements StringInterner {\n\tprivate readonly stringToInternedIdMap = new Map<string, InternedStringId>();\n\tprivate readonly internedStrings: string[] = [];\n\n\t/**\n\t * @param inputStrings - A list of strings to intern in the order given. Can be used to rehydrate from a previous\n\t * `StringInterner`'s {@link StringInterner.getSerializable} return value.\n\t */\n\tconstructor(inputStrings: readonly string[] = []) {\n\t\tfor (const value of inputStrings) {\n\t\t\tthis.getOrCreateInternedId(value);\n\t\t}\n\t}\n\n\t/**\n\t * @param input - The string to get the associated intern ID for\n\t * @returns an intern ID that is uniquely associated with the input string\n\t */\n\tpublic getOrCreateInternedId(input: string): InternedStringId {\n\t\treturn this.getInternedId(input) ?? this.createNewId(input);\n\t}\n\n\tpublic getInternedId(input: string): InternedStringId | undefined {\n\t\treturn this.stringToInternedIdMap.get(input);\n\t}\n\n\t/**\n\t *\n\t * @param internId - The intern ID to get the associated string for. Can only retrieve strings that have been used as inputs to\n\t * calls of `getInternId`.\n\t * @returns a string that is uniquely associated with the given intern ID\n\t */\n\tpublic getString(internId: number): string {\n\t\treturn this.internedStrings[internId] ?? fail(`No string associated with ${internId}.`);\n\t}\n\n\t/**\n\t * @returns the list of strings interned where the indices map to the associated {@link InternedStringId} of each string\n\t */\n\tpublic getSerializable(): readonly string[] {\n\t\treturn this.internedStrings;\n\t}\n\n\t/** Create a new interned id. Assumes without validation that the input doesn't already have an interned id. */\n\tprivate createNewId(input: string): InternedStringId {\n\t\tconst internedId = this.stringToInternedIdMap.size as InternedStringId;\n\t\tthis.stringToInternedIdMap.set(input, internedId);\n\t\tthis.internedStrings.push(input);\n\t\treturn internedId;\n\t}\n}\n"]}
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { IFluidHandle } from '@fluidframework/core-interfaces';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import type { IdCompressor } from './id-compressor';
8
+ import type { EditLogSummary, SharedTreeSummaryBase, ChangeNode, ChangeInternal } from './persisted-types';
9
+ import type { EditHandle } from './EditLog';
10
+ import type { MutableStringInterner } from './StringInterner';
11
+ /**
12
+ * The contents of a SharedTree summary, converted to a common internal format that can be
13
+ * loaded into a SharedTree.
14
+ * @internal
15
+ */
16
+ export interface SummaryContents {
17
+ readonly currentTree?: ChangeNode;
18
+ /**
19
+ * Information that can populate an edit log.
20
+ */
21
+ readonly editHistory: EditLogSummary<ChangeInternal, EditHandle<ChangeInternal>>;
22
+ /**
23
+ * Information about all IDs compressed in the summary
24
+ */
25
+ readonly idCompressor: IdCompressor;
26
+ /**
27
+ * Interner pre-loaded with all definitions and labels from the summary.
28
+ */
29
+ readonly interner: MutableStringInterner;
30
+ }
31
+ /**
32
+ * Serializes a SharedTree summary into a JSON string. This may later be used to initialize a SharedTree's state via `deserialize()`
33
+ * Also replaces handle objects with their serialized form.
34
+ *
35
+ * @param summary - The SharedTree summary to serialize.
36
+ * @param serializer - The serializer required to serialize handles in the summary.
37
+ * @param bind - The object handle required to serialize handles in the summary
38
+ */
39
+ export declare function serialize(summary: SharedTreeSummaryBase, serializer: IFluidSerializer, bind: IFluidHandle): string;
40
+ //# sourceMappingURL=Summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../src/Summary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,oCAAoC,CAAC;AAExF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC,cAAc,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjF;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAElH"}
package/lib/Summary.js ADDED
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { serializeHandles } from '@fluidframework/shared-object-base';
6
+ import { fail } from './Common';
7
+ /**
8
+ * Serializes a SharedTree summary into a JSON string. This may later be used to initialize a SharedTree's state via `deserialize()`
9
+ * Also replaces handle objects with their serialized form.
10
+ *
11
+ * @param summary - The SharedTree summary to serialize.
12
+ * @param serializer - The serializer required to serialize handles in the summary.
13
+ * @param bind - The object handle required to serialize handles in the summary
14
+ */
15
+ export function serialize(summary, serializer, bind) {
16
+ var _a;
17
+ return (_a = serializeHandles(summary, serializer, bind)) !== null && _a !== void 0 ? _a : fail();
18
+ }
19
+ //# sourceMappingURL=Summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Summary.js","sourceRoot":"","sources":["../src/Summary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAoB,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AA8BhC;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,OAA8B,EAAE,UAA4B,EAAE,IAAkB;;IACzG,aAAO,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,mCAAI,IAAI,EAAE,CAAC;AAC9D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from '@fluidframework/core-interfaces';\nimport { IFluidSerializer, serializeHandles } from '@fluidframework/shared-object-base';\nimport { fail } from './Common';\nimport type { IdCompressor } from './id-compressor';\nimport type { EditLogSummary, SharedTreeSummaryBase, ChangeNode, ChangeInternal } from './persisted-types';\nimport type { EditHandle } from './EditLog';\nimport type { MutableStringInterner } from './StringInterner';\n\n/**\n * The contents of a SharedTree summary, converted to a common internal format that can be\n * loaded into a SharedTree.\n * @internal\n */\nexport interface SummaryContents {\n\treadonly currentTree?: ChangeNode;\n\n\t/**\n\t * Information that can populate an edit log.\n\t */\n\treadonly editHistory: EditLogSummary<ChangeInternal, EditHandle<ChangeInternal>>;\n\n\t/**\n\t * Information about all IDs compressed in the summary\n\t */\n\treadonly idCompressor: IdCompressor;\n\n\t/**\n\t * Interner pre-loaded with all definitions and labels from the summary.\n\t */\n\treadonly interner: MutableStringInterner;\n}\n\n/**\n * Serializes a SharedTree summary into a JSON string. This may later be used to initialize a SharedTree's state via `deserialize()`\n * Also replaces handle objects with their serialized form.\n *\n * @param summary - The SharedTree summary to serialize.\n * @param serializer - The serializer required to serialize handles in the summary.\n * @param bind - The object handle required to serialize handles in the summary\n */\nexport function serialize(summary: SharedTreeSummaryBase, serializer: IFluidSerializer, bind: IFluidHandle): string {\n\treturn serializeHandles(summary, serializer, bind) ?? fail();\n}\n"]}
@@ -2,36 +2,36 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IFluidSerializer } from '@fluidframework/shared-object-base';
6
- import { ErrorString } from './Common';
7
- import { ChangeNode, Edit, SharedTreeSummaryBase, SharedTreeSummary } from './generic';
8
- /** The summary format version that is read by SharedTree. */
9
- export declare const readFormatVersion = "0.1.0";
10
- /**
11
- * Legacy summary format currently still used for writing.
12
- * TODO:#49901: Remove export when this format is no longer written.
13
- * @internal
14
- */
15
- export interface SharedTreeSummary_0_0_2<TChange> extends SharedTreeSummaryBase {
16
- readonly currentTree: ChangeNode;
17
- /**
18
- * A list of edits.
19
- */
20
- readonly sequencedEdits: readonly Edit<TChange>[];
21
- }
5
+ import type { ITelemetryProperties } from '@fluidframework/common-definitions';
6
+ import type { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { SharedTreeSummaryBase } from './persisted-types';
22
8
  /**
23
9
  * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.
24
10
  * Also constructs handle objects from their serialized form.
25
11
  *
26
12
  * @param jsonSummary - The string to deserialize.
27
13
  * @param serializer - The serializer required to deserialize handles in the string.
28
- * @returns A SharedTree summary or an ErrorString if the summary could not be interpreted.
14
+ * @returns A SharedTree summary.
15
+ * @throws If the summary could not be interpreted.
29
16
  *
30
17
  */
31
- export declare function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase | ErrorString;
18
+ export declare function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase;
32
19
  /**
33
- * @returns SharedTreeSummary that can be used to initialize a SharedTree, or an ErrorString if the summary could not be converted.
34
- *
20
+ * General statistics about summaries.
21
+ */
22
+ export interface SummaryStatistics extends ITelemetryProperties {
23
+ /** Format version the summary is written in. */
24
+ readonly formatVersion: string;
25
+ /** Number of edits. */
26
+ readonly historySize: number;
27
+ /** Number of edit chunks in the history. */
28
+ readonly totalNumberOfChunks?: number;
29
+ /** Number of chunks in the summary that have handles stored. */
30
+ readonly uploadedChunks?: number;
31
+ }
32
+ /**
33
+ * @returns SummaryStatistics.
34
+ * @throws If statistics could not be obtained from the summary.
35
35
  */
36
- export declare function convertSummaryToReadFormat<TChange>(summary: SharedTreeSummaryBase): SharedTreeSummary<TChange> | ErrorString;
36
+ export declare function getSummaryStatistics(summary: SharedTreeSummaryBase): SummaryStatistics;
37
37
  //# sourceMappingURL=SummaryBackCompatibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryBackCompatibility.d.ts","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEvF,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,UAAU,CAAC;AAEzC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,OAAO,CAAE,SAAQ,qBAAqB;IAC9E,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IAEjC;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;CAClD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,qBAAqB,GAAG,WAAW,CAmBlH;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EACjD,OAAO,EAAE,qBAAqB,GAC5B,iBAAiB,CAAC,OAAO,CAAC,GAAG,WAAW,CA4C1C"}
1
+ {"version":3,"file":"SummaryBackCompatibility.d.ts","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,EAAqB,qBAAqB,EAAwC,MAAM,mBAAmB,CAAC;AAEnH;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,qBAAqB,CAmBpG;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC9D,gDAAgD;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,uBAAuB;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,4CAA4C;IAC5C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,gEAAgE;IAChE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,iBAAiB,CAqCtF"}
@@ -2,16 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { EditLog } from './EditLog';
6
- /** The summary format version that is read by SharedTree. */
7
- export const readFormatVersion = '0.1.0';
5
+ import { fail } from './Common';
6
+ import { getNumberOfHandlesFromEditLogSummary } from './EditLog';
7
+ import { WriteFormat } from './persisted-types';
8
8
  /**
9
9
  * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.
10
10
  * Also constructs handle objects from their serialized form.
11
11
  *
12
12
  * @param jsonSummary - The string to deserialize.
13
13
  * @param serializer - The serializer required to deserialize handles in the string.
14
- * @returns A SharedTree summary or an ErrorString if the summary could not be interpreted.
14
+ * @returns A SharedTree summary.
15
+ * @throws If the summary could not be interpreted.
15
16
  *
16
17
  */
17
18
  export function deserialize(jsonSummary, serializer) {
@@ -20,56 +21,52 @@ export function deserialize(jsonSummary, serializer) {
20
21
  summary = serializer.parse(jsonSummary);
21
22
  }
22
23
  catch (_a) {
23
- return 'Json syntax error in Summary';
24
+ fail('Json syntax error in Summary');
24
25
  }
25
26
  if (typeof summary !== 'object') {
26
- return 'Summary is not an object';
27
+ fail('Summary is not an object');
27
28
  }
28
29
  const { version } = summary;
29
30
  if (version !== undefined) {
30
31
  return Object.assign({ version }, summary);
31
32
  }
32
- return 'Missing fields on summary';
33
+ fail('Missing fields on summary');
33
34
  }
34
35
  /**
35
- * @returns SharedTreeSummary that can be used to initialize a SharedTree, or an ErrorString if the summary could not be converted.
36
- *
36
+ * @returns SummaryStatistics.
37
+ * @throws If statistics could not be obtained from the summary.
37
38
  */
38
- export function convertSummaryToReadFormat(summary) {
39
+ export function getSummaryStatistics(summary) {
39
40
  const { version } = summary;
40
- if (version === readFormatVersion) {
41
- const { currentTree, editHistory } = summary;
41
+ if (version === WriteFormat.v0_1_1) {
42
+ const { editHistory } = summary;
42
43
  if (editHistory !== undefined) {
43
44
  if (typeof editHistory !== 'object') {
44
- return 'Edit history is not an object';
45
+ fail('Edit history is not an object');
45
46
  }
46
47
  const { editChunks, editIds } = editHistory;
47
48
  // TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.
48
49
  if (editChunks !== undefined && editIds !== undefined) {
49
- return { currentTree, editHistory, version };
50
+ return {
51
+ formatVersion: version,
52
+ historySize: editIds.length,
53
+ totalNumberOfChunks: editChunks.length,
54
+ uploadedChunks: getNumberOfHandlesFromEditLogSummary(editHistory),
55
+ };
50
56
  }
57
+ fail('Missing fields on edit log summary');
51
58
  }
52
59
  }
53
- else if (version === '0.0.2') {
54
- const { currentTree, sequencedEdits } = summary;
55
- if (sequencedEdits !== undefined) {
56
- /**
57
- * The number of edits that can safely fit in a blob upload.
58
- */
59
- const maxChunkSize = 1000;
60
- // This saves all of the edits in the summary as part of the first chunk.
61
- const temporaryLog = new EditLog(undefined, undefined, maxChunkSize);
62
- sequencedEdits.forEach((edit) => temporaryLog.addSequencedEdit(edit, { sequenceNumber: 1, referenceSequenceNumber: 0 }));
63
- return {
64
- currentTree,
65
- editHistory: temporaryLog.getEditLogSummary(),
66
- version: readFormatVersion,
67
- };
68
- }
60
+ else if (version === WriteFormat.v0_0_2) {
61
+ const { sequencedEdits } = summary;
62
+ return {
63
+ formatVersion: version,
64
+ historySize: sequencedEdits.length,
65
+ };
69
66
  }
70
67
  else {
71
- return 'Format version is not supported';
68
+ fail('Format version is not supported');
72
69
  }
73
- return 'Missing fields on summary';
70
+ fail('Missing fields on summary');
74
71
  }
75
72
  //# sourceMappingURL=SummaryBackCompatibility.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAgBzC;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI;QACH,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;KACxC;IAAC,WAAM;QACP,OAAO,8BAA8B,CAAC;KACtC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAChC,OAAO,0BAA0B,CAAC;KAClC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1B,uBAAS,OAAO,IAAK,OAAO,EAAG;KAC/B;IAED,OAAO,2BAA2B,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACzC,OAA8B;IAE9B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,iBAAiB,EAAE;QAClC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,OAAqC,CAAC;QAE3E,IAAI,WAAW,KAAK,SAAS,EAAE;YAC9B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;gBACpC,OAAO,+BAA+B,CAAC;aACvC;YAED,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;YAE5C,oHAAoH;YACpH,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE;gBACtD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;aAC7C;SACD;KACD;SAAM,IAAI,OAAO,KAAK,OAAO,EAAE;QAC/B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,OAA2C,CAAC;QAEpF,IAAI,cAAc,KAAK,SAAS,EAAE;YACjC;;eAEG;YACH,MAAM,YAAY,GAAG,IAAI,CAAC;YAE1B,yEAAyE;YACzE,MAAM,YAAY,GAAG,IAAI,OAAO,CAAU,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;YAC9E,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAC/B,YAAY,CAAC,gBAAgB,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,uBAAuB,EAAE,CAAC,EAAE,CAAC,CACtF,CAAC;YAEF,OAAO;gBACN,WAAW;gBACX,WAAW,EAAE,YAAY,CAAC,iBAAiB,EAAE;gBAC7C,OAAO,EAAE,iBAAiB;aAC1B,CAAC;SACF;KACD;SAAM;QACN,OAAO,iCAAiC,CAAC;KACzC;IAED,OAAO,2BAA2B,CAAC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidSerializer } from '@fluidframework/shared-object-base';\nimport { ErrorString } from './Common';\nimport { EditLog } from './EditLog';\nimport { ChangeNode, Edit, SharedTreeSummaryBase, SharedTreeSummary } from './generic';\n\n/** The summary format version that is read by SharedTree. */\nexport const readFormatVersion = '0.1.0';\n\n/**\n * Legacy summary format currently still used for writing.\n * TODO:#49901: Remove export when this format is no longer written.\n * @internal\n */\nexport interface SharedTreeSummary_0_0_2<TChange> extends SharedTreeSummaryBase {\n\treadonly currentTree: ChangeNode;\n\n\t/**\n\t * A list of edits.\n\t */\n\treadonly sequencedEdits: readonly Edit<TChange>[];\n}\n\n/**\n * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.\n * Also constructs handle objects from their serialized form.\n *\n * @param jsonSummary - The string to deserialize.\n * @param serializer - The serializer required to deserialize handles in the string.\n * @returns A SharedTree summary or an ErrorString if the summary could not be interpreted.\n *\n */\nexport function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase | ErrorString {\n\tlet summary: Partial<SharedTreeSummaryBase>;\n\ttry {\n\t\tsummary = serializer.parse(jsonSummary);\n\t} catch {\n\t\treturn 'Json syntax error in Summary';\n\t}\n\n\tif (typeof summary !== 'object') {\n\t\treturn 'Summary is not an object';\n\t}\n\n\tconst { version } = summary;\n\n\tif (version !== undefined) {\n\t\treturn { version, ...summary };\n\t}\n\n\treturn 'Missing fields on summary';\n}\n\n/**\n * @returns SharedTreeSummary that can be used to initialize a SharedTree, or an ErrorString if the summary could not be converted.\n *\n */\nexport function convertSummaryToReadFormat<TChange>(\n\tsummary: SharedTreeSummaryBase\n): SharedTreeSummary<TChange> | ErrorString {\n\tconst { version } = summary;\n\n\tif (version === readFormatVersion) {\n\t\tconst { currentTree, editHistory } = summary as SharedTreeSummary<TChange>;\n\n\t\tif (editHistory !== undefined) {\n\t\t\tif (typeof editHistory !== 'object') {\n\t\t\t\treturn 'Edit history is not an object';\n\t\t\t}\n\n\t\t\tconst { editChunks, editIds } = editHistory;\n\n\t\t\t// TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.\n\t\t\tif (editChunks !== undefined && editIds !== undefined) {\n\t\t\t\treturn { currentTree, editHistory, version };\n\t\t\t}\n\t\t}\n\t} else if (version === '0.0.2') {\n\t\tconst { currentTree, sequencedEdits } = summary as SharedTreeSummary_0_0_2<TChange>;\n\n\t\tif (sequencedEdits !== undefined) {\n\t\t\t/**\n\t\t\t * The number of edits that can safely fit in a blob upload.\n\t\t\t */\n\t\t\tconst maxChunkSize = 1000;\n\n\t\t\t// This saves all of the edits in the summary as part of the first chunk.\n\t\t\tconst temporaryLog = new EditLog<TChange>(undefined, undefined, maxChunkSize);\n\t\t\tsequencedEdits.forEach((edit) =>\n\t\t\t\ttemporaryLog.addSequencedEdit(edit, { sequenceNumber: 1, referenceSequenceNumber: 0 })\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tcurrentTree,\n\t\t\t\teditHistory: temporaryLog.getEditLogSummary(),\n\t\t\t\tversion: readFormatVersion,\n\t\t\t};\n\t\t}\n\t} else {\n\t\treturn 'Format version is not supported';\n\t}\n\n\treturn 'Missing fields on summary';\n}\n"]}
1
+ {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,oCAAoC,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAqE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnH;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI;QACH,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;KACxC;IAAC,WAAM;QACP,IAAI,CAAC,8BAA8B,CAAC,CAAC;KACrC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAChC,IAAI,CAAC,0BAA0B,CAAC,CAAC;KACjC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1B,uBAAS,OAAO,IAAK,OAAO,EAAG;KAC/B;IAED,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AAgBD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,WAAW,CAAC,MAAM,EAAE;QACnC,MAAM,EAAE,WAAW,EAAE,GAAG,OAA4B,CAAC;QAErD,IAAI,WAAW,KAAK,SAAS,EAAE;YAC9B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;gBACpC,IAAI,CAAC,+BAA+B,CAAC,CAAC;aACtC;YAED,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;YAE5C,oHAAoH;YACpH,IAAI,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAAE;gBACtD,OAAO;oBACN,aAAa,EAAE,OAAO;oBACtB,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,mBAAmB,EAAE,UAAU,CAAC,MAAM;oBACtC,cAAc,EAAE,oCAAoC,CAAC,WAAW,CAAC;iBACjE,CAAC;aACF;YAED,IAAI,CAAC,oCAAoC,CAAC,CAAC;SAC3C;KACD;SAAM,IAAI,OAAO,KAAK,WAAW,CAAC,MAAM,EAAE;QAC1C,MAAM,EAAE,cAAc,EAAE,GAAG,OAAkC,CAAC;QAE9D,OAAO;YACN,aAAa,EAAE,OAAO;YACtB,WAAW,EAAE,cAAc,CAAC,MAAM;SAClC,CAAC;KACF;SAAM;QACN,IAAI,CAAC,iCAAiC,CAAC,CAAC;KACxC;IAED,IAAI,CAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryProperties } from '@fluidframework/common-definitions';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base';\nimport { fail } from './Common';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog';\nimport { SharedTreeSummary, SharedTreeSummaryBase, SharedTreeSummary_0_0_2, WriteFormat } from './persisted-types';\n\n/**\n * Deserializes a JSON object produced by `serialize()` and uses it to initialize the tree with the encoded state.\n * Also constructs handle objects from their serialized form.\n *\n * @param jsonSummary - The string to deserialize.\n * @param serializer - The serializer required to deserialize handles in the string.\n * @returns A SharedTree summary.\n * @throws If the summary could not be interpreted.\n *\n */\nexport function deserialize(jsonSummary: string, serializer: IFluidSerializer): SharedTreeSummaryBase {\n\tlet summary: Partial<SharedTreeSummaryBase>;\n\ttry {\n\t\tsummary = serializer.parse(jsonSummary);\n\t} catch {\n\t\tfail('Json syntax error in Summary');\n\t}\n\n\tif (typeof summary !== 'object') {\n\t\tfail('Summary is not an object');\n\t}\n\n\tconst { version } = summary;\n\n\tif (version !== undefined) {\n\t\treturn { version, ...summary };\n\t}\n\n\tfail('Missing fields on summary');\n}\n\n/**\n * General statistics about summaries.\n */\nexport interface SummaryStatistics extends ITelemetryProperties {\n\t/** Format version the summary is written in. */\n\treadonly formatVersion: string;\n\t/** Number of edits. */\n\treadonly historySize: number;\n\t/** Number of edit chunks in the history. */\n\treadonly totalNumberOfChunks?: number;\n\t/** Number of chunks in the summary that have handles stored. */\n\treadonly uploadedChunks?: number;\n}\n\n/**\n * @returns SummaryStatistics.\n * @throws If statistics could not be obtained from the summary.\n */\nexport function getSummaryStatistics(summary: SharedTreeSummaryBase): SummaryStatistics {\n\tconst { version } = summary;\n\n\tif (version === WriteFormat.v0_1_1) {\n\t\tconst { editHistory } = summary as SharedTreeSummary;\n\n\t\tif (editHistory !== undefined) {\n\t\t\tif (typeof editHistory !== 'object') {\n\t\t\t\tfail('Edit history is not an object');\n\t\t\t}\n\n\t\t\tconst { editChunks, editIds } = editHistory;\n\n\t\t\t// TODO:#45414: Add more robust validation of the summary's fields. Even if they are present, they may be malformed.\n\t\t\tif (editChunks !== undefined && editIds !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\tformatVersion: version,\n\t\t\t\t\thistorySize: editIds.length,\n\t\t\t\t\ttotalNumberOfChunks: editChunks.length,\n\t\t\t\t\tuploadedChunks: getNumberOfHandlesFromEditLogSummary(editHistory),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfail('Missing fields on edit log summary');\n\t\t}\n\t} else if (version === WriteFormat.v0_0_2) {\n\t\tconst { sequencedEdits } = summary as SharedTreeSummary_0_0_2;\n\n\t\treturn {\n\t\t\tformatVersion: version,\n\t\t\thistorySize: sequencedEdits.length,\n\t\t};\n\t} else {\n\t\tfail('Format version is not supported');\n\t}\n\n\tfail('Missing fields on summary');\n}\n"]}
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import type { EditChunkContents } from './persisted-types';
6
+ import type { SharedTree } from './SharedTree';
7
+ /**
8
+ * Format used for exporting an uploaded edit chunk and its associated handle path. Primarily used for testing SharedTree summaries.
9
+ * @public
10
+ */
11
+ export interface UploadedEditChunkContents {
12
+ /**
13
+ * The handle path associated with the edit chunk.
14
+ */
15
+ absolutePath: string;
16
+ /**
17
+ * The edits uploaded as part of the edit chunk.
18
+ */
19
+ chunkContents: EditChunkContents;
20
+ }
21
+ /**
22
+ * Returns a list of blob paths and their associated contents for all uploaded edit chunks in the given edit log, in order of edit sequence numbers.
23
+ * The contents will not be decoded from the format used in the blob.
24
+ */
25
+ export declare function getUploadedEditChunkContents(sharedTree: SharedTree): Promise<UploadedEditChunkContents[]>;
26
+ /**
27
+ * Returns a serialized description of blob paths and their associated contents for all uploaded edit chunks in the given edit log.
28
+ * @public
29
+ */
30
+ export declare function getSerializedUploadedEditChunkContents(sharedTree: SharedTree): Promise<string>;
31
+ //# sourceMappingURL=SummaryTestUtilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummaryTestUtilities.d.ts","sourceRoot":"","sources":["../src/SummaryTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAkB,iBAAiB,EAAmB,MAAM,mBAAmB,CAAC;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,EAAE,iBAAiB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAgB/G;AAED;;;GAGG;AACH,wBAAsB,sCAAsC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpG"}
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { IsoBuffer } from '@fluidframework/common-utils';
6
+ /**
7
+ * Returns a list of blob paths and their associated contents for all uploaded edit chunks in the given edit log, in order of edit sequence numbers.
8
+ * The contents will not be decoded from the format used in the blob.
9
+ */
10
+ export async function getUploadedEditChunkContents(sharedTree) {
11
+ const editChunks = [];
12
+ const { editChunks: editsOrHandles } = sharedTree.edits.getEditLogSummary();
13
+ for (const { chunk } of editsOrHandles) {
14
+ if (!Array.isArray(chunk)) {
15
+ const handle = chunk;
16
+ const chunkContents = JSON.parse(IsoBuffer.from(await handle.get()).toString());
17
+ editChunks.push({
18
+ absolutePath: handle.absolutePath,
19
+ chunkContents,
20
+ });
21
+ }
22
+ }
23
+ return editChunks;
24
+ }
25
+ /**
26
+ * Returns a serialized description of blob paths and their associated contents for all uploaded edit chunks in the given edit log.
27
+ * @public
28
+ */
29
+ export async function getSerializedUploadedEditChunkContents(sharedTree) {
30
+ return JSON.stringify(await getUploadedEditChunkContents(sharedTree));
31
+ }
32
+ //# sourceMappingURL=SummaryTestUtilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummaryTestUtilities.js","sourceRoot":"","sources":["../src/SummaryTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAoBzD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,UAAsB;IACxE,MAAM,UAAU,GAAgC,EAAE,CAAC;IACnD,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAI,UAAU,CAAC,KAAiC,CAAC,iBAAiB,EAAE,CAAC;IACzG,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,cAAc,EAAE;QACvC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAC1B,MAAM,MAAM,GAAG,KAAwB,CAAC;YAExC,MAAM,aAAa,GAAsB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;YACnG,UAAU,CAAC,IAAI,CAAC;gBACf,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,aAAa;aACb,CAAC,CAAC;SACH;KACD;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAAC,UAAsB;IAClF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,4BAA4B,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluidframework/common-utils';\nimport type { EditLog } from './EditLog';\nimport type { ChangeInternal, EditChunkContents, FluidEditHandle } from './persisted-types';\nimport type { SharedTree } from './SharedTree';\n\n/**\n * Format used for exporting an uploaded edit chunk and its associated handle path. Primarily used for testing SharedTree summaries.\n * @public\n */\nexport interface UploadedEditChunkContents {\n\t/**\n\t * The handle path associated with the edit chunk.\n\t */\n\tabsolutePath: string;\n\t/**\n\t * The edits uploaded as part of the edit chunk.\n\t */\n\tchunkContents: EditChunkContents;\n}\n\n/**\n * Returns a list of blob paths and their associated contents for all uploaded edit chunks in the given edit log, in order of edit sequence numbers.\n * The contents will not be decoded from the format used in the blob.\n */\nexport async function getUploadedEditChunkContents(sharedTree: SharedTree): Promise<UploadedEditChunkContents[]> {\n\tconst editChunks: UploadedEditChunkContents[] = [];\n\tconst { editChunks: editsOrHandles } = (sharedTree.edits as EditLog<ChangeInternal>).getEditLogSummary();\n\tfor (const { chunk } of editsOrHandles) {\n\t\tif (!Array.isArray(chunk)) {\n\t\t\tconst handle = chunk as FluidEditHandle;\n\n\t\t\tconst chunkContents: EditChunkContents = JSON.parse(IsoBuffer.from(await handle.get()).toString());\n\t\t\teditChunks.push({\n\t\t\t\tabsolutePath: handle.absolutePath,\n\t\t\t\tchunkContents,\n\t\t\t});\n\t\t}\n\t}\n\n\treturn editChunks;\n}\n\n/**\n * Returns a serialized description of blob paths and their associated contents for all uploaded edit chunks in the given edit log.\n * @public\n */\nexport async function getSerializedUploadedEditChunkContents(sharedTree: SharedTree): Promise<string> {\n\treturn JSON.stringify(await getUploadedEditChunkContents(sharedTree));\n}\n"]}
@@ -0,0 +1,71 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { IErrorEvent } from '@fluidframework/common-definitions';
6
+ import { TypedEventEmitter } from '@fluidframework/common-utils';
7
+ import { EditStatus } from './persisted-types';
8
+ import { TreeView } from './TreeView';
9
+ import { Change } from './ChangeTypes';
10
+ import { SharedTree } from './SharedTree';
11
+ /**
12
+ * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.
13
+ * @public
14
+ */
15
+ export declare enum TransactionEvent {
16
+ /**
17
+ * `currentView` has changed from `before` to `after`
18
+ */
19
+ ViewChange = "viewChange"
20
+ }
21
+ /**
22
+ * Events which may be emitted by `Transaction`
23
+ */
24
+ export interface TransactionEvents extends IErrorEvent {
25
+ (event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void): any;
26
+ }
27
+ /**
28
+ * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a
29
+ * single edit
30
+ */
31
+ export declare class Transaction extends TypedEventEmitter<TransactionEvents> {
32
+ readonly tree: SharedTree;
33
+ /** The view of the tree when this transaction was created */
34
+ readonly startingView: TreeView;
35
+ private readonly transaction;
36
+ /**
37
+ * Create a new transaction over the given tree. The tree's `currentView` at this time will become the `startingView` for this
38
+ * transaction.
39
+ * @param tree - the `SharedTree` that this transaction applies changes to
40
+ */
41
+ constructor(tree: SharedTree);
42
+ /**
43
+ * True if this transaction is open, false if it is closed. A transaction may be closed manually via `closeAndApplyEdit()`, or may
44
+ * be automatically closed by a change in this transaction failing to apply (see `applyChange()`).
45
+ */
46
+ get isOpen(): boolean;
47
+ /**
48
+ * The status of the most recently applied change in this transaction
49
+ */
50
+ get status(): EditStatus;
51
+ /**
52
+ * The state of the tree following the most change that was successfully applied. If no changes have been applied, this is the same as
53
+ * `startingView`.
54
+ */
55
+ get currentView(): TreeView;
56
+ /**
57
+ * Attempt to apply a sequence of changes in this transaction. The `currentView` will be updated to reflect the new tree state after all
58
+ * applied changes. If any change fails to apply, the remaining changes will be ignored and this transaction will be automatically
59
+ * closed (see `isOpen`). If this transaction is already closed, this method has no effect. This method will emit a
60
+ * `TransactionEvent.ViewChange` event at most once per call.
61
+ * @param changes - the changes to apply
62
+ * @returns either the `EditStatus` of the given changes or the `EditStatus` of the last change before the transaction was closed
63
+ */
64
+ apply(...changes: Change[]): EditStatus;
65
+ apply(changes: Change[]): EditStatus;
66
+ /**
67
+ * Close this transaction and apply its changes to the `SharedTree`. If this transaction is already closed, this method has no effect.
68
+ */
69
+ closeAndCommit(): void;
70
+ }
71
+ //# sourceMappingURL=Transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../src/Transaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAwB,UAA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