@fluidframework/tree 2.70.0 → 2.72.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 (684) hide show
  1. package/CHANGELOG.md +84 -40
  2. package/api-report/tree.alpha.api.md +52 -22
  3. package/api-report/tree.beta.api.md +45 -0
  4. package/api-report/tree.legacy.beta.api.md +45 -0
  5. package/dist/alpha.d.ts +12 -7
  6. package/dist/api.js +1 -1
  7. package/dist/api.js.map +1 -1
  8. package/dist/beta.d.ts +8 -0
  9. package/dist/codec/codec.d.ts +16 -1
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +16 -3
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/discriminatedUnions.d.ts +1 -1
  14. package/dist/codec/discriminatedUnions.js +1 -1
  15. package/dist/codec/discriminatedUnions.js.map +1 -1
  16. package/dist/core/index.d.ts +1 -1
  17. package/dist/core/index.d.ts.map +1 -1
  18. package/dist/core/index.js +2 -2
  19. package/dist/core/index.js.map +1 -1
  20. package/dist/core/schema-stored/index.d.ts +1 -1
  21. package/dist/core/schema-stored/index.d.ts.map +1 -1
  22. package/dist/core/schema-stored/index.js +2 -2
  23. package/dist/core/schema-stored/index.js.map +1 -1
  24. package/dist/core/schema-stored/schema.d.ts +6 -6
  25. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  26. package/dist/core/schema-stored/schema.js +6 -7
  27. package/dist/core/schema-stored/schema.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  29. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  30. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  31. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  32. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  33. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  34. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  36. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
  37. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  38. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  39. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  40. package/dist/core/tree/detachedFieldIndexCodecs.js +29 -8
  41. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  43. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
  45. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  46. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  47. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  48. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  49. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  50. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  51. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  52. package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
  53. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  54. package/dist/core/tree/index.d.ts +2 -1
  55. package/dist/core/tree/index.d.ts.map +1 -1
  56. package/dist/core/tree/index.js.map +1 -1
  57. package/dist/external-utilities/typeboxValidator.js +1 -1
  58. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  60. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -8
  62. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
  66. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/format.js +9 -4
  68. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  70. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/index.js +1 -2
  72. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
  75. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  77. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/index.js +1 -2
  79. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  80. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
  81. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  82. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +3 -21
  83. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  84. package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
  85. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  86. package/dist/feature-libraries/forest-summary/codec.js +15 -4
  87. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  88. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  89. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  90. package/dist/feature-libraries/forest-summary/format.d.ts +8 -1
  91. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  92. package/dist/feature-libraries/forest-summary/format.js +8 -3
  93. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  94. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  95. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  96. package/dist/feature-libraries/forest-summary/index.js +3 -1
  97. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  98. package/dist/feature-libraries/index.d.ts +3 -3
  99. package/dist/feature-libraries/index.d.ts.map +1 -1
  100. package/dist/feature-libraries/index.js +2 -2
  101. package/dist/feature-libraries/index.js.map +1 -1
  102. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  103. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  104. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  105. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  106. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  107. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
  108. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  109. package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
  110. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  111. package/dist/feature-libraries/schema-index/codec.js +22 -18
  112. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  113. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  114. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  115. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  116. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  117. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
  118. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  119. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  120. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  121. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  122. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  123. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  124. package/dist/index.d.ts +2 -2
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +6 -2
  127. package/dist/index.js.map +1 -1
  128. package/dist/legacy.d.ts +8 -0
  129. package/dist/packageVersion.d.ts +1 -1
  130. package/dist/packageVersion.js +1 -1
  131. package/dist/packageVersion.js.map +1 -1
  132. package/dist/shared-tree/independentView.d.ts +75 -6
  133. package/dist/shared-tree/independentView.d.ts.map +1 -1
  134. package/dist/shared-tree/independentView.js +116 -43
  135. package/dist/shared-tree/independentView.js.map +1 -1
  136. package/dist/shared-tree/index.d.ts +2 -1
  137. package/dist/shared-tree/index.d.ts.map +1 -1
  138. package/dist/shared-tree/index.js +6 -1
  139. package/dist/shared-tree/index.js.map +1 -1
  140. package/dist/shared-tree/sharedTree.d.ts +12 -16
  141. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  142. package/dist/shared-tree/sharedTree.js +105 -130
  143. package/dist/shared-tree/sharedTree.js.map +1 -1
  144. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
  145. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  146. package/dist/shared-tree/sharedTreeChangeCodecs.js +12 -11
  147. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  148. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  149. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  150. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  151. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  152. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  153. package/dist/shared-tree/treeAlpha.js +4 -2
  154. package/dist/shared-tree/treeAlpha.js.map +1 -1
  155. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  156. package/dist/shared-tree/treeCheckout.js +1 -3
  157. package/dist/shared-tree/treeCheckout.js.map +1 -1
  158. package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
  159. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  160. package/dist/shared-tree-core/editManagerCodecs.js +35 -17
  161. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  162. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
  163. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  164. package/dist/shared-tree-core/editManagerFormatCommons.js +43 -1
  165. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  166. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  167. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  168. package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
  169. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  170. package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  171. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  172. package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
  173. package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
  174. package/dist/shared-tree-core/index.d.ts +5 -3
  175. package/dist/shared-tree-core/index.d.ts.map +1 -1
  176. package/dist/shared-tree-core/index.js +11 -3
  177. package/dist/shared-tree-core/index.js.map +1 -1
  178. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  179. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  180. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  181. package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
  182. package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  183. package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
  184. package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
  185. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  186. package/dist/shared-tree-core/messageCodecs.js +38 -21
  187. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  188. package/dist/shared-tree-core/messageFormat.d.ts +50 -0
  189. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
  190. package/dist/shared-tree-core/messageFormat.js +51 -0
  191. package/dist/shared-tree-core/messageFormat.js.map +1 -0
  192. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
  193. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  194. package/dist/shared-tree-core/sharedTreeCore.js +3 -3
  195. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  196. package/dist/simple-tree/api/discrepancies.d.ts +2 -2
  197. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  198. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  199. package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
  200. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  201. package/dist/simple-tree/api/index.d.ts +3 -2
  202. package/dist/simple-tree/api/index.d.ts.map +1 -1
  203. package/dist/simple-tree/api/index.js +4 -1
  204. package/dist/simple-tree/api/index.js.map +1 -1
  205. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  206. package/dist/simple-tree/api/schemaFactory.js +2 -2
  207. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  208. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  209. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  210. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
  211. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  212. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  213. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  214. package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
  215. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  216. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  217. package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -0
  218. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  219. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  220. package/dist/simple-tree/api/schemaFromSimple.js +15 -8
  221. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  222. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  223. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  224. package/dist/simple-tree/api/simpleSchemaCodec.js +292 -0
  225. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  226. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  227. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -2
  228. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  229. package/dist/simple-tree/api/storedSchema.d.ts +2 -2
  230. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  231. package/dist/simple-tree/api/storedSchema.js +8 -6
  232. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  233. package/dist/simple-tree/api/tree.d.ts +2 -2
  234. package/dist/simple-tree/api/tree.js.map +1 -1
  235. package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
  236. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  237. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +17 -1
  238. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  239. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +71 -7
  240. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  241. package/dist/simple-tree/core/allowedTypes.d.ts +12 -7
  242. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  243. package/dist/simple-tree/core/allowedTypes.js +18 -5
  244. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  245. package/dist/simple-tree/core/treeNode.js +1 -1
  246. package/dist/simple-tree/core/treeNode.js.map +1 -1
  247. package/dist/simple-tree/fieldSchema.d.ts +2 -1
  248. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  249. package/dist/simple-tree/fieldSchema.js +10 -0
  250. package/dist/simple-tree/fieldSchema.js.map +1 -1
  251. package/dist/simple-tree/index.d.ts +3 -2
  252. package/dist/simple-tree/index.d.ts.map +1 -1
  253. package/dist/simple-tree/index.js +4 -0
  254. package/dist/simple-tree/index.js.map +1 -1
  255. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  256. package/dist/simple-tree/node-kinds/array/arrayNode.js +7 -1
  257. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  258. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  259. package/dist/simple-tree/node-kinds/map/mapNode.js +7 -1
  260. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  261. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +17 -0
  262. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  263. package/dist/simple-tree/node-kinds/object/objectNode.js +21 -8
  264. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  265. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  266. package/dist/simple-tree/node-kinds/record/recordNode.js +8 -2
  267. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  268. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +16 -0
  269. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  270. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  271. package/dist/simple-tree/simpleSchema.d.ts +30 -6
  272. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  273. package/dist/simple-tree/simpleSchema.js.map +1 -1
  274. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  275. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  276. package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
  277. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  278. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  279. package/dist/simple-tree/toStoredSchema.js +6 -3
  280. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  281. package/dist/tableSchema.d.ts.map +1 -1
  282. package/dist/tableSchema.js +1 -1
  283. package/dist/tableSchema.js.map +1 -1
  284. package/dist/treeFactory.d.ts +3 -1
  285. package/dist/treeFactory.d.ts.map +1 -1
  286. package/dist/treeFactory.js +26 -2
  287. package/dist/treeFactory.js.map +1 -1
  288. package/dist/util/brand.d.ts +31 -2
  289. package/dist/util/brand.d.ts.map +1 -1
  290. package/dist/util/brand.js +28 -2
  291. package/dist/util/brand.js.map +1 -1
  292. package/dist/util/brandedMap.d.ts +3 -1
  293. package/dist/util/brandedMap.d.ts.map +1 -1
  294. package/dist/util/brandedMap.js.map +1 -1
  295. package/dist/util/index.d.ts +1 -1
  296. package/dist/util/index.d.ts.map +1 -1
  297. package/dist/util/index.js +3 -2
  298. package/dist/util/index.js.map +1 -1
  299. package/dist/util/referenceCounting.d.ts.map +1 -1
  300. package/dist/util/referenceCounting.js +1 -0
  301. package/dist/util/referenceCounting.js.map +1 -1
  302. package/lib/alpha.d.ts +12 -7
  303. package/lib/api.js +2 -2
  304. package/lib/api.js.map +1 -1
  305. package/lib/beta.d.ts +8 -0
  306. package/lib/codec/codec.d.ts +16 -1
  307. package/lib/codec/codec.d.ts.map +1 -1
  308. package/lib/codec/codec.js +16 -3
  309. package/lib/codec/codec.js.map +1 -1
  310. package/lib/codec/discriminatedUnions.d.ts +1 -1
  311. package/lib/codec/discriminatedUnions.js +1 -1
  312. package/lib/codec/discriminatedUnions.js.map +1 -1
  313. package/lib/core/index.d.ts +1 -1
  314. package/lib/core/index.d.ts.map +1 -1
  315. package/lib/core/index.js +1 -1
  316. package/lib/core/index.js.map +1 -1
  317. package/lib/core/schema-stored/index.d.ts +1 -1
  318. package/lib/core/schema-stored/index.d.ts.map +1 -1
  319. package/lib/core/schema-stored/index.js +1 -1
  320. package/lib/core/schema-stored/index.js.map +1 -1
  321. package/lib/core/schema-stored/schema.d.ts +6 -6
  322. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  323. package/lib/core/schema-stored/schema.js +6 -7
  324. package/lib/core/schema-stored/schema.js.map +1 -1
  325. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  326. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  327. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  328. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  329. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  330. package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
  331. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  332. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  333. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
  334. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  335. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  336. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  337. package/lib/core/tree/detachedFieldIndexCodecs.js +29 -8
  338. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  339. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  340. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  341. package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
  342. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  343. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  344. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  345. package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
  346. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  347. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  348. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  349. package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
  350. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  351. package/lib/core/tree/index.d.ts +2 -1
  352. package/lib/core/tree/index.d.ts.map +1 -1
  353. package/lib/core/tree/index.js +1 -1
  354. package/lib/core/tree/index.js.map +1 -1
  355. package/lib/external-utilities/typeboxValidator.js +1 -1
  356. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  357. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  358. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  359. package/lib/feature-libraries/chunked-forest/codec/codecs.js +13 -8
  360. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  361. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +2 -2
  362. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  363. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
  364. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  365. package/lib/feature-libraries/chunked-forest/codec/format.js +8 -3
  366. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  367. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  368. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  369. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  370. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  371. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  372. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  373. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  374. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  375. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  376. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  377. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  378. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
  379. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  380. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -20
  381. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  382. package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
  383. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  384. package/lib/feature-libraries/forest-summary/codec.js +16 -5
  385. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  386. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  387. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  388. package/lib/feature-libraries/forest-summary/format.d.ts +8 -1
  389. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  390. package/lib/feature-libraries/forest-summary/format.js +7 -2
  391. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  392. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  393. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  394. package/lib/feature-libraries/forest-summary/index.js +1 -0
  395. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  396. package/lib/feature-libraries/index.d.ts +3 -3
  397. package/lib/feature-libraries/index.d.ts.map +1 -1
  398. package/lib/feature-libraries/index.js +2 -2
  399. package/lib/feature-libraries/index.js.map +1 -1
  400. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  401. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  402. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  403. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  404. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  405. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
  406. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  407. package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
  408. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  409. package/lib/feature-libraries/schema-index/codec.js +24 -20
  410. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  411. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  412. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  413. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  414. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  415. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
  416. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  417. package/lib/feature-libraries/schema-index/formatV2.js +2 -2
  418. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  419. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  420. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  421. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  422. package/lib/index.d.ts +2 -2
  423. package/lib/index.d.ts.map +1 -1
  424. package/lib/index.js +2 -2
  425. package/lib/index.js.map +1 -1
  426. package/lib/legacy.d.ts +8 -0
  427. package/lib/packageVersion.d.ts +1 -1
  428. package/lib/packageVersion.js +1 -1
  429. package/lib/packageVersion.js.map +1 -1
  430. package/lib/shared-tree/independentView.d.ts +75 -6
  431. package/lib/shared-tree/independentView.d.ts.map +1 -1
  432. package/lib/shared-tree/independentView.js +111 -39
  433. package/lib/shared-tree/independentView.js.map +1 -1
  434. package/lib/shared-tree/index.d.ts +2 -1
  435. package/lib/shared-tree/index.d.ts.map +1 -1
  436. package/lib/shared-tree/index.js +2 -1
  437. package/lib/shared-tree/index.js.map +1 -1
  438. package/lib/shared-tree/sharedTree.d.ts +12 -16
  439. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  440. package/lib/shared-tree/sharedTree.js +108 -133
  441. package/lib/shared-tree/sharedTree.js.map +1 -1
  442. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
  443. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  444. package/lib/shared-tree/sharedTreeChangeCodecs.js +7 -6
  445. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  446. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  447. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  448. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  449. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  450. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  451. package/lib/shared-tree/treeAlpha.js +5 -3
  452. package/lib/shared-tree/treeAlpha.js.map +1 -1
  453. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  454. package/lib/shared-tree/treeCheckout.js +1 -3
  455. package/lib/shared-tree/treeCheckout.js.map +1 -1
  456. package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
  457. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  458. package/lib/shared-tree-core/editManagerCodecs.js +32 -16
  459. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  460. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
  461. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  462. package/lib/shared-tree-core/editManagerFormatCommons.js +42 -0
  463. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  464. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  465. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  466. package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
  467. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  468. package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  469. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  470. package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
  471. package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
  472. package/lib/shared-tree-core/index.d.ts +5 -3
  473. package/lib/shared-tree-core/index.d.ts.map +1 -1
  474. package/lib/shared-tree-core/index.js +4 -2
  475. package/lib/shared-tree-core/index.js.map +1 -1
  476. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  477. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  478. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  479. package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
  480. package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  481. package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
  482. package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
  483. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  484. package/lib/shared-tree-core/messageCodecs.js +35 -20
  485. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  486. package/lib/shared-tree-core/messageFormat.d.ts +50 -0
  487. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
  488. package/lib/shared-tree-core/messageFormat.js +48 -0
  489. package/lib/shared-tree-core/messageFormat.js.map +1 -0
  490. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
  491. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  492. package/lib/shared-tree-core/sharedTreeCore.js +3 -3
  493. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  494. package/lib/simple-tree/api/discrepancies.d.ts +2 -2
  495. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  496. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  497. package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
  498. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  499. package/lib/simple-tree/api/index.d.ts +3 -2
  500. package/lib/simple-tree/api/index.d.ts.map +1 -1
  501. package/lib/simple-tree/api/index.js +1 -0
  502. package/lib/simple-tree/api/index.js.map +1 -1
  503. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  504. package/lib/simple-tree/api/schemaFactory.js +2 -2
  505. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  506. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  507. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  508. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
  509. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  510. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  511. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  512. package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
  513. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  514. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  515. package/lib/simple-tree/api/schemaFactoryRecursive.js +1 -0
  516. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  517. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  518. package/lib/simple-tree/api/schemaFromSimple.js +15 -8
  519. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  520. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  521. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  522. package/lib/simple-tree/api/simpleSchemaCodec.js +264 -0
  523. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  524. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  525. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +4 -2
  526. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  527. package/lib/simple-tree/api/storedSchema.d.ts +2 -2
  528. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  529. package/lib/simple-tree/api/storedSchema.js +5 -3
  530. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  531. package/lib/simple-tree/api/tree.d.ts +2 -2
  532. package/lib/simple-tree/api/tree.js.map +1 -1
  533. package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
  534. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  535. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +17 -1
  536. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  537. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +69 -7
  538. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  539. package/lib/simple-tree/core/allowedTypes.d.ts +12 -7
  540. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  541. package/lib/simple-tree/core/allowedTypes.js +19 -6
  542. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  543. package/lib/simple-tree/core/treeNode.js +1 -1
  544. package/lib/simple-tree/core/treeNode.js.map +1 -1
  545. package/lib/simple-tree/fieldSchema.d.ts +2 -1
  546. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  547. package/lib/simple-tree/fieldSchema.js +10 -0
  548. package/lib/simple-tree/fieldSchema.js.map +1 -1
  549. package/lib/simple-tree/index.d.ts +3 -2
  550. package/lib/simple-tree/index.d.ts.map +1 -1
  551. package/lib/simple-tree/index.js +1 -0
  552. package/lib/simple-tree/index.js.map +1 -1
  553. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  554. package/lib/simple-tree/node-kinds/array/arrayNode.js +9 -3
  555. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  556. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  557. package/lib/simple-tree/node-kinds/map/mapNode.js +9 -3
  558. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  559. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +17 -0
  560. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  561. package/lib/simple-tree/node-kinds/object/objectNode.js +22 -9
  562. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  563. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  564. package/lib/simple-tree/node-kinds/record/recordNode.js +10 -4
  565. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  566. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +16 -0
  567. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  568. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  569. package/lib/simple-tree/simpleSchema.d.ts +30 -6
  570. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  571. package/lib/simple-tree/simpleSchema.js.map +1 -1
  572. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  573. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  574. package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
  575. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  576. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  577. package/lib/simple-tree/toStoredSchema.js +6 -3
  578. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  579. package/lib/tableSchema.d.ts.map +1 -1
  580. package/lib/tableSchema.js +1 -1
  581. package/lib/tableSchema.js.map +1 -1
  582. package/lib/treeFactory.d.ts +3 -1
  583. package/lib/treeFactory.d.ts.map +1 -1
  584. package/lib/treeFactory.js +23 -1
  585. package/lib/treeFactory.js.map +1 -1
  586. package/lib/util/brand.d.ts +31 -2
  587. package/lib/util/brand.d.ts.map +1 -1
  588. package/lib/util/brand.js +26 -1
  589. package/lib/util/brand.js.map +1 -1
  590. package/lib/util/brandedMap.d.ts +3 -1
  591. package/lib/util/brandedMap.d.ts.map +1 -1
  592. package/lib/util/brandedMap.js.map +1 -1
  593. package/lib/util/index.d.ts +1 -1
  594. package/lib/util/index.d.ts.map +1 -1
  595. package/lib/util/index.js +1 -1
  596. package/lib/util/index.js.map +1 -1
  597. package/lib/util/referenceCounting.d.ts.map +1 -1
  598. package/lib/util/referenceCounting.js +1 -0
  599. package/lib/util/referenceCounting.js.map +1 -1
  600. package/package.json +26 -26
  601. package/src/api.ts +2 -2
  602. package/src/codec/codec.ts +17 -3
  603. package/src/codec/discriminatedUnions.ts +1 -1
  604. package/src/core/index.ts +1 -2
  605. package/src/core/schema-stored/index.ts +1 -2
  606. package/src/core/schema-stored/schema.ts +10 -7
  607. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  608. package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
  609. package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
  610. package/src/core/tree/detachedFieldIndexCodecs.ts +33 -11
  611. package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
  612. package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
  613. package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
  614. package/src/core/tree/index.ts +2 -4
  615. package/src/external-utilities/typeboxValidator.ts +1 -1
  616. package/src/feature-libraries/chunked-forest/codec/codecs.ts +18 -13
  617. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
  618. package/src/feature-libraries/chunked-forest/codec/format.ts +15 -4
  619. package/src/feature-libraries/chunked-forest/codec/index.ts +4 -2
  620. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -2
  621. package/src/feature-libraries/chunked-forest/index.ts +0 -1
  622. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +2 -29
  623. package/src/feature-libraries/forest-summary/codec.ts +24 -9
  624. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
  625. package/src/feature-libraries/forest-summary/format.ts +12 -2
  626. package/src/feature-libraries/forest-summary/index.ts +2 -1
  627. package/src/feature-libraries/index.ts +1 -2
  628. package/src/feature-libraries/schema-edits/index.ts +0 -1
  629. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
  630. package/src/feature-libraries/schema-index/codec.ts +34 -22
  631. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  632. package/src/feature-libraries/schema-index/formatV2.ts +2 -2
  633. package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
  634. package/src/index.ts +6 -1
  635. package/src/packageVersion.ts +1 -1
  636. package/src/shared-tree/independentView.ts +161 -75
  637. package/src/shared-tree/index.ts +4 -0
  638. package/src/shared-tree/sharedTree.ts +137 -175
  639. package/src/shared-tree/sharedTreeChangeCodecs.ts +15 -9
  640. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
  641. package/src/shared-tree/treeAlpha.ts +6 -5
  642. package/src/shared-tree/treeCheckout.ts +1 -3
  643. package/src/shared-tree-core/editManagerCodecs.ts +56 -19
  644. package/src/shared-tree-core/editManagerFormatCommons.ts +47 -0
  645. package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
  646. package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
  647. package/src/shared-tree-core/index.ts +11 -5
  648. package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
  649. package/src/shared-tree-core/messageCodecV5.ts +2 -1
  650. package/src/shared-tree-core/messageCodecs.ts +60 -26
  651. package/src/shared-tree-core/messageFormat.ts +56 -0
  652. package/src/shared-tree-core/sharedTreeCore.ts +11 -13
  653. package/src/simple-tree/api/discrepancies.ts +2 -2
  654. package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
  655. package/src/simple-tree/api/index.ts +6 -2
  656. package/src/simple-tree/api/schemaFactory.ts +2 -2
  657. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
  658. package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
  659. package/src/simple-tree/api/schemaFactoryRecursive.ts +2 -0
  660. package/src/simple-tree/api/schemaFromSimple.ts +23 -17
  661. package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
  662. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +8 -2
  663. package/src/simple-tree/api/storedSchema.ts +8 -5
  664. package/src/simple-tree/api/tree.ts +2 -2
  665. package/src/simple-tree/api/typesUnsafe.ts +6 -6
  666. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +76 -7
  667. package/src/simple-tree/core/allowedTypes.ts +29 -16
  668. package/src/simple-tree/core/treeNode.ts +2 -2
  669. package/src/simple-tree/fieldSchema.ts +14 -1
  670. package/src/simple-tree/index.ts +6 -1
  671. package/src/simple-tree/node-kinds/array/arrayNode.ts +11 -2
  672. package/src/simple-tree/node-kinds/map/mapNode.ts +11 -2
  673. package/src/simple-tree/node-kinds/object/objectNode.ts +57 -21
  674. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -3
  675. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +16 -0
  676. package/src/simple-tree/simpleSchema.ts +32 -6
  677. package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
  678. package/src/simple-tree/toStoredSchema.ts +12 -3
  679. package/src/tableSchema.ts +5 -2
  680. package/src/treeFactory.ts +33 -1
  681. package/src/util/brand.ts +40 -2
  682. package/src/util/brandedMap.ts +3 -1
  683. package/src/util/index.ts +1 -0
  684. package/src/util/referenceCounting.ts +1 -0
