@fluidframework/tree 2.91.0 → 2.93.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 (1023) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/README.md +1 -1
  3. package/api-report/tree.alpha.api.md +117 -51
  4. package/api-report/tree.beta.api.md +41 -12
  5. package/api-report/tree.legacy.beta.api.md +41 -12
  6. package/dist/api.d.ts +11 -1
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/codec/codec.d.ts +28 -2
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +1 -0
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/index.d.ts +2 -2
  14. package/dist/codec/index.d.ts.map +1 -1
  15. package/dist/codec/index.js +2 -4
  16. package/dist/codec/index.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +18 -36
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js +46 -59
  20. package/dist/codec/versioned/codec.js.map +1 -1
  21. package/dist/codec/versioned/index.d.ts +1 -1
  22. package/dist/codec/versioned/index.d.ts.map +1 -1
  23. package/dist/codec/versioned/index.js +2 -4
  24. package/dist/codec/versioned/index.js.map +1 -1
  25. package/dist/core/forest/forest.d.ts +5 -2
  26. package/dist/core/forest/forest.d.ts.map +1 -1
  27. package/dist/core/forest/forest.js.map +1 -1
  28. package/dist/core/index.d.ts +1 -1
  29. package/dist/core/index.d.ts.map +1 -1
  30. package/dist/core/index.js +6 -2
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/rebase/changeRebaser.d.ts +8 -1
  33. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  34. package/dist/core/rebase/changeRebaser.js.map +1 -1
  35. package/dist/core/rebase/revisionTagCodec.d.ts +4 -3
  36. package/dist/core/rebase/revisionTagCodec.d.ts.map +1 -1
  37. package/dist/core/rebase/revisionTagCodec.js +2 -0
  38. package/dist/core/rebase/revisionTagCodec.js.map +1 -1
  39. package/dist/core/rebase/utils.d.ts +2 -2
  40. package/dist/core/rebase/utils.d.ts.map +1 -1
  41. package/dist/core/rebase/utils.js +4 -4
  42. package/dist/core/rebase/utils.js.map +1 -1
  43. package/dist/core/schema-stored/formatV2.d.ts +1 -1
  44. package/dist/core/schema-stored/formatV2.js +1 -1
  45. package/dist/core/schema-stored/formatV2.js.map +1 -1
  46. package/dist/core/tree/anchorSet.d.ts +8 -0
  47. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  48. package/dist/core/tree/anchorSet.js +63 -7
  49. package/dist/core/tree/anchorSet.js.map +1 -1
  50. package/dist/core/tree/cursor.d.ts +25 -1
  51. package/dist/core/tree/cursor.d.ts.map +1 -1
  52. package/dist/core/tree/cursor.js +45 -1
  53. package/dist/core/tree/cursor.js.map +1 -1
  54. package/dist/core/tree/deltaUtil.d.ts +13 -1
  55. package/dist/core/tree/deltaUtil.d.ts.map +1 -1
  56. package/dist/core/tree/deltaUtil.js +34 -1
  57. package/dist/core/tree/deltaUtil.js.map +1 -1
  58. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  59. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  60. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  61. package/dist/core/tree/index.d.ts +2 -2
  62. package/dist/core/tree/index.d.ts.map +1 -1
  63. package/dist/core/tree/index.js +6 -2
  64. package/dist/core/tree/index.js.map +1 -1
  65. package/dist/core/tree/visitDelta.d.ts +11 -0
  66. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  67. package/dist/core/tree/visitDelta.js +1 -1
  68. package/dist/core/tree/visitDelta.js.map +1 -1
  69. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  70. package/dist/core/tree/visitorUtils.js +5 -0
  71. package/dist/core/tree/visitorUtils.js.map +1 -1
  72. package/dist/entrypoints/alpha.d.ts +1 -1
  73. package/dist/entrypoints/alpha.d.ts.map +1 -1
  74. package/dist/entrypoints/alpha.js +5 -6
  75. package/dist/entrypoints/alpha.js.map +1 -1
  76. package/dist/entrypoints/beta.d.ts +1 -1
  77. package/dist/entrypoints/beta.d.ts.map +1 -1
  78. package/dist/entrypoints/beta.js +4 -2
  79. package/dist/entrypoints/beta.js.map +1 -1
  80. package/dist/entrypoints/legacy.d.ts +1 -1
  81. package/dist/entrypoints/legacy.d.ts.map +1 -1
  82. package/dist/entrypoints/legacy.js +4 -2
  83. package/dist/entrypoints/legacy.js.map +1 -1
  84. package/dist/entrypoints/public.js +1 -1
  85. package/dist/entrypoints/public.js.map +1 -1
  86. package/dist/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  87. package/dist/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  88. package/dist/feature-libraries/changeAtomIdCodec.js +2 -0
  89. package/dist/feature-libraries/changeAtomIdCodec.js.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  91. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  92. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -1
  93. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  94. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  95. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  97. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  99. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +6 -6
  101. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  103. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  106. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  109. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  110. package/dist/feature-libraries/chunked-forest/codec/codecs.js +6 -6
  111. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  112. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  113. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  114. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +3 -3
  115. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  116. package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  117. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  118. package/dist/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  119. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  120. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  121. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js +115 -0
  122. package/dist/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  123. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  124. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  125. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js +16 -0
  126. package/dist/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  127. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  128. package/dist/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  129. package/dist/feature-libraries/chunked-forest/codec/format/index.js +18 -0
  130. package/dist/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  131. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  132. package/dist/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  133. package/dist/feature-libraries/chunked-forest/codec/format/versions.js +29 -0
  134. package/dist/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  135. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  136. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  137. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  138. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  139. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  140. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  141. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  142. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  143. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  144. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +6 -4
  145. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  146. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  147. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  148. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +3 -3
  149. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  150. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  151. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  152. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  153. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  154. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  155. package/dist/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  156. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  157. package/dist/feature-libraries/cursorComparator.d.ts +23 -0
  158. package/dist/feature-libraries/cursorComparator.d.ts.map +1 -0
  159. package/dist/feature-libraries/cursorComparator.js +65 -0
  160. package/dist/feature-libraries/cursorComparator.js.map +1 -0
  161. package/dist/feature-libraries/forest-summary/codec.d.ts +1 -1
  162. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  163. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  164. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  165. package/dist/feature-libraries/index.d.ts +3 -2
  166. package/dist/feature-libraries/index.d.ts.map +1 -1
  167. package/dist/feature-libraries/index.js +5 -5
  168. package/dist/feature-libraries/index.js.map +1 -1
  169. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -0
  170. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  171. package/dist/feature-libraries/indexing/anchorTreeIndex.js +15 -8
  172. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  173. package/dist/feature-libraries/indexing/types.d.ts +4 -3
  174. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  175. package/dist/feature-libraries/indexing/types.js.map +1 -1
  176. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  177. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  178. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  179. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  180. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  181. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  182. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  183. package/dist/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  184. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  185. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  186. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  187. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  188. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  189. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  190. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  191. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  192. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  193. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  194. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  195. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  196. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  197. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
  198. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  199. package/dist/feature-libraries/object-forest/objectForest.d.ts +1 -1
  200. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  201. package/dist/feature-libraries/object-forest/objectForest.js +2 -2
  202. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  203. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  204. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  205. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  206. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  207. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  208. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  209. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  210. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  211. package/dist/feature-libraries/schema-edits/index.js +2 -3
  212. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  213. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  214. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  215. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -54
  216. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  217. package/dist/feature-libraries/schema-index/codec.d.ts +3 -16
  218. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  219. package/dist/feature-libraries/schema-index/codec.js +1 -21
  220. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  221. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
  222. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  223. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  224. package/dist/feature-libraries/schema-index/index.d.ts +1 -1
  225. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  226. package/dist/feature-libraries/schema-index/index.js +1 -2
  227. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  228. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  229. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  230. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  231. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  232. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  233. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  234. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  235. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  236. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  237. package/dist/index.d.ts +2 -2
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +2 -3
  240. package/dist/index.js.map +1 -1
  241. package/dist/packageVersion.d.ts +1 -1
  242. package/dist/packageVersion.js +1 -1
  243. package/dist/packageVersion.js.map +1 -1
  244. package/dist/serializableDomainSchema.d.ts +5 -5
  245. package/dist/serializableDomainSchema.d.ts.map +1 -1
  246. package/dist/serializableDomainSchema.js.map +1 -1
  247. package/dist/shared-tree/independentView.d.ts +1 -1
  248. package/dist/shared-tree/independentView.d.ts.map +1 -1
  249. package/dist/shared-tree/independentView.js +14 -21
  250. package/dist/shared-tree/independentView.js.map +1 -1
  251. package/dist/shared-tree/index.d.ts +2 -2
  252. package/dist/shared-tree/index.d.ts.map +1 -1
  253. package/dist/shared-tree/index.js +1 -2
  254. package/dist/shared-tree/index.js.map +1 -1
  255. package/dist/shared-tree/schematizingTreeView.d.ts +2 -36
  256. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  257. package/dist/shared-tree/schematizingTreeView.js +15 -117
  258. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  259. package/dist/shared-tree/sharedTree.d.ts +3 -22
  260. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  261. package/dist/shared-tree/sharedTree.js +10 -27
  262. package/dist/shared-tree/sharedTree.js.map +1 -1
  263. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  264. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  265. package/dist/shared-tree/sharedTreeChangeCodecs.js +23 -16
  266. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  267. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  268. package/dist/shared-tree/sharedTreeChangeEnricher.js +1 -1
  269. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  270. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  271. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  272. package/dist/shared-tree/sharedTreeChangeFamily.js +2 -2
  273. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  274. package/dist/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  275. package/dist/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  276. package/dist/shared-tree/sharedTreeChangeFormat.js +13 -5
  277. package/dist/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  278. package/dist/shared-tree/tree.d.ts.map +1 -1
  279. package/dist/shared-tree/tree.js +2 -1
  280. package/dist/shared-tree/tree.js.map +1 -1
  281. package/dist/shared-tree/treeAlpha.d.ts +17 -1
  282. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  283. package/dist/shared-tree/treeAlpha.js +3 -0
  284. package/dist/shared-tree/treeAlpha.js.map +1 -1
  285. package/dist/shared-tree/treeCheckout.d.ts +34 -69
  286. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  287. package/dist/shared-tree/treeCheckout.js +885 -678
  288. package/dist/shared-tree/treeCheckout.js.map +1 -1
  289. package/dist/shared-tree/unhydratedTreeContext.js +3 -3
  290. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  291. package/dist/shared-tree-core/editManagerCodecs.d.ts +23 -12
  292. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  293. package/dist/shared-tree-core/editManagerCodecs.js +40 -67
  294. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  295. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  296. package/dist/shared-tree-core/editManagerCodecsCommons.js +0 -1
  297. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  298. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  299. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  300. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +18 -13
  301. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  302. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  303. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  304. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +6 -9
  305. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  306. package/dist/shared-tree-core/index.d.ts +3 -3
  307. package/dist/shared-tree-core/index.d.ts.map +1 -1
  308. package/dist/shared-tree-core/index.js +5 -8
  309. package/dist/shared-tree-core/index.js.map +1 -1
  310. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  311. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  312. package/dist/shared-tree-core/messageCodecV1ToV4.js +8 -8
  313. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  314. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  315. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  316. package/dist/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  317. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  318. package/dist/shared-tree-core/messageCodecs.d.ts +15 -14
  319. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  320. package/dist/shared-tree-core/messageCodecs.js +38 -74
  321. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  322. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  323. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  324. package/dist/shared-tree-core/messageFormat.js +1 -2
  325. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  326. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -3
  327. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  328. package/dist/shared-tree-core/sharedTreeCore.js +12 -2
  329. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  330. package/dist/sharedTreeAttributes.d.ts.map +1 -1
  331. package/dist/sharedTreeAttributes.js +3 -0
  332. package/dist/sharedTreeAttributes.js.map +1 -1
  333. package/dist/simple-tree/api/discrepancies.js +4 -1
  334. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  335. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  336. package/dist/simple-tree/api/identifierIndex.js +1 -1
  337. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  338. package/dist/simple-tree/api/index.d.ts +2 -1
  339. package/dist/simple-tree/api/index.d.ts.map +1 -1
  340. package/dist/simple-tree/api/index.js +3 -2
  341. package/dist/simple-tree/api/index.js.map +1 -1
  342. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +33 -4
  345. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  346. package/dist/simple-tree/api/schemaFactoryAlpha.js +17 -1
  347. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  348. package/dist/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  349. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  350. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  351. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  352. package/dist/simple-tree/api/storedSchema.js +10 -7
  353. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  354. package/dist/simple-tree/api/tree.d.ts +7 -19
  355. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  356. package/dist/simple-tree/api/tree.js.map +1 -1
  357. package/dist/simple-tree/api/treeAlpha.d.ts +126 -0
  358. package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -0
  359. package/dist/simple-tree/api/treeAlpha.js +7 -0
  360. package/dist/simple-tree/api/treeAlpha.js.map +1 -0
  361. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  362. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  363. package/dist/simple-tree/api/treeChangeEvents.d.ts +4 -1
  364. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  365. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  366. package/dist/simple-tree/api/treeNodeApi.d.ts +108 -0
  367. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  368. package/dist/simple-tree/api/treeNodeApi.js +104 -3
  369. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  370. package/dist/simple-tree/core/toStored.d.ts +7 -0
  371. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  372. package/dist/simple-tree/core/toStored.js.map +1 -1
  373. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  374. package/dist/simple-tree/core/treeNodeKernel.js +45 -8
  375. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  376. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  377. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  378. package/dist/simple-tree/core/unhydratedFlexTree.js +117 -11
  379. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  380. package/dist/simple-tree/fieldSchema.d.ts +6 -1
  381. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  382. package/dist/simple-tree/fieldSchema.js +3 -0
  383. package/dist/simple-tree/fieldSchema.js.map +1 -1
  384. package/dist/simple-tree/index.d.ts +2 -2
  385. package/dist/simple-tree/index.d.ts.map +1 -1
  386. package/dist/simple-tree/index.js +4 -3
  387. package/dist/simple-tree/index.js.map +1 -1
  388. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  389. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  390. package/dist/simple-tree/node-kinds/array/arrayNode.js +23 -0
  391. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  392. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  393. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  394. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  395. package/dist/simple-tree/node-kinds/array/index.d.ts +2 -2
  396. package/dist/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  397. package/dist/simple-tree/node-kinds/array/index.js.map +1 -1
  398. package/dist/simple-tree/node-kinds/index.d.ts +2 -2
  399. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  400. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  401. package/dist/simple-tree/node-kinds/map/index.d.ts +1 -1
  402. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  403. package/dist/simple-tree/node-kinds/map/index.js.map +1 -1
  404. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  405. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  406. package/dist/simple-tree/node-kinds/map/mapNode.js +6 -1
  407. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  408. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  409. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  410. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  411. package/dist/simple-tree/simpleSchema.d.ts +17 -0
  412. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  413. package/dist/simple-tree/simpleSchema.js.map +1 -1
  414. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  415. package/dist/simple-tree/toStoredSchema.js +23 -1
  416. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  417. package/dist/tableSchema.d.ts +4 -5
  418. package/dist/tableSchema.d.ts.map +1 -1
  419. package/dist/tableSchema.js +12 -23
  420. package/dist/tableSchema.js.map +1 -1
  421. package/dist/text/textDomain.d.ts.map +1 -1
  422. package/dist/text/textDomain.js +27 -0
  423. package/dist/text/textDomain.js.map +1 -1
  424. package/dist/text/textDomainFormatted.d.ts +321 -11
  425. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  426. package/dist/text/textDomainFormatted.js +100 -25
  427. package/dist/text/textDomainFormatted.js.map +1 -1
  428. package/dist/treeFactory.d.ts.map +1 -1
  429. package/dist/treeFactory.js +5 -2
  430. package/dist/treeFactory.js.map +1 -1
  431. package/dist/util/index.d.ts +1 -1
  432. package/dist/util/index.d.ts.map +1 -1
  433. package/dist/util/index.js +2 -3
  434. package/dist/util/index.js.map +1 -1
  435. package/dist/util/referenceCounting.d.ts.map +1 -1
  436. package/dist/util/referenceCounting.js +0 -1
  437. package/dist/util/referenceCounting.js.map +1 -1
  438. package/dist/util/utils.d.ts +0 -1
  439. package/dist/util/utils.d.ts.map +1 -1
  440. package/dist/util/utils.js +1 -6
  441. package/dist/util/utils.js.map +1 -1
  442. package/eslint.config.mts +1 -1
  443. package/legacy.d.ts +2 -3
  444. package/lib/api.d.ts +11 -1
  445. package/lib/api.d.ts.map +1 -1
  446. package/lib/api.js.map +1 -1
  447. package/lib/codec/codec.d.ts +28 -2
  448. package/lib/codec/codec.d.ts.map +1 -1
  449. package/lib/codec/codec.js +1 -0
  450. package/lib/codec/codec.js.map +1 -1
  451. package/lib/codec/index.d.ts +2 -2
  452. package/lib/codec/index.d.ts.map +1 -1
  453. package/lib/codec/index.js +1 -1
  454. package/lib/codec/index.js.map +1 -1
  455. package/lib/codec/versioned/codec.d.ts +18 -36
  456. package/lib/codec/versioned/codec.d.ts.map +1 -1
  457. package/lib/codec/versioned/codec.js +45 -56
  458. package/lib/codec/versioned/codec.js.map +1 -1
  459. package/lib/codec/versioned/index.d.ts +1 -1
  460. package/lib/codec/versioned/index.d.ts.map +1 -1
  461. package/lib/codec/versioned/index.js +1 -1
  462. package/lib/codec/versioned/index.js.map +1 -1
  463. package/lib/core/forest/forest.d.ts +5 -2
  464. package/lib/core/forest/forest.d.ts.map +1 -1
  465. package/lib/core/forest/forest.js.map +1 -1
  466. package/lib/core/index.d.ts +1 -1
  467. package/lib/core/index.d.ts.map +1 -1
  468. package/lib/core/index.js +1 -1
  469. package/lib/core/index.js.map +1 -1
  470. package/lib/core/rebase/changeRebaser.d.ts +8 -1
  471. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  472. package/lib/core/rebase/changeRebaser.js.map +1 -1
  473. package/lib/core/rebase/revisionTagCodec.d.ts +4 -3
  474. package/lib/core/rebase/revisionTagCodec.d.ts.map +1 -1
  475. package/lib/core/rebase/revisionTagCodec.js +2 -0
  476. package/lib/core/rebase/revisionTagCodec.js.map +1 -1
  477. package/lib/core/rebase/utils.d.ts +2 -2
  478. package/lib/core/rebase/utils.d.ts.map +1 -1
  479. package/lib/core/rebase/utils.js +4 -4
  480. package/lib/core/rebase/utils.js.map +1 -1
  481. package/lib/core/schema-stored/formatV2.d.ts +1 -1
  482. package/lib/core/schema-stored/formatV2.js +1 -1
  483. package/lib/core/schema-stored/formatV2.js.map +1 -1
  484. package/lib/core/tree/anchorSet.d.ts +8 -0
  485. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  486. package/lib/core/tree/anchorSet.js +63 -7
  487. package/lib/core/tree/anchorSet.js.map +1 -1
  488. package/lib/core/tree/cursor.d.ts +25 -1
  489. package/lib/core/tree/cursor.d.ts.map +1 -1
  490. package/lib/core/tree/cursor.js +43 -0
  491. package/lib/core/tree/cursor.js.map +1 -1
  492. package/lib/core/tree/deltaUtil.d.ts +13 -1
  493. package/lib/core/tree/deltaUtil.d.ts.map +1 -1
  494. package/lib/core/tree/deltaUtil.js +31 -0
  495. package/lib/core/tree/deltaUtil.js.map +1 -1
  496. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +5 -5
  497. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  498. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  499. package/lib/core/tree/index.d.ts +2 -2
  500. package/lib/core/tree/index.d.ts.map +1 -1
  501. package/lib/core/tree/index.js +2 -2
  502. package/lib/core/tree/index.js.map +1 -1
  503. package/lib/core/tree/visitDelta.d.ts +11 -0
  504. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  505. package/lib/core/tree/visitDelta.js +1 -1
  506. package/lib/core/tree/visitDelta.js.map +1 -1
  507. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  508. package/lib/core/tree/visitorUtils.js +5 -0
  509. package/lib/core/tree/visitorUtils.js.map +1 -1
  510. package/lib/entrypoints/alpha.d.ts +1 -1
  511. package/lib/entrypoints/alpha.d.ts.map +1 -1
  512. package/lib/entrypoints/alpha.js +2 -2
  513. package/lib/entrypoints/alpha.js.map +1 -1
  514. package/lib/entrypoints/beta.d.ts +1 -1
  515. package/lib/entrypoints/beta.d.ts.map +1 -1
  516. package/lib/entrypoints/beta.js +2 -2
  517. package/lib/entrypoints/beta.js.map +1 -1
  518. package/lib/entrypoints/legacy.d.ts +1 -1
  519. package/lib/entrypoints/legacy.d.ts.map +1 -1
  520. package/lib/entrypoints/legacy.js +2 -2
  521. package/lib/entrypoints/legacy.js.map +1 -1
  522. package/lib/entrypoints/public.js +1 -1
  523. package/lib/entrypoints/public.js.map +1 -1
  524. package/lib/feature-libraries/changeAtomIdCodec.d.ts +4 -3
  525. package/lib/feature-libraries/changeAtomIdCodec.d.ts.map +1 -1
  526. package/lib/feature-libraries/changeAtomIdCodec.js +2 -0
  527. package/lib/feature-libraries/changeAtomIdCodec.js.map +1 -1
  528. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  529. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  530. package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -1
  531. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  532. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +2 -1
  533. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  534. package/lib/feature-libraries/chunked-forest/chunkedForest.js +2 -2
  535. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  536. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +4 -4
  537. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  538. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +4 -4
  539. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  540. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  541. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  542. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  543. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -2
  544. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  546. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -4
  547. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  549. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  550. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +12 -12
  551. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.d.ts → format/formatGeneric.d.ts} +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.d.ts.map +1 -0
  556. package/lib/feature-libraries/chunked-forest/codec/format/formatGeneric.js.map +1 -0
  557. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts +187 -0
  558. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.d.ts.map +1 -0
  559. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js +112 -0
  560. package/lib/feature-libraries/chunked-forest/codec/format/formatV1.js.map +1 -0
  561. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts +33 -0
  562. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.d.ts.map +1 -0
  563. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js +13 -0
  564. package/lib/feature-libraries/chunked-forest/codec/format/formatV2.js.map +1 -0
  565. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts +10 -0
  566. package/lib/feature-libraries/chunked-forest/codec/format/index.d.ts.map +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/format/index.js +8 -0
  568. package/lib/feature-libraries/chunked-forest/codec/format/index.js.map +1 -0
  569. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts +93 -0
  570. package/lib/feature-libraries/chunked-forest/codec/format/versions.d.ts.map +1 -0
  571. package/lib/feature-libraries/chunked-forest/codec/format/versions.js +26 -0
  572. package/lib/feature-libraries/chunked-forest/codec/format/versions.js.map +1 -0
  573. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  574. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  576. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  577. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts +7 -7
  578. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -1
  579. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -1
  580. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  581. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  582. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +4 -2
  583. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  584. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +1 -1
  585. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  586. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  587. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  588. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  589. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  590. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  591. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  592. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  593. package/lib/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  594. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  595. package/lib/feature-libraries/cursorComparator.d.ts +23 -0
  596. package/lib/feature-libraries/cursorComparator.d.ts.map +1 -0
  597. package/lib/feature-libraries/cursorComparator.js +61 -0
  598. package/lib/feature-libraries/cursorComparator.js.map +1 -0
  599. package/lib/feature-libraries/forest-summary/codec.d.ts +1 -1
  600. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +3 -3
  601. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  602. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  603. package/lib/feature-libraries/index.d.ts +3 -2
  604. package/lib/feature-libraries/index.d.ts.map +1 -1
  605. package/lib/feature-libraries/index.js +3 -2
  606. package/lib/feature-libraries/index.js.map +1 -1
  607. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -0
  608. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  609. package/lib/feature-libraries/indexing/anchorTreeIndex.js +15 -8
  610. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  611. package/lib/feature-libraries/indexing/types.d.ts +4 -3
  612. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  613. package/lib/feature-libraries/indexing/types.js.map +1 -1
  614. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  615. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  616. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  617. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +3 -3
  618. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.js +0 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  623. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +10 -10
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -4
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts +3 -3
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +3 -3
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +4 -3
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  637. package/lib/feature-libraries/object-forest/objectForest.d.ts +1 -1
  638. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  639. package/lib/feature-libraries/object-forest/objectForest.js +2 -2
  640. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  641. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +4 -4
  642. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  643. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +1 -1
  644. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  645. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts +3 -3
  646. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  647. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  648. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  649. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  650. package/lib/feature-libraries/schema-edits/index.js +1 -1
  651. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  652. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -15
  653. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  654. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -50
  655. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  656. package/lib/feature-libraries/schema-index/codec.d.ts +3 -16
  657. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-index/codec.js +0 -19
  659. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  660. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
  661. package/lib/feature-libraries/schema-index/formatV2.js +1 -1
  662. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  663. package/lib/feature-libraries/schema-index/index.d.ts +1 -1
  664. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  665. package/lib/feature-libraries/schema-index/index.js +1 -1
  666. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  667. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -4
  668. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  669. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  670. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts +3 -3
  671. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  672. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +1 -1
  673. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  674. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts +3 -3
  675. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  676. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  677. package/lib/index.d.ts +2 -2
  678. package/lib/index.d.ts.map +1 -1
  679. package/lib/index.js +1 -1
  680. package/lib/index.js.map +1 -1
  681. package/lib/packageVersion.d.ts +1 -1
  682. package/lib/packageVersion.js +1 -1
  683. package/lib/packageVersion.js.map +1 -1
  684. package/lib/serializableDomainSchema.d.ts +5 -5
  685. package/lib/serializableDomainSchema.d.ts.map +1 -1
  686. package/lib/serializableDomainSchema.js +4 -1
  687. package/lib/serializableDomainSchema.js.map +1 -1
  688. package/lib/shared-tree/independentView.d.ts +1 -1
  689. package/lib/shared-tree/independentView.d.ts.map +1 -1
  690. package/lib/shared-tree/independentView.js +4 -11
  691. package/lib/shared-tree/independentView.js.map +1 -1
  692. package/lib/shared-tree/index.d.ts +2 -2
  693. package/lib/shared-tree/index.d.ts.map +1 -1
  694. package/lib/shared-tree/index.js +1 -1
  695. package/lib/shared-tree/index.js.map +1 -1
  696. package/lib/shared-tree/schematizingTreeView.d.ts +2 -36
  697. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  698. package/lib/shared-tree/schematizingTreeView.js +17 -116
  699. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  700. package/lib/shared-tree/sharedTree.d.ts +3 -22
  701. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  702. package/lib/shared-tree/sharedTree.js +11 -27
  703. package/lib/shared-tree/sharedTree.js.map +1 -1
  704. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +3 -2
  705. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  706. package/lib/shared-tree/sharedTreeChangeCodecs.js +19 -12
  707. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  708. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  709. package/lib/shared-tree/sharedTreeChangeEnricher.js +2 -2
  710. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  711. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +1 -1
  712. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  713. package/lib/shared-tree/sharedTreeChangeFamily.js +2 -2
  714. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  715. package/lib/shared-tree/sharedTreeChangeFormat.d.ts +8 -7
  716. package/lib/shared-tree/sharedTreeChangeFormat.d.ts.map +1 -1
  717. package/lib/shared-tree/sharedTreeChangeFormat.js +11 -5
  718. package/lib/shared-tree/sharedTreeChangeFormat.js.map +1 -1
  719. package/lib/shared-tree/tree.d.ts.map +1 -1
  720. package/lib/shared-tree/tree.js +2 -1
  721. package/lib/shared-tree/tree.js.map +1 -1
  722. package/lib/shared-tree/treeAlpha.d.ts +17 -1
  723. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  724. package/lib/shared-tree/treeAlpha.js +3 -0
  725. package/lib/shared-tree/treeAlpha.js.map +1 -1
  726. package/lib/shared-tree/treeCheckout.d.ts +34 -69
  727. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  728. package/lib/shared-tree/treeCheckout.js +889 -683
  729. package/lib/shared-tree/treeCheckout.js.map +1 -1
  730. package/lib/shared-tree/unhydratedTreeContext.js +1 -1
  731. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts +23 -12
  733. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecs.js +41 -65
  735. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js +0 -1
  738. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +10 -2
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +16 -11
  742. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  744. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +5 -8
  746. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  747. package/lib/shared-tree-core/index.d.ts +3 -3
  748. package/lib/shared-tree-core/index.d.ts.map +1 -1
  749. package/lib/shared-tree-core/index.js +3 -3
  750. package/lib/shared-tree-core/index.js.map +1 -1
  751. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -3
  752. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  753. package/lib/shared-tree-core/messageCodecV1ToV4.js +8 -8
  754. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  755. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +2 -3
  756. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  757. package/lib/shared-tree-core/messageCodecVSharedBranches.js +5 -4
  758. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  759. package/lib/shared-tree-core/messageCodecs.d.ts +15 -14
  760. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  761. package/lib/shared-tree-core/messageCodecs.js +38 -71
  762. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  763. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  764. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  765. package/lib/shared-tree-core/messageFormat.js +0 -1
  766. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  767. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -3
  768. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  769. package/lib/shared-tree-core/sharedTreeCore.js +14 -4
  770. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  771. package/lib/sharedTreeAttributes.d.ts.map +1 -1
  772. package/lib/sharedTreeAttributes.js +3 -0
  773. package/lib/sharedTreeAttributes.js.map +1 -1
  774. package/lib/simple-tree/api/discrepancies.js +4 -1
  775. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  776. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  777. package/lib/simple-tree/api/identifierIndex.js +1 -1
  778. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  779. package/lib/simple-tree/api/index.d.ts +2 -1
  780. package/lib/simple-tree/api/index.d.ts.map +1 -1
  781. package/lib/simple-tree/api/index.js +1 -1
  782. package/lib/simple-tree/api/index.js.map +1 -1
  783. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  784. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  785. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +33 -4
  786. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  787. package/lib/simple-tree/api/schemaFactoryAlpha.js +19 -3
  788. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  789. package/lib/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  790. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  791. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  792. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  793. package/lib/simple-tree/api/storedSchema.js +11 -8
  794. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  795. package/lib/simple-tree/api/tree.d.ts +7 -19
  796. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  797. package/lib/simple-tree/api/tree.js.map +1 -1
  798. package/lib/simple-tree/api/treeAlpha.d.ts +126 -0
  799. package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -0
  800. package/lib/simple-tree/api/treeAlpha.js +6 -0
  801. package/lib/simple-tree/api/treeAlpha.js.map +1 -0
  802. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  803. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  804. package/lib/simple-tree/api/treeChangeEvents.d.ts +4 -1
  805. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -1
  806. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  807. package/lib/simple-tree/api/treeNodeApi.d.ts +108 -0
  808. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  809. package/lib/simple-tree/api/treeNodeApi.js +101 -2
  810. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  811. package/lib/simple-tree/core/toStored.d.ts +7 -0
  812. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  813. package/lib/simple-tree/core/toStored.js.map +1 -1
  814. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  815. package/lib/simple-tree/core/treeNodeKernel.js +45 -8
  816. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  817. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  818. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  819. package/lib/simple-tree/core/unhydratedFlexTree.js +118 -12
  820. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  821. package/lib/simple-tree/fieldSchema.d.ts +6 -1
  822. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  823. package/lib/simple-tree/fieldSchema.js +3 -0
  824. package/lib/simple-tree/fieldSchema.js.map +1 -1
  825. package/lib/simple-tree/index.d.ts +2 -2
  826. package/lib/simple-tree/index.d.ts.map +1 -1
  827. package/lib/simple-tree/index.js +1 -1
  828. package/lib/simple-tree/index.js.map +1 -1
  829. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +16 -0
  830. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  831. package/lib/simple-tree/node-kinds/array/arrayNode.js +23 -0
  832. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  833. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +10 -1
  834. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  835. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  836. package/lib/simple-tree/node-kinds/array/index.d.ts +2 -2
  837. package/lib/simple-tree/node-kinds/array/index.d.ts.map +1 -1
  838. package/lib/simple-tree/node-kinds/array/index.js.map +1 -1
  839. package/lib/simple-tree/node-kinds/index.d.ts +2 -2
  840. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  841. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  842. package/lib/simple-tree/node-kinds/map/index.d.ts +1 -1
  843. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  844. package/lib/simple-tree/node-kinds/map/index.js.map +1 -1
  845. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  846. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  847. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -1
  848. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  849. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  850. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  851. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  852. package/lib/simple-tree/simpleSchema.d.ts +17 -0
  853. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  854. package/lib/simple-tree/simpleSchema.js.map +1 -1
  855. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  856. package/lib/simple-tree/toStoredSchema.js +24 -2
  857. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  858. package/lib/tableSchema.d.ts +4 -5
  859. package/lib/tableSchema.d.ts.map +1 -1
  860. package/lib/tableSchema.js +12 -23
  861. package/lib/tableSchema.js.map +1 -1
  862. package/lib/text/textDomain.d.ts.map +1 -1
  863. package/lib/text/textDomain.js +29 -0
  864. package/lib/text/textDomain.js.map +1 -1
  865. package/lib/text/textDomainFormatted.d.ts +321 -11
  866. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  867. package/lib/text/textDomainFormatted.js +103 -28
  868. package/lib/text/textDomainFormatted.js.map +1 -1
  869. package/lib/treeFactory.d.ts.map +1 -1
  870. package/lib/treeFactory.js +6 -3
  871. package/lib/treeFactory.js.map +1 -1
  872. package/lib/tsdoc-metadata.json +1 -1
  873. package/lib/util/index.d.ts +1 -1
  874. package/lib/util/index.d.ts.map +1 -1
  875. package/lib/util/index.js +1 -1
  876. package/lib/util/index.js.map +1 -1
  877. package/lib/util/referenceCounting.d.ts.map +1 -1
  878. package/lib/util/referenceCounting.js +0 -1
  879. package/lib/util/referenceCounting.js.map +1 -1
  880. package/lib/util/utils.d.ts +0 -1
  881. package/lib/util/utils.d.ts.map +1 -1
  882. package/lib/util/utils.js +0 -1
  883. package/lib/util/utils.js.map +1 -1
  884. package/package.json +35 -40
  885. package/scripts/generate-entrypoint-sources.sh +4 -2
  886. package/src/api.ts +21 -0
  887. package/src/codec/codec.ts +32 -2
  888. package/src/codec/index.ts +2 -3
  889. package/src/codec/versioned/codec.ts +99 -109
  890. package/src/codec/versioned/index.ts +1 -3
  891. package/src/core/forest/forest.ts +5 -2
  892. package/src/core/index.ts +4 -0
  893. package/src/core/rebase/changeRebaser.ts +8 -0
  894. package/src/core/rebase/revisionTagCodec.ts +4 -4
  895. package/src/core/rebase/utils.ts +9 -2
  896. package/src/core/schema-stored/formatV2.ts +1 -1
  897. package/src/core/tree/anchorSet.ts +92 -10
  898. package/src/core/tree/cursor.ts +52 -1
  899. package/src/core/tree/deltaUtil.ts +37 -1
  900. package/src/core/tree/detachedFieldIndexCodecs.ts +4 -4
  901. package/src/core/tree/index.ts +4 -0
  902. package/src/core/tree/visitDelta.ts +13 -1
  903. package/src/core/tree/visitorUtils.ts +5 -0
  904. package/src/entrypoints/alpha.ts +21 -10
  905. package/src/entrypoints/beta.ts +7 -1
  906. package/src/entrypoints/legacy.ts +7 -1
  907. package/src/entrypoints/public.ts +1 -1
  908. package/src/feature-libraries/changeAtomIdCodec.ts +8 -7
  909. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
  910. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -2
  911. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +18 -13
  912. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  913. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -2
  914. package/src/feature-libraries/chunked-forest/codec/codecs.ts +16 -10
  915. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +16 -14
  916. package/src/feature-libraries/chunked-forest/codec/{formatGeneric.ts → format/formatGeneric.ts} +1 -1
  917. package/src/feature-libraries/chunked-forest/codec/{format.ts → format/formatV1.ts} +41 -111
  918. package/src/feature-libraries/chunked-forest/codec/format/formatV2.ts +31 -0
  919. package/src/feature-libraries/chunked-forest/codec/format/index.ts +31 -0
  920. package/src/feature-libraries/chunked-forest/codec/format/versions.ts +81 -0
  921. package/src/feature-libraries/chunked-forest/codec/index.ts +6 -2
  922. package/src/feature-libraries/chunked-forest/codec/nodeEncoder.ts +19 -12
  923. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +6 -4
  924. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +10 -10
  925. package/src/feature-libraries/chunked-forest/index.ts +2 -1
  926. package/src/feature-libraries/chunked-forest/uniformChunk.ts +42 -20
  927. package/src/feature-libraries/cursorComparator.ts +77 -0
  928. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +5 -5
  929. package/src/feature-libraries/index.ts +5 -3
  930. package/src/feature-libraries/indexing/anchorTreeIndex.ts +21 -10
  931. package/src/feature-libraries/indexing/types.ts +5 -3
  932. package/src/feature-libraries/mitigatedChangeFamily.ts +4 -1
  933. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +4 -5
  934. package/src/feature-libraries/modular-schema/genericFieldKind.ts +0 -1
  935. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +19 -26
  936. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +4 -4
  937. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -5
  938. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +6 -2
  939. package/src/feature-libraries/object-forest/objectForest.ts +8 -2
  940. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +11 -13
  941. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +4 -5
  942. package/src/feature-libraries/schema-edits/index.ts +1 -4
  943. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +10 -78
  944. package/src/feature-libraries/schema-index/codec.ts +0 -25
  945. package/src/feature-libraries/schema-index/formatV2.ts +1 -1
  946. package/src/feature-libraries/schema-index/index.ts +1 -4
  947. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +6 -6
  948. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +8 -5
  949. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +4 -5
  950. package/src/index.ts +14 -3
  951. package/src/packageVersion.ts +1 -1
  952. package/src/serializableDomainSchema.ts +6 -0
  953. package/src/shared-tree/independentView.ts +5 -18
  954. package/src/shared-tree/index.ts +0 -4
  955. package/src/shared-tree/schematizingTreeView.ts +19 -165
  956. package/src/shared-tree/sharedTree.ts +16 -59
  957. package/src/shared-tree/sharedTreeChangeCodecs.ts +23 -29
  958. package/src/shared-tree/sharedTreeChangeEnricher.ts +1 -2
  959. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -0
  960. package/src/shared-tree/sharedTreeChangeFormat.ts +23 -8
  961. package/src/shared-tree/tree.ts +2 -5
  962. package/src/shared-tree/treeAlpha.ts +30 -0
  963. package/src/shared-tree/treeCheckout.ts +275 -99
  964. package/src/shared-tree/unhydratedTreeContext.ts +1 -1
  965. package/src/shared-tree-core/editManagerCodecs.ts +99 -124
  966. package/src/shared-tree-core/editManagerCodecsCommons.ts +0 -1
  967. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +54 -59
  968. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +72 -95
  969. package/src/shared-tree-core/index.ts +4 -8
  970. package/src/shared-tree-core/messageCodecV1ToV4.ts +56 -71
  971. package/src/shared-tree-core/messageCodecVSharedBranches.ts +76 -92
  972. package/src/shared-tree-core/messageCodecs.ts +88 -126
  973. package/src/shared-tree-core/messageFormat.ts +0 -3
  974. package/src/shared-tree-core/sharedTreeCore.ts +14 -21
  975. package/src/sharedTreeAttributes.ts +3 -0
  976. package/src/simple-tree/api/discrepancies.ts +6 -1
  977. package/src/simple-tree/api/identifierIndex.ts +2 -2
  978. package/src/simple-tree/api/index.ts +14 -0
  979. package/src/simple-tree/api/schemaFactory.ts +0 -2
  980. package/src/simple-tree/api/schemaFactoryAlpha.ts +80 -4
  981. package/src/simple-tree/api/simpleTreeIndex.ts +6 -6
  982. package/src/simple-tree/api/storedSchema.ts +12 -20
  983. package/src/simple-tree/api/tree.ts +7 -20
  984. package/src/simple-tree/api/treeAlpha.ts +153 -0
  985. package/src/simple-tree/api/treeBeta.ts +1 -1
  986. package/src/simple-tree/api/treeChangeEvents.ts +4 -1
  987. package/src/simple-tree/api/treeNodeApi.ts +189 -3
  988. package/src/simple-tree/core/toStored.ts +8 -0
  989. package/src/simple-tree/core/treeNodeKernel.ts +53 -7
  990. package/src/simple-tree/core/unhydratedFlexTree.ts +137 -9
  991. package/src/simple-tree/fieldSchema.ts +10 -0
  992. package/src/simple-tree/index.ts +15 -0
  993. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -0
  994. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +25 -1
  995. package/src/simple-tree/node-kinds/array/index.ts +2 -0
  996. package/src/simple-tree/node-kinds/index.ts +3 -0
  997. package/src/simple-tree/node-kinds/map/index.ts +1 -0
  998. package/src/simple-tree/node-kinds/map/mapNode.ts +20 -3
  999. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +6 -6
  1000. package/src/simple-tree/simpleSchema.ts +20 -0
  1001. package/src/simple-tree/toStoredSchema.ts +28 -1
  1002. package/src/tableSchema.ts +16 -28
  1003. package/src/text/textDomain.ts +68 -1
  1004. package/src/text/textDomainFormatted.ts +113 -11
  1005. package/src/treeFactory.ts +10 -5
  1006. package/src/util/index.ts +0 -1
  1007. package/src/util/referenceCounting.ts +0 -1
  1008. package/src/util/utils.ts +0 -2
  1009. package/.mocharc.customBenchmarks.cjs +0 -25
  1010. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  1011. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1012. package/dist/feature-libraries/chunked-forest/codec/format.js +0 -191
  1013. package/dist/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1014. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1015. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1016. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +0 -383
  1017. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +0 -1
  1018. package/lib/feature-libraries/chunked-forest/codec/format.js +0 -188
  1019. package/lib/feature-libraries/chunked-forest/codec/format.js.map +0 -1
  1020. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +0 -1
  1021. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +0 -1
  1022. /package/dist/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
  1023. /package/lib/feature-libraries/chunked-forest/codec/{formatGeneric.js → format/formatGeneric.js} +0 -0
