@fluidframework/tree 2.21.0 → 2.22.1

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 (327) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -0
  3. package/api-report/tree.alpha.api.md +29 -4
  4. package/api-report/tree.beta.api.md +29 -4
  5. package/api-report/tree.legacy.alpha.api.md +29 -4
  6. package/api-report/tree.legacy.public.api.md +29 -4
  7. package/api-report/tree.public.api.md +29 -4
  8. package/dist/alpha.d.ts +1 -0
  9. package/dist/beta.d.ts +1 -0
  10. package/dist/core/forest/editableForest.js +1 -1
  11. package/dist/core/forest/editableForest.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js.map +1 -1
  15. package/dist/core/tree/anchorSet.d.ts +2 -5
  16. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  17. package/dist/core/tree/anchorSet.js +1 -151
  18. package/dist/core/tree/anchorSet.js.map +1 -1
  19. package/dist/core/tree/index.d.ts +1 -2
  20. package/dist/core/tree/index.d.ts.map +1 -1
  21. package/dist/core/tree/index.js.map +1 -1
  22. package/dist/core/tree/pathTree.d.ts +0 -11
  23. package/dist/core/tree/pathTree.d.ts.map +1 -1
  24. package/dist/core/tree/pathTree.js.map +1 -1
  25. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  26. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  27. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
  28. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  29. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +1 -2
  30. package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  31. package/dist/feature-libraries/detachedFieldIndexSummarizer.js +0 -9
  32. package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  33. package/dist/feature-libraries/flex-tree/treeEvents.d.ts +2 -4
  34. package/dist/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  35. package/dist/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  36. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -2
  37. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  38. package/dist/feature-libraries/forest-summary/forestSummarizer.js +0 -9
  39. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  40. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +6 -2
  41. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  42. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  43. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -4
  44. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  45. package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -19
  46. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  47. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  48. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +11 -12
  49. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  50. package/dist/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
  51. package/dist/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  52. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  53. package/dist/feature-libraries/optional-field/optionalField.js +7 -3
  54. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  55. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -5
  56. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  57. package/dist/feature-libraries/schema-index/schemaSummarizer.js +1 -11
  58. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  59. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +1 -1
  60. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  61. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -1
  62. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  63. package/dist/index.d.ts +3 -3
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +4 -4
  66. package/dist/index.js.map +1 -1
  67. package/dist/legacy.d.ts +1 -0
  68. package/dist/packageVersion.d.ts +1 -1
  69. package/dist/packageVersion.js +1 -1
  70. package/dist/packageVersion.js.map +1 -1
  71. package/dist/public.d.ts +1 -0
  72. package/dist/shared-tree/index.d.ts +1 -3
  73. package/dist/shared-tree/index.d.ts.map +1 -1
  74. package/dist/shared-tree/index.js +1 -7
  75. package/dist/shared-tree/index.js.map +1 -1
  76. package/dist/shared-tree/schematizingTreeView.d.ts +4 -5
  77. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  78. package/dist/shared-tree/schematizingTreeView.js +9 -10
  79. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  80. package/dist/shared-tree/sharedTree.d.ts +39 -39
  81. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  82. package/dist/shared-tree/sharedTree.js +81 -52
  83. package/dist/shared-tree/sharedTree.js.map +1 -1
  84. package/dist/shared-tree/treeApi.d.ts +2 -2
  85. package/dist/shared-tree/treeApi.d.ts.map +1 -1
  86. package/dist/shared-tree/treeApi.js +9 -3
  87. package/dist/shared-tree/treeApi.js.map +1 -1
  88. package/dist/shared-tree/treeCheckout.d.ts +3 -3
  89. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  90. package/dist/shared-tree/treeCheckout.js +3 -2
  91. package/dist/shared-tree/treeCheckout.js.map +1 -1
  92. package/dist/shared-tree-core/editManager.js +1 -1
  93. package/dist/shared-tree-core/editManager.js.map +1 -1
  94. package/dist/shared-tree-core/editManagerSummarizer.d.ts +1 -2
  95. package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  96. package/dist/shared-tree-core/editManagerSummarizer.js +0 -9
  97. package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
  98. package/dist/shared-tree-core/sequenceIdUtils.d.ts +12 -1
  99. package/dist/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  100. package/dist/shared-tree-core/sequenceIdUtils.js +25 -7
  101. package/dist/shared-tree-core/sequenceIdUtils.js.map +1 -1
  102. package/dist/shared-tree-core/sharedTreeCore.d.ts +25 -30
  103. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  104. package/dist/shared-tree-core/sharedTreeCore.js +20 -49
  105. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  106. package/dist/simple-tree/api/index.d.ts +3 -2
  107. package/dist/simple-tree/api/index.d.ts.map +1 -1
  108. package/dist/simple-tree/api/index.js +3 -1
  109. package/dist/simple-tree/api/index.js.map +1 -1
  110. package/dist/simple-tree/api/schemaFactory.d.ts +156 -63
  111. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  112. package/dist/simple-tree/api/schemaFactory.js +179 -86
  113. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  114. package/dist/{shared-tree → simple-tree/api}/transactionTypes.d.ts +1 -1
  115. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -0
  116. package/dist/{shared-tree → simple-tree/api}/transactionTypes.js.map +1 -1
  117. package/dist/simple-tree/api/tree.d.ts +23 -2
  118. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  119. package/dist/simple-tree/api/tree.js.map +1 -1
  120. package/dist/simple-tree/index.d.ts +1 -1
  121. package/dist/simple-tree/index.d.ts.map +1 -1
  122. package/dist/simple-tree/index.js +3 -2
  123. package/dist/simple-tree/index.js.map +1 -1
  124. package/dist/simple-tree/schemaTypes.d.ts +2 -2
  125. package/dist/simple-tree/schemaTypes.js +1 -1
  126. package/dist/simple-tree/schemaTypes.js.map +1 -1
  127. package/dist/simple-tree/treeNodeValid.js +1 -2
  128. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  129. package/dist/treeFactory.d.ts +16 -5
  130. package/dist/treeFactory.d.ts.map +1 -1
  131. package/dist/treeFactory.js +21 -12
  132. package/dist/treeFactory.js.map +1 -1
  133. package/dist/util/breakable.d.ts +1 -1
  134. package/dist/util/breakable.d.ts.map +1 -1
  135. package/dist/util/breakable.js.map +1 -1
  136. package/dist/util/rangeMap.d.ts +1 -1
  137. package/dist/util/rangeMap.js +1 -1
  138. package/dist/util/rangeMap.js.map +1 -1
  139. package/lib/alpha.d.ts +1 -0
  140. package/lib/beta.d.ts +1 -0
  141. package/lib/core/forest/editableForest.js +1 -1
  142. package/lib/core/forest/editableForest.js.map +1 -1
  143. package/lib/core/index.d.ts +1 -1
  144. package/lib/core/index.d.ts.map +1 -1
  145. package/lib/core/index.js.map +1 -1
  146. package/lib/core/tree/anchorSet.d.ts +2 -5
  147. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  148. package/lib/core/tree/anchorSet.js +1 -151
  149. package/lib/core/tree/anchorSet.js.map +1 -1
  150. package/lib/core/tree/index.d.ts +1 -2
  151. package/lib/core/tree/index.d.ts.map +1 -1
  152. package/lib/core/tree/index.js.map +1 -1
  153. package/lib/core/tree/pathTree.d.ts +0 -11
  154. package/lib/core/tree/pathTree.d.ts.map +1 -1
  155. package/lib/core/tree/pathTree.js.map +1 -1
  156. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  157. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  158. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +1 -1
  159. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  160. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +1 -2
  161. package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
  162. package/lib/feature-libraries/detachedFieldIndexSummarizer.js +0 -9
  163. package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
  164. package/lib/feature-libraries/flex-tree/treeEvents.d.ts +2 -4
  165. package/lib/feature-libraries/flex-tree/treeEvents.d.ts.map +1 -1
  166. package/lib/feature-libraries/flex-tree/treeEvents.js.map +1 -1
  167. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +1 -2
  168. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  169. package/lib/feature-libraries/forest-summary/forestSummarizer.js +0 -9
  170. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  171. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +6 -2
  172. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  173. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  174. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -4
  175. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  176. package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -19
  177. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  178. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  179. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +11 -12
  180. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  181. package/lib/feature-libraries/node-key/mockNodeKeyManager.js +1 -1
  182. package/lib/feature-libraries/node-key/mockNodeKeyManager.js.map +1 -1
  183. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  184. package/lib/feature-libraries/optional-field/optionalField.js +7 -3
  185. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  186. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +3 -5
  187. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  188. package/lib/feature-libraries/schema-index/schemaSummarizer.js +1 -11
  189. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  190. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +1 -1
  191. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  192. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +13 -1
  193. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  194. package/lib/index.d.ts +3 -3
  195. package/lib/index.d.ts.map +1 -1
  196. package/lib/index.js +3 -3
  197. package/lib/index.js.map +1 -1
  198. package/lib/legacy.d.ts +1 -0
  199. package/lib/packageVersion.d.ts +1 -1
  200. package/lib/packageVersion.js +1 -1
  201. package/lib/packageVersion.js.map +1 -1
  202. package/lib/public.d.ts +1 -0
  203. package/lib/shared-tree/index.d.ts +1 -3
  204. package/lib/shared-tree/index.d.ts.map +1 -1
  205. package/lib/shared-tree/index.js +1 -3
  206. package/lib/shared-tree/index.js.map +1 -1
  207. package/lib/shared-tree/schematizingTreeView.d.ts +4 -5
  208. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  209. package/lib/shared-tree/schematizingTreeView.js +4 -5
  210. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  211. package/lib/shared-tree/sharedTree.d.ts +39 -39
  212. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  213. package/lib/shared-tree/sharedTree.js +79 -50
  214. package/lib/shared-tree/sharedTree.js.map +1 -1
  215. package/lib/shared-tree/treeApi.d.ts +2 -2
  216. package/lib/shared-tree/treeApi.d.ts.map +1 -1
  217. package/lib/shared-tree/treeApi.js +8 -2
  218. package/lib/shared-tree/treeApi.js.map +1 -1
  219. package/lib/shared-tree/treeCheckout.d.ts +3 -3
  220. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  221. package/lib/shared-tree/treeCheckout.js +4 -3
  222. package/lib/shared-tree/treeCheckout.js.map +1 -1
  223. package/lib/shared-tree-core/editManager.js +2 -2
  224. package/lib/shared-tree-core/editManager.js.map +1 -1
  225. package/lib/shared-tree-core/editManagerSummarizer.d.ts +1 -2
  226. package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
  227. package/lib/shared-tree-core/editManagerSummarizer.js +0 -9
  228. package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
  229. package/lib/shared-tree-core/sequenceIdUtils.d.ts +12 -1
  230. package/lib/shared-tree-core/sequenceIdUtils.d.ts.map +1 -1
  231. package/lib/shared-tree-core/sequenceIdUtils.js +23 -5
  232. package/lib/shared-tree-core/sequenceIdUtils.js.map +1 -1
  233. package/lib/shared-tree-core/sharedTreeCore.d.ts +25 -30
  234. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  235. package/lib/shared-tree-core/sharedTreeCore.js +19 -48
  236. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  237. package/lib/simple-tree/api/index.d.ts +3 -2
  238. package/lib/simple-tree/api/index.d.ts.map +1 -1
  239. package/lib/simple-tree/api/index.js +1 -0
  240. package/lib/simple-tree/api/index.js.map +1 -1
  241. package/lib/simple-tree/api/schemaFactory.d.ts +156 -63
  242. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  243. package/lib/simple-tree/api/schemaFactory.js +178 -85
  244. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  245. package/lib/{shared-tree → simple-tree/api}/transactionTypes.d.ts +1 -1
  246. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -0
  247. package/lib/{shared-tree → simple-tree/api}/transactionTypes.js.map +1 -1
  248. package/lib/simple-tree/api/tree.d.ts +23 -2
  249. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  250. package/lib/simple-tree/api/tree.js.map +1 -1
  251. package/lib/simple-tree/index.d.ts +1 -1
  252. package/lib/simple-tree/index.d.ts.map +1 -1
  253. package/lib/simple-tree/index.js +1 -1
  254. package/lib/simple-tree/index.js.map +1 -1
  255. package/lib/simple-tree/schemaTypes.d.ts +2 -2
  256. package/lib/simple-tree/schemaTypes.js +1 -1
  257. package/lib/simple-tree/schemaTypes.js.map +1 -1
  258. package/lib/simple-tree/treeNodeValid.js +1 -2
  259. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  260. package/lib/treeFactory.d.ts +16 -5
  261. package/lib/treeFactory.d.ts.map +1 -1
  262. package/lib/treeFactory.js +20 -11
  263. package/lib/treeFactory.js.map +1 -1
  264. package/lib/util/breakable.d.ts +1 -1
  265. package/lib/util/breakable.d.ts.map +1 -1
  266. package/lib/util/breakable.js.map +1 -1
  267. package/lib/util/rangeMap.d.ts +1 -1
  268. package/lib/util/rangeMap.js +1 -1
  269. package/lib/util/rangeMap.js.map +1 -1
  270. package/package.json +21 -21
  271. package/src/core/forest/editableForest.ts +1 -1
  272. package/src/core/index.ts +0 -3
  273. package/src/core/tree/anchorSet.ts +4 -197
  274. package/src/core/tree/index.ts +0 -3
  275. package/src/core/tree/pathTree.ts +0 -13
  276. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +1 -1
  277. package/src/feature-libraries/detachedFieldIndexSummarizer.ts +0 -11
  278. package/src/feature-libraries/flex-tree/treeEvents.ts +2 -4
  279. package/src/feature-libraries/forest-summary/forestSummarizer.ts +0 -11
  280. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +6 -2
  281. package/src/feature-libraries/modular-schema/genericFieldKind.ts +3 -35
  282. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +9 -42
  283. package/src/feature-libraries/optional-field/optionalField.ts +10 -3
  284. package/src/feature-libraries/schema-index/schemaSummarizer.ts +1 -16
  285. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +13 -2
  286. package/src/index.ts +15 -12
  287. package/src/packageVersion.ts +1 -1
  288. package/src/shared-tree/index.ts +3 -19
  289. package/src/shared-tree/schematizingTreeView.ts +18 -16
  290. package/src/shared-tree/sharedTree.ts +203 -100
  291. package/src/shared-tree/treeApi.ts +10 -1
  292. package/src/shared-tree/treeCheckout.ts +11 -8
  293. package/src/shared-tree-core/editManager.ts +2 -2
  294. package/src/shared-tree-core/editManagerSummarizer.ts +0 -11
  295. package/src/shared-tree-core/sequenceIdUtils.ts +26 -5
  296. package/src/shared-tree-core/sharedTreeCore.ts +30 -87
  297. package/src/simple-tree/api/index.ts +15 -0
  298. package/src/simple-tree/api/schemaFactory.ts +203 -89
  299. package/src/{shared-tree → simple-tree/api}/transactionTypes.ts +1 -1
  300. package/src/simple-tree/api/tree.ts +31 -6
  301. package/src/simple-tree/index.ts +12 -0
  302. package/src/simple-tree/schemaTypes.ts +2 -2
  303. package/src/treeFactory.ts +29 -11
  304. package/src/util/breakable.ts +1 -1
  305. package/src/util/rangeMap.ts +1 -1
  306. package/dist/core/tree/visitPath.d.ts +0 -101
  307. package/dist/core/tree/visitPath.d.ts.map +0 -1
  308. package/dist/core/tree/visitPath.js +0 -7
  309. package/dist/core/tree/visitPath.js.map +0 -1
  310. package/dist/shared-tree/publicContracts.d.ts +0 -18
  311. package/dist/shared-tree/publicContracts.d.ts.map +0 -1
  312. package/dist/shared-tree/publicContracts.js +0 -24
  313. package/dist/shared-tree/publicContracts.js.map +0 -1
  314. package/dist/shared-tree/transactionTypes.d.ts.map +0 -1
  315. package/lib/core/tree/visitPath.d.ts +0 -101
  316. package/lib/core/tree/visitPath.d.ts.map +0 -1
  317. package/lib/core/tree/visitPath.js +0 -6
  318. package/lib/core/tree/visitPath.js.map +0 -1
  319. package/lib/shared-tree/publicContracts.d.ts +0 -18
  320. package/lib/shared-tree/publicContracts.d.ts.map +0 -1
  321. package/lib/shared-tree/publicContracts.js +0 -21
  322. package/lib/shared-tree/publicContracts.js.map +0 -1
  323. package/lib/shared-tree/transactionTypes.d.ts.map +0 -1
  324. package/src/core/tree/visitPath.ts +0 -124
  325. package/src/shared-tree/publicContracts.ts +0 -24
  326. /package/dist/{shared-tree → simple-tree/api}/transactionTypes.js +0 -0
  327. /package/lib/{shared-tree → simple-tree/api}/transactionTypes.js +0 -0