@@ -2,17 +2,16 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type CodecTree, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
5
+ import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
6
+ import { type CodecTree, type CodecWriteOptions, type IJsonCodec } from "../../codec/index.js";
6
7
  import type { FieldKey, ITreeCursorSynchronous } from "../../core/index.js";
7
8
  import type { FieldBatchCodec, FieldBatchEncodingContext } from "../chunked-forest/index.js";
8
9
  import { Format } from "./format.js";
9
- import type { Brand } from "../../util/index.js";
10
10
  /**
11
11
  * Uses field cursors
12
12
  */
13
13
  export type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;
14
14
  export type ForestCodec = IJsonCodec<FieldSet, Format, Format, FieldBatchEncodingContext>;
15
- export declare function makeForestSummarizerCodec(options: ICodecOptions, fieldBatchCodec: FieldBatchCodec): ForestCodec;
16
- export type ForestFormatVersion = Brand<1, "ForestFormatVersion">;
17
- export declare function getCodecTreeForForestFormat(version: ForestFormatVersion): CodecTree;
15
+ export declare function makeForestSummarizerCodec(options: CodecWriteOptions, fieldBatchCodec: FieldBatchCodec): ForestCodec;
16
+ export declare function getCodecTreeForForestFormat(clientVersion: MinimumVersionForCollab): CodecTree;
18
17
  //# sourceMappingURL=codec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAE1F,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,aAAa,EACtB,eAAe,EAAE,eAAe,GAC9B,WAAW,CAyBb;AAED,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;AAClE,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAEnF"}
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,UAAU,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EAAE,MAAM,EAAuB,MAAM,aAAa,CAAC;AAG1D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAc1F,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EAAE,eAAe,GAC9B,WAAW,CA0Bb;AAED,wBAAgB,2BAA2B,CAC1C,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAEX"}
@@ -4,13 +4,24 @@
4
4
  */