@@ -4,84 +4,57 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.getCodecTreeForEditManagerFormatWithChange = exports.makeEditManagerCodecs = exports.makeEditManagerCodec = exports.editManagerFormatVersionSelectorForSharedBranches = exports.clientVersionToEditManagerFormatVersion = void 0;
8
- const internal_1 = require("@fluidframework/core-utils/internal");
9
- const internal_2 = require("@fluidframework/runtime-utils/internal");
7
+ exports.getCodecTreeForEditManagerFormatWithChange = exports.makeEditManagerCodecBuilder = exports.editManagerCodecName = void 0;
8
+ const internal_1 = require("@fluidframework/runtime-utils/internal");
10
9
  const index_js_1 = require("../codec/index.js");
11
- const index_js_2 = require("../codec/index.js");
12
- const index_js_3 = require("../util/index.js");
13
10
  const editManagerCodecsV1toV4_js_1 = require("./editManagerCodecsV1toV4.js");
14
11
  const editManagerCodecsVSharedBranches_js_1 = require("./editManagerCodecsVSharedBranches.js");
15
12
  const editManagerFormatCommons_js_1 = require("./editManagerFormatCommons.js");
16
13
  /**
17
- * Convert a MinimumVersionForCollab to an EditManagerFormatVersion.
18
- * @param clientVersion - The MinimumVersionForCollab to convert.
19
- * @returns The EditManagerFormatVersion that corresponds to the provided MinimumVersionForCollab.
14
+ * Codec name used to identify the {@link EditManager} codec, see {@link makeEditManagerCodecBuilder}.
20
15
  */