@@ -45,7 +45,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
45
45
  exports.SharedTreeCore = void 0;
46
46
  const internal_1 = require("@fluidframework/core-utils/internal");
47
47
  const internal_2 = require("@fluidframework/runtime-utils/internal");
48
- const internal_3 = require("@fluidframework/shared-object-base/internal");
49
48
  const index_js_1 = require("../core/index.js");
50
49
  const index_js_2 = require("../util/index.js");
51
50
  const editManager_js_1 = require("./editManager.js");
@@ -55,7 +54,7 @@ const messageCodecs_js_1 = require("./messageCodecs.js");
55
54
  const changeEnricher_js_1 = require("./changeEnricher.js");
56
55
  const defaultResubmitMachine_js_1 = require("./defaultResubmitMachine.js");
57
56
  const branchCommitEnricher_js_1 = require("./branchCommitEnricher.js");
58
- const internal_4 = require("@fluidframework/telemetry-utils/internal");
57
+ const internal_3 = require("@fluidframework/telemetry-utils/internal");
59
58
  // TODO: Organize this to be adjacent to persisted types.
60
59
  const summarizablesTreeKey = "indexes";
61
60
  /**
@@ -66,31 +65,24 @@ let SharedTreeCore = (() => {
66
65
  let _classDescriptor;
67
66
  let _classExtraInitializers = [];
68
67
  let _classThis;
69
- let _classSuper = internal_3.SharedObject;
70
68
  let _instanceExtraInitializers = [];
71
69
  let _summarizeCore_decorators;
72
- var SharedTreeCore = _classThis = class extends _classSuper {
73
- /**
74
- * Used to edit the state of the tree. Edits will be immediately applied locally to the tree.
75
- * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.
76
- */
77
- get editor() {
78
- return this.getLocalBranch().editor;
79
- }
70
+ var SharedTreeCore = _classThis = class {
80
71
  /**
81
72
  * @param summarizables - Summarizers for all indexes used by this tree
82
73
  * @param changeFamily - The change family
83
74
  * @param editManager - The edit manager
84
- * @param id - The id of the shared object
85
75
  * @param runtime - The IFluidDataStoreRuntime which contains the shared object
86
- * @param attributes - Attributes of the shared object
87
- * @param telemetryContextPrefix - The property prefix for telemetry pertaining to this object. See {@link ITelemetryContext}
76
+ * @param editor - Used to edit the state of the tree. Edits will be immediately applied locally to the tree.
77
+ * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.
88
78
  */
89
- constructor(summarizables, changeFamily, options, formatOptions,
90
- // Base class arguments
91
- id, runtime, attributes, telemetryContextPrefix, schema, schemaPolicy, resubmitMachine, enricher) {
92
- super(id, runtime, attributes, telemetryContextPrefix);
93
- this.breaker = (__runInitializers(this, _instanceExtraInitializers), new index_js_2.Breakable("Shared Tree"));
79
+ constructor(breaker, sharedObject, serializer, submitLocalMessage, logger, summarizables, changeFamily, options, formatOptions, idCompressor, schema, schemaPolicy, resubmitMachine, enricher, getEditor = () => this.getLocalBranch().editor) {
80
+ this.breaker = (__runInitializers(this, _instanceExtraInitializers), breaker);
81
+ this.sharedObject = sharedObject;
82
+ this.serializer = serializer;
83
+ this.submitLocalMessage = submitLocalMessage;
84
+ this.idCompressor = idCompressor;
85
+ this.getEditor = getEditor;
94
86
  /**
95
87
  * The sequence number that this instance is at.
96
88
  * This number is artificial in that it is made up by this instance as opposed to being provided by the runtime.
@@ -101,19 +93,17 @@ let SharedTreeCore = (() => {
101
93
  schema,
102
94
  policy: schemaPolicy,
103
95
  };
104
- const rebaseLogger = (0, internal_4.createChildLogger)({
105
- logger: this.logger,
96
+ const rebaseLogger = (0, internal_3.createChildLogger)({
97
+ logger,
106
98
  namespace: "Rebase",
107
99
  });
108
- (0, internal_1.assert)(runtime.idCompressor !== undefined, 0x886 /* IdCompressor must be enabled to use SharedTree */);
109
- this.idCompressor = runtime.idCompressor;
110
100
  this.mintRevisionTag = () => this.idCompressor.generateCompressedId();
111
101
  /**
112
102
  * A random ID that uniquely identifies this client in the collab session.
113
103
  * This is sent alongside every op to identify which client the op originated from.
114
104
  * This is used rather than the Fluid client ID because the Fluid client ID is not stable across reconnections.
115
105
  */
116
- const localSessionId = runtime.idCompressor.localSessionId;
106
+ const localSessionId = idCompressor.localSessionId;
117
107
  this.editManager = new editManager_js_1.EditManager(changeFamily, localSessionId, this.mintRevisionTag, rebaseLogger);
118
108
  this.editManager.localBranch.events.on("beforeChange", (change) => {
119
109
  if (this.detachedRevision === undefined) {
@@ -126,14 +116,14 @@ let SharedTreeCore = (() => {
126
116
  }
127
117
  }
128
118
  });
129
- const revisionTagCodec = new index_js_1.RevisionTagCodec(runtime.idCompressor);
119
+ const revisionTagCodec = new index_js_1.RevisionTagCodec(idCompressor);
130
120
  const editManagerCodec = (0, editManagerCodecs_js_1.makeEditManagerCodec)(this.editManager.changeFamily.codecs, revisionTagCodec, options, formatOptions.editManager);
131
121
  this.summarizables = [
132
122
  new editManagerSummarizer_js_1.EditManagerSummarizer(this.editManager, editManagerCodec, this.idCompressor, this.schemaAndPolicy),
133
123
  ...summarizables,
134
124
  ];
135
125
  (0, internal_1.assert)(new Set(this.summarizables.map((e) => e.key)).size === this.summarizables.length, 0x350 /* Index summary element keys must be unique */);
136
- this.messageCodec = (0, messageCodecs_js_1.makeMessageCodec)(changeFamily.codecs, new index_js_1.RevisionTagCodec(runtime.idCompressor), options, formatOptions.message);
126
+ this.messageCodec = (0, messageCodecs_js_1.makeMessageCodec)(changeFamily.codecs, new index_js_1.RevisionTagCodec(idCompressor), options, formatOptions.message);
137
127
  const changeEnricher = enricher ?? new changeEnricher_js_1.NoOpChangeEnricher();
138
128
  this.resubmitMachine =
139
129
  resubmitMachine ??
@@ -147,7 +137,7 @@ let SharedTreeCore = (() => {
147
137
  const summarizableBuilder = new internal_2.SummaryTreeBuilder();
148
138
  // Merge the summaries of all summarizables together under a single ISummaryTree
149
139
  for (const s of this.summarizables) {
150
- summarizableBuilder.addWithStats(s.key, s.getAttachSummary((contents) => serializer.stringify(contents, this.handle), undefined, undefined, telemetryContext, incrementalSummaryContext));
140
+ summarizableBuilder.addWithStats(s.key, s.getAttachSummary((contents) => serializer.stringify(contents, this.sharedObject.handle), undefined, undefined, telemetryContext, incrementalSummaryContext));
151
141
  }
152
142
  builder.addWithStats(summarizablesTreeKey, summarizableBuilder.getSummaryTree());
153
143
  return builder.getSummaryTree();
@@ -189,7 +179,7 @@ let SharedTreeCore = (() => {
189
179
  * and may differ from `commit` due to enrichments like detached tree refreshers.
190
180
  */
191
181
  submitCommit(commit, schemaAndPolicy, isResubmit) {
192
- (0, internal_1.assert)(this.isAttached() === (this.detachedRevision === undefined), 0x95a /* Detached revision should only be set when not attached */);
182
+ (0, internal_1.assert)(this.sharedObject.isAttached() === (this.detachedRevision === undefined), 0x95a /* Detached revision should only be set when not attached */);
193
183
  const enrichedCommit = this.detachedRevision === undefined && !isResubmit
194
184
  ? this.commitEnricher.enrich(commit)
195
185
  : commit;
@@ -229,11 +219,8 @@ let SharedTreeCore = (() => {
229
219
  getLocalBranch() {
230
220
  return this.editManager.localBranch;
231
221
  }
232
- onDisconnect() { }
233
222
  didAttach() {
234
- if (this.detachedRevision !== undefined) {
235
- this.detachedRevision = undefined;
236
- }
223
+ this.detachedRevision = undefined;
237
224
  }
238
225
  reSubmitCore(content, localOpMetadata) {
239
226
  // Empty context object is passed in, as our decode function is schema-agnostic.
@@ -257,26 +244,10 @@ let SharedTreeCore = (() => {
257
244
  const { commit: { revision, change }, } = this.messageCodec.decode(content, { idCompressor: this.idCompressor });
258
245
  this.editManager.localBranch.apply({ change, revision });
259
246
  }
260
- getGCData(fullGC) {
261
- const gcNodes = super.getGCData(fullGC).gcNodes;
262
- for (const s of this.summarizables) {
263
- for (const [id, routes] of Object.entries(s.getGCData(fullGC).gcNodes)) {
264
- gcNodes[id] ?? (gcNodes[id] = []);
265
- for (const route of routes) {
266
- // Non null asserting here because we are creating an array at gcNodes[id] if it is undefined
267
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
268
- gcNodes[id].push(route);
269
- }
270
- }
271
- }
272
- return {
273
- gcNodes,
274
- };
275
- }
276
247
  };
277
248
  __setFunctionName(_classThis, "SharedTreeCore");
278
249
  (() => {
279
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
250
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
280
251
  _summarizeCore_decorators = [index_js_2.throwIfBroken];
281
252
  __esDecorate(_classThis, null, _summarizeCore_decorators, { kind: "method", name: "summarizeCore", static: false, private: false, access: { has: obj => "summarizeCore" in obj, get: obj => obj.summarizeCore }, metadata: _metadata }, null, _instanceExtraInitializers);
282
253
  __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
@@ -1 +1 @@
1
- {"version":3,"file":"sharedTreeCore.js","sourceRoot":"","sources":["../../src/shared-tree-core/sharedTreeCore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kEAA6D;AAc7D,qEAA4E;AAC5E,0EAGqD;AAGrD,+CAW0B;AAC1B,+CAO0B;AAG1B,qDAA8E;AAC9E,iEAA8D;AAE9D,yEAAmE;AACnE,yDAAmF;AAEnF,2DAA8F;AAE9F,2EAAqE;AACrE,uEAAiE;AACjE,uEAA6E;AAE7E,yDAAyD;AACzD,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAWvC;;GAEG;IAEU,cAAc;4BAD1B,wBAAa;;;;sBAEL,uBAAY;;;2CAApB,SAAQ,WAAY;QAcpB;;;WAGG;QACH,IAAW,MAAM;YAChB,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC;QACrC,CAAC;QA2BD;;;;;;;;WAQG;QACH,YACC,aAAsC,EACtC,YAA4C,EAC5C,OAAsB,EACtB,aAAwC;QACxC,uBAAuB;QACvB,EAAU,EACV,OAA+B,EAC/B,UAA8B,EAC9B,sBAA8B,EAC9B,MAAkC,EAClC,YAA0B,EAC1B,eAA0C,EAC1C,QAAkD;YAElD,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC;YApExC,YAAO,IAJX,mDAAc,EAIW,IAAI,oBAAS,CAAC,aAAa,CAAC,EAAC;YAIlE;;;;eAIG;YACK,qBAAgB,GAA0B,8CAA6B,CAAC;YA6D/E,IAAI,CAAC,eAAe,GAAG;gBACtB,MAAM;gBACN,MAAM,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ACP,CAAC;QACH,CAAC;;;;;qCAlNA,wBAAa;QACd,gMAAU,aAAa,6DAuBtB;QApLF,6KA+WC;;;QA/WY,uDAAc;;;;AAAd,wCAAc;AAiX3B,SAAS,sBAAsB,CAC9B,iBAA0B;IAE1B,MAAM,eAAe,GAAG,iBAA4C,CAAC;IACrE,OAAO,eAAe,CAAC,MAAM,KAAK,SAAS,IAAI,eAAe,CAAC,MAAM,KAAK,SAAS,CAAC;AACrF,CAAC;AA6DD;;GAEG;AACH,SAAS,mBAAmB,CAC3B,OAA+B,EAC/B,GAAG,YAAsB;IAEzB,MAAM,KAAK,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAE3C,OAAO;QACN,KAAK,CAAC,QAAQ,CAAC,IAAY;YAC1B,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,KAAK,CAAC,QAAQ,CAAC,IAAI;YAClB,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI;YACd,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC;KACD,CAAC;AACH,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/internal\";\nimport type {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\ttype IFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ICodecOptions, IJsonCodec } from \"../codec/index.js\";\nimport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\tfindAncestor,\n\ttype GraphCommit,\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\ttype SchemaAndPolicy,\n\ttype SchemaPolicy,\n\ttype TaggedChange,\n\ttype TreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tbrand,\n\tBreakable,\n\ttype WithBreakable,\n\tthrowIfBroken,\n\tbreakingClass,\n} from \"../util/index.js\";\n\nimport type { SharedTreeBranch } from \"./branch.js\";\nimport { EditManager, minimumPossibleSequenceNumber } from \"./editManager.js\";\nimport { makeEditManagerCodec } from \"./editManagerCodecs.js\";\nimport type { SeqNumber } from \"./editManagerFormat.js\";\nimport { EditManagerSummarizer } from \"./editManagerSummarizer.js\";\nimport { type MessageEncodingContext, makeMessageCodec } from \"./messageCodecs.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\nimport { type ChangeEnricherReadonlyCheckout, NoOpChangeEnricher } from \"./changeEnricher.js\";\nimport type { ResubmitMachine } from \"./resubmitMachine.js\";\nimport { DefaultResubmitMachine } from \"./defaultResubmitMachine.js\";\nimport { BranchCommitEnricher } from \"./branchCommitEnricher.js\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\n\n// TODO: Organize this to be adjacent to persisted types.\nconst summarizablesTreeKey = \"indexes\";\n\nexport interface ExplicitCoreCodecVersions {\n\teditManager: number;\n\tmessage: number;\n}\n\nexport interface ClonableSchemaAndPolicy extends SchemaAndPolicy {\n\tschema: TreeStoredSchemaRepository;\n}\n\n/**\n * Generic shared tree, which needs to be configured with indexes, field kinds and other configuration.\n */\n@breakingClass\nexport class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>\n\textends SharedObject\n\timplements WithBreakable\n{\n\tpublic readonly breaker: Breakable = new Breakable(\"Shared Tree\");\n\n\tprivate readonly editManager: EditManager<TEditor, TChange, ChangeFamily<TEditor, TChange>>;\n\tprivate readonly summarizables: readonly [EditManagerSummarizer<TChange>, ...Summarizable[]];\n\t/**\n\t * The sequence number that this instance is at.\n\t * This number is artificial in that it is made up by this instance as opposed to being provided by the runtime.\n\t * Is `undefined` after (and only after) this instance is attached.\n\t */\n\tprivate detachedRevision: SeqNumber | undefined = minimumPossibleSequenceNumber;\n\n\t/**\n\t * Used to edit the state of the tree. Edits will be immediately applied locally to the tree.\n\t * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.\n\t */\n\tpublic get editor(): TEditor {\n\t\treturn this.getLocalBranch().editor;\n\t}\n\n\t/**\n\t * Used to encode/decode messages sent to/received from the Fluid runtime.\n\t *\n\t * @remarks Since there is currently only one format, this can just be cached on the class.\n\t * With more write formats active, it may make sense to keep around the \"usual\" format codec\n\t * (the one for the current persisted configuration) and resolve codecs for different versions\n\t * as necessary (e.g. an upgrade op came in, or the configuration changed within the collab window\n\t * and an op needs to be interpreted which isn't written with the current configuration).\n\t */\n\tprivate readonly messageCodec: IJsonCodec<\n\t\tDecodedMessage<TChange>,\n\t\tunknown,\n\t\tunknown,\n\t\tMessageEncodingContext\n\t>;\n\n\tprivate readonly idCompressor: IIdCompressor;\n\n\tprivate readonly resubmitMachine: ResubmitMachine<TChange>;\n\tprotected readonly commitEnricher: BranchCommitEnricher<TChange>;\n\n\tprotected readonly mintRevisionTag: () => RevisionTag;\n\n\tprivate readonly schemaAndPolicy: ClonableSchemaAndPolicy;\n\n\t/**\n\t * @param summarizables - Summarizers for all indexes used by this tree\n\t * @param changeFamily - The change family\n\t * @param editManager - The edit manager\n\t * @param id - The id of the shared object\n\t * @param runtime - The IFluidDataStoreRuntime which contains the shared object\n\t * @param attributes - Attributes of the shared object\n\t * @param telemetryContextPrefix - The property prefix for telemetry pertaining to this object. See {@link ITelemetryContext}\n\t */\n\tpublic constructor(\n\t\tsummarizables: readonly Summarizable[],\n\t\tchangeFamily: ChangeFamily<TEditor, TChange>,\n\t\toptions: ICodecOptions,\n\t\tformatOptions: ExplicitCoreCodecVersions,\n\t\t// Base class arguments\n\t\tid: string,\n\t\truntime: IFluidDataStoreRuntime,\n\t\tattributes: IChannelAttributes,\n\t\ttelemetryContextPrefix: string,\n\t\tschema: TreeStoredSchemaRepository,\n\t\tschemaPolicy: SchemaPolicy,\n\t\tresubmitMachine?: ResubmitMachine<TChange>,\n\t\tenricher?: ChangeEnricherReadonlyCheckout<TChange>,\n\t) {\n\t\tsuper(id, runtime, attributes, telemetryContextPrefix);\n\n\t\tthis.schemaAndPolicy = {\n\t\t\tschema,\n\t\t\tpolicy: schemaPolicy,\n\t\t};\n\n\t\tconst rebaseLogger = createChildLogger({\n\t\t\tlogger: this.logger,\n\t\t\tnamespace: \"Rebase\",\n\t\t});\n\n\t\tassert(\n\t\t\truntime.idCompressor !== undefined,\n\t\t\t0x886 /* IdCompressor must be enabled to use SharedTree */,\n\t\t);\n\t\tthis.idCompressor = runtime.idCompressor;\n\t\tthis.mintRevisionTag = () => this.idCompressor.generateCompressedId();\n\t\t/**\n\t\t * A random ID that uniquely identifies this client in the collab session.\n\t\t * This is sent alongside every op to identify which client the op originated from.\n\t\t * This is used rather than the Fluid client ID because the Fluid client ID is not stable across reconnections.\n\t\t */\n\t\tconst localSessionId = runtime.idCompressor.localSessionId;\n\t\tthis.editManager = new EditManager(\n\t\t\tchangeFamily,\n\t\t\tlocalSessionId,\n\t\t\tthis.mintRevisionTag,\n\t\t\trebaseLogger,\n\t\t);\n\n\t\tthis.editManager.localBranch.events.on(\"beforeChange\", (change) => {\n\t\t\tif (this.detachedRevision === undefined) {\n\t\t\t\t// Commit enrichment is only necessary for changes that will be submitted as ops, and changes issued while detached are not submitted.\n\t\t\t\tthis.commitEnricher.processChange(change);\n\t\t\t}\n\t\t\tif (change.type === \"append\") {\n\t\t\t\tfor (const commit of change.newCommits) {\n\t\t\t\t\tthis.submitCommit(commit, this.schemaAndPolicy, false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst revisionTagCodec = new RevisionTagCodec(runtime.idCompressor);\n\t\tconst editManagerCodec = makeEditManagerCodec(\n\t\t\tthis.editManager.changeFamily.codecs,\n\t\t\trevisionTagCodec,\n\t\t\toptions,\n\t\t\tformatOptions.editManager,\n\t\t);\n\t\tthis.summarizables = [\n\t\t\tnew EditManagerSummarizer(\n\t\t\t\tthis.editManager,\n\t\t\t\teditManagerCodec,\n\t\t\t\tthis.idCompressor,\n\t\t\t\tthis.schemaAndPolicy,\n\t\t\t),\n\t\t\t...summarizables,\n\t\t];\n\t\tassert(\n\t\t\tnew Set(this.summarizables.map((e) => e.key)).size === this.summarizables.length,\n\t\t\t0x350 /* Index summary element keys must be unique */,\n\t\t);\n\n\t\tthis.messageCodec = makeMessageCodec(\n\t\t\tchangeFamily.codecs,\n\t\t\tnew RevisionTagCodec(runtime.idCompressor),\n\t\t\toptions,\n\t\t\tformatOptions.message,\n\t\t);\n\n\t\tconst changeEnricher = enricher ?? new NoOpChangeEnricher();\n\t\tthis.resubmitMachine =\n\t\t\tresubmitMachine ??\n\t\t\tnew DefaultResubmitMachine(\n\t\t\t\t(change: TaggedChange<TChange>) =>\n\t\t\t\t\tchangeFamily.rebaser.invert(change, true, this.mintRevisionTag()),\n\t\t\t\tchangeEnricher,\n\t\t\t);\n\t\tthis.commitEnricher = new BranchCommitEnricher(changeFamily.rebaser, changeEnricher);\n\t}\n\n\t// TODO: SharedObject's merging of the two summary methods into summarizeCore is not what we want here:\n\t// We might want to not subclass it, or override/reimplement most of its functionality.\n\t@throwIfBroken\n\tprotected summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tconst summarizableBuilder = new SummaryTreeBuilder();\n\t\t// Merge the summaries of all summarizables together under a single ISummaryTree\n\t\tfor (const s of this.summarizables) {\n\t\t\tsummarizableBuilder.addWithStats(\n\t\t\t\ts.key,\n\t\t\t\ts.getAttachSummary(\n\t\t\t\t\t(contents) => serializer.stringify(contents, this.handle),\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\ttelemetryContext,\n\t\t\t\t\tincrementalSummaryContext,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tbuilder.addWithStats(summarizablesTreeKey, summarizableBuilder.getSummaryTree());\n\t\treturn builder.getSummaryTree();\n\t}\n\n\tprotected async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tassert(\n\t\t\tthis.editManager.localBranch.getHead() === this.editManager.getTrunkHead(),\n\t\t\t0xaaa /* All local changes should be applied to the trunk before loading from summary */,\n\t\t);\n\t\tconst [editManagerSummarizer, ...summarizables] = this.summarizables;\n\t\tconst loadEditManager = this.loadSummarizable(editManagerSummarizer, services);\n\t\tconst loadSummarizables = summarizables.map(async (s) =>\n\t\t\tthis.loadSummarizable(s, services),\n\t\t);\n\n\t\tif (this.detachedRevision !== undefined) {\n\t\t\t// If we are detached but loading from a summary, then we need to update our detached revision to ensure that it is ahead of all detached revisions in the summary.\n\t\t\t// First, finish loading the edit manager so that we can inspect the sequence numbers of the commits on the trunk.\n\t\t\tawait loadEditManager;\n\t\t\t// Find the most recent detached revision in the summary trunk...\n\t\t\tlet latestDetachedSequenceNumber: SeqNumber | undefined;\n\t\t\tfindAncestor(this.editManager.getTrunkHead(), (c) => {\n\t\t\t\tconst sequenceNumber = this.editManager.getSequenceNumber(c);\n\t\t\t\tif (sequenceNumber !== undefined && sequenceNumber < 0) {\n\t\t\t\t\tlatestDetachedSequenceNumber = sequenceNumber;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\t// ...and set our detached revision to be as it would be if we had been already created that revision.\n\t\t\tthis.detachedRevision = latestDetachedSequenceNumber ?? this.detachedRevision;\n\t\t\tawait Promise.all(loadSummarizables);\n\t\t} else {\n\t\t\tawait Promise.all([loadEditManager, ...loadSummarizables]);\n\t\t}\n\t}\n\n\tprivate async loadSummarizable(\n\t\tsummarizable: Summarizable,\n\t\tservices: IChannelStorageService,\n\t): Promise<void> {\n\t\treturn summarizable.load(\n\t\t\tscopeStorageService(services, summarizablesTreeKey, summarizable.key),\n\t\t\t(contents) => this.serializer.parse(contents),\n\t\t);\n\t}\n\n\t/**\n\t * Submits an op to the Fluid runtime containing the given commit\n\t * @param commit - the commit to submit\n\t * @returns the submitted commit. This is undefined if the underlying `SharedObject` is not attached,\n\t * and may differ from `commit` due to enrichments like detached tree refreshers.\n\t */\n\tprotected submitCommit(\n\t\tcommit: GraphCommit<TChange>,\n\t\tschemaAndPolicy: ClonableSchemaAndPolicy,\n\t\tisResubmit: boolean,\n\t): void {\n\t\tassert(\n\t\t\tthis.isAttached() === (this.detachedRevision === undefined),\n\t\t\t0x95a /* Detached revision should only be set when not attached */,\n\t\t);\n\n\t\tconst enrichedCommit =\n\t\t\tthis.detachedRevision === undefined && !isResubmit\n\t\t\t\t? this.commitEnricher.enrich(commit)\n\t\t\t\t: commit;\n\n\t\t// Edits submitted before the first attach are treated as sequenced because they will be included\n\t\t// in the attach summary that is uploaded to the service.\n\t\t// Until this attach workflow happens, this instance essentially behaves as a centralized data structure.\n\t\tif (this.detachedRevision !== undefined) {\n\t\t\tconst newRevision: SeqNumber = brand((this.detachedRevision as number) + 1);\n\t\t\tthis.detachedRevision = newRevision;\n\t\t\tthis.editManager.addSequencedChange(\n\t\t\t\t{ ...enrichedCommit, sessionId: this.editManager.localSessionId },\n\t\t\t\tnewRevision,\n\t\t\t\tthis.detachedRevision,\n\t\t\t);\n\t\t\tthis.editManager.advanceMinimumSequenceNumber(newRevision, false);\n\t\t\treturn undefined;\n\t\t}\n\t\tconst message = this.messageCodec.encode(\n\t\t\t{\n\t\t\t\tcommit: enrichedCommit,\n\t\t\t\tsessionId: this.editManager.localSessionId,\n\t\t\t},\n\t\t\t{\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t\tschema: schemaAndPolicy,\n\t\t\t},\n\t\t);\n\t\tthis.submitLocalMessage(message, {\n\t\t\t// Clone the schema to ensure that during resubmit the schema has not been mutated by later changes\n\t\t\tschema: schemaAndPolicy.schema.clone(),\n\t\t\tpolicy: schemaAndPolicy.policy,\n\t\t});\n\t\tthis.resubmitMachine.onCommitSubmitted(enrichedCommit);\n\t}\n\n\tprotected processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// Empty context object is passed in, as our decode function is schema-agnostic.\n\t\tconst { commit, sessionId } = this.messageCodec.decode(message.contents, {\n\t\t\tidCompressor: this.idCompressor,\n\t\t});\n\n\t\tthis.editManager.addSequencedChange(\n\t\t\t{ ...commit, sessionId },\n\t\t\tbrand(message.sequenceNumber),\n\t\t\tbrand(message.referenceSequenceNumber),\n\t\t);\n\t\tthis.resubmitMachine.onSequencedCommitApplied(local);\n\n\t\tthis.editManager.advanceMinimumSequenceNumber(brand(message.minimumSequenceNumber));\n\t}\n\n\tprotected getLocalBranch(): SharedTreeBranch<TEditor, TChange> {\n\t\treturn this.editManager.localBranch;\n\t}\n\n\tprotected onDisconnect(): void {}\n\n\tprotected override didAttach(): void {\n\t\tif (this.detachedRevision !== undefined) {\n\t\t\tthis.detachedRevision = undefined;\n\t\t}\n\t}\n\n\tprotected override reSubmitCore(\n\t\tcontent: JsonCompatibleReadOnly,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// Empty context object is passed in, as our decode function is schema-agnostic.\n\t\tconst {\n\t\t\tcommit: { revision },\n\t\t} = this.messageCodec.decode(this.serializer.decode(content), {\n\t\t\tidCompressor: this.idCompressor,\n\t\t});\n\t\tconst [commit] = this.editManager.findLocalCommit(revision);\n\t\t// If a resubmit phase is not already in progress, then this must be the first commit of a new resubmit phase.\n\t\tif (this.resubmitMachine.isInResubmitPhase === false) {\n\t\t\tconst toResubmit = this.editManager.getLocalCommits();\n\t\t\tassert(\n\t\t\t\tcommit === toResubmit[0],\n\t\t\t\t0x95d /* Resubmit phase should start with the oldest local commit */,\n\t\t\t);\n\t\t\tthis.resubmitMachine.prepareForResubmit(toResubmit);\n\t\t}\n\t\tassert(\n\t\t\tisClonableSchemaPolicy(localOpMetadata),\n\t\t\t0x95e /* Local metadata must contain schema and policy. */,\n\t\t);\n\t\tassert(\n\t\t\tthis.resubmitMachine.isInResubmitPhase !== false,\n\t\t\t0x984 /* Invalid resubmit outside of resubmit phase */,\n\t\t);\n\t\tconst enrichedCommit = this.resubmitMachine.peekNextCommit();\n\t\tthis.submitCommit(enrichedCommit, localOpMetadata, true);\n\t}\n\n\tprotected applyStashedOp(content: JsonCompatibleReadOnly): void {\n\t\t// Empty context object is passed in, as our decode function is schema-agnostic.\n\t\tconst {\n\t\t\tcommit: { revision, change },\n\t\t} = this.messageCodec.decode(content, { idCompressor: this.idCompressor });\n\t\tthis.editManager.localBranch.apply({ change, revision });\n\t}\n\n\tpublic override getGCData(fullGC?: boolean): IGarbageCollectionData {\n\t\tconst gcNodes: IGarbageCollectionData[\"gcNodes\"] = super.getGCData(fullGC).gcNodes;\n\t\tfor (const s of this.summarizables) {\n\t\t\tfor (const [id, routes] of Object.entries(s.getGCData(fullGC).gcNodes)) {\n\t\t\t\tgcNodes[id] ??= [];\n\t\t\t\tfor (const route of routes) {\n\t\t\t\t\t// Non null asserting here because we are creating an array at gcNodes[id] if it is undefined\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\tgcNodes[id]!.push(route);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tgcNodes,\n\t\t};\n\t}\n}\n\nfunction isClonableSchemaPolicy(\n\tmaybeSchemaPolicy: unknown,\n): maybeSchemaPolicy is ClonableSchemaAndPolicy {\n\tconst schemaAndPolicy = maybeSchemaPolicy as ClonableSchemaAndPolicy;\n\treturn schemaAndPolicy.schema !== undefined && schemaAndPolicy.policy !== undefined;\n}\n\n/**\n * Specifies the behavior of a component that puts data in a summary.\n */\nexport interface Summarizable {\n\t/**\n\t * Field name in summary json under which this element stores its data.\n\t */\n\treadonly key: string;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getAttachSummary}\n\t * @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.\n\t */\n\tgetAttachSummary(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): ISummaryTreeWithStats;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize}\n\t * @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.\n\t */\n\tsummarize(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * {@inheritDoc (ISharedObject:interface).getGCData}\n\t */\n\t// TODO: Change this interface (and the one in ISharedObject, if necessary) to support \"handles within handles\".\n\t// Consider the case of a document with history; the return value here currently grows unboundedly.\n\tgetGCData(fullGC?: boolean): IGarbageCollectionData;\n\n\t/**\n\t * Allows the component to perform custom loading. The storage service is scoped to this component and therefore\n\t * paths in this component will not collide with those in other components, even if they are the same string.\n\t * @param service - Storage used by the component\n\t * @param parse - Parses serialized data from storage into runtime objects for the component\n\t */\n\tload(service: IChannelStorageService, parse: SummaryElementParser): Promise<void>;\n}\n\n/**\n * Serializes the given contents into a string acceptable for storing in summaries, i.e. all\n * Fluid handles have been replaced appropriately by an IFluidSerializer\n */\nexport type SummaryElementStringifier = (contents: unknown) => string;\n\n/**\n * Parses a serialized/summarized string into an object, rehydrating any Fluid handles as necessary\n */\nexport type SummaryElementParser = (contents: string) => unknown;\n\n/**\n * Compose an {@link IChannelStorageService} which prefixes all paths before forwarding them to the original service\n */\nfunction scopeStorageService(\n\tservice: IChannelStorageService,\n\t...pathElements: string[]\n): IChannelStorageService {\n\tconst scope = `${pathElements.join(\"/\")}/`;\n\n\treturn {\n\t\tasync readBlob(path: string): Promise<ArrayBufferLike> {\n\t\t\treturn service.readBlob(`${scope}${path}`);\n\t\t},\n\t\tasync contains(path) {\n\t\t\treturn service.contains(`${scope}${path}`);\n\t\t},\n\t\tasync list(path) {\n\t\t\treturn service.list(`${scope}${path}`);\n\t\t},\n\t};\n}\n"]}
1
+ {"version":3,"file":"sharedTreeCore.js","sourceRoot":"","sources":["../../src/shared-tree-core/sharedTreeCore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kEAA6D;AAS7D,qEAA4E;AAI5E,+CAW0B;AAC1B,+CAO0B;AAG1B,qDAA8E;AAC9E,iEAA8D;AAE9D,yEAAmE;AACnE,yDAAmF;AAEnF,2DAA8F;AAE9F,2EAAqE;AACrE,uEAAiE;AACjE,uEAA6E;AAI7E,yDAAyD;AACzD,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAWvC;;GAEG;IAEU,cAAc;4BAD1B,wBAAa;;;;;;;QAoCb;;;;;;;WAOG;QACH,YACiB,OAAkB,EAClB,YAA2C,EAC3C,UAA4B,EAC5B,kBAAyE,EACzF,MAAwC,EACxC,aAAsC,EACtC,YAA4C,EAC5C,OAAsB,EACtB,aAAwC,EACvB,YAA2B,EAC5C,MAAkC,EAClC,YAA0B,EAC1B,eAA0C,EAC1C,QAAkD,EAClC,YAA2B,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC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EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,KAAK,CAAC,QAAQ,CAAC,IAAI;YAClB,OAAO,OAAO,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,IAAI;YACd,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC;KACD,CAAC;AACH,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/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type { ISequencedDocumentMessage } from \"@fluidframework/driver-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidSerializer } from \"@fluidframework/shared-object-base/internal\";\n\nimport type { ICodecOptions, IJsonCodec } from \"../codec/index.js\";\nimport {\n\ttype ChangeFamily,\n\ttype ChangeFamilyEditor,\n\tfindAncestor,\n\ttype GraphCommit,\n\ttype RevisionTag,\n\tRevisionTagCodec,\n\ttype SchemaAndPolicy,\n\ttype SchemaPolicy,\n\ttype TaggedChange,\n\ttype TreeStoredSchemaRepository,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tbrand,\n\ttype Breakable,\n\ttype WithBreakable,\n\tthrowIfBroken,\n\tbreakingClass,\n} from \"../util/index.js\";\n\nimport type { SharedTreeBranch } from \"./branch.js\";\nimport { EditManager, minimumPossibleSequenceNumber } from \"./editManager.js\";\nimport { makeEditManagerCodec } from \"./editManagerCodecs.js\";\nimport type { SeqNumber } from \"./editManagerFormat.js\";\nimport { EditManagerSummarizer } from \"./editManagerSummarizer.js\";\nimport { type MessageEncodingContext, makeMessageCodec } from \"./messageCodecs.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\nimport { type ChangeEnricherReadonlyCheckout, NoOpChangeEnricher } from \"./changeEnricher.js\";\nimport type { ResubmitMachine } from \"./resubmitMachine.js\";\nimport { DefaultResubmitMachine } from \"./defaultResubmitMachine.js\";\nimport { BranchCommitEnricher } from \"./branchCommitEnricher.js\";\nimport { createChildLogger } from \"@fluidframework/telemetry-utils/internal\";\nimport type { IFluidLoadable, ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport type { IChannelView } from \"../shared-tree/index.js\";\n\n// TODO: Organize this to be adjacent to persisted types.\nconst summarizablesTreeKey = \"indexes\";\n\nexport interface ExplicitCoreCodecVersions {\n\teditManager: number;\n\tmessage: number;\n}\n\nexport interface ClonableSchemaAndPolicy extends SchemaAndPolicy {\n\tschema: TreeStoredSchemaRepository;\n}\n\n/**\n * Generic shared tree, which needs to be configured with indexes, field kinds and other configuration.\n */\n@breakingClass\nexport class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>\n\timplements WithBreakable\n{\n\tprivate readonly editManager: EditManager<TEditor, TChange, ChangeFamily<TEditor, TChange>>;\n\tprivate readonly summarizables: readonly [EditManagerSummarizer<TChange>, ...Summarizable[]];\n\t/**\n\t * The sequence number that this instance is at.\n\t * This number is artificial in that it is made up by this instance as opposed to being provided by the runtime.\n\t * Is `undefined` after (and only after) this instance is attached.\n\t */\n\tprivate detachedRevision: SeqNumber | undefined = minimumPossibleSequenceNumber;\n\n\t/**\n\t * Used to encode/decode messages sent to/received from the Fluid runtime.\n\t *\n\t * @remarks Since there is currently only one format, this can just be cached on the class.\n\t * With more write formats active, it may make sense to keep around the \"usual\" format codec\n\t * (the one for the current persisted configuration) and resolve codecs for different versions\n\t * as necessary (e.g. an upgrade op came in, or the configuration changed within the collab window\n\t * and an op needs to be interpreted which isn't written with the current configuration).\n\t */\n\tprivate readonly messageCodec: IJsonCodec<\n\t\tDecodedMessage<TChange>,\n\t\tunknown,\n\t\tunknown,\n\t\tMessageEncodingContext\n\t>;\n\n\tprivate readonly resubmitMachine: ResubmitMachine<TChange>;\n\tpublic readonly commitEnricher: BranchCommitEnricher<TChange>;\n\n\tpublic readonly mintRevisionTag: () => RevisionTag;\n\n\tprivate readonly schemaAndPolicy: ClonableSchemaAndPolicy;\n\n\t/**\n\t * @param summarizables - Summarizers for all indexes used by this tree\n\t * @param changeFamily - The change family\n\t * @param editManager - The edit manager\n\t * @param runtime - The IFluidDataStoreRuntime which contains the shared object\n\t * @param editor - Used to edit the state of the tree. Edits will be immediately applied locally to the tree.\n\t * If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.\n\t */\n\tpublic constructor(\n\t\tpublic readonly breaker: Breakable,\n\t\tpublic readonly sharedObject: IChannelView & IFluidLoadable,\n\t\tpublic readonly serializer: IFluidSerializer,\n\t\tpublic readonly submitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void,\n\t\tlogger: ITelemetryBaseLogger | undefined,\n\t\tsummarizables: readonly Summarizable[],\n\t\tchangeFamily: ChangeFamily<TEditor, TChange>,\n\t\toptions: ICodecOptions,\n\t\tformatOptions: ExplicitCoreCodecVersions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tschema: TreeStoredSchemaRepository,\n\t\tschemaPolicy: SchemaPolicy,\n\t\tresubmitMachine?: ResubmitMachine<TChange>,\n\t\tenricher?: ChangeEnricherReadonlyCheckout<TChange>,\n\t\tpublic readonly getEditor: () => TEditor = () => this.getLocalBranch().editor,\n\t) {\n\t\tthis.schemaAndPolicy = {\n\t\t\tschema,\n\t\t\tpolicy: schemaPolicy,\n\t\t};\n\n\t\tconst rebaseLogger = createChildLogger({\n\t\t\tlogger,\n\t\t\tnamespace: \"Rebase\",\n\t\t});\n\n\t\tthis.mintRevisionTag = () => this.idCompressor.generateCompressedId();\n\t\t/**\n\t\t * A random ID that uniquely identifies this client in the collab session.\n\t\t * This is sent alongside every op to identify which client the op originated from.\n\t\t * This is used rather than the Fluid client ID because the Fluid client ID is not stable across reconnections.\n\t\t */\n\t\tconst localSessionId = idCompressor.localSessionId;\n\t\tthis.editManager = new EditManager(\n\t\t\tchangeFamily,\n\t\t\tlocalSessionId,\n\t\t\tthis.mintRevisionTag,\n\t\t\trebaseLogger,\n\t\t);\n\n\t\tthis.editManager.localBranch.events.on(\"beforeChange\", (change) => {\n\t\t\tif (this.detachedRevision === undefined) {\n\t\t\t\t// Commit enrichment is only necessary for changes that will be submitted as ops, and changes issued while detached are not submitted.\n\t\t\t\tthis.commitEnricher.processChange(change);\n\t\t\t}\n\t\t\tif (change.type === \"append\") {\n\t\t\t\tfor (const commit of change.newCommits) {\n\t\t\t\t\tthis.submitCommit(commit, this.schemaAndPolicy, false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\t\tconst editManagerCodec = makeEditManagerCodec(\n\t\t\tthis.editManager.changeFamily.codecs,\n\t\t\trevisionTagCodec,\n\t\t\toptions,\n\t\t\tformatOptions.editManager,\n\t\t);\n\t\tthis.summarizables = [\n\t\t\tnew EditManagerSummarizer(\n\t\t\t\tthis.editManager,\n\t\t\t\teditManagerCodec,\n\t\t\t\tthis.idCompressor,\n\t\t\t\tthis.schemaAndPolicy,\n\t\t\t),\n\t\t\t...summarizables,\n\t\t];\n\t\tassert(\n\t\t\tnew Set(this.summarizables.map((e) => e.key)).size === this.summarizables.length,\n\t\t\t0x350 /* Index summary element keys must be unique */,\n\t\t);\n\n\t\tthis.messageCodec = makeMessageCodec(\n\t\t\tchangeFamily.codecs,\n\t\t\tnew RevisionTagCodec(idCompressor),\n\t\t\toptions,\n\t\t\tformatOptions.message,\n\t\t);\n\n\t\tconst changeEnricher = enricher ?? new NoOpChangeEnricher();\n\t\tthis.resubmitMachine =\n\t\t\tresubmitMachine ??\n\t\t\tnew DefaultResubmitMachine(\n\t\t\t\t(change: TaggedChange<TChange>) =>\n\t\t\t\t\tchangeFamily.rebaser.invert(change, true, this.mintRevisionTag()),\n\t\t\t\tchangeEnricher,\n\t\t\t);\n\t\tthis.commitEnricher = new BranchCommitEnricher(changeFamily.rebaser, changeEnricher);\n\t}\n\n\t// TODO: SharedObject's merging of the two summary methods into summarizeCore is not what we want here:\n\t// We might want to not subclass it, or override/reimplement most of its functionality.\n\t@throwIfBroken\n\tpublic summarizeCore(\n\t\tserializer: IFluidSerializer,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\tconst summarizableBuilder = new SummaryTreeBuilder();\n\t\t// Merge the summaries of all summarizables together under a single ISummaryTree\n\t\tfor (const s of this.summarizables) {\n\t\t\tsummarizableBuilder.addWithStats(\n\t\t\t\ts.key,\n\t\t\t\ts.getAttachSummary(\n\t\t\t\t\t(contents) => serializer.stringify(contents, this.sharedObject.handle),\n\t\t\t\t\tundefined,\n\t\t\t\t\tundefined,\n\t\t\t\t\ttelemetryContext,\n\t\t\t\t\tincrementalSummaryContext,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tbuilder.addWithStats(summarizablesTreeKey, summarizableBuilder.getSummaryTree());\n\t\treturn builder.getSummaryTree();\n\t}\n\n\tpublic async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tassert(\n\t\t\tthis.editManager.localBranch.getHead() === this.editManager.getTrunkHead(),\n\t\t\t0xaaa /* All local changes should be applied to the trunk before loading from summary */,\n\t\t);\n\t\tconst [editManagerSummarizer, ...summarizables] = this.summarizables;\n\t\tconst loadEditManager = this.loadSummarizable(editManagerSummarizer, services);\n\t\tconst loadSummarizables = summarizables.map(async (s) =>\n\t\t\tthis.loadSummarizable(s, services),\n\t\t);\n\n\t\tif (this.detachedRevision !== undefined) {\n\t\t\t// If we are detached but loading from a summary, then we need to update our detached revision to ensure that it is ahead of all detached revisions in the summary.\n\t\t\t// First, finish loading the edit manager so that we can inspect the sequence numbers of the commits on the trunk.\n\t\t\tawait loadEditManager;\n\t\t\t// Find the most recent detached revision in the summary trunk...\n\t\t\tlet latestDetachedSequenceNumber: SeqNumber | undefined;\n\t\t\tfindAncestor(this.editManager.getTrunkHead(), (c) => {\n\t\t\t\tconst sequenceNumber = this.editManager.getSequenceNumber(c);\n\t\t\t\tif (sequenceNumber !== undefined && sequenceNumber < 0) {\n\t\t\t\t\tlatestDetachedSequenceNumber = sequenceNumber;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\t// ...and set our detached revision to be as it would be if we had been already created that revision.\n\t\t\tthis.detachedRevision = latestDetachedSequenceNumber ?? this.detachedRevision;\n\t\t\tawait Promise.all(loadSummarizables);\n\t\t} else {\n\t\t\tawait Promise.all([loadEditManager, ...loadSummarizables]);\n\t\t}\n\t}\n\n\tprivate async loadSummarizable(\n\t\tsummarizable: Summarizable,\n\t\tservices: IChannelStorageService,\n\t): Promise<void> {\n\t\treturn summarizable.load(\n\t\t\tscopeStorageService(services, summarizablesTreeKey, summarizable.key),\n\t\t\t(contents) => this.serializer.parse(contents),\n\t\t);\n\t}\n\n\t/**\n\t * Submits an op to the Fluid runtime containing the given commit\n\t * @param commit - the commit to submit\n\t * @returns the submitted commit. This is undefined if the underlying `SharedObject` is not attached,\n\t * and may differ from `commit` due to enrichments like detached tree refreshers.\n\t */\n\tprotected submitCommit(\n\t\tcommit: GraphCommit<TChange>,\n\t\tschemaAndPolicy: ClonableSchemaAndPolicy,\n\t\tisResubmit: boolean,\n\t): void {\n\t\tassert(\n\t\t\tthis.sharedObject.isAttached() === (this.detachedRevision === undefined),\n\t\t\t0x95a /* Detached revision should only be set when not attached */,\n\t\t);\n\n\t\tconst enrichedCommit =\n\t\t\tthis.detachedRevision === undefined && !isResubmit\n\t\t\t\t? this.commitEnricher.enrich(commit)\n\t\t\t\t: commit;\n\n\t\t// Edits submitted before the first attach are treated as sequenced because they will be included\n\t\t// in the attach summary that is uploaded to the service.\n\t\t// Until this attach workflow happens, this instance essentially behaves as a centralized data structure.\n\t\tif (this.detachedRevision !== undefined) {\n\t\t\tconst newRevision: SeqNumber = brand((this.detachedRevision as number) + 1);\n\t\t\tthis.detachedRevision = newRevision;\n\t\t\tthis.editManager.addSequencedChange(\n\t\t\t\t{ ...enrichedCommit, sessionId: this.editManager.localSessionId },\n\t\t\t\tnewRevision,\n\t\t\t\tthis.detachedRevision,\n\t\t\t);\n\t\t\tthis.editManager.advanceMinimumSequenceNumber(newRevision, false);\n\t\t\treturn undefined;\n\t\t}\n\t\tconst message = this.messageCodec.encode(\n\t\t\t{\n\t\t\t\tcommit: enrichedCommit,\n\t\t\t\tsessionId: this.editManager.localSessionId,\n\t\t\t},\n\t\t\t{\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t\tschema: schemaAndPolicy,\n\t\t\t},\n\t\t);\n\t\tthis.submitLocalMessage(message, {\n\t\t\t// Clone the schema to ensure that during resubmit the schema has not been mutated by later changes\n\t\t\tschema: schemaAndPolicy.schema.clone(),\n\t\t\tpolicy: schemaAndPolicy.policy,\n\t\t});\n\t\tthis.resubmitMachine.onCommitSubmitted(enrichedCommit);\n\t}\n\n\tpublic processCore(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalOpMetadata: unknown,\n\t): void {\n\t\t// Empty context object is passed in, as our decode function is schema-agnostic.\n\t\tconst { commit, sessionId } = this.messageCodec.decode(message.contents, {\n\t\t\tidCompressor: this.idCompressor,\n\t\t});\n\n\t\tthis.editManager.addSequencedChange(\n\t\t\t{ ...commit, sessionId },\n\t\t\tbrand(message.sequenceNumber),\n\t\t\tbrand(message.referenceSequenceNumber),\n\t\t);\n\t\tthis.resubmitMachine.onSequencedCommitApplied(local);\n\n\t\tthis.editManager.advanceMinimumSequenceNumber(brand(message.minimumSequenceNumber));\n\t}\n\n\tpublic getLocalBranch(): SharedTreeBranch<TEditor, TChange> {\n\t\treturn this.editManager.localBranch;\n\t}\n\n\tpublic didAttach(): void {\n\t\tthis.detachedRevision = undefined;\n\t}\n\n\tpublic reSubmitCore(content: JsonCompatibleReadOnly, localOpMetadata: unknown): void {\n\t\t// Empty context object is passed in, as our decode function is schema-agnostic.\n\t\tconst {\n\t\t\tcommit: { revision },\n\t\t} = this.messageCodec.decode(this.serializer.decode(content), {\n\t\t\tidCompressor: this.idCompressor,\n\t\t});\n\t\tconst [commit] = this.editManager.findLocalCommit(revision);\n\t\t// If a resubmit phase is not already in progress, then this must be the first commit of a new resubmit phase.\n\t\tif (this.resubmitMachine.isInResubmitPhase === false) {\n\t\t\tconst toResubmit = this.editManager.getLocalCommits();\n\t\t\tassert(\n\t\t\t\tcommit === toResubmit[0],\n\t\t\t\t0x95d /* Resubmit phase should start with the oldest local commit */,\n\t\t\t);\n\t\t\tthis.resubmitMachine.prepareForResubmit(toResubmit);\n\t\t}\n\t\tassert(\n\t\t\tisClonableSchemaPolicy(localOpMetadata),\n\t\t\t0x95e /* Local metadata must contain schema and policy. */,\n\t\t);\n\t\tassert(\n\t\t\tthis.resubmitMachine.isInResubmitPhase !== false,\n\t\t\t0x984 /* Invalid resubmit outside of resubmit phase */,\n\t\t);\n\t\tconst enrichedCommit = this.resubmitMachine.peekNextCommit();\n\t\tthis.submitCommit(enrichedCommit, localOpMetadata, true);\n\t}\n\n\tpublic applyStashedOp(content: JsonCompatibleReadOnly): void {\n\t\t// Empty context object is passed in, as our decode function is schema-agnostic.\n\t\tconst {\n\t\t\tcommit: { revision, change },\n\t\t} = this.messageCodec.decode(content, { idCompressor: this.idCompressor });\n\t\tthis.editManager.localBranch.apply({ change, revision });\n\t}\n}\n\nfunction isClonableSchemaPolicy(\n\tmaybeSchemaPolicy: unknown,\n): maybeSchemaPolicy is ClonableSchemaAndPolicy {\n\tconst schemaAndPolicy = maybeSchemaPolicy as ClonableSchemaAndPolicy;\n\treturn schemaAndPolicy.schema !== undefined && schemaAndPolicy.policy !== undefined;\n}\n\n/**\n * Specifies the behavior of a component that puts data in a summary.\n */\nexport interface Summarizable {\n\t/**\n\t * Field name in summary json under which this element stores its data.\n\t */\n\treadonly key: string;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).getAttachSummary}\n\t * @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.\n\t */\n\tgetAttachSummary(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): ISummaryTreeWithStats;\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize}\n\t * @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage.\n\t */\n\tsummarize(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Allows the component to perform custom loading. The storage service is scoped to this component and therefore\n\t * paths in this component will not collide with those in other components, even if they are the same string.\n\t * @param service - Storage used by the component\n\t * @param parse - Parses serialized data from storage into runtime objects for the component\n\t */\n\tload(service: IChannelStorageService, parse: SummaryElementParser): Promise<void>;\n}\n\n/**\n * Serializes the given contents into a string acceptable for storing in summaries, i.e. all\n * Fluid handles have been replaced appropriately by an IFluidSerializer\n */\nexport type SummaryElementStringifier = (contents: unknown) => string;\n\n/**\n * Parses a serialized/summarized string into an object, rehydrating any Fluid handles as necessary\n */\nexport type SummaryElementParser = (contents: string) => unknown;\n\n/**\n * Compose an {@link IChannelStorageService} which prefixes all paths before forwarding them to the original service\n */\nfunction scopeStorageService(\n\tservice: IChannelStorageService,\n\t...pathElements: string[]\n): IChannelStorageService {\n\tconst scope = `${pathElements.join(\"/\")}/`;\n\n\treturn {\n\t\tasync readBlob(path: string): Promise<ArrayBufferLike> {\n\t\t\treturn service.readBlob(`${scope}${path}`);\n\t\t},\n\t\tasync contains(path) {\n\t\t\treturn service.contains(`${scope}${path}`);\n\t\t},\n\t\tasync list(path) {\n\t\t\treturn service.list(`${scope}${path}`);\n\t\t},\n\t};\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
- export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, asTreeViewAlpha, } from "./tree.js";
6
- export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, } from "./schemaFactory.js";
5
+ export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, type ITreeAlpha, asTreeViewAlpha, } from "./tree.js";
6
+ export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, type schemaStatics, } from "./schemaFactory.js";
7
7
  export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
8
8
  export type { ValidateRecursiveSchema, FixRecursiveArraySchema, } from "./schemaFactoryRecursive.js";
9
9
  export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
@@ -22,5 +22,6 @@ export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./tre
22
22
  export { createSimpleTreeIndex, type SimpleTreeIndex } from "./simpleTreeIndex.js";
23
23
  export { createIdentifierIndex, type IdentifierIndex, } from "./identifierIndex.js";
24
24
  export { extractPersistedSchema, comparePersistedSchemaInternal, comparePersistedSchema, } from "./storedSchema.js";
25
+ export { type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, } from "./transactionTypes.js";
25
26
  export { RecursiveObject as test_RecursiveObject, base as test_RecursiveObject_base, RecursiveObjectPojoMode as test_RecursiveObjectPojoMode, } from "./testRecursiveDomain.js";
26
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3F,YAAY,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO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,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,EACrB,KAAK,eAAe,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC3F,YAAY,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,sBA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BAAkB,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,EACrB,KAAK,eAAe,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.comparePersistedSchema = exports.comparePersistedSchemaInternal = exports.extractPersistedSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.conciseFromCursor = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.ViewSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createFromCursor = exports.cursorFromInsertable = exports.createFromInsertable = exports.tryGetSchema = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.asTreeViewAlpha = exports.TreeViewConfiguration = void 0;
7
+ exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.rollback = exports.comparePersistedSchema = exports.comparePersistedSchemaInternal = exports.extractPersistedSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.conciseFromCursor = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.ViewSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createFromCursor = exports.cursorFromInsertable = exports.createFromInsertable = exports.tryGetSchema = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.asTreeViewAlpha = exports.TreeViewConfiguration = void 0;
8
8
  var tree_js_1 = require("./tree.js");
9
9
  Object.defineProperty(exports, "TreeViewConfiguration", { enumerable: true, get: function () { return tree_js_1.TreeViewConfiguration; } });
10
10
  Object.defineProperty(exports, "asTreeViewAlpha", { enumerable: true, get: function () { return tree_js_1.asTreeViewAlpha; } });
@@ -48,6 +48,8 @@ var storedSchema_js_1 = require("./storedSchema.js");
48
48
  Object.defineProperty(exports, "extractPersistedSchema", { enumerable: true, get: function () { return storedSchema_js_1.extractPersistedSchema; } });
49
49
  Object.defineProperty(exports, "comparePersistedSchemaInternal", { enumerable: true, get: function () { return storedSchema_js_1.comparePersistedSchemaInternal; } });
50
50
  Object.defineProperty(exports, "comparePersistedSchema", { enumerable: true, get: function () { return storedSchema_js_1.comparePersistedSchema; } });
51
+ var transactionTypes_js_1 = require("./transactionTypes.js");
52
+ Object.defineProperty(exports, "rollback", { enumerable: true, get: function () { return transactionTypes_js_1.rollback; } });
51
53
  // Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
52
54
  // These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
53
55
  var testRecursiveDomain_js_1 = require("./testRecursiveDomain.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qCAamB;AARlB,gHAAA,qBAAqB,OAAA;AAOrB,0GAAA,eAAe,OAAA;AAEhB,uDAI4B;AAH3B,iHAAA,aAAa,OAAA;AAId,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAK3B,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AA0BrE,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAyBnB,mDAO0B;AAHzB,4HAAA,0BAA0B,OAAA;AAC1B,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AAGlB,iDAMyB;AAJxB,uHAAA,sBAAsB,OAAA;AAGtB,uHAAA,sBAAsB,OAAA;AAGvB,mDAAuE;AAA5C,mHAAA,iBAAiB,OAAA;AAE5C,mDAA6F;AAApF,0GAAA,QAAQ,OAAA;AACjB,2DAAmF;AAA1E,2HAAA,qBAAqB,OAAA;AAC9B,2DAG8B;AAF7B,2HAAA,qBAAqB,OAAA;AAItB,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAC9B,yHAAA,sBAAsB,OAAA;AAGvB,6FAA6F;AAC7F,4IAA4I;AAC5I,mEAIkC;AAHjC,8HAAA,eAAe,OAAwB;AACvC,mIAAA,IAAI,OAA6B;AACjC,sIAAA,uBAAuB,OAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\tasTreeViewAlpha,\n} from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi, tryGetSchema } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable, createFromCursor } from \"./create.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n} from \"./simpleSchema.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { ViewSchema } from \"./view.js\";\nexport type {\n\tUnenforced,\n\tFieldHasDefaultUnsafe,\n\tObjectFromSchemaRecordUnsafe,\n\tTreeObjectNodeUnsafe,\n\tTreeFieldFromImplicitFieldUnsafe,\n\tTreeNodeFromImplicitAllowedTypesUnsafe,\n\tFieldSchemaUnsafe,\n\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\tTreeArrayNodeUnsafe,\n\tTreeMapNodeUnsafe,\n\tInsertableObjectFromSchemaRecordUnsafe,\n\tInsertableTreeFieldFromImplicitFieldUnsafe,\n\tInsertableTypedNodeUnsafe,\n\tNodeBuilderDataUnsafe,\n\tNodeFromSchemaUnsafe,\n\tReadonlyMapInlined,\n\tTreeNodeSchemaClassUnsafe,\n\tTreeNodeSchemaUnsafe,\n\tAllowedTypesUnsafe,\n\tTreeNodeSchemaNonClassUnsafe,\n\tInsertableTreeNodeFromAllowedTypesUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype EncodeOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n} from \"./customTree.js\";\n\nexport { type ConciseTree, conciseFromCursor } from \"./conciseTree.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from \"./treeApiBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchemaInternal,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qCAcmB;AATlB,gHAAA,qBAAqB,OAAA;AAQrB,0GAAA,eAAe,OAAA;AAEhB,uDAK4B;AAJ3B,iHAAA,aAAa,OAAA;AAKd,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAK3B,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AA0BrE,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AAyBnB,mDAO0B;AAHzB,4HAAA,0BAA0B,OAAA;AAC1B,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AAGlB,iDAMyB;AAJxB,uHAAA,sBAAsB,OAAA;AAGtB,uHAAA,sBAAsB,OAAA;AAGvB,mDAAuE;AAA5C,mHAAA,iBAAiB,OAAA;AAE5C,mDAA6F;AAApF,0GAAA,QAAQ,OAAA;AACjB,2DAAmF;AAA1E,2HAAA,qBAAqB,OAAA;AAC9B,2DAG8B;AAF7B,2HAAA,qBAAqB,OAAA;AAItB,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAC9B,yHAAA,sBAAsB,OAAA;AAGvB,6DAW+B;AAD9B,+GAAA,QAAQ,OAAA;AAGT,6FAA6F;AAC7F,4IAA4I;AAC5I,mEAIkC;AAHjC,8HAAA,eAAe,OAAwB;AACvC,mIAAA,IAAI,OAA6B;AACjC,sIAAA,uBAAuB,OAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttype ITreeAlpha,\n\tasTreeViewAlpha,\n} from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n\ttype schemaStatics,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi, tryGetSchema } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable, createFromCursor } from \"./create.js\";\nexport type {\n\tSimpleTreeSchema,\n\tSimpleNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleArrayNodeSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleNodeSchemaBase,\n} from \"./simpleSchema.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n} from \"./jsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { ViewSchema } from \"./view.js\";\nexport type {\n\tUnenforced,\n\tFieldHasDefaultUnsafe,\n\tObjectFromSchemaRecordUnsafe,\n\tTreeObjectNodeUnsafe,\n\tTreeFieldFromImplicitFieldUnsafe,\n\tTreeNodeFromImplicitAllowedTypesUnsafe,\n\tFieldSchemaUnsafe,\n\tInsertableTreeNodeFromImplicitAllowedTypesUnsafe,\n\tTreeArrayNodeUnsafe,\n\tTreeMapNodeUnsafe,\n\tInsertableObjectFromSchemaRecordUnsafe,\n\tInsertableTreeFieldFromImplicitFieldUnsafe,\n\tInsertableTypedNodeUnsafe,\n\tNodeBuilderDataUnsafe,\n\tNodeFromSchemaUnsafe,\n\tReadonlyMapInlined,\n\tTreeNodeSchemaClassUnsafe,\n\tTreeNodeSchemaUnsafe,\n\tAllowedTypesUnsafe,\n\tTreeNodeSchemaNonClassUnsafe,\n\tInsertableTreeNodeFromAllowedTypesUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype ParseOptions,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype EncodeOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n} from \"./customTree.js\";\n\nexport { type ConciseTree, conciseFromCursor } from \"./conciseTree.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from \"./treeApiBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchemaInternal,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n} from \"./transactionTypes.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}