5
5
  import { assert, oob } from "@fluidframework/core-utils/internal";
6
6
  import { makeVersionedValidatedCodec, } from "../../codec/index.js";
7
- import { Format } from "./format.js";
7
+ import { Format, ForestFormatVersion } from "./format.js";
8
+ import { brand } from "../../util/index.js";
9
+ /**
10
+ * Convert a MinimumVersionForCollab to a ForestFormatVersion.
11
+ * @param clientVersion - The MinimumVersionForCollab to convert.
12
+ * @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.
13
+ */
14
+ function clientVersionToForestSummaryVersion(clientVersion) {
15
+ // Currently, forest summary codec only writes in version 1.
16
+ return brand(ForestFormatVersion.v1);
17
+ }
8
18
  export function makeForestSummarizerCodec(options, fieldBatchCodec) {
9
19
  const inner = fieldBatchCodec;
10
20
  // TODO: AB#41865
11
21
  // This needs to be updated to support multiple versions.
12
22
  // The second version will be used to enable incremental summarization.
13
- return makeVersionedValidatedCodec(options, new Set([1]), Format, {
23
+ const writeVersion = clientVersionToForestSummaryVersion(options.minVersionForCollab);
24
+ return makeVersionedValidatedCodec(options, new Set([ForestFormatVersion.v1]), Format, {
14
25
  encode: (data, context) => {
15
26
  const keys = [];
16
27
  const fields = [];
@@ -18,7 +29,7 @@ export function makeForestSummarizerCodec(options, fieldBatchCodec) {
18
29
  keys.push(key);
19
30
  fields.push(value);
20
31
  }
21
- return { keys, fields: inner.encode(fields, context), version: 1 };
32
+ return { keys, fields: inner.encode(fields, context), version: writeVersion };
22
33
  },
23
34
  decode: (data, context) => {
24
35
  const out = new Map();
@@ -31,7 +42,7 @@ export function makeForestSummarizerCodec(options, fieldBatchCodec) {
31
42
  },
32
43
  });
33
44
  }
34
- export function getCodecTreeForForestFormat(version) {
35
- return { name: "Forest", version };
45
+ export function getCodecTreeForForestFormat(clientVersion) {
46
+ return { name: "Forest", version: clientVersionToForestSummaryVersion(clientVersion) };
36
47
  }
37
48
  //# sourceMappingURL=codec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAIN,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,MAAM,UAAU,yBAAyB,CACxC,OAAsB,EACtB,eAAgC;IAEhC,MAAM,KAAK,GAAG,eAAe,CAAC;IAC9B,iBAAiB;IACjB,yDAAyD;IACzD,uEAAuE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AC;AACpC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport type { FieldKey, ITreeCursorSynchronous } from \"../../core/index.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport { Format } from \"./format.js\";\nimport type { Brand } from \"../../util/index.js\";\n\n/**\n * Uses field cursors\n */\nexport type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;\nexport type ForestCodec = IJsonCodec<FieldSet, Format, Format, FieldBatchEncodingContext>;\n\nexport function makeForestSummarizerCodec(\n\toptions: ICodecOptions,\n\tfieldBatchCodec: FieldBatchCodec,\n): ForestCodec {\n\tconst inner = fieldBatchCodec;\n\t// TODO: AB#41865\n\t// This needs to be updated to support multiple versions.\n\t// The second version will be used to enable incremental summarization.\n\treturn makeVersionedValidatedCodec(options, new Set([1]), Format, {\n\t\tencode: (data: FieldSet, context: FieldBatchEncodingContext): Format => {\n\t\t\tconst keys: FieldKey[] = [];\n\t\t\tconst fields: ITreeCursorSynchronous[] = [];\n\t\t\tfor (const [key, value] of data) {\n\t\t\t\tkeys.push(key);\n\t\t\t\tfields.push(value);\n\t\t\t}\n\t\t\treturn { keys, fields: inner.encode(fields, context), version: 1 };\n\t\t},\n\t\tdecode: (data: Format, context: FieldBatchEncodingContext): FieldSet => {\n\t\t\tconst out: Map<FieldKey, ITreeCursorSynchronous> = new Map();\n\t\t\tconst fields = inner.decode(data.fields, context);\n\t\t\tassert(data.keys.length === fields.length, 0x891 /* mismatched lengths */);\n\t\t\tfor (const [index, field] of fields.entries()) {\n\t\t\t\tout.set(data.keys[index] ?? oob(), field);\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t});\n}\n\nexport type ForestFormatVersion = Brand<1, \"ForestFormatVersion\">;\nexport function getCodecTreeForForestFormat(version: ForestFormatVersion): CodecTree {\n\treturn { name: \"Forest\", version };\n}\n"]}
1
+ {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAGlE,OAAO,EAIN,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAQ5C;;;;GAIG;AACH,SAAS,mCAAmC,CAC3C,aAAsC;IAEtC,4DAA4D;IAC5D,OAAO,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,OAA0B,EAC1B,eAAgC;IAEhC,MAAM,KAAK,GAAG,eAAe,CAAC;IAC9B,iBAAiB;IACjB,yDAAyD;IACzD,uEAAuE;IACvE,MAAM,YAAY,GAAG,mCAAmC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACtF,OAAO,2BAA2B,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE;QACtF,MAAM,EAAE,CAAC,IAAc,EAAE,OAAkC,EAAU,EAAE;YACtE,MAAM,IAAI,GAAe,EAAE,CAAC;YAC5B,MAAM,MAAM,GAA6B,EAAE,CAAC;YAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;QAC/E,CAAC;QACD,MAAM,EAAE,CAAC,IAAY,EAAE,OAAkC,EAAY,EAAE;YACtE,MAAM,GAAG,GAA0C,IAAI,GAAG,EAAE,CAAC;YAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC3E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC/C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,GAAG,CAAC;QACZ,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,aAAsC;IAEtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mCAAmC,CAAC,aAAa,CAAC,EAAE,CAAC;AACxF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport type { FieldKey, ITreeCursorSynchronous } from \"../../core/index.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport { Format, ForestFormatVersion } from \"./format.js\";\nimport { brand } from \"../../util/index.js\";\n\n/**\n * Uses field cursors\n */\nexport type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;\nexport type ForestCodec = IJsonCodec<FieldSet, Format, Format, FieldBatchEncodingContext>;\n\n/**\n * Convert a MinimumVersionForCollab to a ForestFormatVersion.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n * @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.\n */\nfunction clientVersionToForestSummaryVersion(\n\tclientVersion: MinimumVersionForCollab,\n): ForestFormatVersion {\n\t// Currently, forest summary codec only writes in version 1.\n\treturn brand(ForestFormatVersion.v1);\n}\n\nexport function makeForestSummarizerCodec(\n\toptions: CodecWriteOptions,\n\tfieldBatchCodec: FieldBatchCodec,\n): ForestCodec {\n\tconst inner = fieldBatchCodec;\n\t// TODO: AB#41865\n\t// This needs to be updated to support multiple versions.\n\t// The second version will be used to enable incremental summarization.\n\tconst writeVersion = clientVersionToForestSummaryVersion(options.minVersionForCollab);\n\treturn makeVersionedValidatedCodec(options, new Set([ForestFormatVersion.v1]), Format, {\n\t\tencode: (data: FieldSet, context: FieldBatchEncodingContext): Format => {\n\t\t\tconst keys: FieldKey[] = [];\n\t\t\tconst fields: ITreeCursorSynchronous[] = [];\n\t\t\tfor (const [key, value] of data) {\n\t\t\t\tkeys.push(key);\n\t\t\t\tfields.push(value);\n\t\t\t}\n\t\t\treturn { keys, fields: inner.encode(fields, context), version: writeVersion };\n\t\t},\n\t\tdecode: (data: Format, context: FieldBatchEncodingContext): FieldSet => {\n\t\t\tconst out: Map<FieldKey, ITreeCursorSynchronous> = new Map();\n\t\t\tconst fields = inner.decode(data.fields, context);\n\t\t\tassert(data.keys.length === fields.length, 0x891 /* mismatched lengths */);\n\t\t\tfor (const [index, field] of fields.entries()) {\n\t\t\t\tout.set(data.keys[index] ?? oob(), field);\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t});\n}\n\nexport function getCodecTreeForForestFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn { name: \"Forest\", version: clientVersionToForestSummaryVersion(clientVersion) };\n}\n"]}
@@ -6,7 +6,7 @@ import { bufferToString } from "@fluid-internal/client-utils";
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import { applyDelta, forEachField, makeDetachedFieldIndex, } from "../../core/index.js";
8
8
  import { idAllocatorFromMaxId } from "../../util/index.js";
9
- // eslint-disable-next-line import/no-internal-modules
9
+ // eslint-disable-next-line import-x/no-internal-modules
10
10
  import { chunkFieldSingle, defaultChunkPolicy } from "../chunked-forest/chunkTree.js";
11
11
  import { defaultIncrementalEncodingPolicy, } from "../chunked-forest/index.js";
12
12
  import { makeForestSummarizerCodec } from "./codec.js";
@@ -1 +1 @@
1
- {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAU7D,OAAO,EASN,UAAU,EACV,YAAY,EACZ,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;AAChF,sDAAsD;AACtD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,EACN,gCAAgC,GAIhC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAoB,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EACN,gCAAgC,EAChC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAG7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAEzC;;GAEG;AACH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MAAM,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,EAAE,EACxC,SAAS,EACT,IAAI,CAAC,MAAM,EACX,sBAAsB,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport type { CodecWriteOptions } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype RevisionTagCodec,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n} from \"../../core/index.js\";\nimport type {\n\tSummarizable,\n\tSummaryElementParser,\n\tSummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport { idAllocatorFromMaxId, type JsonCompatible } from \"../../util/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport {\n\tdefaultIncrementalEncodingPolicy,\n\ttype FieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncodingPolicy,\n} from \"../chunked-forest/index.js\";\n\nimport { type ForestCodec, makeForestSummarizerCodec } from \"./codec.js\";\nimport {\n\tForestIncrementalSummaryBehavior,\n\tForestIncrementalSummaryBuilder,\n\tforestSummaryContentKey,\n} from \"./incrementalSummaryBuilder.js\";\nimport { TreeCompressionStrategyExtended } from \"../treeCompressionUtils.js\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\n/**\n * The key for the tree that contains the overall forest's summary tree.\n * This tree is added by the parent of the forest summarizer.\n * See {@link ForestIncrementalSummaryBuilder} for details on the summary structure.\n */\nexport const forestSummaryKey = \"Forest\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer implements Summarizable {\n\tpublic readonly key = forestSummaryKey;\n\n\tprivate readonly codec: ForestCodec;\n\n\tprivate readonly incrementalSummaryBuilder: ForestIncrementalSummaryBuilder;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\toptions: CodecWriteOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tinitialSequenceNumber: number,\n\t\tshouldEncodeIncrementally: IncrementalEncodingPolicy = defaultIncrementalEncodingPolicy,\n\t) {\n\t\t// TODO: this should take in CodecWriteOptions, and use it to pick the write version.\n\t\tthis.codec = makeForestSummarizerCodec(options, fieldBatchCodec);\n\t\tthis.incrementalSummaryBuilder = new ForestIncrementalSummaryBuilder(\n\t\t\tencoderContext.encodeType ===\n\t\t\t\tTreeCompressionStrategyExtended.CompressedIncremental /* enableIncrementalSummary */,\n\t\t\t(cursor: ITreeCursorSynchronous) => this.forest.chunkField(cursor),\n\t\t\tshouldEncodeIncrementally,\n\t\t\tinitialSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Summarization of the forest's tree content.\n\t * @returns a summary tree containing the forest's tree content.\n\t * @remarks\n\t * If incremental summary is disabled, all the content will be added to a single summary blob.\n\t * If incremental summary is enabled, the summary will be a tree.\n\t * See {@link ForestIncrementalSummaryBuilder} for details of what this tree looks like.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t */\n\tpublic summarize(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t}): ISummaryTreeWithStats {\n\t\tconst { stringify, fullTree = false, incrementalSummaryContext } = props;\n\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\n\t\t// Let the incremental summary builder know that we are starting a new summary.\n\t\t// It returns whether incremental encoding is enabled.\n\t\tconst incrementalSummaryBehavior = this.incrementalSummaryBuilder.startSummary({\n\t\t\tfullTree,\n\t\t\tincrementalSummaryContext,\n\t\t\tstringify,\n\t\t});\n\t\tconst encoderContext: FieldBatchEncodingContext = {\n\t\t\t...this.encoderContext,\n\t\t\tincrementalEncoderDecoder:\n\t\t\t\tincrementalSummaryBehavior === ForestIncrementalSummaryBehavior.Incremental\n\t\t\t\t\t? this.incrementalSummaryBuilder\n\t\t\t\t\t: undefined,\n\t\t};\n\t\tconst encoded = this.codec.encode(fieldMap, encoderContext);\n\t\tfieldMap.forEach((value) => value.free());\n\n\t\treturn this.incrementalSummaryBuilder.completeSummary({\n\t\t\tincrementalSummaryContext,\n\t\t\tforestSummaryContent: stringify(encoded),\n\t\t});\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\t// The contents of the top-level forest must be present under a summary blob named `forestSummaryContentKey`.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.SingleBlob`, this blob will contain all\n\t\t// of forest's contents.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.Incremental`, this blob will contain only\n\t\t// the top-level forest node's contents.\n\t\t// The contents of the incremental chunks will be in separate tree nodes and will be read later during decoding.\n\t\tassert(\n\t\t\tawait services.contains(forestSummaryContentKey),\n\t\t\t0xc21 /* Forest summary content missing in snapshot */,\n\t\t);\n\n\t\tconst readAndParseBlob = async <T extends JsonCompatible<IFluidHandle>>(\n\t\t\tid: string,\n\t\t): Promise<T> => {\n\t\t\tconst treeBuffer = await services.readBlob(id);\n\t\t\tconst treeBufferString = bufferToString(treeBuffer, \"utf8\");\n\t\t\treturn parse(treeBufferString) as T;\n\t\t};\n\n\t\t// Load the incremental summary builder so that it can download any incremental chunks in the\n\t\t// snapshot.\n\t\tawait this.incrementalSummaryBuilder.load(services, readAndParseBlob);\n\n\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t// forest summary format.\n\t\tconst fields = this.codec.decode(await readAndParseBlob(forestSummaryContentKey), {\n\t\t\t...this.encoderContext,\n\t\t\tincrementalEncoderDecoder: this.incrementalSummaryBuilder,\n\t\t});\n\t\tconst allocator = idAllocatorFromMaxId();\n\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\tfor (const [fieldKey, field] of fields) {\n\t\t\tconst chunked = chunkFieldSingle(field, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t\tconst buildId = { minor: allocator.allocate(chunked.topLevelLength) };\n\t\t\tbuild.push({\n\t\t\t\tid: buildId,\n\t\t\t\ttrees: chunked,\n\t\t\t});\n\t\t\tfieldChanges.push([fieldKey, [{ count: chunked.topLevelLength, attach: buildId }]]);\n\t\t}\n\n\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\tapplyDelta(\n\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\tundefined,\n\t\t\tthis.forest,\n\t\t\tmakeDetachedFieldIndex(\"init\", this.revisionTagCodec, this.idCompressor),\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAU7D,OAAO,EASN,UAAU,EACV,YAAY,EACZ,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;AAChF,wDAAwD;AACxD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,EACN,gCAAgC,GAIhC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAoB,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EACN,gCAAgC,EAChC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAG7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAEzC;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAO5B;;OAEG;IACH,YACkB,MAAuB,EACvB,gBAAkC,EACnD,eAAgC,EACf,cAAyC,EAC1D,OAA0B,EACT,YAA2B,EAC5C,q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AAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\n\nimport type { CodecWriteOptions } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype RevisionTagCodec,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n} from \"../../core/index.js\";\nimport type {\n\tSummarizable,\n\tSummaryElementParser,\n\tSummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport { idAllocatorFromMaxId, type JsonCompatible } from \"../../util/index.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport { chunkFieldSingle, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport {\n\tdefaultIncrementalEncodingPolicy,\n\ttype FieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncodingPolicy,\n} from \"../chunked-forest/index.js\";\n\nimport { type ForestCodec, makeForestSummarizerCodec } from \"./codec.js\";\nimport {\n\tForestIncrementalSummaryBehavior,\n\tForestIncrementalSummaryBuilder,\n\tforestSummaryContentKey,\n} from \"./incrementalSummaryBuilder.js\";\nimport { TreeCompressionStrategyExtended } from \"../treeCompressionUtils.js\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\n/**\n * The key for the tree that contains the overall forest's summary tree.\n * This tree is added by the parent of the forest summarizer.\n * See {@link ForestIncrementalSummaryBuilder} for details on the summary structure.\n */\nexport const forestSummaryKey = \"Forest\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer implements Summarizable {\n\tpublic readonly key = forestSummaryKey;\n\n\tprivate readonly codec: ForestCodec;\n\n\tprivate readonly incrementalSummaryBuilder: ForestIncrementalSummaryBuilder;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\toptions: CodecWriteOptions,\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t\tinitialSequenceNumber: number,\n\t\tshouldEncodeIncrementally: IncrementalEncodingPolicy = defaultIncrementalEncodingPolicy,\n\t) {\n\t\t// TODO: this should take in CodecWriteOptions, and use it to pick the write version.\n\t\tthis.codec = makeForestSummarizerCodec(options, fieldBatchCodec);\n\t\tthis.incrementalSummaryBuilder = new ForestIncrementalSummaryBuilder(\n\t\t\tencoderContext.encodeType ===\n\t\t\t\tTreeCompressionStrategyExtended.CompressedIncremental /* enableIncrementalSummary */,\n\t\t\t(cursor: ITreeCursorSynchronous) => this.forest.chunkField(cursor),\n\t\t\tshouldEncodeIncrementally,\n\t\t\tinitialSequenceNumber,\n\t\t);\n\t}\n\n\t/**\n\t * Summarization of the forest's tree content.\n\t * @returns a summary tree containing the forest's tree content.\n\t * @remarks\n\t * If incremental summary is disabled, all the content will be added to a single summary blob.\n\t * If incremental summary is enabled, the summary will be a tree.\n\t * See {@link ForestIncrementalSummaryBuilder} for details of what this tree looks like.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t */\n\tpublic summarize(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t}): ISummaryTreeWithStats {\n\t\tconst { stringify, fullTree = false, incrementalSummaryContext } = props;\n\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\n\t\t// Let the incremental summary builder know that we are starting a new summary.\n\t\t// It returns whether incremental encoding is enabled.\n\t\tconst incrementalSummaryBehavior = this.incrementalSummaryBuilder.startSummary({\n\t\t\tfullTree,\n\t\t\tincrementalSummaryContext,\n\t\t\tstringify,\n\t\t});\n\t\tconst encoderContext: FieldBatchEncodingContext = {\n\t\t\t...this.encoderContext,\n\t\t\tincrementalEncoderDecoder:\n\t\t\t\tincrementalSummaryBehavior === ForestIncrementalSummaryBehavior.Incremental\n\t\t\t\t\t? this.incrementalSummaryBuilder\n\t\t\t\t\t: undefined,\n\t\t};\n\t\tconst encoded = this.codec.encode(fieldMap, encoderContext);\n\t\tfieldMap.forEach((value) => value.free());\n\n\t\treturn this.incrementalSummaryBuilder.completeSummary({\n\t\t\tincrementalSummaryContext,\n\t\t\tforestSummaryContent: stringify(encoded),\n\t\t});\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\t// The contents of the top-level forest must be present under a summary blob named `forestSummaryContentKey`.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.SingleBlob`, this blob will contain all\n\t\t// of forest's contents.\n\t\t// If the summary was generated as `ForestIncrementalSummaryBehavior.Incremental`, this blob will contain only\n\t\t// the top-level forest node's contents.\n\t\t// The contents of the incremental chunks will be in separate tree nodes and will be read later during decoding.\n\t\tassert(\n\t\t\tawait services.contains(forestSummaryContentKey),\n\t\t\t0xc21 /* Forest summary content missing in snapshot */,\n\t\t);\n\n\t\tconst readAndParseBlob = async <T extends JsonCompatible<IFluidHandle>>(\n\t\t\tid: string,\n\t\t): Promise<T> => {\n\t\t\tconst treeBuffer = await services.readBlob(id);\n\t\t\tconst treeBufferString = bufferToString(treeBuffer, \"utf8\");\n\t\t\treturn parse(treeBufferString) as T;\n\t\t};\n\n\t\t// Load the incremental summary builder so that it can download any incremental chunks in the\n\t\t// snapshot.\n\t\tawait this.incrementalSummaryBuilder.load(services, readAndParseBlob);\n\n\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t// forest summary format.\n\t\tconst fields = this.codec.decode(await readAndParseBlob(forestSummaryContentKey), {\n\t\t\t...this.encoderContext,\n\t\t\tincrementalEncoderDecoder: this.incrementalSummaryBuilder,\n\t\t});\n\t\tconst allocator = idAllocatorFromMaxId();\n\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\tfor (const [fieldKey, field] of fields) {\n\t\t\tconst chunked = chunkFieldSingle(field, {\n\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t});\n\t\t\tconst buildId = { minor: allocator.allocate(chunked.topLevelLength) };\n\t\t\tbuild.push({\n\t\t\t\tid: buildId,\n\t\t\t\ttrees: chunked,\n\t\t\t});\n\t\t\tfieldChanges.push([fieldKey, [{ count: chunked.topLevelLength, attach: buildId }]]);\n\t\t}\n\n\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\tapplyDelta(\n\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\tundefined,\n\t\t\tthis.forest,\n\t\t\tmakeDetachedFieldIndex(\"init\", this.revisionTagCodec, this.idCompressor),\n\t\t);\n\t}\n}\n"]}
@@ -4,7 +4,14 @@
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
6
  import { schemaFormatV1 } from "../../core/index.js";
7
- export declare const version = 1;
7
+ import type { Brand } from "../../util/index.js";
8
+ /**
9
+ * The format version for the forest.
10
+ */
11
+ export declare const ForestFormatVersion: {
12
+ readonly v1: 1;
13
+ };
14
+ export type ForestFormatVersion = Brand<(typeof ForestFormatVersion)[keyof typeof ForestFormatVersion], "ForestFormatVersion">;
8
15
  export declare const Format: import("@sinclair/typebox").TObject<{
9
16
  version: import("@sinclair/typebox").TLiteral<1>;
10
17
  keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKey>>;
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,eAAO,MAAM,OAAO,IAAM,CAAC;AAE3B,eAAO,MAAM,MAAM;;;;;;EAOlB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,mBAAmB;;CAEtB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,KAAK,CACtC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,EAC9D,qBAAqB,CACrB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;EAOlB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -5,9 +5,14 @@
5
5
  import { Type } from "@sinclair/typebox";
6
6
  import { Versioned } from "../../codec/index.js";
7
7
  import { schemaFormatV1 } from "../../core/index.js";
8
- export const version = 1.0;
8
+ /**
9
+ * The format version for the forest.
10
+ */
11
+ export const ForestFormatVersion = {
12
+ v1: 1,
13
+ };
9
14
  export const Format = Type.Object({
10
- version: Type.Literal(version),
15
+ version: Type.Literal(ForestFormatVersion.v1),
11
16
  keys: Type.Array(schemaFormatV1.FieldKeySchema),
12
17
  fields: Versioned,
13
18
  }, { additionalProperties: false });
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC;AAE3B,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/C,MAAM,EAAE,SAAS;CACjB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { Versioned } from \"../../codec/index.js\";\nimport { schemaFormatV1 } from \"../../core/index.js\";\n\nexport const version = 1.0;\n\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(version),\n\t\tkeys: Type.Array(schemaFormatV1.FieldKeySchema),\n\t\tfields: Versioned,\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type Format = Static<typeof Format>;\n"]}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,EAAE,EAAE,CAAC;CACI,CAAC;AAMX,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/C,MAAM,EAAE,SAAS;CACjB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { Versioned } from \"../../codec/index.js\";\nimport { schemaFormatV1 } from \"../../core/index.js\";\nimport type { Brand } from \"../../util/index.js\";\n\n/**\n * The format version for the forest.\n */\nexport const ForestFormatVersion = {\n\tv1: 1,\n} as const;\nexport type ForestFormatVersion = Brand<\n\t(typeof ForestFormatVersion)[keyof typeof ForestFormatVersion],\n\t\"ForestFormatVersion\"\n>;\n\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(ForestFormatVersion.v1),\n\t\tkeys: Type.Array(schemaFormatV1.FieldKeySchema),\n\t\tfields: Versioned,\n\t},\n\t{ additionalProperties: false },\n);\n\nexport type Format = Static<typeof Format>;\n"]}
@@ -3,5 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { forestSummaryKey, ForestSummarizer } from "./forestSummarizer.js";
6
- export { getCodecTreeForForestFormat, type ForestFormatVersion } from "./codec.js";
6
+ export { getCodecTreeForForestFormat } from "./codec.js";
7
+ export { ForestFormatVersion } from "./format.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
@@ -4,4 +4,5 @@
4
4
  */