21
- function clientVersionToEditManagerFormatVersion(clientVersion, writeVersionOverride) {
22
- const compatibleVersion = (0, index_js_3.brand)((0, internal_2.getConfigForMinVersionForCollab)(clientVersion, {
23
- [internal_2.lowestMinVersionForCollab]: editManagerFormatCommons_js_1.EditManagerFormatVersion.v3,
24
- [index_js_1.FluidClientVersion.v2_43]: editManagerFormatCommons_js_1.EditManagerFormatVersion.v4,
25
- [index_js_1.FluidClientVersion.v2_80]: editManagerFormatCommons_js_1.EditManagerFormatVersion.v6,
26
- }));
27
- return writeVersionOverride ?? compatibleVersion;
28
- }
29
- exports.clientVersionToEditManagerFormatVersion = clientVersionToEditManagerFormatVersion;
16
+ exports.editManagerCodecName = "EditManager";
30
17
  /**
31
- * Returns the version that should be used for testing shared branches.
18
+ * Creates a {@link ClientVersionDispatchingCodecBuilder} encoding for {@link SummaryData}.
32
19
  */
33
- function editManagerFormatVersionSelectorForSharedBranches(clientVersion) {
34
- return (0, index_js_3.brand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.vSharedBranches);
35
- }
36
- exports.editManagerFormatVersionSelectorForSharedBranches = editManagerFormatVersionSelectorForSharedBranches;
37
- function editManagerFormatVersionFromOptions(options) {
38
- const selector = options.editManagerFormatSelector ?? clientVersionToEditManagerFormatVersion;
39
- return selector(options.minVersionForCollab);
40
- }
41
- function makeEditManagerCodec(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options) {
42
- const family = makeEditManagerCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options);
43
- const writeVersion = editManagerFormatVersionFromOptions(options);
44
- return (0, index_js_2.makeVersionDispatchingCodec)(family, { ...options, writeVersion });
20
+ function makeEditManagerCodecBuilder() {
21
+ // See EditManagerFormatVersion and its members for documentation on what changed in each version.
22
+ const versions = [
23
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v1, "2.73.0"),
24
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v2, "2.73.0"),
25
+ {
26
+ minVersionForCollab: internal_1.lowestMinVersionForCollab,
27
+ formatVersion: editManagerFormatCommons_js_1.EditManagerFormatVersion.v3,
28
+ codec: (options) => (0, editManagerCodecsV1toV4_js_1.makeV1toV4andV6CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(editManagerFormatCommons_js_1.EditManagerFormatVersion.v3)), options.revisionTagCodec, editManagerFormatCommons_js_1.EditManagerFormatVersion.v3),
29
+ },
30
+ {
31
+ minVersionForCollab: index_js_1.FluidClientVersion.v2_43,
32
+ formatVersion: editManagerFormatCommons_js_1.EditManagerFormatVersion.v4,
33
+ codec: (options) => (0, editManagerCodecsV1toV4_js_1.makeV1toV4andV6CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(editManagerFormatCommons_js_1.EditManagerFormatVersion.v4)), options.revisionTagCodec, editManagerFormatCommons_js_1.EditManagerFormatVersion.v4),
34
+ },
35
+ (0, index_js_1.makeDiscontinuedCodecAndSchema)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v5, "2.74.0"),
36
+ {
37
+ minVersionForCollab: index_js_1.FluidClientVersion.v2_80,
38
+ formatVersion: editManagerFormatCommons_js_1.EditManagerFormatVersion.v6,
39
+ codec: (options) => (0, editManagerCodecsV1toV4_js_1.makeV1toV4andV6CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(editManagerFormatCommons_js_1.EditManagerFormatVersion.v6)), options.revisionTagCodec, editManagerFormatCommons_js_1.EditManagerFormatVersion.v6),
40
+ },
41
+ {
42
+ minVersionForCollab: undefined,
43
+ formatVersion: editManagerFormatCommons_js_1.EditManagerFormatVersion.vSharedBranches,
44
+ codec: (options) => (0, editManagerCodecsVSharedBranches_js_1.makeSharedBranchesCodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(editManagerFormatCommons_js_1.EditManagerFormatVersion.vSharedBranches)), options.revisionTagCodec, editManagerFormatCommons_js_1.EditManagerFormatVersion.vSharedBranches),
45
+ },
46
+ ];
47
+ return index_js_1.ClientVersionDispatchingCodecBuilder.build(exports.editManagerCodecName, versions);
45
48
  }
