@fluid-experimental/tree 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.0

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 (571) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/experimental-tree.api.md +2 -2
  3. package/dist/ChangeCompression.d.ts +2 -2
  4. package/dist/ChangeCompression.d.ts.map +1 -1
  5. package/dist/ChangeCompression.js +1 -1
  6. package/dist/ChangeCompression.js.map +1 -1
  7. package/dist/ChangeTypes.d.ts +1 -1
  8. package/dist/ChangeTypes.d.ts.map +1 -1
  9. package/dist/ChangeTypes.js +4 -4
  10. package/dist/ChangeTypes.js.map +1 -1
  11. package/dist/Checkout.d.ts +3 -3
  12. package/dist/Checkout.d.ts.map +1 -1
  13. package/dist/Checkout.js +17 -17
  14. package/dist/Checkout.js.map +1 -1
  15. package/dist/EditLog.d.ts +1 -1
  16. package/dist/EditLog.d.ts.map +1 -1
  17. package/dist/EditLog.js +9 -9
  18. package/dist/EditLog.js.map +1 -1
  19. package/dist/EditUtilities.d.ts +3 -3
  20. package/dist/EditUtilities.d.ts.map +1 -1
  21. package/dist/EditUtilities.js +6 -6
  22. package/dist/EditUtilities.js.map +1 -1
  23. package/dist/Forest.d.ts.map +1 -1
  24. package/dist/Forest.js +23 -23
  25. package/dist/Forest.js.map +1 -1
  26. package/dist/HistoryEditFactory.d.ts +1 -1
  27. package/dist/HistoryEditFactory.d.ts.map +1 -1
  28. package/dist/HistoryEditFactory.js +7 -7
  29. package/dist/HistoryEditFactory.js.map +1 -1
  30. package/dist/IdConversion.d.ts.map +1 -1
  31. package/dist/IdConversion.js.map +1 -1
  32. package/dist/LogViewer.d.ts +2 -2
  33. package/dist/LogViewer.d.ts.map +1 -1
  34. package/dist/LogViewer.js +7 -7
  35. package/dist/LogViewer.js.map +1 -1
  36. package/dist/MergeHealth.d.ts.map +1 -1
  37. package/dist/MergeHealth.js +1 -1
  38. package/dist/MergeHealth.js.map +1 -1
  39. package/dist/NodeIdUtilities.d.ts +1 -1
  40. package/dist/NodeIdUtilities.d.ts.map +1 -1
  41. package/dist/NodeIdUtilities.js +1 -1
  42. package/dist/NodeIdUtilities.js.map +1 -1
  43. package/dist/PayloadUtilities.d.ts.map +1 -1
  44. package/dist/PayloadUtilities.js +2 -2
  45. package/dist/PayloadUtilities.js.map +1 -1
  46. package/dist/ReconciliationPath.d.ts +1 -1
  47. package/dist/ReconciliationPath.d.ts.map +1 -1
  48. package/dist/ReconciliationPath.js.map +1 -1
  49. package/dist/RevisionValueCache.d.ts.map +1 -1
  50. package/dist/RevisionValueCache.js +2 -2
  51. package/dist/RevisionValueCache.js.map +1 -1
  52. package/dist/RevisionView.d.ts +2 -2
  53. package/dist/RevisionView.d.ts.map +1 -1
  54. package/dist/RevisionView.js.map +1 -1
  55. package/dist/SerializationUtilities.d.ts +1 -1
  56. package/dist/SerializationUtilities.d.ts.map +1 -1
  57. package/dist/SerializationUtilities.js.map +1 -1
  58. package/dist/SharedTree.d.ts +8 -7
  59. package/dist/SharedTree.d.ts.map +1 -1
  60. package/dist/SharedTree.js +78 -78
  61. package/dist/SharedTree.js.map +1 -1
  62. package/dist/SharedTreeEncoder.d.ts +1 -1
  63. package/dist/SharedTreeEncoder.d.ts.map +1 -1
  64. package/dist/SharedTreeEncoder.js +31 -31
  65. package/dist/SharedTreeEncoder.js.map +1 -1
  66. package/dist/Summary.d.ts +2 -2
  67. package/dist/Summary.d.ts.map +1 -1
  68. package/dist/Summary.js +2 -2
  69. package/dist/Summary.js.map +1 -1
  70. package/dist/SummaryBackCompatibility.d.ts.map +1 -1
  71. package/dist/SummaryBackCompatibility.js.map +1 -1
  72. package/dist/SummaryTestUtilities.d.ts +1 -1
  73. package/dist/SummaryTestUtilities.d.ts.map +1 -1
  74. package/dist/SummaryTestUtilities.js.map +1 -1
  75. package/dist/Transaction.d.ts +3 -3
  76. package/dist/Transaction.d.ts.map +1 -1
  77. package/dist/Transaction.js +3 -3
  78. package/dist/Transaction.js.map +1 -1
  79. package/dist/TransactionInternal.d.ts +3 -3
  80. package/dist/TransactionInternal.d.ts.map +1 -1
  81. package/dist/TransactionInternal.js +6 -6
  82. package/dist/TransactionInternal.js.map +1 -1
  83. package/dist/TreeCompressor.d.ts +5 -1
  84. package/dist/TreeCompressor.d.ts.map +1 -1
  85. package/dist/TreeCompressor.js +5 -5
  86. package/dist/TreeCompressor.js.map +1 -1
  87. package/dist/TreeNodeHandle.d.ts +1 -1
  88. package/dist/TreeNodeHandle.d.ts.map +1 -1
  89. package/dist/TreeNodeHandle.js.map +1 -1
  90. package/dist/TreeView.d.ts +1 -1
  91. package/dist/TreeView.d.ts.map +1 -1
  92. package/dist/TreeView.js +2 -3
  93. package/dist/TreeView.js.map +1 -1
  94. package/dist/UuidUtilities.d.ts.map +1 -1
  95. package/dist/UuidUtilities.js.map +1 -1
  96. package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  97. package/dist/id-compressor/AppendOnlySortedMap.js +3 -3
  98. package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
  99. package/dist/id-compressor/IdCompressor.d.ts +1 -1
  100. package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
  101. package/dist/id-compressor/IdCompressor.js +25 -26
  102. package/dist/id-compressor/IdCompressor.js.map +1 -1
  103. package/dist/id-compressor/IdRange.d.ts.map +1 -1
  104. package/dist/id-compressor/IdRange.js +2 -2
  105. package/dist/id-compressor/IdRange.js.map +1 -1
  106. package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
  107. package/dist/id-compressor/NumericUuid.js +2 -1
  108. package/dist/id-compressor/NumericUuid.js.map +1 -1
  109. package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
  110. package/dist/id-compressor/SessionIdNormalizer.js +8 -9
  111. package/dist/id-compressor/SessionIdNormalizer.js.map +1 -1
  112. package/dist/migration-shim/migrationDeltaHandler.d.ts +1 -1
  113. package/dist/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
  114. package/dist/migration-shim/migrationDeltaHandler.js +11 -11
  115. package/dist/migration-shim/migrationDeltaHandler.js.map +1 -1
  116. package/dist/migration-shim/migrationShim.d.ts +8 -4
  117. package/dist/migration-shim/migrationShim.d.ts.map +1 -1
  118. package/dist/migration-shim/migrationShim.js +13 -13
  119. package/dist/migration-shim/migrationShim.js.map +1 -1
  120. package/dist/migration-shim/migrationShimFactory.d.ts +2 -2
  121. package/dist/migration-shim/migrationShimFactory.d.ts.map +1 -1
  122. package/dist/migration-shim/migrationShimFactory.js +2 -2
  123. package/dist/migration-shim/migrationShimFactory.js.map +1 -1
  124. package/dist/migration-shim/packageVersion.d.ts +0 -2
  125. package/dist/migration-shim/packageVersion.d.ts.map +1 -1
  126. package/dist/migration-shim/packageVersion.js +0 -2
  127. package/dist/migration-shim/packageVersion.js.map +1 -1
  128. package/dist/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
  129. package/dist/migration-shim/sharedTreeDeltaHandler.js +8 -8
  130. package/dist/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
  131. package/dist/migration-shim/sharedTreeShim.d.ts +2 -2
  132. package/dist/migration-shim/sharedTreeShim.d.ts.map +1 -1
  133. package/dist/migration-shim/sharedTreeShim.js +8 -4
  134. package/dist/migration-shim/sharedTreeShim.js.map +1 -1
  135. package/dist/migration-shim/sharedTreeShimFactory.d.ts +1 -1
  136. package/dist/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
  137. package/dist/migration-shim/sharedTreeShimFactory.js +2 -2
  138. package/dist/migration-shim/sharedTreeShimFactory.js.map +1 -1
  139. package/dist/migration-shim/shimChannelServices.d.ts +1 -1
  140. package/dist/migration-shim/shimChannelServices.d.ts.map +1 -1
  141. package/dist/migration-shim/shimChannelServices.js.map +1 -1
  142. package/dist/migration-shim/shimDeltaConnection.d.ts +1 -1
  143. package/dist/migration-shim/shimDeltaConnection.d.ts.map +1 -1
  144. package/dist/migration-shim/shimDeltaConnection.js +2 -2
  145. package/dist/migration-shim/shimDeltaConnection.js.map +1 -1
  146. package/dist/migration-shim/shimHandle.d.ts.map +1 -1
  147. package/dist/migration-shim/shimHandle.js.map +1 -1
  148. package/dist/migration-shim/types.d.ts +1 -1
  149. package/dist/migration-shim/types.d.ts.map +1 -1
  150. package/dist/migration-shim/types.js.map +1 -1
  151. package/dist/migration-shim/utils.d.ts +1 -1
  152. package/dist/migration-shim/utils.d.ts.map +1 -1
  153. package/dist/migration-shim/utils.js.map +1 -1
  154. package/dist/persisted-types/0.0.2.d.ts +1 -1
  155. package/dist/persisted-types/0.0.2.d.ts.map +1 -1
  156. package/dist/persisted-types/0.0.2.js.map +1 -1
  157. package/dist/persisted-types/0.1.1.d.ts +1 -1
  158. package/dist/persisted-types/0.1.1.d.ts.map +1 -1
  159. package/dist/persisted-types/0.1.1.js +3 -3
  160. package/dist/persisted-types/0.1.1.js.map +1 -1
  161. package/lib/ChangeCompression.d.ts +2 -2
  162. package/lib/ChangeCompression.d.ts.map +1 -1
  163. package/lib/ChangeCompression.js +1 -1
  164. package/lib/ChangeCompression.js.map +1 -1
  165. package/lib/ChangeTypes.d.ts +1 -1
  166. package/lib/ChangeTypes.d.ts.map +1 -1
  167. package/lib/ChangeTypes.js +2 -2
  168. package/lib/ChangeTypes.js.map +1 -1
  169. package/lib/Checkout.d.ts +3 -3
  170. package/lib/Checkout.d.ts.map +1 -1
  171. package/lib/Checkout.js +4 -4
  172. package/lib/Checkout.js.map +1 -1
  173. package/lib/EditLog.d.ts +1 -1
  174. package/lib/EditLog.d.ts.map +1 -1
  175. package/lib/EditLog.js +2 -2
  176. package/lib/EditLog.js.map +1 -1
  177. package/lib/EditUtilities.d.ts +3 -3
  178. package/lib/EditUtilities.d.ts.map +1 -1
  179. package/lib/EditUtilities.js +5 -5
  180. package/lib/EditUtilities.js.map +1 -1
  181. package/lib/Forest.d.ts.map +1 -1
  182. package/lib/Forest.js +2 -2
  183. package/lib/Forest.js.map +1 -1
  184. package/lib/HistoryEditFactory.d.ts +1 -1
  185. package/lib/HistoryEditFactory.d.ts.map +1 -1
  186. package/lib/HistoryEditFactory.js +5 -5
  187. package/lib/HistoryEditFactory.js.map +1 -1
  188. package/lib/IdConversion.d.ts.map +1 -1
  189. package/lib/IdConversion.js.map +1 -1
  190. package/lib/LogViewer.d.ts +2 -2
  191. package/lib/LogViewer.d.ts.map +1 -1
  192. package/lib/LogViewer.js +3 -3
  193. package/lib/LogViewer.js.map +1 -1
  194. package/lib/MergeHealth.d.ts.map +1 -1
  195. package/lib/MergeHealth.js +1 -1
  196. package/lib/MergeHealth.js.map +1 -1
  197. package/lib/NodeIdUtilities.d.ts +1 -1
  198. package/lib/NodeIdUtilities.d.ts.map +1 -1
  199. package/lib/NodeIdUtilities.js +1 -1
  200. package/lib/NodeIdUtilities.js.map +1 -1
  201. package/lib/PayloadUtilities.d.ts.map +1 -1
  202. package/lib/PayloadUtilities.js +1 -1
  203. package/lib/PayloadUtilities.js.map +1 -1
  204. package/lib/ReconciliationPath.d.ts +1 -1
  205. package/lib/ReconciliationPath.d.ts.map +1 -1
  206. package/lib/ReconciliationPath.js.map +1 -1
  207. package/lib/RevisionValueCache.d.ts.map +1 -1
  208. package/lib/RevisionValueCache.js +2 -2
  209. package/lib/RevisionValueCache.js.map +1 -1
  210. package/lib/RevisionView.d.ts +2 -2
  211. package/lib/RevisionView.d.ts.map +1 -1
  212. package/lib/RevisionView.js.map +1 -1
  213. package/lib/SerializationUtilities.d.ts +1 -1
  214. package/lib/SerializationUtilities.d.ts.map +1 -1
  215. package/lib/SerializationUtilities.js.map +1 -1
  216. package/lib/SharedTree.d.ts +8 -7
  217. package/lib/SharedTree.d.ts.map +1 -1
  218. package/lib/SharedTree.js +13 -13
  219. package/lib/SharedTree.js.map +1 -1
  220. package/lib/SharedTreeEncoder.d.ts +1 -1
  221. package/lib/SharedTreeEncoder.d.ts.map +1 -1
  222. package/lib/SharedTreeEncoder.js +5 -5
  223. package/lib/SharedTreeEncoder.js.map +1 -1
  224. package/lib/Summary.d.ts +2 -2
  225. package/lib/Summary.d.ts.map +1 -1
  226. package/lib/Summary.js +1 -1
  227. package/lib/Summary.js.map +1 -1
  228. package/lib/SummaryBackCompatibility.d.ts.map +1 -1
  229. package/lib/SummaryBackCompatibility.js.map +1 -1
  230. package/lib/SummaryTestUtilities.d.ts +1 -1
  231. package/lib/SummaryTestUtilities.d.ts.map +1 -1
  232. package/lib/SummaryTestUtilities.js.map +1 -1
  233. package/lib/Transaction.d.ts +3 -3
  234. package/lib/Transaction.d.ts.map +1 -1
  235. package/lib/Transaction.js +3 -3
  236. package/lib/Transaction.js.map +1 -1
  237. package/lib/TransactionInternal.d.ts +3 -3
  238. package/lib/TransactionInternal.d.ts.map +1 -1
  239. package/lib/TransactionInternal.js +3 -3
  240. package/lib/TransactionInternal.js.map +1 -1
  241. package/lib/TreeCompressor.d.ts +5 -1
  242. package/lib/TreeCompressor.d.ts.map +1 -1
  243. package/lib/TreeCompressor.js +2 -2
  244. package/lib/TreeCompressor.js.map +1 -1
  245. package/lib/TreeNodeHandle.d.ts +1 -1
  246. package/lib/TreeNodeHandle.d.ts.map +1 -1
  247. package/lib/TreeNodeHandle.js.map +1 -1
  248. package/lib/TreeView.d.ts +1 -1
  249. package/lib/TreeView.d.ts.map +1 -1
  250. package/lib/TreeView.js +1 -2
  251. package/lib/TreeView.js.map +1 -1
  252. package/lib/UuidUtilities.d.ts.map +1 -1
  253. package/lib/UuidUtilities.js +1 -1
  254. package/lib/UuidUtilities.js.map +1 -1
  255. package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  256. package/lib/id-compressor/AppendOnlySortedMap.js +1 -1
  257. package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
  258. package/lib/id-compressor/IdCompressor.d.ts +1 -1
  259. package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
  260. package/lib/id-compressor/IdCompressor.js +4 -5
  261. package/lib/id-compressor/IdCompressor.js.map +1 -1
  262. package/lib/id-compressor/IdRange.d.ts.map +1 -1
  263. package/lib/id-compressor/IdRange.js +1 -1
  264. package/lib/id-compressor/IdRange.js.map +1 -1
  265. package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
  266. package/lib/id-compressor/NumericUuid.js +2 -1
  267. package/lib/id-compressor/NumericUuid.js.map +1 -1
  268. package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -1
  269. package/lib/id-compressor/SessionIdNormalizer.js +1 -2
  270. package/lib/id-compressor/SessionIdNormalizer.js.map +1 -1
  271. package/lib/migration-shim/migrationDeltaHandler.d.ts +1 -1
  272. package/lib/migration-shim/migrationDeltaHandler.d.ts.map +1 -1
  273. package/lib/migration-shim/migrationDeltaHandler.js +1 -1
  274. package/lib/migration-shim/migrationDeltaHandler.js.map +1 -1
  275. package/lib/migration-shim/migrationShim.d.ts +8 -4
  276. package/lib/migration-shim/migrationShim.d.ts.map +1 -1
  277. package/lib/migration-shim/migrationShim.js +3 -3
  278. package/lib/migration-shim/migrationShim.js.map +1 -1
  279. package/lib/migration-shim/migrationShimFactory.d.ts +2 -2
  280. package/lib/migration-shim/migrationShimFactory.d.ts.map +1 -1
  281. package/lib/migration-shim/migrationShimFactory.js +1 -1
  282. package/lib/migration-shim/migrationShimFactory.js.map +1 -1
  283. package/lib/migration-shim/packageVersion.d.ts +0 -2
  284. package/lib/migration-shim/packageVersion.d.ts.map +1 -1
  285. package/lib/migration-shim/packageVersion.js +0 -2
  286. package/lib/migration-shim/packageVersion.js.map +1 -1
  287. package/lib/migration-shim/sharedTreeDeltaHandler.d.ts.map +1 -1
  288. package/lib/migration-shim/sharedTreeDeltaHandler.js +1 -1
  289. package/lib/migration-shim/sharedTreeDeltaHandler.js.map +1 -1
  290. package/lib/migration-shim/sharedTreeShim.d.ts +2 -2
  291. package/lib/migration-shim/sharedTreeShim.d.ts.map +1 -1
  292. package/lib/migration-shim/sharedTreeShim.js +6 -2
  293. package/lib/migration-shim/sharedTreeShim.js.map +1 -1
  294. package/lib/migration-shim/sharedTreeShimFactory.d.ts +1 -1
  295. package/lib/migration-shim/sharedTreeShimFactory.d.ts.map +1 -1
  296. package/lib/migration-shim/sharedTreeShimFactory.js +1 -1
  297. package/lib/migration-shim/sharedTreeShimFactory.js.map +1 -1
  298. package/lib/migration-shim/shimChannelServices.d.ts +1 -1
  299. package/lib/migration-shim/shimChannelServices.d.ts.map +1 -1
  300. package/lib/migration-shim/shimChannelServices.js.map +1 -1
  301. package/lib/migration-shim/shimDeltaConnection.d.ts +1 -1
  302. package/lib/migration-shim/shimDeltaConnection.d.ts.map +1 -1
  303. package/lib/migration-shim/shimDeltaConnection.js +1 -1
  304. package/lib/migration-shim/shimDeltaConnection.js.map +1 -1
  305. package/lib/migration-shim/shimHandle.d.ts.map +1 -1
  306. package/lib/migration-shim/shimHandle.js.map +1 -1
  307. package/lib/migration-shim/types.d.ts +1 -1
  308. package/lib/migration-shim/types.d.ts.map +1 -1
  309. package/lib/migration-shim/types.js.map +1 -1
  310. package/lib/migration-shim/utils.d.ts +1 -1
  311. package/lib/migration-shim/utils.d.ts.map +1 -1
  312. package/lib/migration-shim/utils.js.map +1 -1
  313. package/lib/persisted-types/0.0.2.d.ts +1 -1
  314. package/lib/persisted-types/0.0.2.d.ts.map +1 -1
  315. package/lib/persisted-types/0.0.2.js.map +1 -1
  316. package/lib/persisted-types/0.1.1.d.ts +1 -1
  317. package/lib/persisted-types/0.1.1.d.ts.map +1 -1
  318. package/lib/persisted-types/0.1.1.js +1 -1
  319. package/lib/persisted-types/0.1.1.js.map +1 -1
  320. package/package.json +33 -32
  321. package/src/ChangeCompression.ts +8 -8
  322. package/src/ChangeTypes.ts +5 -4
  323. package/src/Checkout.ts +9 -7
  324. package/src/EditLog.ts +4 -3
  325. package/src/EditUtilities.ts +9 -8
  326. package/src/Forest.ts +3 -2
  327. package/src/HistoryEditFactory.ts +12 -11
  328. package/src/IdConversion.ts +2 -2
  329. package/src/LogViewer.ts +5 -4
  330. package/src/MergeHealth.ts +2 -1
  331. package/src/NodeIdUtilities.ts +2 -2
  332. package/src/PayloadUtilities.ts +2 -1
  333. package/src/ReconciliationPath.ts +1 -1
  334. package/src/RevisionValueCache.ts +3 -2
  335. package/src/RevisionView.ts +3 -3
  336. package/src/SerializationUtilities.ts +1 -1
  337. package/src/SharedTree.ts +46 -49
  338. package/src/SharedTreeEncoder.ts +30 -29
  339. package/src/Summary.ts +5 -3
  340. package/src/SummaryBackCompatibility.ts +1 -0
  341. package/src/SummaryTestUtilities.ts +2 -1
  342. package/src/Transaction.ts +7 -6
  343. package/src/TransactionInternal.ts +17 -16
  344. package/src/TreeCompressor.ts +6 -4
  345. package/src/TreeNodeHandle.ts +2 -2
  346. package/src/TreeView.ts +3 -3
  347. package/src/UuidUtilities.ts +2 -1
  348. package/src/id-compressor/AppendOnlySortedMap.ts +2 -1
  349. package/src/id-compressor/IdCompressor.ts +18 -17
  350. package/src/id-compressor/IdRange.ts +2 -1
  351. package/src/id-compressor/NumericUuid.ts +1 -1
  352. package/src/id-compressor/SessionIdNormalizer.ts +3 -3
  353. package/src/migration-shim/migrationDeltaHandler.ts +3 -2
  354. package/src/migration-shim/migrationShim.ts +14 -10
  355. package/src/migration-shim/migrationShimFactory.ts +6 -4
  356. package/src/migration-shim/packageVersion.ts +0 -2
  357. package/src/migration-shim/sharedTreeDeltaHandler.ts +3 -2
  358. package/src/migration-shim/sharedTreeShim.ts +7 -5
  359. package/src/migration-shim/sharedTreeShimFactory.ts +3 -3
  360. package/src/migration-shim/shimChannelServices.ts +1 -1
  361. package/src/migration-shim/shimDeltaConnection.ts +3 -2
  362. package/src/migration-shim/shimHandle.ts +1 -0
  363. package/src/migration-shim/types.ts +3 -1
  364. package/src/migration-shim/utils.ts +2 -1
  365. package/src/persisted-types/0.0.2.ts +2 -2
  366. package/src/persisted-types/0.1.1.ts +10 -8
  367. package/dist/tree-alpha.d.ts +0 -2901
  368. package/dist/tree-beta.d.ts +0 -348
  369. package/dist/tree-public.d.ts +0 -348
  370. package/dist/tree-untrimmed.d.ts +0 -3820
  371. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +0 -6
  372. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +0 -1
  373. package/lib/test/AppendOnlySortedMap.perf.tests.js +0 -49
  374. package/lib/test/AppendOnlySortedMap.perf.tests.js.map +0 -1
  375. package/lib/test/AppendOnlySortedMap.tests.d.ts +0 -6
  376. package/lib/test/AppendOnlySortedMap.tests.d.ts.map +0 -1
  377. package/lib/test/AppendOnlySortedMap.tests.js +0 -213
  378. package/lib/test/AppendOnlySortedMap.tests.js.map +0 -1
  379. package/lib/test/ChangeCompression.tests.d.ts +0 -6
  380. package/lib/test/ChangeCompression.tests.d.ts.map +0 -1
  381. package/lib/test/ChangeCompression.tests.js +0 -154
  382. package/lib/test/ChangeCompression.tests.js.map +0 -1
  383. package/lib/test/Checkout.tests.d.ts +0 -10
  384. package/lib/test/Checkout.tests.d.ts.map +0 -1
  385. package/lib/test/Checkout.tests.js +0 -460
  386. package/lib/test/Checkout.tests.js.map +0 -1
  387. package/lib/test/Common.tests.d.ts +0 -6
  388. package/lib/test/Common.tests.d.ts.map +0 -1
  389. package/lib/test/Common.tests.js +0 -102
  390. package/lib/test/Common.tests.js.map +0 -1
  391. package/lib/test/EagerCheckout.tests.d.ts +0 -6
  392. package/lib/test/EagerCheckout.tests.d.ts.map +0 -1
  393. package/lib/test/EagerCheckout.tests.js +0 -20
  394. package/lib/test/EagerCheckout.tests.js.map +0 -1
  395. package/lib/test/Edit.tests.d.ts +0 -6
  396. package/lib/test/Edit.tests.d.ts.map +0 -1
  397. package/lib/test/Edit.tests.js +0 -60
  398. package/lib/test/Edit.tests.js.map +0 -1
  399. package/lib/test/EditLog.perf.tests.d.ts +0 -6
  400. package/lib/test/EditLog.perf.tests.d.ts.map +0 -1
  401. package/lib/test/EditLog.perf.tests.js +0 -41
  402. package/lib/test/EditLog.perf.tests.js.map +0 -1
  403. package/lib/test/EditLog.tests.d.ts +0 -6
  404. package/lib/test/EditLog.tests.d.ts.map +0 -1
  405. package/lib/test/EditLog.tests.js +0 -355
  406. package/lib/test/EditLog.tests.js.map +0 -1
  407. package/lib/test/EditUtilities.tests.d.ts +0 -6
  408. package/lib/test/EditUtilities.tests.d.ts.map +0 -1
  409. package/lib/test/EditUtilities.tests.js +0 -512
  410. package/lib/test/EditUtilities.tests.js.map +0 -1
  411. package/lib/test/Forest.perf.tests.d.ts +0 -6
  412. package/lib/test/Forest.perf.tests.d.ts.map +0 -1
  413. package/lib/test/Forest.perf.tests.js +0 -135
  414. package/lib/test/Forest.perf.tests.js.map +0 -1
  415. package/lib/test/Forest.tests.d.ts +0 -6
  416. package/lib/test/Forest.tests.d.ts.map +0 -1
  417. package/lib/test/Forest.tests.js +0 -213
  418. package/lib/test/Forest.tests.js.map +0 -1
  419. package/lib/test/GenericTransaction.tests.d.ts +0 -6
  420. package/lib/test/GenericTransaction.tests.d.ts.map +0 -1
  421. package/lib/test/GenericTransaction.tests.js +0 -31
  422. package/lib/test/GenericTransaction.tests.js.map +0 -1
  423. package/lib/test/HistoryEditFactory.tests.d.ts +0 -6
  424. package/lib/test/HistoryEditFactory.tests.d.ts.map +0 -1
  425. package/lib/test/HistoryEditFactory.tests.js +0 -170
  426. package/lib/test/HistoryEditFactory.tests.js.map +0 -1
  427. package/lib/test/IdCompressor.perf.tests.d.ts +0 -6
  428. package/lib/test/IdCompressor.perf.tests.d.ts.map +0 -1
  429. package/lib/test/IdCompressor.perf.tests.js +0 -290
  430. package/lib/test/IdCompressor.perf.tests.js.map +0 -1
  431. package/lib/test/IdCompressor.tests.d.ts +0 -6
  432. package/lib/test/IdCompressor.tests.d.ts.map +0 -1
  433. package/lib/test/IdCompressor.tests.js +0 -1542
  434. package/lib/test/IdCompressor.tests.js.map +0 -1
  435. package/lib/test/IdConversion.tests.d.ts +0 -6
  436. package/lib/test/IdConversion.tests.d.ts.map +0 -1
  437. package/lib/test/IdConversion.tests.js +0 -36
  438. package/lib/test/IdConversion.tests.js.map +0 -1
  439. package/lib/test/LazyCheckout.tests.d.ts +0 -6
  440. package/lib/test/LazyCheckout.tests.d.ts.map +0 -1
  441. package/lib/test/LazyCheckout.tests.js +0 -22
  442. package/lib/test/LazyCheckout.tests.js.map +0 -1
  443. package/lib/test/LogViewer.tests.d.ts +0 -6
  444. package/lib/test/LogViewer.tests.d.ts.map +0 -1
  445. package/lib/test/LogViewer.tests.js +0 -588
  446. package/lib/test/LogViewer.tests.js.map +0 -1
  447. package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts +0 -6
  448. package/lib/test/MergeHealthTelemetryHeartbeat.tests.d.ts.map +0 -1
  449. package/lib/test/MergeHealthTelemetryHeartbeat.tests.js +0 -351
  450. package/lib/test/MergeHealthTelemetryHeartbeat.tests.js.map +0 -1
  451. package/lib/test/NumericUuid.perf.tests.d.ts +0 -6
  452. package/lib/test/NumericUuid.perf.tests.d.ts.map +0 -1
  453. package/lib/test/NumericUuid.perf.tests.js +0 -68
  454. package/lib/test/NumericUuid.perf.tests.js.map +0 -1
  455. package/lib/test/NumericUuid.tests.d.ts +0 -6
  456. package/lib/test/NumericUuid.tests.d.ts.map +0 -1
  457. package/lib/test/NumericUuid.tests.js +0 -192
  458. package/lib/test/NumericUuid.tests.js.map +0 -1
  459. package/lib/test/RevisionValueCache.tests.d.ts +0 -6
  460. package/lib/test/RevisionValueCache.tests.d.ts.map +0 -1
  461. package/lib/test/RevisionValueCache.tests.js +0 -106
  462. package/lib/test/RevisionValueCache.tests.js.map +0 -1
  463. package/lib/test/RevisionView.tests.d.ts +0 -6
  464. package/lib/test/RevisionView.tests.d.ts.map +0 -1
  465. package/lib/test/RevisionView.tests.js +0 -131
  466. package/lib/test/RevisionView.tests.js.map +0 -1
  467. package/lib/test/SessionIdNormalizer.tests.d.ts +0 -6
  468. package/lib/test/SessionIdNormalizer.tests.d.ts.map +0 -1
  469. package/lib/test/SessionIdNormalizer.tests.js +0 -377
  470. package/lib/test/SessionIdNormalizer.tests.js.map +0 -1
  471. package/lib/test/SharedTree.fuzz.tests.d.ts +0 -6
  472. package/lib/test/SharedTree.fuzz.tests.d.ts.map +0 -1
  473. package/lib/test/SharedTree.fuzz.tests.js +0 -9
  474. package/lib/test/SharedTree.fuzz.tests.js.map +0 -1
  475. package/lib/test/SharedTree.perf.tests.d.ts +0 -6
  476. package/lib/test/SharedTree.perf.tests.d.ts.map +0 -1
  477. package/lib/test/SharedTree.perf.tests.js +0 -39
  478. package/lib/test/SharedTree.perf.tests.js.map +0 -1
  479. package/lib/test/SharedTree.tests.d.ts +0 -6
  480. package/lib/test/SharedTree.tests.d.ts.map +0 -1
  481. package/lib/test/SharedTree.tests.js +0 -22
  482. package/lib/test/SharedTree.tests.js.map +0 -1
  483. package/lib/test/StringInterner.tests.d.ts +0 -6
  484. package/lib/test/StringInterner.tests.d.ts.map +0 -1
  485. package/lib/test/StringInterner.tests.js +0 -73
  486. package/lib/test/StringInterner.tests.js.map +0 -1
  487. package/lib/test/Summary.tests.d.ts +0 -7
  488. package/lib/test/Summary.tests.d.ts.map +0 -1
  489. package/lib/test/Summary.tests.js +0 -386
  490. package/lib/test/Summary.tests.js.map +0 -1
  491. package/lib/test/Transaction.tests.d.ts +0 -6
  492. package/lib/test/Transaction.tests.d.ts.map +0 -1
  493. package/lib/test/Transaction.tests.js +0 -124
  494. package/lib/test/Transaction.tests.js.map +0 -1
  495. package/lib/test/TransactionInternal.tests.d.ts +0 -6
  496. package/lib/test/TransactionInternal.tests.d.ts.map +0 -1
  497. package/lib/test/TransactionInternal.tests.js +0 -576
  498. package/lib/test/TransactionInternal.tests.js.map +0 -1
  499. package/lib/test/TreeCompression.tests.d.ts +0 -6
  500. package/lib/test/TreeCompression.tests.d.ts.map +0 -1
  501. package/lib/test/TreeCompression.tests.js +0 -291
  502. package/lib/test/TreeCompression.tests.js.map +0 -1
  503. package/lib/test/TreeView.tests.d.ts +0 -6
  504. package/lib/test/TreeView.tests.d.ts.map +0 -1
  505. package/lib/test/TreeView.tests.js +0 -178
  506. package/lib/test/TreeView.tests.js.map +0 -1
  507. package/lib/test/UndoRedoHandler.tests.d.ts +0 -6
  508. package/lib/test/UndoRedoHandler.tests.d.ts.map +0 -1
  509. package/lib/test/UndoRedoHandler.tests.js +0 -37
  510. package/lib/test/UndoRedoHandler.tests.js.map +0 -1
  511. package/lib/test/fuzz/Generators.d.ts +0 -8
  512. package/lib/test/fuzz/Generators.d.ts.map +0 -1
  513. package/lib/test/fuzz/Generators.js +0 -345
  514. package/lib/test/fuzz/Generators.js.map +0 -1
  515. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +0 -23
  516. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +0 -1
  517. package/lib/test/fuzz/SharedTreeFuzzTests.js +0 -241
  518. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +0 -1
  519. package/lib/test/fuzz/Types.d.ts +0 -136
  520. package/lib/test/fuzz/Types.d.ts.map +0 -1
  521. package/lib/test/fuzz/Types.js +0 -6
  522. package/lib/test/fuzz/Types.js.map +0 -1
  523. package/lib/test/utilities/IdCompressorTestUtilities.d.ts +0 -246
  524. package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +0 -1
  525. package/lib/test/utilities/IdCompressorTestUtilities.js +0 -608
  526. package/lib/test/utilities/IdCompressorTestUtilities.js.map +0 -1
  527. package/lib/test/utilities/MockTransaction.d.ts +0 -35
  528. package/lib/test/utilities/MockTransaction.d.ts.map +0 -1
  529. package/lib/test/utilities/MockTransaction.js +0 -51
  530. package/lib/test/utilities/MockTransaction.js.map +0 -1
  531. package/lib/test/utilities/PendingLocalStateTests.d.ts +0 -12
  532. package/lib/test/utilities/PendingLocalStateTests.d.ts.map +0 -1
  533. package/lib/test/utilities/PendingLocalStateTests.js +0 -223
  534. package/lib/test/utilities/PendingLocalStateTests.js.map +0 -1
  535. package/lib/test/utilities/SharedTreeTests.d.ts +0 -12
  536. package/lib/test/utilities/SharedTreeTests.d.ts.map +0 -1
  537. package/lib/test/utilities/SharedTreeTests.js +0 -949
  538. package/lib/test/utilities/SharedTreeTests.js.map +0 -1
  539. package/lib/test/utilities/SharedTreeVersioningTests.d.ts +0 -11
  540. package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +0 -1
  541. package/lib/test/utilities/SharedTreeVersioningTests.js +0 -439
  542. package/lib/test/utilities/SharedTreeVersioningTests.js.map +0 -1
  543. package/lib/test/utilities/SummaryLoadPerfTests.d.ts +0 -10
  544. package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +0 -1
  545. package/lib/test/utilities/SummaryLoadPerfTests.js +0 -105
  546. package/lib/test/utilities/SummaryLoadPerfTests.js.map +0 -1
  547. package/lib/test/utilities/SummarySizeTests.d.ts +0 -11
  548. package/lib/test/utilities/SummarySizeTests.d.ts.map +0 -1
  549. package/lib/test/utilities/SummarySizeTests.js +0 -160
  550. package/lib/test/utilities/SummarySizeTests.js.map +0 -1
  551. package/lib/test/utilities/TestCommon.d.ts +0 -13
  552. package/lib/test/utilities/TestCommon.d.ts.map +0 -1
  553. package/lib/test/utilities/TestCommon.js +0 -19
  554. package/lib/test/utilities/TestCommon.js.map +0 -1
  555. package/lib/test/utilities/TestNode.d.ts +0 -140
  556. package/lib/test/utilities/TestNode.d.ts.map +0 -1
  557. package/lib/test/utilities/TestNode.js +0 -282
  558. package/lib/test/utilities/TestNode.js.map +0 -1
  559. package/lib/test/utilities/TestSerializer.d.ts +0 -24
  560. package/lib/test/utilities/TestSerializer.d.ts.map +0 -1
  561. package/lib/test/utilities/TestSerializer.js +0 -40
  562. package/lib/test/utilities/TestSerializer.js.map +0 -1
  563. package/lib/test/utilities/TestUtilities.d.ts +0 -212
  564. package/lib/test/utilities/TestUtilities.d.ts.map +0 -1
  565. package/lib/test/utilities/TestUtilities.js +0 -413
  566. package/lib/test/utilities/TestUtilities.js.map +0 -1
  567. package/lib/test/utilities/UndoRedoTests.d.ts +0 -32
  568. package/lib/test/utilities/UndoRedoTests.d.ts.map +0 -1
  569. package/lib/test/utilities/UndoRedoTests.js +0 -317
  570. package/lib/test/utilities/UndoRedoTests.js.map +0 -1
  571. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -5,20 +5,20 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedTreeEncoder_0_0_2 = exports.SharedTreeEncoder_0_1_1 = void 0;