5
5
  export { forestSummaryKey, ForestSummarizer } from "./forestSummarizer.js";
6
6
  export { getCodecTreeForForestFormat } from "./codec.js";
7
+ export { ForestFormatVersion } from "./format.js";
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAA4B,MAAM,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { forestSummaryKey, ForestSummarizer } from \"./forestSummarizer.js\";\nexport { getCodecTreeForForestFormat, type ForestFormatVersion } from \"./codec.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { forestSummaryKey, ForestSummarizer } from \"./forestSummarizer.js\";\nexport { getCodecTreeForForestFormat } from \"./codec.js\";\nexport { ForestFormatVersion } from \"./format.js\";\n"]}
@@ -7,21 +7,21 @@ export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.j
7
7
  export { ForestSummarizer, getCodecTreeForForestFormat, type ForestFormatVersion, } from "./forest-summary/index.js";
8
8
  export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, type MinimalMapTreeNodeView, mapTreeFieldsWithField, mapTreeWithField, type MapTreeFieldViewGeneric, type MapTreeNodeViewGeneric, type MinimalFieldMap, } from "./mapTreeCursor.js";
9
9
  export { buildForest } from "./object-forest/index.js";
10
- export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, getCodecTreeForSchemaFormat, } from "./schema-index/index.js";
10
+ export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, getCodecTreeForSchemaFormat, clientVersionToSchemaVersion, } from "./schema-index/index.js";
11
11
  export { stackTreeNodeCursor, type CursorAdapter, prefixPath, prefixFieldPath, type CursorWithNode, stackTreeFieldCursor, } from "./treeCursorUtils.js";