46
- exports.makeEditManagerCodec = makeEditManagerCodec;
47
- function makeEditManagerCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options) {
48
- const registry = Array.from(editManagerFormatCommons_js_1.editManagerFormatVersions, (version) => {
49
- switch (version) {
50
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v1):
51
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v2): {
52
- return [version, (0, index_js_1.makeDiscontinuedCodecVersion)(options, version, "2.73.0")];
53
- }
54
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v3):
55
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v4):
56
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v6): {
57
- const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
58
- return [
59
- version,
60
- (0, editManagerCodecsV1toV4_js_1.makeV1CodecWithVersion)(changeCodec, revisionTagCodec, options, version),
61
- ];
62
- }
63
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.v5): {
64
- return [version, (0, index_js_1.makeDiscontinuedCodecVersion)(options, version, "2.74.0")];
65
- }
66
- case (0, index_js_3.unbrand)(editManagerFormatCommons_js_1.EditManagerFormatVersion.vSharedBranches): {
67
- const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
68
- return [
69
- version,
70
- (0, editManagerCodecsVSharedBranches_js_1.makeSharedBranchesCodecWithVersion)(changeCodec, revisionTagCodec, options, version),
71
- ];
72
- }
73
- default: {
74
- (0, internal_1.unreachableCase)(version);
75
- }
76
- }
77
- });
78
- return (0, index_js_1.makeCodecFamily)(registry);
79
- }
80
- exports.makeEditManagerCodecs = makeEditManagerCodecs;
49
+ exports.makeEditManagerCodecBuilder = makeEditManagerCodecBuilder;
50
+ /**
51
+ * Returns a {@link CodecTree} for the EditManager format at the given client version,
52
+ * with the provided change codec tree as a child.
53
+ */
81
54
  function getCodecTreeForEditManagerFormatWithChange(clientVersion, changeFormat) {
55
+ const builder = makeEditManagerCodecBuilder();
82
56
  return {
83
- name: "EditManager",
84
- version: clientVersionToEditManagerFormatVersion(clientVersion),
57
+ ...builder.getCodecTree(clientVersion),
85
58
  children: [changeFormat],
86
59
  };
87
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAsE;AAGtE,qEAGgD;AAEhD,gDAW2B;AAC3B,gDAAgE;AAOhE,+CAA+E;AAG/E,6EAAsE;AACtE,+FAA2F;AAC3F,+EAGuC;AAOvC;;;;GAIG;AACH,SAAgB,uCAAuC,CACtD,aAAsC,EACtC,oBAA+C;IAE/C,MAAM,iBAAiB,GAA6B,IAAA,gBAAK,EACxD,IAAA,0CAA+B,EAAC,aAAa,EAAE;QAC9C,CAAC,oCAAyB,CAAC,EAAE,sDAAwB,CAAC,EAAE;QACxD,CAAC,6BAAkB,CAAC,KAAK,CAAC,EAAE,sDAAwB,CAAC,EAAE;QACvD,CAAC,6BAAkB,CAAC,KAAK,CAAC,EAAE,sDAAwB,CAAC,EAAE;KACvD,CAAC,CACF,CAAC;IAEF,OAAO,oBAAoB,IAAI,iBAAiB,CAAC;AAClD,CAAC;AAbD,0FAaC;AAED;;GAEG;AACH,SAAgB,iDAAiD,CAChE,aAAsC;IAEtC,OAAO,IAAA,gBAAK,EAAC,sDAAwB,CAAC,eAAe,CAAC,CAAC;AACxD,CAAC;AAJD,8GAIC;AAQD,SAAS,mCAAmC,CAC3C,OAAoD;IAEpD,MAAM,QAAQ,GACb,OAAO,CAAC,yBAAyB,IAAI,uCAAuC,CAAC;IAC9E,OAAO,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC9C,CAAC;A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C;YACD,KAAK,IAAA,kBAAO,EAAC,sDAAwB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC3C,OAAO,CAAC,OAAO,EAAE,IAAA,uCAA4B,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC5E,CAAC;YACD,KAAK,IAAA,kBAAO,EAAC,sDAAwB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACxD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;gBACvF,OAAO;oBACN,OAAO;oBACP,IAAA,wEAAkC,EAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC;iBACnF,CAAC;YACH,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACT,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,0BAAe,EAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAlDD,sDAkDC;AAED,SAAgB,0CAA0C,CACzD,aAAsC,EACtC,YAAuB;IAEvB,OAAO;QACN,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,uCAAuC,CAAC,aAAa,CAAC;QAC/D,QAAQ,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC;AACH,CAAC;AATD,gGASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollab,\n\tlowestMinVersionForCollab,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype DependentFormatVersion,\n\tFluidClientVersion,\n\ttype FormatVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeDiscontinuedCodecVersion,\n} from \"../codec/index.js\";\nimport { makeVersionDispatchingCodec } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { brand, unbrand, type JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport type { SummaryData } from \"./editManager.js\";\nimport { makeV1CodecWithVersion } from \"./editManagerCodecsV1toV4.js\";\nimport { makeSharedBranchesCodecWithVersion } from \"./editManagerCodecsVSharedBranches.js\";\nimport {\n\tEditManagerFormatVersion,\n\teditManagerFormatVersions,\n} from \"./editManagerFormatCommons.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\n/**\n * Convert a MinimumVersionForCollab to an EditManagerFormatVersion.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n * @returns The EditManagerFormatVersion that corresponds to the provided MinimumVersionForCollab.\n */\nexport function clientVersionToEditManagerFormatVersion(\n\tclientVersion: MinimumVersionForCollab,\n\twriteVersionOverride?: EditManagerFormatVersion,\n): EditManagerFormatVersion {\n\tconst compatibleVersion: EditManagerFormatVersion = brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: EditManagerFormatVersion.v3,\n\t\t\t[FluidClientVersion.v2_43]: EditManagerFormatVersion.v4,\n\t\t\t[FluidClientVersion.v2_80]: EditManagerFormatVersion.v6,\n\t\t}),\n\t);\n\n\treturn writeVersionOverride ?? compatibleVersion;\n}\n\n/**\n * Returns the version that should be used for testing shared branches.\n */\nexport function editManagerFormatVersionSelectorForSharedBranches(\n\tclientVersion: MinimumVersionForCollab,\n): EditManagerFormatVersion {\n\treturn brand(EditManagerFormatVersion.vSharedBranches);\n}\n\nexport interface EditManagerCodecOptions {\n\treadonly editManagerFormatSelector?: (\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t) => EditManagerFormatVersion;\n}\n\nfunction editManagerFormatVersionFromOptions(\n\toptions: EditManagerCodecOptions & CodecWriteOptions,\n): EditManagerFormatVersion {\n\tconst selector =\n\t\toptions.editManagerFormatSelector ?? clientVersionToEditManagerFormatVersion;\n\treturn selector(options.minVersionForCollab);\n}\n\nexport function makeEditManagerCodec<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: EditManagerCodecOptions & CodecWriteOptions,\n): IJsonCodec<\n\tSummaryData<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tEditManagerEncodingContext\n> {\n\tconst family = makeEditManagerCodecs(\n\t\tchangeCodecs,\n\t\tdependentChangeFormatVersion,\n\t\trevisionTagCodec,\n\t\toptions,\n\t);\n\tconst writeVersion = editManagerFormatVersionFromOptions(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\nexport function makeEditManagerCodecs<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n): ICodecFamily<SummaryData<TChangeset>, EditManagerEncodingContext> {\n\tconst registry: [\n\t\tFormatVersion,\n\t\tIJsonCodec<\n\t\t\tSummaryData<TChangeset>,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tEditManagerEncodingContext\n\t\t>,\n\t][] = Array.from(editManagerFormatVersions, (version) => {\n\t\tswitch (version) {\n\t\t\tcase unbrand(EditManagerFormatVersion.v1):\n\t\t\tcase unbrand(EditManagerFormatVersion.v2): {\n\t\t\t\treturn [version, makeDiscontinuedCodecVersion(options, version, \"2.73.0\")];\n\t\t\t}\n\t\t\tcase unbrand(EditManagerFormatVersion.v3):\n\t\t\tcase unbrand(EditManagerFormatVersion.v4):\n\t\t\tcase unbrand(EditManagerFormatVersion.v6): {\n\t\t\t\tconst changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeV1CodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\t}\n\t\t\tcase unbrand(EditManagerFormatVersion.v5): {\n\t\t\t\treturn [version, makeDiscontinuedCodecVersion(options, version, \"2.74.0\")];\n\t\t\t}\n\t\t\tcase unbrand(EditManagerFormatVersion.vSharedBranches): {\n\t\t\t\tconst changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tunreachableCase(version);\n\t\t\t}\n\t\t}\n\t});\n\treturn makeCodecFamily(registry);\n}\n\nexport function getCodecTreeForEditManagerFormatWithChange(\n\tclientVersion: MinimumVersionForCollab,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\treturn {\n\t\tname: \"EditManager\",\n\t\tversion: clientVersionToEditManagerFormatVersion(clientVersion),\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
1
+ {"version":3,"file":"editManagerCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,qEAAmF;AAEn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AC,4BAA4B,CAAC,MAAM,CAAC,sDAAwB,CAAC,EAAE,CAAC,CACxE,EACD,OAAO,CAAC,gBAAgB,EACxB,sDAAwB,CAAC,EAAE,CAC3B;SACF;QACD;YACC,mBAAmB,EAAE,SAAS;YAC9B,aAAa,EAAE,sDAAwB,CAAC,eAAe;YACvD,KAAK,EAAE,CAAC,OAA4C,EAAE,EAAE,CACvD,IAAA,wEAAkC,EACjC,OAAO,CAAC,YAAY,CAAC,OAAO,CAC3B,OAAO,CAAC,4BAA4B,CAAC,MAAM,CAC1C,sDAAwB,CAAC,eAAe,CACxC,CACD,EACD,OAAO,CAAC,gBAAgB,EACxB,sDAAwB,CAAC,eAAe,CACxC;SACF;KACD,CAAC;IAEF,OAAO,+CAAoC,CAAC,KAAK,CAAC,4BAAoB,EAAE,QAAQ,CAAC,CAAC;AACnF,CAAC;AAxED,kEAwEC;AAED;;;GAGG;AACH,SAAgB,0CAA0C,CACzD,aAAsC,EACtC,YAAuB;IAEvB,MAAM,OAAO,GAAG,2BAA2B,EAAE,CAAC;IAC9C,OAAO;QACN,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC;QACtC,QAAQ,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC;AACH,CAAC;AATD,gGASC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecTree,\n\ttype CodecVersion,\n\ttype DependentFormatVersion,\n\tFluidClientVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeDiscontinuedCodecAndSchema,\n} from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\n\nimport type { SummaryData } from \"./editManager.js\";\nimport { makeV1toV4andV6CodecWithVersion } from \"./editManagerCodecsV1toV4.js\";\nimport { makeSharedBranchesCodecWithVersion } from \"./editManagerCodecsVSharedBranches.js\";\nimport { EditManagerFormatVersion } from \"./editManagerFormatCommons.js\";\n\n/**\n * Context required for encoding/decoding the {@link EditManager}'s {@link SummaryData}.\n */\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\n/**\n * Codec name used to identify the {@link EditManager} codec, see {@link makeEditManagerCodecBuilder}.\n */\nexport const editManagerCodecName = \"EditManager\";\n\n/**\n * Options for constructing an {@link EditManager} codec, see {@link makeEditManagerCodecBuilder}.\n */\ninterface EditManagerCodecOptions<TChangeset> extends ICodecOptions {\n\t/** Codecs for encoding changesets. */\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>;\n\t/** Maps each EditManager format version to the corresponding changeset format version. */\n\tdependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>;\n\t/** Codec for encoding revision tags within changesets. */\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>;\n}\n\n/**\n * Creates a {@link ClientVersionDispatchingCodecBuilder} encoding for {@link SummaryData}.\n */\nexport function makeEditManagerCodecBuilder<\n\tTChangeset,\n>(): ClientVersionDispatchingCodecBuilder<\n\tEditManagerCodecOptions<TChangeset>,\n\tSummaryData<TChangeset>,\n\tEditManagerEncodingContext,\n\tEditManagerFormatVersion,\n\ttypeof editManagerCodecName\n> {\n\t// See EditManagerFormatVersion and its members for documentation on what changed in each version.\n\tconst versions: CodecVersion<\n\t\tSummaryData<TChangeset>,\n\t\tEditManagerEncodingContext,\n\t\tEditManagerFormatVersion,\n\t\tEditManagerCodecOptions<TChangeset>\n\t>[] = [\n\t\tmakeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v1, \"2.73.0\"),\n\t\tmakeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v2, \"2.73.0\"),\n\t\t{\n\t\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\t\tformatVersion: EditManagerFormatVersion.v3,\n\t\t\tcodec: (options: EditManagerCodecOptions<TChangeset>) =>\n\t\t\t\tmakeV1toV4andV6CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(EditManagerFormatVersion.v3),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tEditManagerFormatVersion.v3,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_43,\n\t\t\tformatVersion: EditManagerFormatVersion.v4,\n\t\t\tcodec: (options: EditManagerCodecOptions<TChangeset>) =>\n\t\t\t\tmakeV1toV4andV6CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(EditManagerFormatVersion.v4),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tEditManagerFormatVersion.v4,\n\t\t\t\t),\n\t\t},\n\t\tmakeDiscontinuedCodecAndSchema(EditManagerFormatVersion.v5, \"2.74.0\"),\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_80,\n\t\t\tformatVersion: EditManagerFormatVersion.v6,\n\t\t\tcodec: (options: EditManagerCodecOptions<TChangeset>) =>\n\t\t\t\tmakeV1toV4andV6CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(EditManagerFormatVersion.v6),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tEditManagerFormatVersion.v6,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: undefined,\n\t\t\tformatVersion: EditManagerFormatVersion.vSharedBranches,\n\t\t\tcodec: (options: EditManagerCodecOptions<TChangeset>) =>\n\t\t\t\tmakeSharedBranchesCodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(\n\t\t\t\t\t\t\tEditManagerFormatVersion.vSharedBranches,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tEditManagerFormatVersion.vSharedBranches,\n\t\t\t\t),\n\t\t},\n\t];\n\n\treturn ClientVersionDispatchingCodecBuilder.build(editManagerCodecName, versions);\n}\n\n/**\n * Returns a {@link CodecTree} for the EditManager format at the given client version,\n * with the provided change codec tree as a child.\n */\nexport function getCodecTreeForEditManagerFormatWithChange(\n\tclientVersion: MinimumVersionForCollab,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\tconst builder = makeEditManagerCodecBuilder();\n\treturn {\n\t\t...builder.getCodecTree(clientVersion),\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCodecsCommons.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsCommons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,KAAK,sBAAsB,EAAgB,MAAM,kBAAkB,CAAC;AAG1F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAGX,mBAAmB,EAGnB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AA4DD,wBAAgB,kBAAkB,CAAC,UAAU,EAC5C,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,IAAI,EAAE,uBAAuB,CAAC,UAAU,CAAC,EACzC,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,SAAS,GAAG,SAAS,GACjC,mBAAmB,CAAC,UAAU,CAAC,CAqDjC;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAC5C,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,SAAS,GAAG,SAAS,GACjC,uBAAuB,CAAC,UAAU,CAAC,CAoErC"}
1
+ {"version":3,"file":"editManagerCodecsCommons.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsCommons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAe,KAAK,sBAAsB,EAAgB,MAAM,kBAAkB,CAAC;AAG1F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAGX,mBAAmB,EAGnB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AA4DD,wBAAgB,kBAAkB,CAAC,UAAU,EAC5C,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,IAAI,EAAE,uBAAuB,CAAC,UAAU,CAAC,EACzC,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,SAAS,GAAG,SAAS,GACjC,mBAAmB,CAAC,UAAU,CAAC,CAqDjC;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAC5C,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC,EACrC,OAAO,EAAE,0BAA0B,EACnC,YAAY,EAAE,SAAS,GAAG,SAAS,GACjC,uBAAuB,CAAC,UAAU,CAAC,CAmErC"}
@@ -87,7 +87,6 @@ function decodeSharedBranch(changeCodec, revisionTagCodec, json, context, origin
87
87
  const data = {
88
88
  trunk: trunk.map((commit) =>
89
89
  // TODO: sort out EncodedCommit vs Commit, and make this type check without `as`.
90
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
91
90
  decodeCommit(changeCodec, revisionTagCodec, commit, {
92
91
  originatorId: commit.sessionId,
93
92
  idCompressor: context.idCompressor,
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCod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OAAO,CAAC,YAAY;YAClC,QAAQ,EAAE,SAAS;SACnB,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AApFD,gDAoFC","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 { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { IJsonCodec } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { mapIterable, type JsonCompatibleReadOnly, type Mutable } from \"../util/index.js\";\n\nimport { decodeBranchId, encodeBranchId } from \"./branchIdCodec.js\";\nimport type { SharedBranchSummaryData } from \"./editManager.js\";\nimport type {\n\tCommit,\n\tEncodedCommit,\n\tEncodedSharedBranch,\n\tSequenceId,\n\tSequencedCommit,\n} from \"./editManagerFormatCommons.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction encodeCommit<TChangeset, T extends Commit<TChangeset>>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcommit: T,\n\tcontext: ChangeEncodingContext,\n) {\n\treturn {\n\t\t...commit,\n\t\trevision: revisionTagCodec.encode(commit.revision, {\n\t\t\toriginatorId: commit.sessionId,\n\t\t\tidCompressor: context.idCompressor,\n\t\t\trevision: undefined,\n\t\t}),\n\t\tchange: changeCodec.encode(commit.change, { ...context, revision: commit.revision }),\n\t};\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly>>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcommit: T,\n\tcontext: ChangeEncodingContext,\n) {\n\tconst revision = revisionTagCodec.decode(commit.revision, {\n\t\toriginatorId: commit.sessionId,\n\t\tidCompressor: context.idCompressor,\n\t\trevision: undefined,\n\t});\n\n\treturn {\n\t\t...commit,\n\t\trevision,\n\t\tchange: changeCodec.decode(commit.change, { ...context, revision }),\n\t};\n}\n\nexport function encodeSharedBranch<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tdata: SharedBranchSummaryData<TChangeset>,\n\tcontext: EditManagerEncodingContext,\n\toriginatorId: SessionId | undefined,\n): EncodedSharedBranch<TChangeset> {\n\tconst json: Mutable<EncodedSharedBranch<TChangeset>> = {\n\t\ttrunk: data.trunk.map((commit) =>\n\t\t\tencodeCommit(changeCodec, revisionTagCodec, commit, {\n\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\tschema: context.schema,\n\t\t\t\trevision: undefined,\n\t\t\t}),\n\t\t),\n\t\tpeers: Array.from(data.peerLocalBranches.entries(), ([sessionId, branch]) => [\n\t\t\tsessionId,\n\t\t\t{\n\t\t\t\tbase: revisionTagCodec.encode(branch.base, {\n\t\t\t\t\toriginatorId: sessionId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t}),\n\t\t\t\tcommits: branch.commits.map((commit) =>\n\t\t\t\t\tencodeCommit(changeCodec, revisionTagCodec, commit, {\n\t\t\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\tschema: context.schema,\n\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t},\n\t\t]),\n\t};\n\tif (data.session !== undefined) {\n\t\tjson.session = data.session;\n\t}\n\tif (data.id !== undefined) {\n\t\tjson.id = encodeBranchId(context.idCompressor, data.id);\n\t}\n\tif (data.name !== undefined) {\n\t\tjson.name = data.name;\n\t}\n\tif (data.author !== undefined) {\n\t\tjson.author = data.author;\n\t}\n\tif (data.base !== undefined) {\n\t\tassert(\n\t\t\toriginatorId !== undefined,\n\t\t\t0xc62 /* Cannot encode branch base without originatorId */,\n\t\t);\n\t\tjson.base = revisionTagCodec.encode(data.base, {\n\t\t\toriginatorId,\n\t\t\tidCompressor: context.idCompressor,\n\t\t\trevision: undefined,\n\t\t});\n\t}\n\treturn json;\n}\n\nexport function decodeSharedBranch<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tjson: EncodedSharedBranch<TChangeset>,\n\tcontext: EditManagerEncodingContext,\n\toriginatorId: SessionId | undefined,\n): SharedBranchSummaryData<TChangeset> {\n\t// TODO: sort out EncodedCommit vs Commit, and make this type check without type assertion.\n\tconst trunk = json.trunk as readonly (EncodedCommit<JsonCompatibleReadOnly> & SequenceId)[];\n\tconst data: Mutable<SharedBranchSummaryData<TChangeset>> = {\n\t\ttrunk: trunk.map(\n\t\t\t(commit): SequencedCommit<TChangeset> =>\n\t\t\t\t// TODO: sort out EncodedCommit vs Commit, and make this type check without `as`.\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\t\tdecodeCommit(changeCodec, revisionTagCodec, commit, {\n\t\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t}),\n\t\t),\n\t\tpeerLocalBranches: new Map(\n\t\t\tmapIterable(json.peers, ([sessionId, branch]) => [\n\t\t\t\tsessionId,\n\t\t\t\t{\n\t\t\t\t\tbase: revisionTagCodec.decode(branch.base, {\n\t\t\t\t\t\toriginatorId: sessionId,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t}),\n\t\t\t\t\tcommits: branch.commits.map((commit) =>\n\t\t\t\t\t\t// TODO: sort out EncodedCommit vs Commit, and make this type check without `as`.\n\t\t\t\t\t\tdecodeCommit(\n\t\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t\tcommit as EncodedCommit<JsonCompatibleReadOnly>,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t\t\t},\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\t};\n\tif (json.session !== undefined) {\n\t\tdata.session = json.session;\n\t}\n\tif (json.name !== undefined) {\n\t\tdata.name = json.name;\n\t}\n\tif (json.author !== undefined) {\n\t\tdata.author = json.author;\n\t}\n\tif (json.id !== undefined) {\n\t\tassert(\n\t\t\toriginatorId !== undefined,\n\t\t\t0xc63 /* Cannot decode branch id without originatorId */,\n\t\t);\n\t\tdata.id = decodeBranchId(context.idCompressor, json.id, { originatorId });\n\t}\n\tif (json.base !== undefined) {\n\t\tassert(\n\t\t\toriginatorId !== undefined,\n\t\t\t0xc64 /* Cannot decode branch base without originatorId */,\n\t\t);\n\t\tdata.base = revisionTagCodec.decode(json.base, {\n\t\t\toriginatorId,\n\t\t\tidCompressor: context.idCompressor,\n\t\t\trevision: undefined,\n\t\t});\n\t}\n\treturn data;\n}\n"]}
1
+ {"version":3,"file":"editManagerCodecsCommons.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsCommons.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAU7D,+CAA0F;AAE1F,yDAAoE;AAepE,4EAA4E;AAC5E,SAAS,YAAY,CACpB,WAKC,EACD,gBAKC,EACD,MAAS,EACT,OAA8B;IAE9B,OAAO;QACN,GAAG,MAAM;QACT,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;YAClD,YAAY,EAAE,MAAM,CAAC,SAAS;YAC9B,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,QAAQ,EAAE,SAAS;SACnB,CAAC;QACF,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;KACpF,CAAC;AACH,CAAC;AAED,4EAA4E;AAC5E,SAAS,YAAY,CACpB,WAKC,EACD,gBAKC,EACD,MAAS,EACT,OAA8B;IAE9B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;QACzD,YAAY,EAAE,MAAM,CAAC,SAAS;QAC9B,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,QAAQ,EAAE,SAAS;KACnB,CAAC,CAAC;IAEH,OAAO;QACN,GAAG,MAAM;QACT,QAAQ;QACR,MAAM,EAAE,WAA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,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAA,iBAAM,EACL,YAAY,KAAK,SAAS,EAC1B,KAAK,CAAC,oDAAoD,CAC1D,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE;YAC9C,YAAY;YACZ,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,QAAQ,EAAE,SAAS;SACnB,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAnFD,gDAmFC","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 { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\n\nimport type { IJsonCodec } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { mapIterable, type JsonCompatibleReadOnly, type Mutable } from \"../util/index.js\";\n\nimport { decodeBranchId, encodeBranchId } from \"./branchIdCodec.js\";\nimport type { SharedBranchSummaryData } from \"./editManager.js\";\nimport type {\n\tCommit,\n\tEncodedCommit,\n\tEncodedSharedBranch,\n\tSequenceId,\n\tSequencedCommit,\n} from \"./editManagerFormatCommons.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction encodeCommit<TChangeset, T extends Commit<TChangeset>>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcommit: T,\n\tcontext: ChangeEncodingContext,\n) {\n\treturn {\n\t\t...commit,\n\t\trevision: revisionTagCodec.encode(commit.revision, {\n\t\t\toriginatorId: commit.sessionId,\n\t\t\tidCompressor: context.idCompressor,\n\t\t\trevision: undefined,\n\t\t}),\n\t\tchange: changeCodec.encode(commit.change, { ...context, revision: commit.revision }),\n\t};\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly>>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tcommit: T,\n\tcontext: ChangeEncodingContext,\n) {\n\tconst revision = revisionTagCodec.decode(commit.revision, {\n\t\toriginatorId: commit.sessionId,\n\t\tidCompressor: context.idCompressor,\n\t\trevision: undefined,\n\t});\n\n\treturn {\n\t\t...commit,\n\t\trevision,\n\t\tchange: changeCodec.decode(commit.change, { ...context, revision }),\n\t};\n}\n\nexport function encodeSharedBranch<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tdata: SharedBranchSummaryData<TChangeset>,\n\tcontext: EditManagerEncodingContext,\n\toriginatorId: SessionId | undefined,\n): EncodedSharedBranch<TChangeset> {\n\tconst json: Mutable<EncodedSharedBranch<TChangeset>> = {\n\t\ttrunk: data.trunk.map((commit) =>\n\t\t\tencodeCommit(changeCodec, revisionTagCodec, commit, {\n\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\tschema: context.schema,\n\t\t\t\trevision: undefined,\n\t\t\t}),\n\t\t),\n\t\tpeers: Array.from(data.peerLocalBranches.entries(), ([sessionId, branch]) => [\n\t\t\tsessionId,\n\t\t\t{\n\t\t\t\tbase: revisionTagCodec.encode(branch.base, {\n\t\t\t\t\toriginatorId: sessionId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t}),\n\t\t\t\tcommits: branch.commits.map((commit) =>\n\t\t\t\t\tencodeCommit(changeCodec, revisionTagCodec, commit, {\n\t\t\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\tschema: context.schema,\n\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t},\n\t\t]),\n\t};\n\tif (data.session !== undefined) {\n\t\tjson.session = data.session;\n\t}\n\tif (data.id !== undefined) {\n\t\tjson.id = encodeBranchId(context.idCompressor, data.id);\n\t}\n\tif (data.name !== undefined) {\n\t\tjson.name = data.name;\n\t}\n\tif (data.author !== undefined) {\n\t\tjson.author = data.author;\n\t}\n\tif (data.base !== undefined) {\n\t\tassert(\n\t\t\toriginatorId !== undefined,\n\t\t\t0xc62 /* Cannot encode branch base without originatorId */,\n\t\t);\n\t\tjson.base = revisionTagCodec.encode(data.base, {\n\t\t\toriginatorId,\n\t\t\tidCompressor: context.idCompressor,\n\t\t\trevision: undefined,\n\t\t});\n\t}\n\treturn json;\n}\n\nexport function decodeSharedBranch<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tjson: EncodedSharedBranch<TChangeset>,\n\tcontext: EditManagerEncodingContext,\n\toriginatorId: SessionId | undefined,\n): SharedBranchSummaryData<TChangeset> {\n\t// TODO: sort out EncodedCommit vs Commit, and make this type check without type assertion.\n\tconst trunk = json.trunk as readonly (EncodedCommit<JsonCompatibleReadOnly> & SequenceId)[];\n\tconst data: Mutable<SharedBranchSummaryData<TChangeset>> = {\n\t\ttrunk: trunk.map(\n\t\t\t(commit): SequencedCommit<TChangeset> =>\n\t\t\t\t// TODO: sort out EncodedCommit vs Commit, and make this type check without `as`.\n\t\t\t\tdecodeCommit(changeCodec, revisionTagCodec, commit, {\n\t\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t}),\n\t\t),\n\t\tpeerLocalBranches: new Map(\n\t\t\tmapIterable(json.peers, ([sessionId, branch]) => [\n\t\t\t\tsessionId,\n\t\t\t\t{\n\t\t\t\t\tbase: revisionTagCodec.decode(branch.base, {\n\t\t\t\t\t\toriginatorId: sessionId,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t}),\n\t\t\t\t\tcommits: branch.commits.map((commit) =>\n\t\t\t\t\t\t// TODO: sort out EncodedCommit vs Commit, and make this type check without `as`.\n\t\t\t\t\t\tdecodeCommit(\n\t\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t\tcommit as EncodedCommit<JsonCompatibleReadOnly>,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\toriginatorId: commit.sessionId,\n\t\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t\t\t},\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\t};\n\tif (json.session !== undefined) {\n\t\tdata.session = json.session;\n\t}\n\tif (json.name !== undefined) {\n\t\tdata.name = json.name;\n\t}\n\tif (json.author !== undefined) {\n\t\tdata.author = json.author;\n\t}\n\tif (json.id !== undefined) {\n\t\tassert(\n\t\t\toriginatorId !== undefined,\n\t\t\t0xc63 /* Cannot decode branch id without originatorId */,\n\t\t);\n\t\tdata.id = decodeBranchId(context.idCompressor, json.id, { originatorId });\n\t}\n\tif (json.base !== undefined) {\n\t\tassert(\n\t\t\toriginatorId !== undefined,\n\t\t\t0xc64 /* Cannot decode branch base without originatorId */,\n\t\t);\n\t\tdata.base = revisionTagCodec.decode(json.base, {\n\t\t\toriginatorId,\n\t\t\tidCompressor: context.idCompressor,\n\t\t\trevision: undefined,\n\t\t});\n\t}\n\treturn data;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IIdCompressor } from "@fluidframework/id-compressor";
6
- import { type ICodecOptions, type IJsonCodec } from "../codec/index.js";
6
+ import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
7
7
  import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag, SchemaAndPolicy } from "../core/index.js";
8
8
  import { type JsonCompatibleReadOnly } from "../util/index.js";
9
9
  import type { SummaryData } from "./editManager.js";
@@ -12,5 +12,13 @@ export interface EditManagerEncodingContext {
12
12
  idCompressor: IIdCompressor;
13
13
  readonly schema?: SchemaAndPolicy;
14
14
  }
15
- export declare function makeV1CodecWithVersion<TChangeset>(changeCodec: IJsonCodec<TChangeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, version: EncodedEditManager<TChangeset>["version"]): IJsonCodec<SummaryData<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, EditManagerEncodingContext>;
15
+ /**
16
+ * Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).
17
+ * @remarks
18
+ * The changeCodec and revisionTagCodec are not explicitly versioned, so the exact right version of them must be provided here
19
+ * or data will be incompatible.
20
+ *
21
+ * TODO: this file should be renamed as this is used for v6 as well.
22
+ */
23
+ export declare function makeV1toV4andV6CodecWithVersion<TChangeset>(changeCodec: IJsonCodec<TChangeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, version: EncodedEditManager<TChangeset>["version"]): CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext>;
16
24
  //# sourceMappingURL=editManagerCodecsV1toV4.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCodecsV1toV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAwB,MAAM,mBAAmB,CAAC;AAC9F,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,sBAAsB,EAAgC,MAAM,kBAAkB,CAAC;AAE7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAChD,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,GAChD,UAAU,CACZ,WAAW,CAAC,UAAU,CAAC,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAuDA"}
1
+ {"version":3,"file":"editManagerCodecsV1toV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,sBAAsB,EAG3B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,UAAU,EACzD,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,GAChD,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,0BAA0B,CAAC,CA4CrE"}
@@ -4,22 +4,30 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.makeV1CodecWithVersion = void 0;
8
- const index_js_1 = require("../codec/index.js");
9
- const index_js_2 = require("../util/index.js");
7
+ exports.makeV1toV4andV6CodecWithVersion = void 0;
8
+ const index_js_1 = require("../util/index.js");
10
9
  const editManagerCodecsCommons_js_1 = require("./editManagerCodecsCommons.js");
11
10
  const editManagerFormatV1toV4_js_1 = require("./editManagerFormatV1toV4.js");
12
- function makeV1CodecWithVersion(changeCodec, revisionTagCodec, options, version) {
13
- const format = (0, editManagerFormatV1toV4_js_1.EncodedEditManager)(changeCodec.encodedSchema ?? index_js_2.JsonCompatibleReadOnlySchema);
14
- const codec = (0, index_js_1.withSchemaValidation)(format, {
11
+ /**
12
+ * Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).
13
+ * @remarks
14
+ * The changeCodec and revisionTagCodec are not explicitly versioned, so the exact right version of them must be provided here
15
+ * or data will be incompatible.
16
+ *
17
+ * TODO: this file should be renamed as this is used for v6 as well.
18
+ */
19
+ function makeV1toV4andV6CodecWithVersion(changeCodec, revisionTagCodec, version) {
20
+ const schema = (0, editManagerFormatV1toV4_js_1.EncodedEditManager)(changeCodec.encodedSchema ?? index_js_1.JsonCompatibleReadOnlySchema);
21
+ const codec = {
22
+ schema,
15
23
  encode: (data, context) => {
16
24
  const mainBranch = (0, editManagerCodecsCommons_js_1.encodeSharedBranch)(changeCodec, revisionTagCodec, data.main, context, data.originator);
17
- const json = {
25
+ const encoded = {
18
26
  trunk: mainBranch.trunk,
19
27
  branches: mainBranch.peers,
20
28
  version,
21
29
  };
22
- return json;
30
+ return encoded;
23
31
  },
24
32
  decode: (json, context) => {
25
33
  return {
@@ -29,11 +37,8 @@ function makeV1CodecWithVersion(changeCodec, revisionTagCodec, options, version)
29
37
  }, context, undefined),
30
38
  };
31
39
  },
32
- }, options.jsonValidator);
33
- // TODO: makeVersionedValidatedCodec and withSchemaValidation should allow the codec to decode JsonCompatibleReadOnly, or Versioned or something like that,
34
- // and not leak the internal encoded format in the API surface.
35
- // Fixing that would remove the need for this cast.
40
+ };
36
41
  return codec;
37
42
  }
38
- exports.makeV1CodecWithVersion = makeV1CodecWithVersion;
43
+ exports.makeV1toV4andV6CodecWithVersion = makeV1toV4andV6CodecWithVersion;
39
44
  //# sourceMappingURL=editManagerCodecsV1toV4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCodecsV1toV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsV1toV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,gDAA8F;AAO9F,+CAA6F;AAG7F,+EAAuF;AACvF,6EAAkE;AAOlE,SAAgB,sBAAsB,CACrC,WAKC,EACD,gBAKC,EACD,OAAsB,EACtB,OAAkD;IAOlD,MAAM,MAAM,GAAG,IAAA,+CAAkB,EAAC,WAAW,CAAC,aAAa,IAAI,uCAA4B,CAAC,CAAC;IAE7F,MAAM,KAAK,GAKP,IAAA,+BAAoB,EACvB,MAAM,EACN;QACC,MAAM,EAAE,CAAC,IAAI,EAAE,OAAmC,EAAE,EAAE;YACrD,MAAM,UAAU,GAAG,IAAA,gDAAkB,EACpC,WAAW,EACX,gBAAgB,EAChB,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,UAAU,CACf,CAAC;YACF,MAAM,IAAI,GAAmC;gBAC5C,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,QAAQ,EAAE,UAAU,CAAC,KAAK;gBAC1B,OAAO;aACP,CAAC;YACF,OAAO,IAAI,CAAC;QACb,CAAC;QACD,MAAM,EAAE,CACP,IAAoC,EACpC,OAAmC,EACT,EAAE;YAC5B,OAAO;gBACN,IAAI,EAAE,IAAA,gDAAkB,EACvB,WAAW,EACX,gBAAgB,EAChB;oBACC,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,KAAK,EAAE,IAAI,CAAC,QAAQ;iBACpB,EACD,OAAO,EACP,SAAS,CACT;aACD,CAAC;QACH,CAAC;KACD,EACD,OAAO,CAAC,aAAa,CACrB,CAAC;IACF,2JAA2J;IAC3J,+DAA+D;IAC/D,mDAAmD;IACnD,OAAO,KAKN,CAAC;AACH,CAAC;AA3ED,wDA2EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport { type ICodecOptions, type IJsonCodec, withSchemaValidation } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { type JsonCompatibleReadOnly, JsonCompatibleReadOnlySchema } from \"../util/index.js\";\n\nimport type { SummaryData } from \"./editManager.js\";\nimport { decodeSharedBranch, encodeSharedBranch } from \"./editManagerCodecsCommons.js\";\nimport { EncodedEditManager } from \"./editManagerFormatV1toV4.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport function makeV1CodecWithVersion<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n\tversion: EncodedEditManager<TChangeset>[\"version\"],\n): IJsonCodec<\n\tSummaryData<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tEditManagerEncodingContext\n> {\n\tconst format = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);\n\n\tconst codec: IJsonCodec<\n\t\tSummaryData<TChangeset>,\n\t\tEncodedEditManager<TChangeset>,\n\t\tEncodedEditManager<TChangeset>,\n\t\tEditManagerEncodingContext\n\t> = withSchemaValidation(\n\t\tformat,\n\t\t{\n\t\t\tencode: (data, context: EditManagerEncodingContext) => {\n\t\t\t\tconst mainBranch = encodeSharedBranch(\n\t\t\t\t\tchangeCodec,\n\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\tdata.main,\n\t\t\t\t\tcontext,\n\t\t\t\t\tdata.originator,\n\t\t\t\t);\n\t\t\t\tconst json: EncodedEditManager<TChangeset> = {\n\t\t\t\t\ttrunk: mainBranch.trunk,\n\t\t\t\t\tbranches: mainBranch.peers,\n\t\t\t\t\tversion,\n\t\t\t\t};\n\t\t\t\treturn json;\n\t\t\t},\n\t\t\tdecode: (\n\t\t\t\tjson: EncodedEditManager<TChangeset>,\n\t\t\t\tcontext: EditManagerEncodingContext,\n\t\t\t): SummaryData<TChangeset> => {\n\t\t\t\treturn {\n\t\t\t\t\tmain: decodeSharedBranch(\n\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttrunk: json.trunk,\n\t\t\t\t\t\t\tpeers: json.branches,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tundefined, // originatorId is not encoded in v1\n\t\t\t\t\t),\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t\toptions.jsonValidator,\n\t);\n\t// TODO: makeVersionedValidatedCodec and withSchemaValidation should allow the codec to decode JsonCompatibleReadOnly, or Versioned or something like that,\n\t// and not leak the internal encoded format in the API surface.\n\t// Fixing that would remove the need for this cast.\n\treturn codec as unknown as IJsonCodec<\n\t\tSummaryData<TChangeset>,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tEditManagerEncodingContext\n\t>;\n}\n"]}
1
+ {"version":3,"file":"editManagerCodecsV1toV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsV1toV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,+CAI0B;AAG1B,+EAAuF;AACvF,6EAAkE;AAOlE;;;;;;;GAOG;AACH,SAAgB,+BAA+B,CAC9C,WAKC,EACD,gBAKC,EACD,OAAkD;IAElD,MAAM,MAAM,GAAG,IAAA,+CAAkB,EAAC,WAAW,CAAC,aAAa,IAAI,uCAA4B,CAAC,CAAC;IAE7F,MAAM,KAAK,GAAwE;QAClF,MAAM;QACN,MAAM,EAAE,CACP,IAA6B,EAC7B,OAAmC,EACyC,EAAE;YAC9E,MAAM,UAAU,GAAG,IAAA,gDAAkB,EACpC,WAAW,EACX,gBAAgB,EAChB,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,UAAU,CACf,CAAC;YACF,MAAM,OAAO,GAAmC;gBAC/C,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,QAAQ,EAAE,UAAU,CAAC,KAAK;gBAC1B,OAAO;aACP,CAAC;YACF,OAAO,OAEsB,CAAC;QAC/B,CAAC;QACD,MAAM,EAAE,CACP,IAA6D,EAC7D,OAAmC,EACT,EAAE;YAC5B,OAAO;gBACN,IAAI,EAAE,IAAA,gDAAkB,EACvB,WAAW,EACX,gBAAgB,EAChB;oBACC,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,KAAK,EAAE,IAAI,CAAC,QAAQ;iBACpB,EACD,OAAO,EACP,SAAS,CACT;aACD,CAAC;QACH,CAAC;KACD,CAAC;IACF,OAAO,KAAK,CAAC;AACd,CAAC;AA1DD,0EA0DC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { CodecAndSchema, IJsonCodec, Versioned } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n} from \"../util/index.js\";\n\nimport type { SummaryData } from \"./editManager.js\";\nimport { decodeSharedBranch, encodeSharedBranch } from \"./editManagerCodecsCommons.js\";\nimport { EncodedEditManager } from \"./editManagerFormatV1toV4.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\n/**\n * Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).\n * @remarks\n * The changeCodec and revisionTagCodec are not explicitly versioned, so the exact right version of them must be provided here\n * or data will be incompatible.\n *\n * TODO: this file should be renamed as this is used for v6 as well.\n */\nexport function makeV1toV4andV6CodecWithVersion<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion: EncodedEditManager<TChangeset>[\"version\"],\n): CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> {\n\tconst schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);\n\n\tconst codec: CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> = {\n\t\tschema,\n\t\tencode: (\n\t\t\tdata: SummaryData<TChangeset>,\n\t\t\tcontext: EditManagerEncodingContext,\n\t\t): EncodedEditManager<TChangeset> & Versioned & JsonCompatibleReadOnlyObject => {\n\t\t\tconst mainBranch = encodeSharedBranch(\n\t\t\t\tchangeCodec,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tdata.main,\n\t\t\t\tcontext,\n\t\t\t\tdata.originator,\n\t\t\t);\n\t\t\tconst encoded: EncodedEditManager<TChangeset> = {\n\t\t\t\ttrunk: mainBranch.trunk,\n\t\t\t\tbranches: mainBranch.peers,\n\t\t\t\tversion,\n\t\t\t};\n\t\t\treturn encoded as EncodedEditManager<TChangeset> &\n\t\t\t\tVersioned &\n\t\t\t\tJsonCompatibleReadOnlyObject;\n\t\t},\n\t\tdecode: (\n\t\t\tjson: EncodedEditManager<TChangeset> & JsonCompatibleReadOnly,\n\t\t\tcontext: EditManagerEncodingContext,\n\t\t): SummaryData<TChangeset> => {\n\t\t\treturn {\n\t\t\t\tmain: decodeSharedBranch(\n\t\t\t\t\tchangeCodec,\n\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t{\n\t\t\t\t\t\ttrunk: json.trunk,\n\t\t\t\t\t\tpeers: json.branches,\n\t\t\t\t\t},\n\t\t\t\t\tcontext,\n\t\t\t\t\tundefined, // Non \"vSharedBranches\" versions do not encode the summary originatorId.\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t};\n\treturn codec;\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IIdCompressor } from "@fluidframework/id-compressor";
6
- import { type ICodecOptions, type IJsonCodec } from "../codec/index.js";
6
+ import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
7
7
  import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag, SchemaAndPolicy } from "../core/index.js";
8
8
  import { type JsonCompatibleReadOnly } from "../util/index.js";
9
9
  import type { SummaryData } from "./editManager.js";
@@ -12,5 +12,5 @@ export interface EditManagerEncodingContext {
12
12
  idCompressor: IIdCompressor;
13
13
  readonly schema?: SchemaAndPolicy;
14
14
  }
15
- export declare function makeSharedBranchesCodecWithVersion<TChangeset>(changeCodec: IJsonCodec<TChangeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, version: EncodedEditManager<TChangeset>["version"]): IJsonCodec<SummaryData<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, EditManagerEncodingContext>;
15
+ export declare function makeSharedBranchesCodecWithVersion<TChangeset>(changeCodec: IJsonCodec<TChangeset, JsonCompatibleReadOnly, JsonCompatibleReadOnly, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, version: EncodedEditManager<TChangeset>["version"]): CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext>;
16
16
  //# sourceMappingURL=editManagerCodecsVSharedBranches.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCodecsVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAwB,MAAM,mBAAmB,CAAC;AAC9F,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,sBAAsB,EAG3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,GAChD,UAAU,CACZ,WAAW,CAAC,UAAU,CAAC,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAgGA"}
1
+ {"version":3,"file":"editManagerCodecsVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,sBAAsB,EAI3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,GAChD,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,0BAA0B,CAAC,CA8ErE"}
@@ -6,13 +6,13 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.makeSharedBranchesCodecWithVersion = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
- const index_js_1 = require("../codec/index.js");
10
- const index_js_2 = require("../util/index.js");
9
+ const index_js_1 = require("../util/index.js");
11
10
  const editManagerCodecsCommons_js_1 = require("./editManagerCodecsCommons.js");
12
11
  const editManagerFormatVSharedBranches_js_1 = require("./editManagerFormatVSharedBranches.js");
13
- function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, options, version) {
14
- const format = (0, editManagerFormatVSharedBranches_js_1.EncodedEditManager)(changeCodec.encodedSchema ?? index_js_2.JsonCompatibleReadOnlySchema);
15
- const codec = (0, index_js_1.withSchemaValidation)(format, {
12
+ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, version) {
13
+ const schema = (0, editManagerFormatVSharedBranches_js_1.EncodedEditManager)(changeCodec.encodedSchema ?? index_js_1.JsonCompatibleReadOnlySchema);
14
+ const codec = {
15
+ schema,
16
16
  encode: (data, context) => {
17
17
  const mainBranch = (0, editManagerCodecsCommons_js_1.encodeSharedBranch)(changeCodec, revisionTagCodec, data.main, context, data.originator);
18
18
  (0, internal_1.assert)(data.originator !== undefined, 0xca5 /* Cannot encode vSharedBranches summary without originator */);
@@ -48,10 +48,7 @@ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, optio
48
48
  }
49
49
  return decoded;
50
50
  },
51
- }, options.jsonValidator);
52
- // TODO: makeVersionedValidatedCodec and withSchemaValidation should allow the codec to decode JsonCompatibleReadOnly, or Versioned or something like that,
53
- // and not leak the internal encoded format in the API surface.
54
- // Fixing that would remove the need for this cast.
51
+ };
55
52
  return codec;
56
53
  }
57
54
  exports.makeSharedBranchesCodecWithVersion = makeSharedBranchesCodecWithVersion;
@@ -1 +1 @@
1
- {"version":3,"file":"editManagerCodecsVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":";AAA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AAM,UAAU,GAAG,IAAA,gDAAkB,EACpC,WAAW,EACX,gBAAgB,EAChB,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,UAAU,CACf,CAAC;YAEF,MAAM,OAAO,GAAqC;gBACjD,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,IAAI,CAAC,UAAU;aAC3B,CAAC;YAEF,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAiD,CAAC;gBAC1E,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpC,MAAM,aAAa,GAAG,IAAA,gDAAkB,EACvC,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,IAAI,CAAC,UAAU,CACf,CAAC;oBACF,IAAA,iBAAM,EACL,aAAa,CAAC,EAAE,KAAK,SAAS,EAC9B,KAAK,CAAC,qCAAqC,CAC3C,CAAC;oBACF,IAAA,iBAAM,EAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;oBAChF,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;gBAC/C,CAAC;gBAED,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;YACD,OAAO,OAAO,CAAC;QAChB,CAAC;KACD,EACD,OAAO,CAAC,aAAa,CACrB,CAAC;IACF,2JAA2J;IAC3J,+DAA+D;IAC/D,mDAAmD;IACnD,OAAO,KAKN,CAAC;AACH,CAAC;AApHD,gFAoHC","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 { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport { type ICodecOptions, type IJsonCodec, withSchemaValidation } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlySchema,\n\ttype Mutable,\n} from \"../util/index.js\";\n\nimport type { BranchId } from \"./branch.js\";\nimport type { SharedBranchSummaryData, SummaryData } from \"./editManager.js\";\nimport { decodeSharedBranch, encodeSharedBranch } from \"./editManagerCodecsCommons.js\";\nimport type { EncodedSharedBranch } from \"./editManagerFormatCommons.js\";\nimport { EncodedEditManager } from \"./editManagerFormatVSharedBranches.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport function makeSharedBranchesCodecWithVersion<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n\tversion: EncodedEditManager<TChangeset>[\"version\"],\n): IJsonCodec<\n\tSummaryData<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tEditManagerEncodingContext\n> {\n\tconst format = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);\n\n\tconst codec: IJsonCodec<\n\t\tSummaryData<TChangeset>,\n\t\tEncodedEditManager<TChangeset>,\n\t\tEncodedEditManager<TChangeset>,\n\t\tEditManagerEncodingContext\n\t> = withSchemaValidation(\n\t\tformat,\n\t\t{\n\t\t\tencode: (data: SummaryData<TChangeset>, context: EditManagerEncodingContext) => {\n\t\t\t\tconst mainBranch = encodeSharedBranch(\n\t\t\t\t\tchangeCodec,\n\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\tdata.main,\n\t\t\t\t\tcontext,\n\t\t\t\t\tdata.originator,\n\t\t\t\t);\n\t\t\t\tassert(\n\t\t\t\t\tdata.originator !== undefined,\n\t\t\t\t\t0xca5 /* Cannot encode vSharedBranches summary without originator */,\n\t\t\t\t);\n\t\t\t\tconst json: Mutable<EncodedEditManager<TChangeset>> = {\n\t\t\t\t\tmain: mainBranch,\n\t\t\t\t\toriginator: data.originator,\n\t\t\t\t\tversion,\n\t\t\t\t};\n\t\t\t\tif (data.branches !== undefined && data.branches.size > 0) {\n\t\t\t\t\tconst branches: EncodedSharedBranch<TChangeset>[] = [];\n\t\t\t\t\tfor (const [_, branch] of data.branches) {\n\t\t\t\t\t\tbranches.push(\n\t\t\t\t\t\t\tencodeSharedBranch(\n\t\t\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t\t\tbranch,\n\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\tdata.originator,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tjson.branches = branches;\n\t\t\t\t}\n\t\t\t\treturn json;\n\t\t\t},\n\t\t\tdecode: (\n\t\t\t\tjson: EncodedEditManager<TChangeset>,\n\t\t\t\tcontext: EditManagerEncodingContext,\n\t\t\t): SummaryData<TChangeset> => {\n\t\t\t\tconst mainBranch = decodeSharedBranch(\n\t\t\t\t\tchangeCodec,\n\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\tjson.main,\n\t\t\t\t\tcontext,\n\t\t\t\t\tjson.originator,\n\t\t\t\t);\n\n\t\t\t\tconst decoded: Mutable<SummaryData<TChangeset>> = {\n\t\t\t\t\tmain: mainBranch,\n\t\t\t\t\toriginator: json.originator,\n\t\t\t\t};\n\n\t\t\t\tif (json.branches !== undefined) {\n\t\t\t\t\tconst branches = new Map<BranchId, SharedBranchSummaryData<TChangeset>>();\n\t\t\t\t\tfor (const branch of json.branches) {\n\t\t\t\t\t\tconst decodedBranch = decodeSharedBranch(\n\t\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t\tbranch,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tjson.originator,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tdecodedBranch.id !== undefined,\n\t\t\t\t\t\t\t0xc66 /* Shared branches must have an id */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert(!branches.has(decodedBranch.id), 0xc67 /* Duplicate shared branch id */);\n\t\t\t\t\t\tbranches.set(decodedBranch.id, decodedBranch);\n\t\t\t\t\t}\n\n\t\t\t\t\tdecoded.branches = branches;\n\t\t\t\t}\n\t\t\t\treturn decoded;\n\t\t\t},\n\t\t},\n\t\toptions.jsonValidator,\n\t);\n\t// TODO: makeVersionedValidatedCodec and withSchemaValidation should allow the codec to decode JsonCompatibleReadOnly, or Versioned or something like that,\n\t// and not leak the internal encoded format in the API surface.\n\t// Fixing that would remove the need for this cast.\n\treturn codec as unknown as IJsonCodec<\n\t\tSummaryData<TChangeset>,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tEditManagerEncodingContext\n\t>;\n}\n"]}
1
+ {"version":3,"file":"editManagerCodecsVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAU7D,+CAK0B;AAI1B,+EAAuF;AAEvF,+FAA2E;AAO3E,SAAgB,kCAAkC,CACjD,WAKC,EACD,gBAKC,EACD,OAAkD;IAElD,MAAM,MAAM,GAAG,IAAA,wDAAkB,EAAC,WAAW,CAAC,aAAa,IAAI,uCAA4B,CAAC,CAAC;IAE7F,MAAM,KAAK,GAAwE;QAClF,MAAM;QACN,MAAM,EAAE,CAAC,IAA6B,EAAE,OAAmC,EAAE,EAAE;YAC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,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpC,MAAM,aAAa,GAAG,IAAA,gDAAkB,EACvC,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,IAAI,CAAC,UAAU,CACf,CAAC;oBACF,IAAA,iBAAM,EAAC,aAAa,CAAC,EAAE,KAAK,SAAS,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;oBACpF,IAAA,iBAAM,EAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;oBAChF,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;gBAC/C,CAAC;gBAED,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;YACD,OAAO,OAAO,CAAC;QAChB,CAAC;KACD,CAAC;IAEF,OAAO,KAAK,CAAC;AACd,CAAC;AA5FD,gFA4FC","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 { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { CodecAndSchema, IJsonCodec } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n\ttype Mutable,\n} from \"../util/index.js\";\n\nimport type { BranchId } from \"./branch.js\";\nimport type { SharedBranchSummaryData, SummaryData } from \"./editManager.js\";\nimport { decodeSharedBranch, encodeSharedBranch } from \"./editManagerCodecsCommons.js\";\nimport type { EncodedSharedBranch } from \"./editManagerFormatCommons.js\";\nimport { EncodedEditManager } from \"./editManagerFormatVSharedBranches.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport function makeSharedBranchesCodecWithVersion<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion: EncodedEditManager<TChangeset>[\"version\"],\n): CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> {\n\tconst schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);\n\n\tconst codec: CodecAndSchema<SummaryData<TChangeset>, EditManagerEncodingContext> = {\n\t\tschema,\n\t\tencode: (data: SummaryData<TChangeset>, context: EditManagerEncodingContext) => {\n\t\t\tconst mainBranch = encodeSharedBranch(\n\t\t\t\tchangeCodec,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tdata.main,\n\t\t\t\tcontext,\n\t\t\t\tdata.originator,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tdata.originator !== undefined,\n\t\t\t\t0xca5 /* Cannot encode vSharedBranches summary without originator */,\n\t\t\t);\n\t\t\tconst json: Mutable<EncodedEditManager<TChangeset>> = {\n\t\t\t\tmain: mainBranch,\n\t\t\t\toriginator: data.originator,\n\t\t\t\tversion,\n\t\t\t};\n\t\t\tif (data.branches !== undefined && data.branches.size > 0) {\n\t\t\t\tconst branches: EncodedSharedBranch<TChangeset>[] = [];\n\t\t\t\tfor (const [_, branch] of data.branches) {\n\t\t\t\t\tbranches.push(\n\t\t\t\t\t\tencodeSharedBranch(\n\t\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t\tbranch,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tdata.originator,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tjson.branches = branches;\n\t\t\t}\n\t\t\treturn json as EncodedEditManager<TChangeset> & JsonCompatibleReadOnlyObject;\n\t\t},\n\t\tdecode: (\n\t\t\tjson: EncodedEditManager<TChangeset> & JsonCompatibleReadOnlyObject,\n\t\t\tcontext: EditManagerEncodingContext,\n\t\t): SummaryData<TChangeset> => {\n\t\t\tconst mainBranch = decodeSharedBranch(\n\t\t\t\tchangeCodec,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tjson.main,\n\t\t\t\tcontext,\n\t\t\t\tjson.originator,\n\t\t\t);\n\n\t\t\tconst decoded: Mutable<SummaryData<TChangeset>> = {\n\t\t\t\tmain: mainBranch,\n\t\t\t\toriginator: json.originator,\n\t\t\t};\n\n\t\t\tif (json.branches !== undefined) {\n\t\t\t\tconst branches = new Map<BranchId, SharedBranchSummaryData<TChangeset>>();\n\t\t\t\tfor (const branch of json.branches) {\n\t\t\t\t\tconst decodedBranch = decodeSharedBranch(\n\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\tbranch,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tjson.originator,\n\t\t\t\t\t);\n\t\t\t\t\tassert(decodedBranch.id !== undefined, 0xc66 /* Shared branches must have an id */);\n\t\t\t\t\tassert(!branches.has(decodedBranch.id), 0xc67 /* Duplicate shared branch id */);\n\t\t\t\t\tbranches.set(decodedBranch.id, decodedBranch);\n\t\t\t\t}\n\n\t\t\t\tdecoded.branches = branches;\n\t\t\t}\n\t\t\treturn decoded;\n\t\t},\n\t};\n\n\treturn codec;\n}\n"]}
@@ -10,12 +10,12 @@ export { VersionedSummarizer } from "./versionedSummarizer.js";
10
10
  export type { ResubmitMachine } from "./resubmitMachine.js";