8
- const core_utils_1 = require("@fluidframework/core-utils");
9
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
+ const internal_1 = require("@fluidframework/core-utils/internal");
10
+ const ChangeCompression_js_1 = require("./ChangeCompression.js");
10
11
  const Common_js_1 = require("./Common.js");
11
12
  const EditLog_js_1 = require("./EditLog.js");
12
13
  const EditUtilities_js_1 = require("./EditUtilities.js");
14
+ const IdConversion_js_1 = require("./IdConversion.js");
13
15
  const InitialTree_js_1 = require("./InitialTree.js");
14
16
  const NodeIdUtilities_js_1 = require("./NodeIdUtilities.js");
15
17
  const SerializationUtilities_js_1 = require("./SerializationUtilities.js");
16
- const index_js_1 = require("./persisted-types/index.js");
17
18
  const StringInterner_js_1 = require("./StringInterner.js");
18
19
  const TreeCompressor_js_1 = require("./TreeCompressor.js");
19
- const index_js_2 = require("./id-compressor/index.js");
20
- const ChangeCompression_js_1 = require("./ChangeCompression.js");
21
- const IdConversion_js_1 = require("./IdConversion.js");
20
+ const index_js_1 = require("./id-compressor/index.js");
21
+ const index_js_2 = require("./persisted-types/index.js");
22
22
  /**
23
23
  * Object capable of converting between the current internal representation for 0.1.1 edits and their wire format.
24
24
  * @internal
@@ -42,9 +42,9 @@ class SharedTreeEncoder_0_1_1 {
42
42
  // So replace the handles by encoding before sending:
43
43
  const semiSerialized = fluidSerialize((0, ChangeCompression_js_1.compressEdit)(this.changeCompressor, interner, (0, NodeIdUtilities_js_1.scopeIdNormalizer)(idNormalizer, idRange.sessionId), edit));
44
44
  return {
45
- type: index_js_1.SharedTreeOpType.Edit,
45
+ type: index_js_2.SharedTreeOpType.Edit,
46
46
  edit: semiSerialized,
47
- version: index_js_1.WriteFormat.v0_1_1,
47
+ version: index_js_2.WriteFormat.v0_1_1,
48
48
  idRange,
49
49
  };
50
50
  }
@@ -72,11 +72,11 @@ class SharedTreeEncoder_0_1_1 {
72
72
  * Decodes an encoded summary.
73
73
  */