12
12
  export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
13
  import * as SequenceField from "./sequence-field/index.js";
14
14
  export { SequenceField };
15
15
  export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, FieldKindWithEditor, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangeset, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, isNeverTree, } from "./modular-schema/index.js";
16
16
  export { mapRootChanges } from "./deltaUtils.js";
17
- export { type TreeChunk, chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, type FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, fluidVersionToFieldBatchCodecWriteVersion, type FieldBatchEncodingContext, emptyChunk, combineChunks, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
17
+ export { type TreeChunk, chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, type FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, emptyChunk, combineChunks, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
18
18
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, type LocalNodeIdentifier, MockNodeIdentifierManager, type NodeIdentifierManager, nodeKeyTreeIdentifier, type StableNodeIdentifier, } from "./node-identifier/index.js";
19
19
  export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, } from "./default-schema/index.js";
20
20
  export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, type FlexibleNodeContent, type FlexibleFieldContent, type FlexTreeHydratedContextMinimal, type HydratedFlexTreeNode, getOrCreateHydratedFlexTreeNode, currentObserver, withObservation, type Observer, } from "./flex-tree/index.js";
21
21
  export { TreeCompressionStrategy, TreeCompressionStrategyExtended, type TreeCompressionStrategyPrivate, } from "./treeCompressionUtils.js";