11
11
  export { DefaultResubmitMachine } from "./defaultResubmitMachine.js";
12
12
  export { type ChangeEnricher } from "./changeEnricher.js";
13
- export { makeEditManagerCodec, getCodecTreeForEditManagerFormatWithChange, type EditManagerCodecOptions, clientVersionToEditManagerFormatVersion, editManagerFormatVersionSelectorForSharedBranches, } from "./editManagerCodecs.js";
13
+ export { makeEditManagerCodecBuilder, getCodecTreeForEditManagerFormatWithChange, editManagerCodecName, } from "./editManagerCodecs.js";
14
14
  export { EditManagerFormatVersion, supportedEditManagerFormatVersions, } from "./editManagerFormatCommons.js";
15
15
  export { EditManagerSummarizer } from "./editManagerSummarizer.js";
16
16
  export { EditManager, minimumPossibleSequenceNumber, type SummaryData, type SharedBranchSummaryData, } from "./editManager.js";
17
17
  export type { Commit, SeqNumber, SequencedCommit, SummarySessionBranch, EncodedCommit, } from "./editManagerFormatCommons.js";
18
18
  export type { DecodedMessage } from "./messageTypes.js";
19
- export { getCodecTreeForMessageFormatWithChange, clientVersionToMessageFormatVersion, messageFormatVersionSelectorForSharedBranches, makeMessageCodec, type MessageEncodingContext, } from "./messageCodecs.js";
20
- export { MessageFormatVersion, messageFormatVersions, supportedMessageFormatVersions, } from "./messageFormat.js";
19
+ export { getCodecTreeForMessageFormatWithChange, makeMessageCodecBuilder, messageCodecName, type MessageEncodingContext, } from "./messageCodecs.js";
20
+ export { MessageFormatVersion, supportedMessageFormatVersions, } from "./messageFormat.js";
21
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,MAAM,EACX,KAAK,KAAK,GACV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,cAAc,EACd,KAAK,uBAAuB,EAC5B,KAAK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AgB,EAChB,KAAK,sBAAsB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,EACpB,8BAA8B,GAC9B,MAAM,oBAAoB,CAAC"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.supportedMessageFormatVersions = exports.messageFormatVersions = exports.MessageFormatVersion = exports.makeMessageCodec = exports.messageFormatVersionSelectorForSharedBranches = exports.clientVersionToMessageFormatVersion = exports.getCodecTreeForMessageFormatWithChange = exports.minimumPossibleSequenceNumber = exports.EditManager = exports.EditManagerSummarizer = exports.supportedEditManagerFormatVersions = exports.EditManagerFormatVersion = exports.editManagerFormatVersionSelectorForSharedBranches = exports.clientVersionToEditManagerFormatVersion = exports.getCodecTreeForEditManagerFormatWithChange = exports.makeEditManagerCodec = exports.DefaultResubmitMachine = exports.VersionedSummarizer = exports.summarizablesMetadataKey = exports.SharedTreeSummaryFormatVersion = exports.SharedTreeCore = exports.SquashingTransactionStack = exports.TransactionStack = exports.TransactionResult = exports.SharedTreeBranch = exports.onForkTransitive = void 0;
7
+ exports.supportedMessageFormatVersions = exports.MessageFormatVersion = exports.messageCodecName = exports.makeMessageCodecBuilder = exports.getCodecTreeForMessageFormatWithChange = exports.minimumPossibleSequenceNumber = exports.EditManager = exports.EditManagerSummarizer = exports.supportedEditManagerFormatVersions = exports.EditManagerFormatVersion = exports.editManagerCodecName = exports.getCodecTreeForEditManagerFormatWithChange = exports.makeEditManagerCodecBuilder = exports.DefaultResubmitMachine = exports.VersionedSummarizer = exports.summarizablesMetadataKey = exports.SharedTreeSummaryFormatVersion = exports.SharedTreeCore = exports.SquashingTransactionStack = exports.TransactionStack = exports.TransactionResult = exports.SharedTreeBranch = exports.onForkTransitive = void 0;
8
8
  var branch_js_1 = require("./branch.js");