74
74
  decodeSummary({ editHistory, currentTree: compressedTree, internedStrings, idCompressor: serializedIdCompressor, version, }, attributionId) {
75
- (0, Common_js_1.assertWithMessage)(version === index_js_1.WriteFormat.v0_1_1, `Invalid summary version to decode: ${version}, expected: 0.1.1`);
76
- (0, core_utils_1.assert)(typeof editHistory === 'object', 0x633 /* 0.1.1 summary encountered with non-object edit history. */);
77
- const idCompressor = (0, index_js_2.hasOngoingSession)(serializedIdCompressor)
78
- ? index_js_2.IdCompressor.deserialize(serializedIdCompressor)
79
- : index_js_2.IdCompressor.deserialize(serializedIdCompressor, (0, index_js_2.createSessionId)(), attributionId);
75
+ (0, Common_js_1.assertWithMessage)(version === index_js_2.WriteFormat.v0_1_1, `Invalid summary version to decode: ${version}, expected: 0.1.1`);
76
+ (0, internal_1.assert)(typeof editHistory === 'object', 0x633 /* 0.1.1 summary encountered with non-object edit history. */);
77
+ const idCompressor = (0, index_js_1.hasOngoingSession)(serializedIdCompressor)
78
+ ? index_js_1.IdCompressor.deserialize(serializedIdCompressor)
79
+ : index_js_1.IdCompressor.deserialize(serializedIdCompressor, (0, index_js_1.createSessionId)(), attributionId);
80
80
  const interner = new StringInterner_js_1.MutableStringInterner(internedStrings);
81
81
  const sequencedNormalizer = (0, NodeIdUtilities_js_1.sequencedIdNormalizer)((0, NodeIdUtilities_js_1.getNodeIdContext)(idCompressor));
82
82
  const decompressedTree = compressedTree !== undefined
@@ -84,7 +84,7 @@ class SharedTreeEncoder_0_1_1 {
84
84
  : undefined;
85
85
  const { editChunks, editIds } = editHistory;
86
86
  (0, Common_js_1.assertWithMessage)(editChunks !== undefined, 'Missing editChunks on 0.1.1 summary.');
87
- (0, core_utils_1.assert)(editIds !== undefined, 0x634 /* Missing editIds on 0.1.1 summary. */);
87
+ (0, internal_1.assert)(editIds !== undefined, 0x634 /* Missing editIds on 0.1.1 summary. */);
88
88
  const uncompressedChunks = editChunks.map(({ startRevision, chunk }) => ({
89
89
  startRevision,
90
90
  chunk: isEditHandle(chunk)
@@ -119,12 +119,12 @@ class SharedTreeEncoder_0_1_1 {
119
119
  // Generate a set of changes to set the root node's children to that of the root in the currentTree
120
120
  Object.entries(currentTree.traits).forEach(([label, children]) => {
121
121
  const id = 0;
122
- changes.push(index_js_1.ChangeInternal.build(children, id), index_js_1.ChangeInternal.insert(id, index_js_1.StablePlaceInternal.atStartOf({ parent: initialTreeId, label: label })));
122
+ changes.push(index_js_2.ChangeInternal.build(children, id), index_js_2.ChangeInternal.insert(id, index_js_2.StablePlaceInternal.atStartOf({ parent: initialTreeId, label: label })));
123
123
  });
124
124
  if (currentTree.payload !== undefined) {
125
- changes.push(index_js_1.ChangeInternal.setPayload(initialTreeId, currentTree.payload));
125
+ changes.push(index_js_2.ChangeInternal.setPayload(initialTreeId, currentTree.payload));
126
126
  }
127
- (0, core_utils_1.assert)(currentTree.identifier === initialTreeId && currentTree.definition === InitialTree_js_1.initialTree.definition, 0x635 /* root definition and identifier should be immutable. */);
127
+ (0, internal_1.assert)(currentTree.identifier === initialTreeId && currentTree.definition === InitialTree_js_1.initialTree.definition, 0x635 /* root definition and identifier should be immutable. */);
128
128
  const edit = (0, EditUtilities_js_1.newEdit)(changes);
129
129
  const compressedChanges = edit.changes.map((change) => this.changeCompressor.compress(change, interner, (0, NodeIdUtilities_js_1.sequencedIdNormalizer)(idNormalizer)));
130
130
  return {
@@ -132,7 +132,7 @@ class SharedTreeEncoder_0_1_1 {
132
132
  editChunks: [{ startRevision: 0, chunk: [{ changes: compressedChanges }] }],
133
133
  editIds: [edit.id],
134
134
  },
135
- version: index_js_1.WriteFormat.v0_1_1,
135
+ version: index_js_2.WriteFormat.v0_1_1,
136
136
  internedStrings: interner.getSerializable(),
137
137
  idCompressor: serializedIdCompressor,
138
138
  };
@@ -147,7 +147,7 @@ class SharedTreeEncoder_0_1_1 {
147
147
  return {
148
148
  currentTree,
149
149
  editHistory: edits.getEditLogSummary((edit) => (0, ChangeCompression_js_1.compressEdit)(this.changeCompressor, interner, sequencedNormalizer, edit)),
150
- version: index_js_1.WriteFormat.v0_1_1,
150
+ version: index_js_2.WriteFormat.v0_1_1,
151
151
  internedStrings: interner.getSerializable(),
152
152
  idCompressor: serializedIdCompressor,
153
153
  };
@@ -155,12 +155,12 @@ class SharedTreeEncoder_0_1_1 {
155
155
  encodeEditChunk(edits, idNormalizer, interner) {
156
156
  const compressedEdits = edits.map((edit) => (0, ChangeCompression_js_1.compressEdit)(this.changeCompressor, interner, idNormalizer, edit));
157
157
  return {
158
- version: index_js_1.WriteFormat.v0_1_1,
158
+ version: index_js_2.WriteFormat.v0_1_1,
159
159
  edits: compressedEdits,
160
160
  };
161
161
  }
162
162
  decodeEditChunk(contents, idNormalizer, interner) {
163
- (0, Common_js_1.assertWithMessage)(contents.version === index_js_1.WriteFormat.v0_1_1, `Invalid editChunk to decode: ${contents.version}. Expected 0.1.1.`);
163
+ (0, Common_js_1.assertWithMessage)(contents.version === index_js_2.WriteFormat.v0_1_1, `Invalid editChunk to decode: ${contents.version}. Expected 0.1.1.`);
164
164
  return contents.edits.map((edit) => (0, ChangeCompression_js_1.decompressEdit)(this.changeCompressor, interner, idNormalizer, edit));
165
165
  }
166
166
  }
@@ -186,9 +186,9 @@ class SharedTreeEncoder_0_0_2 {
186
186
  // So replace the handles by encoding before sending:
187
187
  const semiSerialized = fluidSerialize((0, IdConversion_js_1.convertEditIds)(edit, (id) => idConverter.convertToStableNodeId(id)));
188
188
  return {
189
- type: index_js_1.SharedTreeOpType.Edit,
189
+ type: index_js_2.SharedTreeOpType.Edit,
190
190
  edit: semiSerialized,
191
- version: index_js_1.WriteFormat.v0_0_2,
191
+ version: index_js_2.WriteFormat.v0_0_2,
192
192
  };
193
193
  }
194
194
  /**
@@ -215,8 +215,8 @@ class SharedTreeEncoder_0_0_2 {
215
215
  * Decodes an encoded summary.
216
216
  */
217
217
  decodeSummary({ currentTree, sequencedEdits }, attributionId) {
218
- (0, core_utils_1.assert)(sequencedEdits !== undefined, 0x636 /* 0.0.2 summary encountered with missing sequencedEdits field. */);
219
- const idCompressor = new index_js_2.IdCompressor((0, index_js_2.createSessionId)(), index_js_1.reservedIdCount, attributionId);
218
+ (0, internal_1.assert)(sequencedEdits !== undefined, 0x636 /* 0.0.2 summary encountered with missing sequencedEdits field. */);
219
+ const idCompressor = new index_js_1.IdCompressor((0, index_js_1.createSessionId)(), index_js_2.reservedIdCount, attributionId);
220
220
  const idGenerator = (0, NodeIdUtilities_js_1.getNodeIdContext)(idCompressor);
221
221
  const generateId = (id) => idGenerator.generateNodeId(id);
222
222
  // This saves all of the edits in the summary as part of the first chunk.
@@ -244,23 +244,23 @@ class SharedTreeEncoder_0_0_2 {
244
244
  // Generate a set of changes to set the root node's children to that of the root in the currentTree
245
245
  Object.entries(currentTree.traits).forEach(([label, children]) => {
246
246
  const id = 0;
247
- changes.push({ type: index_js_1.ChangeTypeInternal.Build, source: children, destination: id }, {
248
- type: index_js_1.ChangeTypeInternal.Insert,
247
+ changes.push({ type: index_js_2.ChangeTypeInternal.Build, source: children, destination: id }, {
248
+ type: index_js_2.ChangeTypeInternal.Insert,
249
249
  source: id,
250
250
  destination: {
251
- side: index_js_1.Side.After,
251
+ side: index_js_2.Side.After,
252
252
  referenceTrait: { label: label, parent: InitialTree_js_1.initialTree.identifier },
253
253
  },
254
254
  });
255
255
  });
256
256
  if (currentTree.payload !== undefined) {
257
257
  changes.push({
258
- type: index_js_1.ChangeTypeInternal.SetValue,
258
+ type: index_js_2.ChangeTypeInternal.SetValue,
259
259
  nodeToModify: InitialTree_js_1.initialTree.identifier,
260
260
  payload: currentTree.payload,
261
261
  });
262
262
  }
263
- (0, core_utils_1.assert)(currentTree.identifier === InitialTree_js_1.initialTree.identifier && currentTree.definition === InitialTree_js_1.initialTree.definition, 0x637 /* root definition and identifier should be immutable. */);
263
+ (0, internal_1.assert)(currentTree.identifier === InitialTree_js_1.initialTree.identifier && currentTree.definition === InitialTree_js_1.initialTree.definition, 0x637 /* root definition and identifier should be immutable. */);
264
264
  const edit = (0, EditUtilities_js_1.newEdit)(changes);
265
265
  return {
266
266
  currentTree,
@@ -270,7 +270,7 @@ class SharedTreeEncoder_0_0_2 {
270
270
  changes: edit.changes,
271
271
  },
272
272
  ],
273
- version: index_js_1.WriteFormat.v0_0_2,
273
+ version: index_js_2.WriteFormat.v0_0_2,
274
274
  };
275
275
  }
276
276
  /**
@@ -296,7 +296,7 @@ class SharedTreeEncoder_0_0_2 {
296
296
  return {
297
297
  currentTree: (0, SerializationUtilities_js_1.getChangeNode_0_0_2FromView)(currentView, idConverter),
298
298
  sequencedEdits,
299
- version: index_js_1.WriteFormat.v0_0_2,
299
+ version: index_js_2.WriteFormat.v0_0_2,
300
300
  };
301
301
  }
302
302
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeEncoder.js","sourceRoot":"","sources":["../src/SharedTreeEncoder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AACpD,+DAAyD;AACzD,2CAAsD;AACtD,6CAAuC;AACvC,yDAA+D;AAE/D,qDAA+C;AAC/C,6DAS8B;AAC9B,2EAAiG;AACjG,yDAsBoC;AAEpC,2DAA4E;AAE5E,2DAA8D;AAC9D,uDAMkC;AAClC,iEAAwF;AACxF,uDAAuE;AAEvE;;;GAGG;AACH,MAAa,uBAAuB;IAInC,YAAoC,gBAAyB;QAAzB,qBAAgB,GAAhB,gBAAgB,CAAS;QAH5C,mBAAc,GAAG,IAAI,2CAAuB,EAAS,CAAC;QACtD,qBAAgB,GAAG,IAAI,uCAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAEd,CAAC;IAEjE;;;;;;OAMG;IACI,YAAY,CAClB,IAA0B,EAC1B,cAEkD,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ChC,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE;gBACxB,IAAA,gBAAI,EAAC,+CAA+C,CAAC,CAAC;aACtD;iBAAM;gBACN,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;oBAC7B,cAAc,CAAC,IAAI,CAClB,IAAA,gCAAc,EACb;wBACC,OAAO;wBACP,EAAE,EAAE,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,IAAA,gBAAI,EAAC,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,IAAA,uDAA2B,EAAC,WAAW,EAAE,WAAW,CAAC;YAClE,cAAc;YACd,OAAO,EAAE,sBAAW,CAAC,MAAM;SAC3B,CAAC;IACH,CAAC;CACD;AAlLD,0DAkLC;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 { assert } from '@fluidframework/core-utils';\nimport { IsoBuffer } from '@fluid-internal/client-utils';\nimport { assertWithMessage, fail } from './Common.js';\nimport { EditLog } from './EditLog.js';\nimport { convertTreeNodes, newEdit } from './EditUtilities.js';\nimport { AttributionId, DetachedSequenceId, FinalNodeId, OpSpaceNodeId, TraitLabel } from './Identifiers.js';\nimport { initialTree } from './InitialTree.js';\nimport {\n\tContextualizedNodeIdNormalizer,\n\tgetNodeIdContext,\n\tNodeIdContext,\n\tNodeIdConverter,\n\tNodeIdGenerator,\n\tNodeIdNormalizer,\n\tscopeIdNormalizer,\n\tsequencedIdNormalizer,\n} from './NodeIdUtilities.js';\nimport { getChangeNodeFromView, getChangeNode_0_0_2FromView } from './SerializationUtilities.js';\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/index.js';\nimport { RevisionView } from './RevisionView.js';\nimport { MutableStringInterner, StringInterner } from './StringInterner.js';\nimport { SummaryContents } from './Summary.js';\nimport { InterningTreeCompressor } from './TreeCompressor.js';\nimport {\n\tcreateSessionId,\n\thasOngoingSession,\n\tIdCompressor,\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n} from './id-compressor/index.js';\nimport { ChangeCompressor, compressEdit, decompressEdit } from './ChangeCompression.js';\nimport { convertEditIds, convertNodeDataIds } from './IdConversion.js';\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\treturn this.summarizeHistory\n\t\t\t? this.fullHistorySummarizer(edits, currentView, idNormalizer, interner, serializedIdCompressor)\n\t\t\t: this.noHistorySummarizer(edits, currentView, idContext, idNormalizer, interner, serializedIdCompressor);\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{\n\t\t\teditHistory,\n\t\t\tcurrentTree: compressedTree,\n\t\t\tinternedStrings,\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t\tversion,\n\t\t}: SharedTreeSummary,\n\t\tattributionId: AttributionId\n\t): SummaryContents {\n\t\tassertWithMessage(\n\t\t\tversion === WriteFormat.v0_1_1,\n\t\t\t`Invalid summary version to decode: ${version}, expected: 0.1.1`\n\t\t);\n\t\tassert(typeof editHistory === 'object', 0x633 /* 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(), attributionId);\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\tassertWithMessage(editChunks !== undefined, 'Missing editChunks on 0.1.1 summary.');\n\t\tassert(editIds !== undefined, 0x634 /* 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\t0x635 /* 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\tassertWithMessage(\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\treturn this.summarizeHistory\n\t\t\t? this.fullHistorySummarizer(edits, currentView, idConverter)\n\t\t\t: this.noHistorySummarizer(edits, currentView, idConverter);\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{ currentTree, sequencedEdits }: SharedTreeSummary_0_0_2,\n\t\tattributionId?: AttributionId\n\t): SummaryContents {\n\t\tassert(sequencedEdits !== undefined, 0x636 /* 0.0.2 summary encountered with missing sequencedEdits field. */);\n\t\tconst idCompressor = new IdCompressor(createSessionId(), reservedIdCount, attributionId);\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\t0x637 /* 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"]}
1
+ {"version":3,"file":"SharedTreeEncoder.js","sourceRoot":"","sources":["../src/SharedTreeEncoder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyD;AACzD,kEAA6D;AAE7D,iEAAwF;AACxF,2CAAsD;AACtD,6CAAuC;AACvC,yDAA+D;AAC/D,uDAAuE;AAEvE,qDAA+C;AAC/C,6DAS8B;AAE9B,2EAAiG;AACjG,2DAA4E;AAE5E,2DAA8D;AAC9D,uDAMkC;AAClC,yDAsBoC;AAEpC;;;GAGG;AACH,MAAa,uBAAuB;IAInC,YAAoC,gBAAyB;QAAzB,qBAAgB,GAAhB,gBAAgB,CAAS;QAH5C,mBAAc,GAAG,IAAI,2CAAuB,EAAS,CAAC;QACtD,qBAAgB,GAAG,IAAI,uCAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAEd,CAAC;IAEjE;;;;;;OAMG;IACI,YAAY,CAClB,IAA0B,EAC1B,cAEkD,EAClD,OAAwB,EACxB,YAA6C,EAC7C,QAAwB;QAExB,wCAAwC;QACxC,kFAAkF;QAClF,qDAAqD;QACrD,MAAM,cAAc,GAAG,cAAc,CACpC,IAAA,mCAAY,EAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,EAAE,IAAA,sCAAiB,EAAC,YAAY,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CACvG,CAAC;QAEF,OAAO;YACN,IAAI,EAAE,2BAAgB,CAAC,IAAI;YAC3B,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,sBAAW,CAAC,MAAM;YAC3B,OAAO;SACP,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACI,YAAY,CAClB,EAAoB,EACpB,gBAEkD,EAClD,YAA6C,EAC7C,QAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,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E,WAAW,CAAC;YAClE,cAAc;YACd,OAAO,EAAE,sBAAW,CAAC,MAAM;SAC3B,CAAC;IACH,CAAC;CACD;AAlLD,0DAkLC;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 '@fluid-internal/client-utils';\nimport { assert } from '@fluidframework/core-utils/internal';\n\nimport { ChangeCompressor, compressEdit, decompressEdit } from './ChangeCompression.js';\nimport { assertWithMessage, fail } from './Common.js';\nimport { EditLog } from './EditLog.js';\nimport { convertTreeNodes, newEdit } from './EditUtilities.js';\nimport { convertEditIds, convertNodeDataIds } from './IdConversion.js';\nimport { AttributionId, DetachedSequenceId, FinalNodeId, OpSpaceNodeId, TraitLabel } from './Identifiers.js';\nimport { initialTree } from './InitialTree.js';\nimport {\n\tContextualizedNodeIdNormalizer,\n\tNodeIdContext,\n\tNodeIdConverter,\n\tNodeIdGenerator,\n\tNodeIdNormalizer,\n\tgetNodeIdContext,\n\tscopeIdNormalizer,\n\tsequencedIdNormalizer,\n} from './NodeIdUtilities.js';\nimport { RevisionView } from './RevisionView.js';\nimport { getChangeNodeFromView, getChangeNode_0_0_2FromView } from './SerializationUtilities.js';\nimport { MutableStringInterner, StringInterner } from './StringInterner.js';\nimport { SummaryContents } from './Summary.js';\nimport { InterningTreeCompressor } from './TreeCompressor.js';\nimport {\n\tIdCompressor,\n\tIdCreationRange,\n\tSerializedIdCompressorWithNoSession,\n\tcreateSessionId,\n\thasOngoingSession,\n} from './id-compressor/index.js';\nimport {\n\tChangeInternal,\n\tChangeInternal_0_0_2,\n\tChangeNode,\n\tChangeNode_0_0_2,\n\tChangeTypeInternal,\n\tCompressedChangeInternal,\n\tEdit,\n\tEditChunkContents,\n\tEditChunkContents_0_1_1,\n\tEditLogSummary,\n\tEditWithoutId,\n\tFluidEditHandle,\n\tSharedTreeEditOp,\n\tSharedTreeEditOp_0_0_2,\n\tSharedTreeOpType,\n\tSharedTreeSummary,\n\tSharedTreeSummary_0_0_2,\n\tSide,\n\tStablePlaceInternal,\n\tWriteFormat,\n\treservedIdCount,\n} from './persisted-types/index.js';\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\treturn this.summarizeHistory\n\t\t\t? this.fullHistorySummarizer(edits, currentView, idNormalizer, interner, serializedIdCompressor)\n\t\t\t: this.noHistorySummarizer(edits, currentView, idContext, idNormalizer, interner, serializedIdCompressor);\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{\n\t\t\teditHistory,\n\t\t\tcurrentTree: compressedTree,\n\t\t\tinternedStrings,\n\t\t\tidCompressor: serializedIdCompressor,\n\t\t\tversion,\n\t\t}: SharedTreeSummary,\n\t\tattributionId: AttributionId\n\t): SummaryContents {\n\t\tassertWithMessage(\n\t\t\tversion === WriteFormat.v0_1_1,\n\t\t\t`Invalid summary version to decode: ${version}, expected: 0.1.1`\n\t\t);\n\t\tassert(typeof editHistory === 'object', 0x633 /* 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(), attributionId);\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\tassertWithMessage(editChunks !== undefined, 'Missing editChunks on 0.1.1 summary.');\n\t\tassert(editIds !== undefined, 0x634 /* 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\t0x635 /* 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\tassertWithMessage(\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\treturn this.summarizeHistory\n\t\t\t? this.fullHistorySummarizer(edits, currentView, idConverter)\n\t\t\t: this.noHistorySummarizer(edits, currentView, idConverter);\n\t}\n\n\t/**\n\t * Decodes an encoded summary.\n\t */\n\tpublic decodeSummary(\n\t\t{ currentTree, sequencedEdits }: SharedTreeSummary_0_0_2,\n\t\tattributionId?: AttributionId\n\t): SummaryContents {\n\t\tassert(sequencedEdits !== undefined, 0x636 /* 0.0.2 summary encountered with missing sequencedEdits field. */);\n\t\tconst idCompressor = new IdCompressor(createSessionId(), reservedIdCount, attributionId);\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\t0x637 /* 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"]}
package/dist/Summary.d.ts CHANGED
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import type { IFluidHandle } from '@fluidframework/core-interfaces';
6
6
  import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
- import type { IdCompressor } from './id-compressor/index.js';
8
- import type { EditLogSummary, SharedTreeSummaryBase, ChangeNode, ChangeInternal } from './persisted-types/index.js';
9
7
  import type { EditHandle } from './EditLog.js';
10
8
  import type { MutableStringInterner } from './StringInterner.js';
9
+ import type { IdCompressor } from './id-compressor/index.js';
10
+ import type { ChangeInternal, ChangeNode, EditLogSummary, SharedTreeSummaryBase } from './persisted-types/index.js';
11
11
  /**
12
12
  * The contents of a SharedTree summary, converted to a common internal format that can be
13
13
  * loaded into a SharedTree.
@@ -1 +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,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;;;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"}
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,EAAE,MAAM,oCAAoC,CAAC;AAItE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEpH;;;;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/dist/Summary.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.serialize = void 0;
8
- const shared_object_base_1 = require("@fluidframework/shared-object-base");
8
+ const internal_1 = require("@fluidframework/shared-object-base/internal");
9
9
  const Common_js_1 = require("./Common.js");
10
10
  /**
11
11
  * Serializes a SharedTree summary into a JSON string. This may later be used to initialize a SharedTree's state via `deserialize()`
@@ -16,7 +16,7 @@ const Common_js_1 = require("./Common.js");
16
16
  * @param bind - The object handle required to serialize handles in the summary
17
17
  */
18
18
  function serialize(summary, serializer, bind) {
19
- return (0, shared_object_base_1.serializeHandles)(summary, serializer, bind) ?? (0, Common_js_1.fail)();
19
+ return (0, internal_1.serializeHandles)(summary, serializer, bind) ?? (0, Common_js_1.fail)();
20
20
  }
21
21
  exports.serialize = serialize;
22
22
  //# sourceMappingURL=Summary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Summary.js","sourceRoot":"","sources":["../src/Summary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAAwF;AACxF,2CAAmC;AA8BnC;;;;;;;GAOG;AACH,SAAgB,SAAS,CAAC,OAA8B,EAAE,UAA4B,EAAE,IAAkB;IACzG,OAAO,IAAA,qCAAgB,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,IAAA,gBAAI,GAAE,CAAC;AAC9D,CAAC;AAFD,8BAEC","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.js';\nimport type { IdCompressor } from './id-compressor/index.js';\nimport type { EditLogSummary, SharedTreeSummaryBase, ChangeNode, ChangeInternal } from './persisted-types/index.js';\nimport type { EditHandle } from './EditLog.js';\nimport type { MutableStringInterner } from './StringInterner.js';\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"]}
1
+ {"version":3,"file":"Summary.js","sourceRoot":"","sources":["../src/Summary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,0EAA+E;AAE/E,2CAAmC;AA8BnC;;;;;;;GAOG;AACH,SAAgB,SAAS,CAAC,OAA8B,EAAE,UAA4B,EAAE,IAAkB;IACzG,OAAO,IAAA,2BAAgB,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,IAAA,gBAAI,GAAE,CAAC;AAC9D,CAAC;AAFD,8BAEC","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 } from '@fluidframework/shared-object-base';\nimport { serializeHandles } from '@fluidframework/shared-object-base/internal';\n\nimport { fail } from './Common.js';\nimport type { EditHandle } from './EditLog.js';\nimport type { MutableStringInterner } from './StringInterner.js';\nimport type { IdCompressor } from './id-compressor/index.js';\nimport type { ChangeInternal, ChangeNode, EditLogSummary, SharedTreeSummaryBase } from './persisted-types/index.js';\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryBackCompatibility.d.ts","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,EAEN,qBAAqB,EAGrB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,qBAAqB,CAmBpG;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IAClE,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"}
1
+ {"version":3,"file":"SummaryBackCompatibility.d.ts","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAI3E,OAAO,EAEN,qBAAqB,EAGrB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,UA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CAAC;IAE5B,IAAI,OAAO,KAAK,sBAAW,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,IAAA,gBAAI,EAAC,+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,IAAA,iDAAoC,EAAC,WAAW,CAAC;iBACjE,CAAC;aACF;YAED,IAAA,gBAAI,EAAC,oCAAoC,CAAC,CAAC;SAC3C;KACD;SAAM,IAAI,OAAO,KAAK,sBAAW,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,IAAA,gBAAI,EAAC,iCAAiC,CAAC,CAAC;KACxC;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AArCD,oDAqCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base';\nimport { fail } from './Common.js';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog.js';\nimport {\n\tSharedTreeSummary,\n\tSharedTreeSummaryBase,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n} from './persisted-types/index.js';\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 ITelemetryBaseProperties {\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"]}
1
+ {"version":3,"file":"SummaryBackCompatibility.js","sourceRoot":"","sources":["../src/SummaryBackCompatibility.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,2CAAmC;AACnC,6CAAoE;AACpE,yDAKoC;AAEpC;;;;;;;;;GASG;AACH,SAAgB,WAAW,CAAC,WAAmB,EAAE,UAA4B;IAC5E,IAAI,OAAuC,CAAC;IAC5C,IAAI;QACH,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;KACxC;IAAC,MAAM;QACP,IAAA,gBAAI,EAAC,8BAA8B,CAAC,CAAC;KACrC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAChC,IAAA,gBAAI,EAAC,0BAA0B,CAAC,CAAC;KACjC;IAED,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1B,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;KAC/B;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AAnBD,kCAmBC;AAgBD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,OAA8B;IAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,KAAK,sBAAW,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,IAAA,gBAAI,EAAC,+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,IAAA,iDAAoC,EAAC,WAAW,CAAC;iBACjE,CAAC;aACF;YAED,IAAA,gBAAI,EAAC,oCAAoC,CAAC,CAAC;SAC3C;KACD;SAAM,IAAI,OAAO,KAAK,sBAAW,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,IAAA,gBAAI,EAAC,iCAAiC,CAAC,CAAC;KACxC;IAED,IAAA,gBAAI,EAAC,2BAA2B,CAAC,CAAC;AACnC,CAAC;AArCD,oDAqCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ITelemetryBaseProperties } from '@fluidframework/core-interfaces';\nimport type { IFluidSerializer } from '@fluidframework/shared-object-base';\n\nimport { fail } from './Common.js';\nimport { getNumberOfHandlesFromEditLogSummary } from './EditLog.js';\nimport {\n\tSharedTreeSummary,\n\tSharedTreeSummaryBase,\n\tSharedTreeSummary_0_0_2,\n\tWriteFormat,\n} from './persisted-types/index.js';\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 ITelemetryBaseProperties {\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"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { EditChunkContents } from './persisted-types/index.js';
6
5
  import type { SharedTree } from './SharedTree.js';
6
+ import type { EditChunkContents } from './persisted-types/index.js';
7
7
  /**
8
8
  * Format used for exporting an uploaded edit chunk and its associated handle path. Primarily used for testing SharedTree summaries.
9
9
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryTestUtilities.d.ts","sourceRoot":"","sources":["../src/SummaryTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAkB,iBAAiB,EAAmB,MAAM,4BAA4B,CAAC;AACrG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;GAGG;AACH,UAAU,yBAAyB;IAClC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,EAAE,iBAAiB,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAgB/G;AAED;;;;GAIG;AACH,wBAAsB,sCAAsC,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpG"}
1
+ {"version":3,"file":"SummaryTestUtilities.d.ts","sourceRoot":"","sources":["../src/SummaryTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAkB,iBAAi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,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,wFAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluid-internal/client-utils';\nimport type { EditLog } from './EditLog.js';\nimport type { ChangeInternal, EditChunkContents, FluidEditHandle } from './persisted-types/index.js';\nimport type { SharedTree } from './SharedTree.js';\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 */\ninterface 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 * @deprecated Edit virtualization is no longer supported. Do not use this.\n */\nexport async function getUploadedEditChunkContents(sharedTree: SharedTree): Promise<UploadedEditChunkContents[]> {\n\tconst editChunks: UploadedEditChunkContents[] = [];\n\tconst { editChunks: editsOrHandles } = (sharedTree.edits as unknown 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 * @deprecated Edit virtualization is no longer supported. Do not use this.\n * @internal\n */\nexport async function getSerializedUploadedEditChunkContents(sharedTree: SharedTree): Promise<string> {\n\treturn JSON.stringify(await getUploadedEditChunkContents(sharedTree));\n}\n"]}
1
+ {"version":3,"file":"SummaryTestUtilities.js","sourceRoot":"","sources":["../src/SummaryTestUtilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAyD;AAqBzD;;;;GAIG;AACI,KAAK,UAAU,4BAA4B,CAAC,UAAsB;IACxE,MAAM,UAAU,GAAgC,EAAE,CAAC;IACnD,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,GAAI,UAAU,CAAC,KAA4C,CAAC,iBAAiB,EAAE,CAAC;IACpH,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,wBAAS,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;AAhBD,oEAgBC;AAED;;;;GAIG;AACI,KAAK,UAAU,sCAAsC,CAAC,UAAsB;IAClF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,4BAA4B,CAAC,UAAU,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,wFAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from '@fluid-internal/client-utils';\n\nimport type { EditLog } from './EditLog.js';\nimport type { SharedTree } from './SharedTree.js';\nimport type { ChangeInternal, EditChunkContents, FluidEditHandle } from './persisted-types/index.js';\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 */\ninterface 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 * @deprecated Edit virtualization is no longer supported. Do not use this.\n */\nexport async function getUploadedEditChunkContents(sharedTree: SharedTree): Promise<UploadedEditChunkContents[]> {\n\tconst editChunks: UploadedEditChunkContents[] = [];\n\tconst { editChunks: editsOrHandles } = (sharedTree.edits as unknown 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 * @deprecated Edit virtualization is no longer supported. Do not use this.\n * @internal\n */\nexport async function getSerializedUploadedEditChunkContents(sharedTree: SharedTree): Promise<string> {\n\treturn JSON.stringify(await getUploadedEditChunkContents(sharedTree));\n}\n"]}
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IErrorEvent } from '@fluidframework/core-interfaces';
6
5
  import { TypedEventEmitter } from '@fluid-internal/client-utils';
7
- import { EditStatus } from './persisted-types/index.js';
8
- import { TreeView } from './TreeView.js';
6
+ import { IErrorEvent } from '@fluidframework/core-interfaces';
9
7
  import { Change } from './ChangeTypes.js';
10
8
  import { SharedTree } from './SharedTree.js';
9
+ import { TreeView } from './TreeView.js';
10
+ import { EditStatus } from './persisted-types/index.js';
11
11
  /**
12
12
  * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.
13
13
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"Transaction.d.ts","sourceRoot":"","sources":["../src/Transaction.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAwB,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK7C;;;GAGG;AACH,oBAAY,gBAAgB;IAC3B;;OAEG;IACH,UAAU,eAAe;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACrD,CAAC,KAAK,EAAE,gBAAgB,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,KAAK,IAAI,OAAE;CAC5F;AAED;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,iBAAiB,CAAC,iBAAiB,CAAC;aAUjC,IAAI,EAAE,UAAU;IATnD,6DAA6D;IAC7D,SAAgB,YAAY,EAAE,QAAQ,CAAC;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD;;;;OAIG;gBACgC,IAAI,EAAE,UAAU;IAOnD;;;OAGG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED;;OAEG;IACH,IAAW,MAAM,IAAI,UAAU,CAE9B;IAED;;;OAGG;IACH,IAAW,WAAW,IAAI,QAAQ,CAEjC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,GAAG,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU;IAChD,KAAK,CAAC,OAA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,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU;IAkBpD;;OAEG;IACI,cAAc,IAAI,IAAI;CAY7B"}
@@ -6,11 +6,11 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.Transaction = exports.TransactionEvent = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
- const index_js_1 = require("./persisted-types/index.js");
9
+ const Common_js_1 = require("./Common.js");
10
10
  const EditUtilities_js_1 = require("./EditUtilities.js");
11
- const TransactionInternal_js_1 = require("./TransactionInternal.js");
12
11
  const LogViewer_js_1 = require("./LogViewer.js");
13
- const Common_js_1 = require("./Common.js");
12
+ const TransactionInternal_js_1 = require("./TransactionInternal.js");
13
+ const index_js_1 = require("./persisted-types/index.js");
14
14
  /**
15
15
  * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.
16
16
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../src/Transaction.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAiE;AACjE,yDAA8E;AAC9E,yDAA+C;AAI/C,qEAAmF;AACnF,iDAAkD;AAClD,2CAA6D;AAE7D;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,6CAAyB,CAAA;AAC1B,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAUD;;;;GAIG;AACH,MAAa,WAAY,SAAQ,gCAAoC;IAKpE;;;;OAIG;IACH,YAAmC,IAAgB;QAClD,KAAK,EAAE,CAAC;QAD0B,SAAI,GAAJ,IAAI,CAAY;QAElD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,2CAAkB,CAAC,WAAW,EAAE,IAAI,4CAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;QACzF,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACjC,CAAC;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AAI,GAAyB,EAAE,EAAE,EAAE,IAAA,4BAAS,GAAE,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;gBAChF,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,YAAY,+BAAgB,EAAE;oBAChD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;iBACpD;gBACD,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;aAClC;SACD;IACF,CAAC;CACD;AAlFD,kCAkFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IErrorEvent } from '@fluidframework/core-interfaces';\nimport { TypedEventEmitter } from '@fluid-internal/client-utils';\nimport { ChangeInternal, Edit, EditStatus } from './persisted-types/index.js';\nimport { newEditId } from './EditUtilities.js';\nimport { TreeView } from './TreeView.js';\nimport { Change } from './ChangeTypes.js';\nimport { SharedTree } from './SharedTree.js';\nimport { GenericTransaction, TransactionInternal } from './TransactionInternal.js';\nimport { CachingLogViewer } from './LogViewer.js';\nimport { RestOrArray, unwrapRestOrArray } from './Common.js';\n\n/**\n * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.\n * @alpha\n */\nexport enum TransactionEvent {\n\t/**\n\t * `currentView` has changed from `before` to `after`\n\t */\n\tViewChange = 'viewChange',\n}\n\n/**\n * Events which may be emitted by `Transaction`\n * @alpha\n */\nexport interface TransactionEvents extends IErrorEvent {\n\t(event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void);\n}\n\n/**\n * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a\n * single edit\n * @alpha\n */\nexport class Transaction extends TypedEventEmitter<TransactionEvents> {\n\t/** The view of the tree when this transaction was created */\n\tpublic readonly startingView: TreeView;\n\tprivate readonly transaction: GenericTransaction;\n\n\t/**\n\t * Create a new transaction over the given tree. The tree's `currentView` at this time will become the `startingView` for this\n\t * transaction.\n\t * @param tree - the `SharedTree` that this transaction applies changes to\n\t */\n\tpublic constructor(public readonly tree: SharedTree) {\n\t\tsuper();\n\t\tconst { currentView } = tree;\n\t\tthis.transaction = new GenericTransaction(currentView, new TransactionInternal.Policy());\n\t\tthis.startingView = currentView;\n\t}\n\n\t/**\n\t * True if this transaction is open, false if it is closed. A transaction may be closed manually via `closeAndApplyEdit()`, or may\n\t * be automatically closed by a change in this transaction failing to apply (see `applyChange()`).\n\t */\n\tpublic get isOpen(): boolean {\n\t\treturn this.transaction.isOpen && this.status === EditStatus.Applied;\n\t}\n\n\t/**\n\t * The status of the most recently applied change in this transaction\n\t */\n\tpublic get status(): EditStatus {\n\t\treturn this.transaction.status;\n\t}\n\n\t/**\n\t * The state of the tree following the most change that was successfully applied. If no changes have been applied, this is the same as\n\t * `startingView`.\n\t */\n\tpublic get currentView(): TreeView {\n\t\treturn this.transaction.view;\n\t}\n\n\t/**\n\t * Attempt to apply a sequence of changes in this transaction. The `currentView` will be updated to reflect the new tree state after all\n\t * applied changes. If any change fails to apply, the remaining changes will be ignored and this transaction will be automatically\n\t * closed (see `isOpen`). If this transaction is already closed, this method has no effect. This method will emit a\n\t * `TransactionEvent.ViewChange` event at most once per call.\n\t * @param changes - the changes to apply\n\t * @returns either the `EditStatus` of the given changes or the `EditStatus` of the last change before the transaction was closed\n\t */\n\tpublic apply(...changes: readonly Change[]): EditStatus;\n\tpublic apply(changes: readonly Change[]): EditStatus;\n\tpublic apply(...changesOrArray: RestOrArray<Change>): EditStatus {\n\t\tif (this.isOpen) {\n\t\t\tconst changes = unwrapRestOrArray(changesOrArray);\n\t\t\tif (changes.length > 0) {\n\t\t\t\tconst previousView = this.currentView;\n\t\t\t\tthis.transaction.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\t\t\tif (\n\t\t\t\t\tthis.listenerCount(TransactionEvent.ViewChange) > 0 &&\n\t\t\t\t\t!previousView.hasEqualForest(this.currentView)\n\t\t\t\t) {\n\t\t\t\t\tthis.emit(TransactionEvent.ViewChange, previousView, this.currentView);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.status;\n\t}\n\n\t/**\n\t * Close this transaction and apply its changes to the `SharedTree`. If this transaction is already closed, this method has no effect.\n\t */\n\tpublic closeAndCommit(): void {\n\t\tif (this.isOpen) {\n\t\t\tif (this.transaction.changes.length > 0) {\n\t\t\t\tconst result = this.transaction.close();\n\t\t\t\tconst edit: Edit<ChangeInternal> = { id: newEditId(), changes: result.changes };\n\t\t\t\tif (this.tree.edits instanceof CachingLogViewer) {\n\t\t\t\t\tthis.tree.edits.setKnownEditingResult(edit, result);\n\t\t\t\t}\n\t\t\t\tthis.tree.applyEditInternal(edit);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"Transaction.js","sourceRoot":"","sources":["../src/Transaction.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAIjE,2CAA6D;AAC7D,yDAA+C;AAC/C,iDAAkD;AAElD,qEAAmF;AAEnF,yDAA8E;AAE9E;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B;;OAEG;IACH,6CAAyB,CAAA;AAC1B,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAUD;;;;GAIG;AACH,MAAa,WAAY,SAAQ,gCAAoC;IAKpE;;;;OAIG;IACH,YAAmC,IAAgB;QAClD,KAAK,EAAE,CAAC;QAD0B,SAAI,GAAJ,IAAI,CAAY;QAElD,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,2CAAkB,CAAC,WAAW,EAAE,IAAI,4CAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;QACzF,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;;OAGG;IACH,IAAW,MAAM;QAChB,OAAO,IAAI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E,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;gBAChF,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,YAAY,+BAAgB,EAAE;oBAChD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;iBACpD;gBACD,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;aAClC;SACD;IACF,CAAC;CACD;AAlFD,kCAkFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from '@fluid-internal/client-utils';\nimport { IErrorEvent } from '@fluidframework/core-interfaces';\n\nimport { Change } from './ChangeTypes.js';\nimport { RestOrArray, unwrapRestOrArray } from './Common.js';\nimport { newEditId } from './EditUtilities.js';\nimport { CachingLogViewer } from './LogViewer.js';\nimport { SharedTree } from './SharedTree.js';\nimport { GenericTransaction, TransactionInternal } from './TransactionInternal.js';\nimport { TreeView } from './TreeView.js';\nimport { ChangeInternal, Edit, EditStatus } from './persisted-types/index.js';\n\n/**\n * An event emitted by a `Transaction` to indicate a state change. See {@link TransactionEvents} for event argument information.\n * @alpha\n */\nexport enum TransactionEvent {\n\t/**\n\t * `currentView` has changed from `before` to `after`\n\t */\n\tViewChange = 'viewChange',\n}\n\n/**\n * Events which may be emitted by `Transaction`\n * @alpha\n */\nexport interface TransactionEvents extends IErrorEvent {\n\t(event: TransactionEvent.ViewChange, listener: (before: TreeView, after: TreeView) => void);\n}\n\n/**\n * Buffers changes to be applied to an isolated view of a `SharedTree` over time before applying them directly to the tree itself as a\n * single edit\n * @alpha\n */\nexport class Transaction extends TypedEventEmitter<TransactionEvents> {\n\t/** The view of the tree when this transaction was created */\n\tpublic readonly startingView: TreeView;\n\tprivate readonly transaction: GenericTransaction;\n\n\t/**\n\t * Create a new transaction over the given tree. The tree's `currentView` at this time will become the `startingView` for this\n\t * transaction.\n\t * @param tree - the `SharedTree` that this transaction applies changes to\n\t */\n\tpublic constructor(public readonly tree: SharedTree) {\n\t\tsuper();\n\t\tconst { currentView } = tree;\n\t\tthis.transaction = new GenericTransaction(currentView, new TransactionInternal.Policy());\n\t\tthis.startingView = currentView;\n\t}\n\n\t/**\n\t * True if this transaction is open, false if it is closed. A transaction may be closed manually via `closeAndApplyEdit()`, or may\n\t * be automatically closed by a change in this transaction failing to apply (see `applyChange()`).\n\t */\n\tpublic get isOpen(): boolean {\n\t\treturn this.transaction.isOpen && this.status === EditStatus.Applied;\n\t}\n\n\t/**\n\t * The status of the most recently applied change in this transaction\n\t */\n\tpublic get status(): EditStatus {\n\t\treturn this.transaction.status;\n\t}\n\n\t/**\n\t * The state of the tree following the most change that was successfully applied. If no changes have been applied, this is the same as\n\t * `startingView`.\n\t */\n\tpublic get currentView(): TreeView {\n\t\treturn this.transaction.view;\n\t}\n\n\t/**\n\t * Attempt to apply a sequence of changes in this transaction. The `currentView` will be updated to reflect the new tree state after all\n\t * applied changes. If any change fails to apply, the remaining changes will be ignored and this transaction will be automatically\n\t * closed (see `isOpen`). If this transaction is already closed, this method has no effect. This method will emit a\n\t * `TransactionEvent.ViewChange` event at most once per call.\n\t * @param changes - the changes to apply\n\t * @returns either the `EditStatus` of the given changes or the `EditStatus` of the last change before the transaction was closed\n\t */\n\tpublic apply(...changes: readonly Change[]): EditStatus;\n\tpublic apply(changes: readonly Change[]): EditStatus;\n\tpublic apply(...changesOrArray: RestOrArray<Change>): EditStatus {\n\t\tif (this.isOpen) {\n\t\t\tconst changes = unwrapRestOrArray(changesOrArray);\n\t\t\tif (changes.length > 0) {\n\t\t\t\tconst previousView = this.currentView;\n\t\t\t\tthis.transaction.applyChanges(changes.map((c) => this.tree.internalizeChange(c)));\n\t\t\t\tif (\n\t\t\t\t\tthis.listenerCount(TransactionEvent.ViewChange) > 0 &&\n\t\t\t\t\t!previousView.hasEqualForest(this.currentView)\n\t\t\t\t) {\n\t\t\t\t\tthis.emit(TransactionEvent.ViewChange, previousView, this.currentView);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this.status;\n\t}\n\n\t/**\n\t * Close this transaction and apply its changes to the `SharedTree`. If this transaction is already closed, this method has no effect.\n\t */\n\tpublic closeAndCommit(): void {\n\t\tif (this.isOpen) {\n\t\t\tif (this.transaction.changes.length > 0) {\n\t\t\t\tconst result = this.transaction.close();\n\t\t\t\tconst edit: Edit<ChangeInternal> = { id: newEditId(), changes: result.changes };\n\t\t\t\tif (this.tree.edits instanceof CachingLogViewer) {\n\t\t\t\t\tthis.tree.edits.setKnownEditingResult(edit, result);\n\t\t\t\t}\n\t\t\t\tthis.tree.applyEditInternal(edit);\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
@@ -3,12 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { Result } from './Common.js';
6
- import { NodeId, DetachedSequenceId, TraitLabel } from './Identifiers.js';
7
- import { BuildNodeInternal, ChangeInternal, ConstraintInternal, EditStatus, StablePlaceInternal, StableRangeInternal } from './persisted-types/index.js';
8
6
  import { BadPlaceValidationResult, BadRangeValidationResult } from './EditUtilities.js';
9
- import { RevisionView, TransactionView } from './RevisionView.js';
7
+ import { DetachedSequenceId, NodeId, TraitLabel } from './Identifiers.js';
10
8
  import { ReconciliationChange, ReconciliationPath } from './ReconciliationPath.js';
9
+ import { RevisionView, TransactionView } from './RevisionView.js';
11
10
  import { TreeViewNode } from './TreeView.js';
11
+ import { BuildNodeInternal, ChangeInternal, ConstraintInternal, EditStatus, StablePlaceInternal, StableRangeInternal } from './persisted-types/index.js';
12
12
  /**
13
13
  * Result of applying a transaction.
14
14
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionInternal.d.ts","sourceRoot":"","sources":["../src/TransactionInternal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAkD,MAAM,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE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