22
22
  export { valueSchemaAllows } from "./valueUtilities.js";
23
23
  export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js";
24
- export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, getCodecTreeForSchemaChangeFormat, type SchemaChangeFormatVersion, } from "./schema-edits/index.js";
24
+ export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, getCodecTreeForSchemaChangeFormat, } from "./schema-edits/index.js";
25
25
  export { makeMitigatedChangeFamily } from "./mitigatedChangeFamily.js";
26
26
  export { type KeyFinder, AnchorTreeIndex, hasElement, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./indexing/index.js";
27
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,KAAK,mBAAmB,GACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,UAAU,EACV,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,yBAA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AiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,EACjC,KAAK,yBAAyB,GAC9B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,KAAK,mBAAmB,GACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EACnB,KAAK,aAAa,EAClB,UAAU,EACV,eAAe,EACf,KAAK,cAAc,EACnB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,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EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
@@ -7,7 +7,7 @@ export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.j
7
7
  export { ForestSummarizer, getCodecTreeForForestFormat, } from "./forest-summary/index.js";
8
8
  export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, mapTreeFieldsWithField, mapTreeWithField, } from "./mapTreeCursor.js";
9
9
  export { buildForest } from "./object-forest/index.js";
10
- export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, getCodecTreeForSchemaFormat, } from "./schema-index/index.js";
10
+ export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, getCodecTreeForSchemaFormat, clientVersionToSchemaVersion, } from "./schema-index/index.js";
11
11
  export { stackTreeNodeCursor, prefixPath, prefixFieldPath, stackTreeFieldCursor, } from "./treeCursorUtils.js";