9
9
  Object.defineProperty(exports, "onForkTransitive", { enumerable: true, get: function () { return branch_js_1.onForkTransitive; } });
10
10
  Object.defineProperty(exports, "SharedTreeBranch", { enumerable: true, get: function () { return branch_js_1.SharedTreeBranch; } });
@@ -22,10 +22,9 @@ Object.defineProperty(exports, "VersionedSummarizer", { enumerable: true, get: f
22
22
  var defaultResubmitMachine_js_1 = require("./defaultResubmitMachine.js");
23
23
  Object.defineProperty(exports, "DefaultResubmitMachine", { enumerable: true, get: function () { return defaultResubmitMachine_js_1.DefaultResubmitMachine; } });
24
24
  var editManagerCodecs_js_1 = require("./editManagerCodecs.js");
25
- Object.defineProperty(exports, "makeEditManagerCodec", { enumerable: true, get: function () { return editManagerCodecs_js_1.makeEditManagerCodec; } });
25
+ Object.defineProperty(exports, "makeEditManagerCodecBuilder", { enumerable: true, get: function () { return editManagerCodecs_js_1.makeEditManagerCodecBuilder; } });
26
26
  Object.defineProperty(exports, "getCodecTreeForEditManagerFormatWithChange", { enumerable: true, get: function () { return editManagerCodecs_js_1.getCodecTreeForEditManagerFormatWithChange; } });
27
- Object.defineProperty(exports, "clientVersionToEditManagerFormatVersion", { enumerable: true, get: function () { return editManagerCodecs_js_1.clientVersionToEditManagerFormatVersion; } });
28
- Object.defineProperty(exports, "editManagerFormatVersionSelectorForSharedBranches", { enumerable: true, get: function () { return editManagerCodecs_js_1.editManagerFormatVersionSelectorForSharedBranches; } });
27
+ Object.defineProperty(exports, "editManagerCodecName", { enumerable: true, get: function () { return editManagerCodecs_js_1.editManagerCodecName; } });
29
28
  var editManagerFormatCommons_js_1 = require("./editManagerFormatCommons.js");
30
29
  Object.defineProperty(exports, "EditManagerFormatVersion", { enumerable: true, get: function () { return editManagerFormatCommons_js_1.EditManagerFormatVersion; } });
31
30
  Object.defineProperty(exports, "supportedEditManagerFormatVersions", { enumerable: true, get: function () { return editManagerFormatCommons_js_1.supportedEditManagerFormatVersions; } });
@@ -36,11 +35,9 @@ Object.defineProperty(exports, "EditManager", { enumerable: true, get: function
36
35
  Object.defineProperty(exports, "minimumPossibleSequenceNumber", { enumerable: true, get: function () { return editManager_js_1.minimumPossibleSequenceNumber; } });
37
36
  var messageCodecs_js_1 = require("./messageCodecs.js");
38
37
  Object.defineProperty(exports, "getCodecTreeForMessageFormatWithChange", { enumerable: true, get: function () { return messageCodecs_js_1.getCodecTreeForMessageFormatWithChange; } });
39
- Object.defineProperty(exports, "clientVersionToMessageFormatVersion", { enumerable: true, get: function () { return messageCodecs_js_1.clientVersionToMessageFormatVersion; } });
40
- Object.defineProperty(exports, "messageFormatVersionSelectorForSharedBranches", { enumerable: true, get: function () { return messageCodecs_js_1.messageFormatVersionSelectorForSharedBranches; } });
41
- Object.defineProperty(exports, "makeMessageCodec", { enumerable: true, get: function () { return messageCodecs_js_1.makeMessageCodec; } });
38
+ Object.defineProperty(exports, "makeMessageCodecBuilder", { enumerable: true, get: function () { return messageCodecs_js_1.makeMessageCodecBuilder; } });
39
+ Object.defineProperty(exports, "messageCodecName", { enumerable: true, get: function () { return messageCodecs_js_1.messageCodecName; } });
42
40
  var messageFormat_js_1 = require("./messageFormat.js");
43
41
  Object.defineProperty(exports, "MessageFormatVersion", { enumerable: true, get: function () { return messageFormat_js_1.MessageFormatVersion; } });
44
- Object.defineProperty(exports, "messageFormatVersions", { enumerable: true, get: function () { return messageFormat_js_1.messageFormatVersions; } });
45
42
  Object.defineProperty(exports, "supportedMessageFormatVersions", { enumerable: true, get: function () { return messageFormat_js_1.supportedMessageFormatVersions; } });
46
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAMqB;AALpB,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAMjB,mDAQ0B;AAPzB,mHAAA,iBAAiB,OAAA;AAGjB,kHAAA,gBAAgB,OAAA;AAChB,2HAAA,yBAAyB,OAAA;AAK1B,yDAK6B;AAJ5B,mHAAA,cAAc,OAAA;AAKf,qDAO2B;AAN1B,iIAAA,8BAA8B,OAAA;AAK9B,2HAAA,wBAAwB,OAAA;AAEzB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAG5B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAI/B,+DAMgC;AAL/B,4HAAA,oBAAoB,OAAA;AACpB,kJAAA,0CAA0C,OAAA;AAE1C,+IAAA,uCAAuC,OAAA;AACvC,yJAAA,iDAAiD,OAAA;AAElD,6EAGuC;AAFtC,uIAAA,wBAAwB,OAAA;AACxB,iJAAA,kCAAkC,OAAA;AAEnC,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,mDAK0B;AAJzB,6GAAA,WAAW,OAAA;AACX,+HAAA,6BAA6B,OAAA;AAa9B,uDAM4B;AAL3B,0IAAA,sCAAsC,OAAA;AACtC,uIAAA,mCAAmC,OAAA;AACnC,iJAAA,6CAA6C,OAAA;AAC7C,oHAAA,gBAAgB,OAAA;AAGjB,uDAI4B;AAH3B,wHAAA,oBAAoB,OAAA;AACpB,yHAAA,qBAAqB,OAAA;AACrB,kIAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tonForkTransitive,\n\tSharedTreeBranch,\n\ttype SharedTreeBranchChange,\n\ttype SharedTreeBranchEvents,\n\ttype BranchId,\n} from \"./branch.js\";\n\nexport {\n\tTransactionResult,\n\ttype Transactor,\n\ttype TransactionEvents,\n\tTransactionStack,\n\tSquashingTransactionStack,\n\ttype OnPush,\n\ttype OnPop,\n} from \"./transaction.js\";\n\nexport {\n\tSharedTreeCore,\n\ttype ClonableSchemaAndPolicy,\n\ttype SharedTreeCoreOptionsInternal,\n\ttype EnrichmentConfig,\n} from \"./sharedTreeCore.js\";\nexport {\n\tSharedTreeSummaryFormatVersion,\n\ttype SharedTreeSummarizableMetadata,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n\tsummarizablesMetadataKey,\n} from \"./summaryTypes.js\";\nexport { VersionedSummarizer } from \"./versionedSummarizer.js\";\n\nexport type { ResubmitMachine } from \"./resubmitMachine.js\";\nexport { DefaultResubmitMachine } from \"./defaultResubmitMachine.js\";\n\nexport { type ChangeEnricher } from \"./changeEnricher.js\";\n\nexport {\n\tmakeEditManagerCodec,\n\tgetCodecTreeForEditManagerFormatWithChange,\n\ttype EditManagerCodecOptions,\n\tclientVersionToEditManagerFormatVersion,\n\teditManagerFormatVersionSelectorForSharedBranches,\n} from \"./editManagerCodecs.js\";\nexport {\n\tEditManagerFormatVersion,\n\tsupportedEditManagerFormatVersions,\n} from \"./editManagerFormatCommons.js\";\nexport { EditManagerSummarizer } from \"./editManagerSummarizer.js\";\nexport {\n\tEditManager,\n\tminimumPossibleSequenceNumber,\n\ttype SummaryData,\n\ttype SharedBranchSummaryData,\n} from \"./editManager.js\";\nexport type {\n\tCommit,\n\tSeqNumber,\n\tSequencedCommit,\n\tSummarySessionBranch,\n\tEncodedCommit,\n} from \"./editManagerFormatCommons.js\";\n\nexport type { DecodedMessage } from \"./messageTypes.js\";\nexport {\n\tgetCodecTreeForMessageFormatWithChange,\n\tclientVersionToMessageFormatVersion,\n\tmessageFormatVersionSelectorForSharedBranches,\n\tmakeMessageCodec,\n\ttype MessageEncodingContext,\n} from \"./messageCodecs.js\";\nexport {\n\tMessageFormatVersion,\n\tmessageFormatVersions,\n\tsupportedMessageFormatVersions,\n} from \"./messageFormat.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yCAMqB;AALpB,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAMjB,mDAQ0B;AAPzB,mHAAA,iBAAiB,OAAA;AAGjB,kHAAA,gBAAgB,OAAA;AAChB,2HAAA,yBAAyB,OAAA;AAK1B,yDAK6B;AAJ5B,mHAAA,cAAc,OAAA;AAKf,qDAO2B;AAN1B,iIAAA,8BAA8B,OAAA;AAK9B,2HAAA,wBAAwB,OAAA;AAEzB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAG5B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAI/B,+DAIgC;AAH/B,mIAAA,2BAA2B,OAAA;AAC3B,kJAAA,0CAA0C,OAAA;AAC1C,4HAAA,oBAAoB,OAAA;AAErB,6EAGuC;AAFtC,uIAAA,wBAAwB,OAAA;AACxB,iJAAA,kCAAkC,OAAA;AAEnC,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,mDAK0B;AAJzB,6GAAA,WAAW,OAAA;AACX,+HAAA,6BAA6B,OAAA;AAa9B,uDAK4B;AAJ3B,0IAAA,sCAAsC,OAAA;AACtC,2HAAA,uBAAuB,OAAA;AACvB,oHAAA,gBAAgB,OAAA;AAGjB,uDAG4B;AAF3B,wHAAA,oBAAoB,OAAA;AACpB,kIAAA,8BAA8B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tonForkTransitive,\n\tSharedTreeBranch,\n\ttype SharedTreeBranchChange,\n\ttype SharedTreeBranchEvents,\n\ttype BranchId,\n} from \"./branch.js\";\n\nexport {\n\tTransactionResult,\n\ttype Transactor,\n\ttype TransactionEvents,\n\tTransactionStack,\n\tSquashingTransactionStack,\n\ttype OnPush,\n\ttype OnPop,\n} from \"./transaction.js\";\n\nexport {\n\tSharedTreeCore,\n\ttype ClonableSchemaAndPolicy,\n\ttype SharedTreeCoreOptionsInternal,\n\ttype EnrichmentConfig,\n} from \"./sharedTreeCore.js\";\nexport {\n\tSharedTreeSummaryFormatVersion,\n\ttype SharedTreeSummarizableMetadata,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n\tsummarizablesMetadataKey,\n} from \"./summaryTypes.js\";\nexport { VersionedSummarizer } from \"./versionedSummarizer.js\";\n\nexport type { ResubmitMachine } from \"./resubmitMachine.js\";\nexport { DefaultResubmitMachine } from \"./defaultResubmitMachine.js\";\n\nexport { type ChangeEnricher } from \"./changeEnricher.js\";\n\nexport {\n\tmakeEditManagerCodecBuilder,\n\tgetCodecTreeForEditManagerFormatWithChange,\n\teditManagerCodecName,\n} from \"./editManagerCodecs.js\";\nexport {\n\tEditManagerFormatVersion,\n\tsupportedEditManagerFormatVersions,\n} from \"./editManagerFormatCommons.js\";\nexport { EditManagerSummarizer } from \"./editManagerSummarizer.js\";\nexport {\n\tEditManager,\n\tminimumPossibleSequenceNumber,\n\ttype SummaryData,\n\ttype SharedBranchSummaryData,\n} from \"./editManager.js\";\nexport type {\n\tCommit,\n\tSeqNumber,\n\tSequencedCommit,\n\tSummarySessionBranch,\n\tEncodedCommit,\n} from \"./editManagerFormatCommons.js\";\n\nexport type { DecodedMessage } from \"./messageTypes.js\";\nexport {\n\tgetCodecTreeForMessageFormatWithChange,\n\tmakeMessageCodecBuilder,\n\tmessageCodecName,\n\ttype MessageEncodingContext,\n} from \"./messageCodecs.js\";\nexport {\n\tMessageFormatVersion,\n\tsupportedMessageFormatVersions,\n} from \"./messageFormat.js\";\n"]}
@@ -2,11 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ICodecOptions, type IJsonCodec } from "../codec/index.js";
5
+ import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
6
6
  import type { ChangeEncodingContext, ChangeFamilyCodec, EncodedRevisionTag, RevisionTag } from "../core/index.js";
7
- import type { JsonCompatibleReadOnly } from "../util/index.js";
8
7
  import type { MessageEncodingContext } from "./messageCodecs.js";
9
8
  import type { MessageFormatVersion } from "./messageFormat.js";
10
9
  import type { DecodedMessage } from "./messageTypes.js";
11
- export declare function makeV1ToV4CodecWithVersion<TChangeset>(changeCodec: ChangeFamilyCodec<TChangeset>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, version: typeof MessageFormatVersion.v1 | typeof MessageFormatVersion.v2 | typeof MessageFormatVersion.v3 | typeof MessageFormatVersion.v4 | typeof MessageFormatVersion.v6): IJsonCodec<DecodedMessage<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, MessageEncodingContext>;
10
+ export declare function makeV1ToV4CodecWithVersion<TChangeset>(changeCodec: ChangeFamilyCodec<TChangeset>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, version: typeof MessageFormatVersion.v1 | typeof MessageFormatVersion.v2 | typeof MessageFormatVersion.v3 | typeof MessageFormatVersion.v4 | typeof MessageFormatVersion.v6): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext>;
12
11
  //# sourceMappingURL=messageCodecV1ToV4.d.ts.map