12
12
  export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFromCursor, jsonableTreeFromFieldCursor, jsonableTreeFromForest, } from "./treeTextCursor.js";
13
13
  // Split this up into separate import and export for compatibility with API-Extractor.
@@ -15,7 +15,7 @@ import * as SequenceField from "./sequence-field/index.js";
15
15
  export { SequenceField };
16
16
  export { isNeverField, ModularEditBuilder, makeModularChangeCodecFamily, CrossFieldTarget, FlexFieldKind, allowsRepoSuperset, genericFieldKind, FieldKindWithEditor, ModularChangeFamily, EncodedModularChangeset, updateRefreshers, isNeverTree, } from "./modular-schema/index.js";
17
17
  export { mapRootChanges } from "./deltaUtils.js";
18
- export { chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, fluidVersionToFieldBatchCodecWriteVersion, emptyChunk, combineChunks, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
18
+ export { chunkTree, chunkField, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, getCodecTreeForFieldBatchFormat, makeTreeChunker, makeFieldBatchCodec, emptyChunk, combineChunks, defaultIncrementalEncodingPolicy, } from "./chunked-forest/index.js";
19
19
  export { compareLocalNodeIdentifiers, createNodeIdentifierManager, isStableNodeIdentifier, MockNodeIdentifierManager, nodeKeyTreeIdentifier, } from "./node-identifier/index.js";
20
20
  export { FieldKinds, DefaultChangeFamily, DefaultEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, getCodecTreeForModularChangeFormat, } from "./default-schema/index.js";
21
21
  export { TreeStatus, Context, isFlexTreeNode, ContextSlot,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,GAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EAEtB,sBAAsB,EACtB,gBAAgB,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,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ACd,WAAW;AACX,WAAW;AACX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAKlB,+BAA+B,EAC/B,eAAe,EACf,eAAe,GAEf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,uBAAuB,EACvB,+BAA+B,GAE/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GAEjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAEN,eAAe,EACf,UAAU,GAIV,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\ttype ForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tgetCodecTreeForSchemaFormat,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\ttype FieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\tfluidVersionToFieldBatchCodecWriteVersion,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport {\n\tTreeCompressionStrategy,\n\tTreeCompressionStrategyExtended,\n\ttype TreeCompressionStrategyPrivate,\n} from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n\ttype SchemaChangeFormatVersion,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,GAE3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EAEtB,sBAAsB,EACtB,gBAAgB,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe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BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAKlB,+BAA+B,EAC/B,eAAe,EACf,eAAe,GAEf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,uBAAuB,EACvB,+BAA+B,GAE/B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAEN,eAAe,EACf,UAAU,GAIV,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\ttype ForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tgetCodecTreeForSchemaFormat,\n\tclientVersionToSchemaVersion,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\ttype FieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport {\n\tTreeCompressionStrategy,\n\tTreeCompressionStrategyExtended,\n\ttype TreeCompressionStrategyPrivate,\n} from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { makeSchemaChangeCodecs, getCodecTreeForSchemaChangeFormat, type SchemaChangeFormatVersion, } from "./schemaChangeCodecs.js";
5
+ export { makeSchemaChangeCodecs, getCodecTreeForSchemaChangeFormat, } from "./schemaChangeCodecs.js";
6
6
  export type { SchemaChange } from "./schemaChangeTypes.js";
7
7
  export { EncodedSchemaChange } from "./schemaChangeFormat.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,iCAAiC,EACjC,KAAK,yBAAyB,GAC9B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,iCAAiC,GAEjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tmakeSchemaChangeCodecs,\n\tgetCodecTreeForSchemaChangeFormat,\n\ttype SchemaChangeFormatVersion,\n} from \"./schemaChangeCodecs.js\";\nexport type { SchemaChange } from \"./schemaChangeTypes.js\";\nexport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tmakeSchemaChangeCodecs,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schemaChangeCodecs.js\";\nexport type { SchemaChange } from \"./schemaChangeTypes.js\";\nexport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\n"]}
@@ -2,23 +2,22 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type CodecTree, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
5
+ import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
6
+ import { type CodecTree, type CodecWriteOptions, type ICodecFamily, type IJsonCodec } from "../../codec/index.js";
6
7
  import type { SchemaChange } from "./schemaChangeTypes.js";
7
- import { SchemaVersion } from "../../core/index.js";
8
- import type { Brand } from "../../util/index.js";
8
+ import { SchemaFormatVersion } from "../../core/index.js";
9
9
  /**
10
10
  * Create a family of schema change codecs.
11
11
  * @param options - Specifies common codec options, including which `validator` to use.
12
12
  * @returns The composed codec family.
13
13
  */
14
- export declare function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange>;
15
- export type SchemaChangeFormatVersion = Brand<SchemaVersion.v1 | SchemaVersion.v2, "SchemaChangeFormatVersion">;
16
- export declare function getCodecTreeForSchemaChangeFormat(version: SchemaChangeFormatVersion): CodecTree;
14
+ export declare function makeSchemaChangeCodecs(options: CodecWriteOptions): ICodecFamily<SchemaChange>;
15
+ export declare function getCodecTreeForSchemaChangeFormat(version: SchemaFormatVersion, clientVersion: MinimumVersionForCollab): CodecTree;
17
16
  /**
18
17
  * Create a schema change codec.
19
18
  * @param options - Specifies common codec options, including which `validator` to use.
20
19
  * @param writeVersion - The schema change write version.
21
20
  * @returns The composed codec.
22
21
  */
23
- export declare function makeSchemaChangeCodec(options: ICodecOptions, writeVersion: SchemaVersion): IJsonCodec<SchemaChange>;
22
+ export declare function makeSchemaChangeCodec(options: CodecWriteOptions, writeVersion: SchemaFormatVersion): IJsonCodec<SchemaChange>;
24
23
  //# sourceMappingURL=schemaChangeCodecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAKzF;AAED,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC5C,aAAa,CAAC,EAAE,GAAG,aAAa,CAAC,EAAE,EACnC,2BAA2B,CAC3B,CAAC;AACF,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,yBAAyB,GAChC,SAAS,CAMX;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,aAAa,GACzB,UAAU,CAAC,YAAY,CAAC,CAG1B"}
1
+ {"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,iBAAiB,GACxB,YAAY,CAAC,YAAY,CAAC,CAK5B;AAED,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAMX;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,mBAAmB,GAC/B,UAAU,CAAC,YAAY,CAAC,CAG1B"}
@@ -6,7 +6,8 @@ import { assert } from "@fluidframework/core-utils/internal";
6
6
  import { makeCodecFamily, makeVersionDispatchingCodec, withSchemaValidation, } from "../../codec/index.js";
7
7
  import { getCodecTreeForSchemaFormat, makeSchemaCodec } from "../schema-index/index.js";
8
8
  import { EncodedSchemaChange } from "./schemaChangeFormat.js";
9
- import { SchemaVersion } from "../../core/index.js";
9
+ import { SchemaFormatVersion } from "../../core/index.js";
10
+ import { brand } from "../../util/index.js";
10
11
  /**
11
12
  * Create a family of schema change codecs.
12
13
  * @param options - Specifies common codec options, including which `validator` to use.
@@ -14,15 +15,15 @@ import { SchemaVersion } from "../../core/index.js";
14
15
  */
15
16
  export function makeSchemaChangeCodecs(options) {
16
17
  return makeCodecFamily([
17
- [SchemaVersion.v1, makeSchemaChangeCodecV1(options, SchemaVersion.v1)],
18
- [SchemaVersion.v2, makeSchemaChangeCodecV1(options, SchemaVersion.v2)],
18
+ [SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, brand(SchemaFormatVersion.v1))],
19
+ [SchemaFormatVersion.v2, makeSchemaChangeCodecV1(options, brand(SchemaFormatVersion.v2))],
19
20
  ]);
20
21
  }
21
- export function getCodecTreeForSchemaChangeFormat(version) {
22
+ export function getCodecTreeForSchemaChangeFormat(version, clientVersion) {
22
23
  return {
23
24
  name: "SchemaChange",
24
25
  version,
25
- children: [getCodecTreeForSchemaFormat(version)],
26
+ children: [getCodecTreeForSchemaFormat(clientVersion)],
26
27
  };
27
28
  }
28
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":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AM,iBAAiB,GAAkD;QACxE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,MAAM,CACL,CAAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;gBAChD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;aAChD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,mBAAmB;KAClC,CAAC;IAEF,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { getCodecTreeForSchemaFormat, makeSchemaCodec } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\nimport { SchemaVersion } from \"../../core/index.js\";\nimport type { Brand } from \"../../util/index.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([\n\t\t[SchemaVersion.v1, makeSchemaChangeCodecV1(options, SchemaVersion.v1)],\n\t\t[SchemaVersion.v2, makeSchemaChangeCodecV1(options, SchemaVersion.v2)],\n\t]);\n}\n\nexport type SchemaChangeFormatVersion = Brand<\n\tSchemaVersion.v1 | SchemaVersion.v2,\n\t\"SchemaChangeFormatVersion\"\n>;\nexport function getCodecTreeForSchemaChangeFormat(\n\tversion: SchemaChangeFormatVersion,\n): CodecTree {\n\treturn {\n\t\tname: \"SchemaChange\",\n\t\tversion,\n\t\tchildren: [getCodecTreeForSchemaFormat(version)],\n\t};\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: ICodecOptions,\n\twriteVersion: SchemaVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the change codec using mostly v1 logic.\n * @param options - The codec options.\n * @param schemaWriteVersion - The schema write version.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: ICodecOptions,\n\tschemaWriteVersion: SchemaVersion,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, schemaWriteVersion);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
1
+ {"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAKN,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAA0B;IAE1B,OAAO,eAAe,CAAC;QACtB,CAAC,mBAAmB,CAAC,EAAE,EAAE,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC;QACzF,CAAC,mBAAmB,CAAC,EAAE,EAAE,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,CAAC;KACzF,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAChD,OAA4B,EAC5B,aAAsC;IAEtC,OAAO;QACN,IAAI,EAAE,cAAc;QACpB,OAAO;QACP,QAAQ,EAAE,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC;KACtD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACpC,OAA0B,EAC1B,YAAiC;IAEjC,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,2BAA2B,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,SAAS,uBAAuB,CAC/B,OAA0B,EAC1B,kBAAuC;IAEvC,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;IACjE,MAAM,iBAAiB,GAAkD;QACxE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,MAAM,CACL,CAAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;gBAChD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;aAChD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,mBAAmB;KAClC,CAAC;IAEF,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype ICodecFamily,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { getCodecTreeForSchemaFormat, makeSchemaCodec } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\nimport { SchemaFormatVersion } from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(\n\toptions: CodecWriteOptions,\n): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([\n\t\t[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, brand(SchemaFormatVersion.v1))],\n\t\t[SchemaFormatVersion.v2, makeSchemaChangeCodecV1(options, brand(SchemaFormatVersion.v2))],\n\t]);\n}\n\nexport function getCodecTreeForSchemaChangeFormat(\n\tversion: SchemaFormatVersion,\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn {\n\t\tname: \"SchemaChange\",\n\t\tversion,\n\t\tchildren: [getCodecTreeForSchemaFormat(clientVersion)],\n\t};\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: CodecWriteOptions,\n\twriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the change codec using mostly v1 logic.\n * @param options - The codec options.\n * @param schemaWriteVersion - The schema write version.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: CodecWriteOptions,\n\tschemaWriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, schemaWriteVersion);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
@@ -2,26 +2,26 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type CodecTree, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
6
- import { SchemaVersion, type TreeStoredSchema } from "../../core/index.js";
5
+ import { type CodecTree, type CodecWriteOptions, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
6
+ import { SchemaFormatVersion, type TreeStoredSchema } from "../../core/index.js";
7
7
  import { type JsonCompatible } from "../../util/index.js";
8
8
  import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
9
9
  /**
10
- * Convert a MinimumVersionForCollab to a SchemaVersion.
10
+ * Convert a MinimumVersionForCollab to a SchemaFormatVersion.
11
11
  * @param clientVersion - The MinimumVersionForCollab to convert.
12
- * @returns The SchemaVersion that corresponds to the provided MinimumVersionForCollab.
12
+ * @returns The SchemaFormatVersion that corresponds to the provided MinimumVersionForCollab.
13
13
  */
14
- export declare function clientVersionToSchemaVersion(clientVersion: MinimumVersionForCollab): SchemaVersion;
15
- export declare function getCodecTreeForSchemaFormat(version: SchemaVersion): CodecTree;
14
+ export declare function clientVersionToSchemaVersion(clientVersion: MinimumVersionForCollab): SchemaFormatVersion;
15
+ export declare function getCodecTreeForSchemaFormat(clientVersion: MinimumVersionForCollab): CodecTree;
16
16
  /**
17
17
  * Create a schema codec.
18
- * @param options - Specifies common codec options, including which `validator` to use.
19
- * @param writeVersion - The schema write version.
18
+ * @param options - Specifies common codec options, including `minVersionForCollab` and which `validator` to use.
19
+ * @param writeVersionOverride - The schema version to write. If not provided, the version will be derived from `minVersionForCollab`.
20
20
  * @returns The composed codec.
21
21
  *
22
22
  * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.
23
23
  */
24
- export declare function makeSchemaCodec(options: ICodecOptions, writeVersion: SchemaVersion): IJsonCodec<TreeStoredSchema>;
24
+ export declare function makeSchemaCodec(options: CodecWriteOptions, writeVersionOverride?: SchemaFormatVersion): IJsonCodec<TreeStoredSchema>;
25
25
  /**
26
26
  * Create a family of schema codecs.
27
27
  * @param options - Specifies common codec options, including which `validator` to use.
@@ -34,5 +34,5 @@ export declare function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<T
34
34
  * @param version - The schema write version.
35
35
  * @returns The encoded schema.
36
36
  */
37
- export declare function encodeRepo(repo: TreeStoredSchema, version: SchemaVersion): JsonCompatible;
37
+ export declare function encodeRepo(repo: TreeStoredSchema, version: SchemaFormatVersion): JsonCompatible;
38
38
  //# sourceMappingURL=codec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,YA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