@fluidframework/tree 2.72.0 → 2.74.0-365691

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 (696) hide show
  1. package/CHANGELOG.md +99 -0
  2. package/api-report/tree.alpha.api.md +32 -31
  3. package/dist/alpha.d.ts +7 -1
  4. package/dist/api.d.ts +6 -2
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/api.js +2 -11
  7. package/dist/api.js.map +1 -1
  8. package/dist/codec/codec.d.ts +9 -2
  9. package/dist/codec/codec.d.ts.map +1 -1
  10. package/dist/codec/codec.js +9 -2
  11. package/dist/codec/codec.js.map +1 -1
  12. package/dist/codec/index.d.ts +1 -1
  13. package/dist/codec/index.d.ts.map +1 -1
  14. package/dist/codec/index.js +2 -1
  15. package/dist/codec/index.js.map +1 -1
  16. package/dist/codec/versioned/codec.d.ts +7 -2
  17. package/dist/codec/versioned/codec.d.ts.map +1 -1
  18. package/dist/codec/versioned/codec.js +24 -1
  19. package/dist/codec/versioned/codec.js.map +1 -1
  20. package/dist/codec/versioned/index.d.ts +1 -1
  21. package/dist/codec/versioned/index.d.ts.map +1 -1
  22. package/dist/codec/versioned/index.js +2 -1
  23. package/dist/codec/versioned/index.js.map +1 -1
  24. package/dist/core/schema-stored/schema.d.ts +12 -1
  25. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  26. package/dist/core/schema-stored/schema.js.map +1 -1
  27. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecs.js +5 -3
  29. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  31. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  32. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  33. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  34. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
  35. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  36. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  37. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  38. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -3
  40. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/codecs.js +32 -18
  42. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  44. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  45. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  46. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  47. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
  48. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  49. package/dist/feature-libraries/chunked-forest/codec/format.js +7 -3
  50. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  51. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  52. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  53. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  54. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  55. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +2 -2
  56. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  59. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
  61. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  62. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  63. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
  65. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  67. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
  69. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  71. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/index.js +2 -1
  73. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  74. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
  75. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  76. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +53 -55
  77. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  78. package/dist/feature-libraries/default-schema/index.d.ts +1 -3
  79. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  80. package/dist/feature-libraries/default-schema/index.js +2 -8
  81. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  82. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  83. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  84. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  85. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  86. package/dist/feature-libraries/forest-summary/format.js +4 -2
  87. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  88. package/dist/feature-libraries/index.d.ts +5 -4
  89. package/dist/feature-libraries/index.d.ts.map +1 -1
  90. package/dist/feature-libraries/index.js +8 -8
  91. package/dist/feature-libraries/index.js.map +1 -1
  92. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  93. package/dist/feature-libraries/modular-schema/comparison.js +1 -2
  94. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  95. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  96. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  97. package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
  98. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  99. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  100. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  101. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  102. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  103. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  104. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  105. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  106. package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
  107. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  108. package/dist/feature-libraries/modular-schema/index.js +1 -3
  109. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  110. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  111. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  112. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  113. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  114. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  115. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  117. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  118. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  119. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  120. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  121. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  122. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  123. package/dist/feature-libraries/object-forest/objectForest.js +3 -2
  124. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  125. package/dist/feature-libraries/optional-field/index.d.ts +1 -1
  126. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  127. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  128. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  129. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  130. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  131. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  132. package/dist/feature-libraries/schema-index/codec.js +5 -3
  133. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  134. package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  135. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
  136. package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  137. package/dist/feature-libraries/schemaChecker.js.map +1 -0
  138. package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  139. package/dist/feature-libraries/sequence-field/formatV2.js +1 -0
  140. package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
  141. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  142. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  143. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  144. package/dist/feature-libraries/treeCompressionUtils.d.ts +2 -12
  145. package/dist/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
  146. package/dist/feature-libraries/treeCompressionUtils.js +4 -14
  147. package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
  148. package/dist/index.d.ts +4 -4
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +8 -3
  151. package/dist/index.js.map +1 -1
  152. package/dist/packageVersion.d.ts +1 -1
  153. package/dist/packageVersion.d.ts.map +1 -1
  154. package/dist/packageVersion.js +1 -1
  155. package/dist/packageVersion.js.map +1 -1
  156. package/dist/shared-tree/index.d.ts +1 -1
  157. package/dist/shared-tree/index.d.ts.map +1 -1
  158. package/dist/shared-tree/index.js +1 -2
  159. package/dist/shared-tree/index.js.map +1 -1
  160. package/dist/shared-tree/sharedTree.d.ts +7 -54
  161. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  162. package/dist/shared-tree/sharedTree.js +2 -52
  163. package/dist/shared-tree/sharedTree.js.map +1 -1
  164. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  165. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  166. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -2
  167. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  168. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  169. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  170. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  171. package/dist/shared-tree/treeCheckout.d.ts +2 -2
  172. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  173. package/dist/shared-tree/treeCheckout.js.map +1 -1
  174. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  175. package/dist/shared-tree-core/editManagerCodecs.js +12 -6
  176. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  177. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
  178. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  179. package/dist/shared-tree-core/editManagerFormatCommons.js +5 -8
  180. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  181. package/dist/shared-tree-core/index.d.ts +3 -3
  182. package/dist/shared-tree-core/index.d.ts.map +1 -1
  183. package/dist/shared-tree-core/index.js +3 -2
  184. package/dist/shared-tree-core/index.js.map +1 -1
  185. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  186. package/dist/shared-tree-core/messageCodecs.js +20 -9
  187. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  188. package/dist/shared-tree-core/messageFormat.d.ts +4 -6
  189. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  190. package/dist/shared-tree-core/messageFormat.js +9 -7
  191. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  192. package/dist/simple-tree/api/configuration.d.ts +2 -0
  193. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  194. package/dist/simple-tree/api/configuration.js +10 -0
  195. package/dist/simple-tree/api/configuration.js.map +1 -1
  196. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +15 -12
  197. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  198. package/dist/simple-tree/api/incrementalAllowedTypes.js +17 -14
  199. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  200. package/dist/simple-tree/api/index.d.ts +2 -1
  201. package/dist/simple-tree/api/index.d.ts.map +1 -1
  202. package/dist/simple-tree/api/index.js +6 -2
  203. package/dist/simple-tree/api/index.js.map +1 -1
  204. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  205. package/dist/simple-tree/api/schemaFromSimple.js +7 -1
  206. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  207. package/dist/simple-tree/api/simpleSchemaCodec.js +4 -6
  208. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  209. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  210. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  211. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
  212. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  213. package/dist/simple-tree/api/tree.d.ts +2 -2
  214. package/dist/simple-tree/api/tree.js +1 -1
  215. package/dist/simple-tree/api/tree.js.map +1 -1
  216. package/dist/simple-tree/core/allowedTypes.js +1 -1
  217. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  218. package/dist/simple-tree/core/index.d.ts +3 -3
  219. package/dist/simple-tree/core/index.d.ts.map +1 -1
  220. package/dist/simple-tree/core/index.js +3 -1
  221. package/dist/simple-tree/core/index.js.map +1 -1
  222. package/dist/simple-tree/core/toStored.d.ts +12 -5
  223. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  224. package/dist/simple-tree/core/toStored.js +26 -10
  225. package/dist/simple-tree/core/toStored.js.map +1 -1
  226. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  227. package/dist/simple-tree/core/treeNodeKernel.js +1 -0
  228. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  229. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
  230. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  231. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  232. package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
  233. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  234. package/dist/simple-tree/core/treeNodeValid.js +1 -2
  235. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  236. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  237. package/dist/simple-tree/fieldSchema.js +1 -8
  238. package/dist/simple-tree/fieldSchema.js.map +1 -1
  239. package/dist/simple-tree/index.d.ts +3 -3
  240. package/dist/simple-tree/index.d.ts.map +1 -1
  241. package/dist/simple-tree/index.js +10 -4
  242. package/dist/simple-tree/index.js.map +1 -1
  243. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  244. package/dist/simple-tree/leafNodeSchema.js +0 -1
  245. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  246. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  247. package/dist/simple-tree/node-kinds/array/arrayNode.js +14 -49
  248. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  249. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  250. package/dist/simple-tree/node-kinds/map/mapNode.js +1 -5
  251. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  252. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  253. package/dist/simple-tree/node-kinds/object/objectNode.js +3 -10
  254. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  255. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  256. package/dist/simple-tree/node-kinds/record/recordNode.js +1 -5
  257. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  258. package/dist/simple-tree/simpleSchema.d.ts +15 -3
  259. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  260. package/dist/simple-tree/simpleSchema.js.map +1 -1
  261. package/dist/simple-tree/toStoredSchema.d.ts +20 -8
  262. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  263. package/dist/simple-tree/toStoredSchema.js +27 -22
  264. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  265. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  266. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
  267. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  268. package/dist/tableSchema.d.ts +22 -52
  269. package/dist/tableSchema.d.ts.map +1 -1
  270. package/dist/tableSchema.js +141 -277
  271. package/dist/tableSchema.js.map +1 -1
  272. package/dist/treeFactory.d.ts +5 -0
  273. package/dist/treeFactory.d.ts.map +1 -1
  274. package/dist/treeFactory.js +12 -5
  275. package/dist/treeFactory.js.map +1 -1
  276. package/dist/util/arrayUtilities.d.ts +45 -0
  277. package/dist/util/arrayUtilities.d.ts.map +1 -0
  278. package/dist/util/arrayUtilities.js +76 -0
  279. package/dist/util/arrayUtilities.js.map +1 -0
  280. package/dist/util/breakable.js +3 -3
  281. package/dist/util/breakable.js.map +1 -1
  282. package/dist/util/index.d.ts +1 -0
  283. package/dist/util/index.d.ts.map +1 -1
  284. package/dist/util/index.js +7 -2
  285. package/dist/util/index.js.map +1 -1
  286. package/dist/util/typeCheckTests.d.ts.map +1 -1
  287. package/dist/util/typeCheckTests.js.map +1 -1
  288. package/lib/alpha.d.ts +7 -1
  289. package/lib/api.d.ts +6 -2
  290. package/lib/api.d.ts.map +1 -1
  291. package/lib/api.js +2 -13
  292. package/lib/api.js.map +1 -1
  293. package/lib/codec/codec.d.ts +9 -2
  294. package/lib/codec/codec.d.ts.map +1 -1
  295. package/lib/codec/codec.js +9 -2
  296. package/lib/codec/codec.js.map +1 -1
  297. package/lib/codec/index.d.ts +1 -1
  298. package/lib/codec/index.d.ts.map +1 -1
  299. package/lib/codec/index.js +1 -1
  300. package/lib/codec/index.js.map +1 -1
  301. package/lib/codec/versioned/codec.d.ts +7 -2
  302. package/lib/codec/versioned/codec.d.ts.map +1 -1
  303. package/lib/codec/versioned/codec.js +22 -0
  304. package/lib/codec/versioned/codec.js.map +1 -1
  305. package/lib/codec/versioned/index.d.ts +1 -1
  306. package/lib/codec/versioned/index.d.ts.map +1 -1
  307. package/lib/codec/versioned/index.js +1 -1
  308. package/lib/codec/versioned/index.js.map +1 -1
  309. package/lib/core/schema-stored/schema.d.ts +12 -1
  310. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  311. package/lib/core/schema-stored/schema.js.map +1 -1
  312. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  313. package/lib/core/tree/detachedFieldIndexCodecs.js +5 -3
  314. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  315. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  316. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  317. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  318. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  319. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
  320. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  321. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  322. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  323. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  324. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -3
  325. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  326. package/lib/feature-libraries/chunked-forest/codec/codecs.js +36 -22
  327. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  328. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  329. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  330. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  331. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  332. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
  333. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  334. package/lib/feature-libraries/chunked-forest/codec/format.js +6 -2
  335. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  336. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  337. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  338. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  339. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  340. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +2 -2
  341. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
  342. package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
  343. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +1 -1
  344. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  345. package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
  346. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  347. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  348. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  349. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
  350. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  351. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  352. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  353. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
  354. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  355. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  356. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  357. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  358. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  359. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
  360. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  361. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -57
  362. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  363. package/lib/feature-libraries/default-schema/index.d.ts +1 -3
  364. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  365. package/lib/feature-libraries/default-schema/index.js +1 -3
  366. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  367. package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -2
  368. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  369. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  370. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  371. package/lib/feature-libraries/forest-summary/format.js +4 -2
  372. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  373. package/lib/feature-libraries/index.d.ts +5 -4
  374. package/lib/feature-libraries/index.d.ts.map +1 -1
  375. package/lib/feature-libraries/index.js +5 -4
  376. package/lib/feature-libraries/index.js.map +1 -1
  377. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  378. package/lib/feature-libraries/modular-schema/comparison.js +1 -2
  379. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  380. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  381. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  382. package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
  383. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  384. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  385. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  386. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  387. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  388. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  389. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  390. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  391. package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
  392. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  393. package/lib/feature-libraries/modular-schema/index.js +0 -1
  394. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  395. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  396. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  397. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  398. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
  399. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  400. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  401. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  402. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  403. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  404. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  405. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  406. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  407. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  408. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  409. package/lib/feature-libraries/object-forest/objectForest.js +2 -1
  410. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  411. package/lib/feature-libraries/optional-field/index.d.ts +1 -1
  412. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  413. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  414. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  415. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  416. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  417. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  418. package/lib/feature-libraries/schema-index/codec.js +5 -3
  419. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  420. package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  421. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
  422. package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  423. package/lib/feature-libraries/schemaChecker.js.map +1 -0
  424. package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
  425. package/lib/feature-libraries/sequence-field/formatV2.js +1 -0
  426. package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
  427. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  428. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  429. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  430. package/lib/feature-libraries/treeCompressionUtils.d.ts +2 -12
  431. package/lib/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
  432. package/lib/feature-libraries/treeCompressionUtils.js +3 -13
  433. package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
  434. package/lib/index.d.ts +4 -4
  435. package/lib/index.d.ts.map +1 -1
  436. package/lib/index.js +3 -3
  437. package/lib/index.js.map +1 -1
  438. package/lib/packageVersion.d.ts +1 -1
  439. package/lib/packageVersion.d.ts.map +1 -1
  440. package/lib/packageVersion.js +1 -1
  441. package/lib/packageVersion.js.map +1 -1
  442. package/lib/shared-tree/index.d.ts +1 -1
  443. package/lib/shared-tree/index.d.ts.map +1 -1
  444. package/lib/shared-tree/index.js +1 -1
  445. package/lib/shared-tree/index.js.map +1 -1
  446. package/lib/shared-tree/sharedTree.d.ts +7 -54
  447. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  448. package/lib/shared-tree/sharedTree.js +1 -51
  449. package/lib/shared-tree/sharedTree.js.map +1 -1
  450. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  451. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  452. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -2
  453. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  454. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  455. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  456. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  457. package/lib/shared-tree/treeCheckout.d.ts +2 -2
  458. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  459. package/lib/shared-tree/treeCheckout.js.map +1 -1
  460. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  461. package/lib/shared-tree-core/editManagerCodecs.js +13 -7
  462. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  463. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
  464. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  465. package/lib/shared-tree-core/editManagerFormatCommons.js +4 -7
  466. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  467. package/lib/shared-tree-core/index.d.ts +3 -3
  468. package/lib/shared-tree-core/index.d.ts.map +1 -1
  469. package/lib/shared-tree-core/index.js +2 -2
  470. package/lib/shared-tree-core/index.js.map +1 -1
  471. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  472. package/lib/shared-tree-core/messageCodecs.js +21 -10
  473. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  474. package/lib/shared-tree-core/messageFormat.d.ts +4 -6
  475. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  476. package/lib/shared-tree-core/messageFormat.js +8 -6
  477. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  478. package/lib/simple-tree/api/configuration.d.ts +2 -0
  479. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  480. package/lib/simple-tree/api/configuration.js +10 -0
  481. package/lib/simple-tree/api/configuration.js.map +1 -1
  482. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +15 -12
  483. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  484. package/lib/simple-tree/api/incrementalAllowedTypes.js +15 -12
  485. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  486. package/lib/simple-tree/api/index.d.ts +2 -1
  487. package/lib/simple-tree/api/index.d.ts.map +1 -1
  488. package/lib/simple-tree/api/index.js +2 -1
  489. package/lib/simple-tree/api/index.js.map +1 -1
  490. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  491. package/lib/simple-tree/api/schemaFromSimple.js +8 -2
  492. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  493. package/lib/simple-tree/api/simpleSchemaCodec.js +5 -7
  494. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  495. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  496. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  497. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
  498. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  499. package/lib/simple-tree/api/tree.d.ts +2 -2
  500. package/lib/simple-tree/api/tree.js +1 -1
  501. package/lib/simple-tree/api/tree.js.map +1 -1
  502. package/lib/simple-tree/core/allowedTypes.js +1 -1
  503. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  504. package/lib/simple-tree/core/index.d.ts +3 -3
  505. package/lib/simple-tree/core/index.d.ts.map +1 -1
  506. package/lib/simple-tree/core/index.js +2 -2
  507. package/lib/simple-tree/core/index.js.map +1 -1
  508. package/lib/simple-tree/core/toStored.d.ts +12 -5
  509. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  510. package/lib/simple-tree/core/toStored.js +25 -9
  511. package/lib/simple-tree/core/toStored.js.map +1 -1
  512. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  513. package/lib/simple-tree/core/treeNodeKernel.js +1 -0
  514. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  515. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
  516. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  517. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  518. package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
  519. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  520. package/lib/simple-tree/core/treeNodeValid.js +1 -2
  521. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  522. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  523. package/lib/simple-tree/fieldSchema.js +2 -9
  524. package/lib/simple-tree/fieldSchema.js.map +1 -1
  525. package/lib/simple-tree/index.d.ts +3 -3
  526. package/lib/simple-tree/index.d.ts.map +1 -1
  527. package/lib/simple-tree/index.js +3 -3
  528. package/lib/simple-tree/index.js.map +1 -1
  529. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  530. package/lib/simple-tree/leafNodeSchema.js +1 -2
  531. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  532. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  533. package/lib/simple-tree/node-kinds/array/arrayNode.js +16 -51
  534. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  535. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  536. package/lib/simple-tree/node-kinds/map/mapNode.js +3 -7
  537. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  538. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  539. package/lib/simple-tree/node-kinds/object/objectNode.js +4 -11
  540. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  541. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  542. package/lib/simple-tree/node-kinds/record/recordNode.js +3 -7
  543. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  544. package/lib/simple-tree/simpleSchema.d.ts +15 -3
  545. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  546. package/lib/simple-tree/simpleSchema.js.map +1 -1
  547. package/lib/simple-tree/toStoredSchema.d.ts +20 -8
  548. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  549. package/lib/simple-tree/toStoredSchema.js +28 -24
  550. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  551. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  552. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
  553. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  554. package/lib/tableSchema.d.ts +22 -52
  555. package/lib/tableSchema.d.ts.map +1 -1
  556. package/lib/tableSchema.js +143 -279
  557. package/lib/tableSchema.js.map +1 -1
  558. package/lib/treeFactory.d.ts +5 -0
  559. package/lib/treeFactory.d.ts.map +1 -1
  560. package/lib/treeFactory.js +10 -4
  561. package/lib/treeFactory.js.map +1 -1
  562. package/lib/util/arrayUtilities.d.ts +45 -0
  563. package/lib/util/arrayUtilities.d.ts.map +1 -0
  564. package/lib/util/arrayUtilities.js +69 -0
  565. package/lib/util/arrayUtilities.js.map +1 -0
  566. package/lib/util/breakable.js +3 -3
  567. package/lib/util/breakable.js.map +1 -1
  568. package/lib/util/index.d.ts +1 -0
  569. package/lib/util/index.d.ts.map +1 -1
  570. package/lib/util/index.js +1 -0
  571. package/lib/util/index.js.map +1 -1
  572. package/lib/util/typeCheckTests.d.ts.map +1 -1
  573. package/lib/util/typeCheckTests.js.map +1 -1
  574. package/package.json +22 -22
  575. package/src/api.ts +22 -11
  576. package/src/codec/codec.ts +10 -2
  577. package/src/codec/index.ts +1 -0
  578. package/src/codec/versioned/codec.ts +40 -2
  579. package/src/codec/versioned/index.ts +1 -0
  580. package/src/core/schema-stored/schema.ts +12 -1
  581. package/src/core/tree/detachedFieldIndexCodecs.ts +10 -3
  582. package/src/feature-libraries/README.md +1 -1
  583. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
  584. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
  585. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
  586. package/src/feature-libraries/chunked-forest/codec/codecs.ts +55 -26
  587. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +8 -3
  588. package/src/feature-libraries/chunked-forest/codec/format.ts +14 -4
  589. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
  590. package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +5 -6
  591. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -4
  592. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
  593. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
  594. package/src/feature-libraries/chunked-forest/index.ts +1 -1
  595. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +86 -74
  596. package/src/feature-libraries/default-schema/index.ts +1 -9
  597. package/src/feature-libraries/forest-summary/forestSummarizer.ts +2 -2
  598. package/src/feature-libraries/forest-summary/format.ts +15 -9
  599. package/src/feature-libraries/index.ts +8 -10
  600. package/src/feature-libraries/modular-schema/comparison.ts +2 -3
  601. package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
  602. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
  603. package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
  604. package/src/feature-libraries/modular-schema/index.ts +0 -1
  605. package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
  606. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -6
  607. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
  608. package/src/feature-libraries/object-forest/objectForest.ts +2 -6
  609. package/src/feature-libraries/optional-field/index.ts +1 -0
  610. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  611. package/src/feature-libraries/schema-index/codec.ts +10 -3
  612. package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
  613. package/src/feature-libraries/sequence-field/formatV2.ts +1 -0
  614. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
  615. package/src/feature-libraries/treeCompressionUtils.ts +1 -15
  616. package/src/index.ts +7 -1
  617. package/src/packageVersion.ts +1 -1
  618. package/src/shared-tree/index.ts +0 -1
  619. package/src/shared-tree/sharedTree.ts +12 -88
  620. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -6
  621. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
  622. package/src/shared-tree/treeCheckout.ts +2 -2
  623. package/src/shared-tree-core/editManagerCodecs.ts +19 -7
  624. package/src/shared-tree-core/editManagerFormatCommons.ts +11 -12
  625. package/src/shared-tree-core/index.ts +7 -3
  626. package/src/shared-tree-core/messageCodecs.ts +32 -17
  627. package/src/shared-tree-core/messageFormat.ts +8 -6
  628. package/src/simple-tree/api/configuration.ts +17 -4
  629. package/src/simple-tree/api/incrementalAllowedTypes.ts +20 -18
  630. package/src/simple-tree/api/index.ts +6 -1
  631. package/src/simple-tree/api/schemaFromSimple.ts +14 -6
  632. package/src/simple-tree/api/simpleSchemaCodec.ts +10 -9
  633. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
  634. package/src/simple-tree/api/tree.ts +2 -2
  635. package/src/simple-tree/core/allowedTypes.ts +1 -1
  636. package/src/simple-tree/core/index.ts +3 -1
  637. package/src/simple-tree/core/toStored.ts +42 -18
  638. package/src/simple-tree/core/treeNodeKernel.ts +1 -0
  639. package/src/simple-tree/core/treeNodeSchema.ts +1 -7
  640. package/src/simple-tree/core/treeNodeValid.ts +0 -2
  641. package/src/simple-tree/fieldSchema.ts +2 -11
  642. package/src/simple-tree/index.ts +7 -2
  643. package/src/simple-tree/leafNodeSchema.ts +1 -2
  644. package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -75
  645. package/src/simple-tree/node-kinds/map/mapNode.ts +1 -15
  646. package/src/simple-tree/node-kinds/object/objectNode.ts +4 -18
  647. package/src/simple-tree/node-kinds/record/recordNode.ts +1 -15
  648. package/src/simple-tree/simpleSchema.ts +16 -3
  649. package/src/simple-tree/toStoredSchema.ts +54 -38
  650. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
  651. package/src/tableSchema.ts +110 -334
  652. package/src/treeFactory.ts +13 -4
  653. package/src/util/arrayUtilities.ts +88 -0
  654. package/src/util/breakable.ts +4 -4
  655. package/src/util/index.ts +6 -0
  656. package/src/util/typeCheckTests.ts +0 -1
  657. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  658. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  659. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
  660. package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  661. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  662. package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  663. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  664. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  665. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
  666. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  667. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  668. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  669. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
  670. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  671. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  672. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  673. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
  674. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  675. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  676. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  677. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
  678. package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  679. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  680. package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  681. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  682. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  683. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
  684. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  685. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  686. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  687. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
  688. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  689. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  690. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  691. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
  692. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  693. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
  694. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
  695. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
  696. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.FieldKinds = exports.fieldKinds = exports.getCodecTreeForModularChangeFormat = exports.fieldKindConfigurations = exports.forbidden = exports.identifier = exports.sequence = exports.required = exports.valueChangeHandler = exports.valueFieldEditor = exports.optional = exports.noChangeHandler = void 0;
7
+ exports.defaultSchemaPolicy = exports.FieldKinds = exports.fieldKinds = exports.getCodecTreeForModularChangeFormat = exports.fieldKindConfigurations = exports.forbidden = exports.identifier = exports.sequence = exports.required = exports.requiredFieldChangeHandler = exports.requiredFieldEditor = exports.optional = exports.noChangeHandler = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../core/index.js");
10
10
  const index_js_2 = require("../modular-schema/index.js");
@@ -31,53 +31,63 @@ exports.noChangeHandler = {
31
31
  createEmpty: () => 0,
32
32
  getCrossFieldKeys: () => [],
33
33
  };
34
- const optionalIdentifier = "Optional";
34
+ const optionalIdentifier = (0, index_js_5.brandConst)("Optional")();
35
35
  /**
36
36
  * 0 or 1 items.
37
37
  */
38
- exports.optional = new index_js_2.FieldKindWithEditor(optionalIdentifier, index_js_1.Multiplicity.Optional, index_js_3.optionalChangeHandler, (types, other) => (other.kind === exports.sequence.identifier || other.kind === optionalIdentifier) &&
39
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types), new Set([]));
40
- exports.valueFieldEditor = {
38
+ exports.optional = new index_js_2.FlexFieldKind(optionalIdentifier, index_js_1.Multiplicity.Optional, {
39
+ changeHandler: index_js_3.optionalChangeHandler,
40
+ allowsTreeSupersetOf: (types, other) => (other.kind === exports.sequence.identifier || other.kind === optionalIdentifier) &&
41
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
42
+ });
43
+ exports.requiredFieldEditor = {
41
44
  ...index_js_3.optionalFieldEditor,
42
45
  set: (ids) => index_js_3.optionalFieldEditor.set(false, ids),
43
46
  };
44
- exports.valueChangeHandler = {
45
- ...exports.optional.changeHandler,
46
- editor: exports.valueFieldEditor,
47
+ exports.requiredFieldChangeHandler = {
48
+ ...index_js_3.optionalChangeHandler,
49
+ editor: exports.requiredFieldEditor,
47
50
  };
48
- const requiredIdentifier = "Value";
51
+ const requiredIdentifier = (0, index_js_5.brandConst)("Value")();
49
52
  /**
50
53
  * Exactly one item.
51
54
  */
52
- exports.required = new index_js_2.FieldKindWithEditor(requiredIdentifier, index_js_1.Multiplicity.Single, exports.valueChangeHandler, (types, other) =>
53
- // By omitting Identifier here,
54
- // this is making a policy choice that a schema upgrade cannot be done from required to identifier.
55
- // Since an identifier can be upgraded into a required field,
56
- // preventing the inverse helps ensure that schema upgrades are monotonic.
57
- // Which direction is allowed is a subjective policy choice.
58
- (other.kind === exports.sequence.identifier ||
59
- other.kind === requiredIdentifier ||
60
- other.kind === exports.optional.identifier) &&
61
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types), new Set());
62
- const sequenceIdentifier = "Sequence";
55
+ exports.required = new index_js_2.FlexFieldKind(requiredIdentifier, index_js_1.Multiplicity.Single, {
56
+ changeHandler: exports.requiredFieldChangeHandler,
57
+ allowsTreeSupersetOf: (types, other) =>
58
+ // By omitting Identifier here,
59
+ // this is making a policy choice that a schema upgrade cannot be done from required to identifier.
60
+ // Since an identifier can be upgraded into a required field,
61
+ // preventing the inverse helps ensure that schema upgrades are monotonic.
62
+ // Which direction is allowed is a subjective policy choice.
63
+ (other.kind === exports.sequence.identifier ||
64
+ other.kind === requiredIdentifier ||
65
+ other.kind === exports.optional.identifier) &&
66
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
67
+ });
68
+ const sequenceIdentifier = (0, index_js_5.brandConst)("Sequence")();
63
69
  /**
64
70
  * 0 or more items.
65
71
  */
66
- exports.sequence = new index_js_2.FieldKindWithEditor(sequenceIdentifier, index_js_1.Multiplicity.Sequence, index_js_4.sequenceFieldChangeHandler, (types, other) => other.kind === sequenceIdentifier &&
67
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
68
- // TODO: add normalizer/importers for handling ops from other kinds.
69
- new Set([]));
70
- const identifierFieldIdentifier = "Identifier";
72
+ exports.sequence = new index_js_2.FlexFieldKind(sequenceIdentifier, index_js_1.Multiplicity.Sequence, {
73
+ changeHandler: index_js_4.sequenceFieldChangeHandler,
74
+ allowsTreeSupersetOf: (types, other) => other.kind === sequenceIdentifier &&
75
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
76
+ });
77
+ const identifierFieldIdentifier = (0, index_js_5.brandConst)("Identifier")();
71
78
  /**
72
79
  * Exactly one identifier.
73
80
  */
74
- exports.identifier = new index_js_2.FieldKindWithEditor(identifierFieldIdentifier, index_js_1.Multiplicity.Single, exports.noChangeHandler, (types, other) =>
75
- // Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.
76
- (other.kind === exports.sequence.identifier ||
77
- other.kind === requiredIdentifier ||
78
- other.kind === exports.optional.identifier ||
79
- other.kind === identifierFieldIdentifier) &&
80
- (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types), new Set());
81
+ exports.identifier = new index_js_2.FlexFieldKind(identifierFieldIdentifier, index_js_1.Multiplicity.Single, {
82
+ changeHandler: exports.noChangeHandler,
83
+ allowsTreeSupersetOf: (types, other) =>
84
+ // Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.
85
+ (other.kind === exports.sequence.identifier ||
86
+ other.kind === requiredIdentifier ||
87
+ other.kind === exports.optional.identifier ||
88
+ other.kind === identifierFieldIdentifier) &&
89
+ (0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
90
+ });
81
91
  /**
82
92
  * Exactly 0 items.
83
93
  *
@@ -106,30 +116,12 @@ exports.identifier = new index_js_2.FieldKindWithEditor(identifierFieldIdentifie
106
116
  *
107
117
  * See {@link emptyField} for a constant, reusable field using Forbidden.
108
118
  */
109
- exports.forbidden = new index_js_2.FieldKindWithEditor(index_js_1.forbiddenFieldKindIdentifier, index_js_1.Multiplicity.Forbidden, exports.noChangeHandler,
110
- // All multiplicities other than Value support empty.
111
- (types, other) => exports.fieldKinds.get(other.kind)?.multiplicity !== index_js_1.Multiplicity.Single, new Set());
119
+ exports.forbidden = new index_js_2.FlexFieldKind(index_js_1.forbiddenFieldKindIdentifier, index_js_1.Multiplicity.Forbidden, {
120
+ changeHandler: exports.noChangeHandler,
121
+ // All multiplicities other than Value support empty.
122
+ allowsTreeSupersetOf: (types, other) => exports.fieldKinds.get(other.kind)?.multiplicity !== index_js_1.Multiplicity.Single,
123
+ });
112
124
  exports.fieldKindConfigurations = new Map([
113
- [
114
- (0, index_js_5.brand)(1),
115
- new Map([
116
- [exports.required.identifier, { kind: exports.required, formatVersion: 1 }],
117
- [exports.optional.identifier, { kind: exports.optional, formatVersion: 1 }],
118
- [exports.sequence.identifier, { kind: exports.sequence, formatVersion: 1 }],
119
- [exports.forbidden.identifier, { kind: exports.forbidden, formatVersion: 1 }],
120
- [exports.identifier.identifier, { kind: exports.identifier, formatVersion: 1 }],
121
- ]),
122
- ],
123
- [
124
- (0, index_js_5.brand)(2),
125
- new Map([
126
- [exports.required.identifier, { kind: exports.required, formatVersion: 2 }],
127
- [exports.optional.identifier, { kind: exports.optional, formatVersion: 2 }],
128
- [exports.sequence.identifier, { kind: exports.sequence, formatVersion: 1 }],
129
- [exports.forbidden.identifier, { kind: exports.forbidden, formatVersion: 1 }],
130
- [exports.identifier.identifier, { kind: exports.identifier, formatVersion: 1 }],
131
- ]),
132
- ],
133
125
  [
134
126
  (0, index_js_5.brand)(3),
135
127
  new Map([
@@ -176,4 +168,10 @@ exports.fieldKinds = new Map([exports.required, exports.optional, exports.sequen
176
168
  * Default FieldKinds with their editor types erased.
177
169
  */
178
170
  exports.FieldKinds = { required: exports.required, optional: exports.optional, sequence: exports.sequence, identifier: exports.identifier, forbidden: exports.forbidden };
171
+ /**
172
+ * FullSchemaPolicy with the default field kinds.
173
+ */
174
+ exports.defaultSchemaPolicy = {
175
+ fieldKinds: exports.fieldKinds,
176
+ };
179
177
  //# sourceMappingURL=defaultFieldKinds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE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hBD,gFAgBC;AAED;;;;;;GAMG;AACU,QAAA,UAAU,GAA0D,IAAI,GAAG,CACvF,CAAC,gBAAQ,EAAE,gBAAQ,EAAE,gBAAQ,EAAE,kBAAU,EAAE,iBAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CACnF,CAAC;AAcF;;GAEG;AACU,QAAA,UAAU,GAOnB,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,UAAU,EAAV,kBAAU,EAAE,SAAS,EAAT,iBAAS,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFieldKindWithEditor,\n\ttype FlexFieldKind,\n\ttype ToDelta,\n\tallowsTreeSchemaIdentifierSuperset,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport { sequenceFieldChangeHandler } from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\nimport type { CodecTree } from \"../../codec/index.js\";\nimport { brand, type Brand } from \"../../util/index.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\nexport interface ValueFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = \"Optional\";\n/**\n * 0 or 1 items.\n */\nexport const optional = new FieldKindWithEditor(\n\toptionalIdentifier,\n\tMultiplicity.Optional,\n\toptionalChangeHandler,\n\t(types, other) =>\n\t\t(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set([]),\n);\n\nexport const valueFieldEditor: ValueFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const valueChangeHandler: FieldChangeHandler<OptionalChangeset, ValueFieldEditor> = {\n\t...optional.changeHandler,\n\teditor: valueFieldEditor,\n};\n\nconst requiredIdentifier = \"Value\";\n\n/**\n * Exactly one item.\n */\nexport const required = new FieldKindWithEditor(\n\trequiredIdentifier,\n\tMultiplicity.Single,\n\tvalueChangeHandler,\n\t(types, other) =>\n\t\t// By omitting Identifier here,\n\t\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t\t// Since an identifier can be upgraded into a required field,\n\t\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t\t// Which direction is allowed is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\nconst sequenceIdentifier = \"Sequence\";\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FieldKindWithEditor(\n\tsequenceIdentifier,\n\tMultiplicity.Sequence,\n\tsequenceFieldChangeHandler,\n\t(types, other) =>\n\t\tother.kind === sequenceIdentifier &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\t// TODO: add normalizer/importers for handling ops from other kinds.\n\tnew Set([]),\n);\n\nconst identifierFieldIdentifier = \"Identifier\";\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FieldKindWithEditor(\n\tidentifierFieldIdentifier,\n\tMultiplicity.Single,\n\tnoChangeHandler,\n\t(types, other) =>\n\t\t// Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === identifierFieldIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n\tnew Set(),\n);\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FieldKindWithEditor(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\tnoChangeHandler,\n\t// All multiplicities other than Value support empty.\n\t(types, other) => fieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,\n\tnew Set(),\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map([\n\t[\n\t\tbrand(1),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 1 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 1 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 1 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(2),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 1 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(3),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(4),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport type ModularChangeFormatVersion = Brand<1 | 2 | 3 | 4, \"ModularChangeFormatVersion\">;\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = Array.from(dependencies.entries()).map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required extends FlexFieldKind<\"Value\", Multiplicity.Single> {}\nexport interface Optional extends FlexFieldKind<\"Optional\", Multiplicity.Optional> {}\nexport interface Sequence extends FlexFieldKind<\"Sequence\", Multiplicity.Sequence> {}\nexport interface Identifier extends FlexFieldKind<\"Identifier\", Multiplicity.Single> {}\nexport interface Forbidden\n\textends FlexFieldKind<typeof forbiddenFieldKindIdentifier, Multiplicity.Forbidden> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n"]}
1
+ {"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,kDAM6B;AAC7B,yDAWoC;AACpC,yDAKoC;AACpC,yDAGoC;AAEpC,2DAA0D;AAE1D,kDAAoE;AAEpE;;GAEG;AACU,QAAA,eAAe,GAA0B;IACrD,OAAO,EAAE,IAAA,0CAA+B,EAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,MAAS,EAAE,IAAO,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;KACvB,CAAC;IACF,aAAa,EAAE,GAAG,EAAE,CAAC,uCAAmB;IACxC,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE;IAClF,SAAS,EAAE,CAAC,MAAM,EAAE,cAAuB,EAAoB,EAAE,CAAC,CAAC,EAAE,CAAC;IACtE,oBAAoB,EAAE,CAAC,MAAM,EAAiC,EAAE,CAAC,EAAE;IACnE,OAAO,EAAE,CAAC,MA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["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\ttype ToDelta,\n\tallowsTreeSchemaIdentifierSuperset,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\ttype OptionalFieldEditor,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport {\n\tsequenceFieldChangeHandler,\n\ttype SequenceFieldEditor,\n} from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\nimport type { CodecTree } from \"../../codec/index.js\";\nimport { brand, brandConst, type Brand } from \"../../util/index.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\n/**\n * {@link FieldEditor} for required fields (always contain exactly 1 child).\n * @remarks\n * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,\n * and the content is always assumed to not be empty.\n * This means the actual edits implemented for optional fields are sufficient to support required fields\n * which is why this is defined and implemented in terms of optional fields.\n */\nexport interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = brandConst(\"Optional\")<FieldKindIdentifier>();\n\n/**\n * 0 or 1 items.\n */\nexport const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {\n\tchangeHandler: optionalChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nexport const requiredFieldEditor: RequiredFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const requiredFieldChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tRequiredFieldEditor\n> = {\n\t...optionalChangeHandler,\n\teditor: requiredFieldEditor,\n};\n\nconst requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\n\n/**\n * Exactly one item.\n */\nexport const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {\n\tchangeHandler: requiredFieldChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t// By omitting Identifier here,\n\t\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t\t// Since an identifier can be upgraded into a required field,\n\t\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t\t// Which direction is allowed is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nconst sequenceIdentifier = brandConst(\"Sequence\")<FieldKindIdentifier>();\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {\n\tchangeHandler: sequenceFieldChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\tother.kind === sequenceIdentifier &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nconst identifierFieldIdentifier = brandConst(\"Identifier\")<FieldKindIdentifier>();\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {\n\tchangeHandler: noChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t// Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === identifierFieldIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\t// All multiplicities other than Value support empty.\n\t\tallowsTreeSupersetOf: (types, other) =>\n\t\t\tfieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map([\n\t[\n\t\tbrand(3),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(4),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport type ModularChangeFormatVersion = Brand<3 | 4, \"ModularChangeFormatVersion\">;\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = Array.from(dependencies.entries()).map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required\n\textends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}\nexport interface Optional\n\textends FlexFieldKind<\n\t\tOptionalFieldEditor,\n\t\ttypeof optionalIdentifier,\n\t\tMultiplicity.Optional\n\t> {}\nexport interface Sequence\n\textends FlexFieldKind<\n\t\tSequenceFieldEditor,\n\t\ttypeof sequenceIdentifier,\n\t\tMultiplicity.Sequence\n\t> {}\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
@@ -2,9 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, fieldKinds, fieldKindConfigurations, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, } from "./defaultFieldKinds.js";
5
+ export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, fieldKinds, fieldKindConfigurations, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, defaultSchemaPolicy, } from "./defaultFieldKinds.js";
6
6
  export { type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, intoDelta, relevantRemovedRoots, } from "./defaultEditBuilder.js";
7
- export { SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./schemaChecker.js";
8
- export { defaultSchemaPolicy } from "./defaultSchema.js";
9
7
  export { MappedEditBuilder } from "./mappedEditBuilder.js";
10
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,KAAK,0BAA0B,GAC/B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,gBAAgB,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,SAAS,EACd,UAAU,EACV,uBAAuB,EACvB,kCAAkC,EAClC,KAAK,0BAA0B,EAC/B,mBAAmB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACN,KAAK,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,SAAS,EACT,oBAAoB,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -4,24 +4,18 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.MappedEditBuilder = exports.defaultSchemaPolicy = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.relevantRemovedRoots = exports.intoDelta = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.getCodecTreeForModularChangeFormat = exports.fieldKindConfigurations = exports.fieldKinds = exports.FieldKinds = void 0;
7
+ exports.MappedEditBuilder = exports.relevantRemovedRoots = exports.intoDelta = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.defaultSchemaPolicy = exports.getCodecTreeForModularChangeFormat = exports.fieldKindConfigurations = exports.fieldKinds = exports.FieldKinds = void 0;
8
8
  var defaultFieldKinds_js_1 = require("./defaultFieldKinds.js");
9
9
  Object.defineProperty(exports, "FieldKinds", { enumerable: true, get: function () { return defaultFieldKinds_js_1.FieldKinds; } });
10
10
  Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function () { return defaultFieldKinds_js_1.fieldKinds; } });
11
11
  Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return defaultFieldKinds_js_1.fieldKindConfigurations; } });
12
12
  Object.defineProperty(exports, "getCodecTreeForModularChangeFormat", { enumerable: true, get: function () { return defaultFieldKinds_js_1.getCodecTreeForModularChangeFormat; } });
13
+ Object.defineProperty(exports, "defaultSchemaPolicy", { enumerable: true, get: function () { return defaultFieldKinds_js_1.defaultSchemaPolicy; } });
13
14
  var defaultEditBuilder_js_1 = require("./defaultEditBuilder.js");
14
15
  Object.defineProperty(exports, "DefaultChangeFamily", { enumerable: true, get: function () { return defaultEditBuilder_js_1.DefaultChangeFamily; } });
15
16
  Object.defineProperty(exports, "DefaultEditBuilder", { enumerable: true, get: function () { return defaultEditBuilder_js_1.DefaultEditBuilder; } });
16
17
  Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return defaultEditBuilder_js_1.intoDelta; } });
17
18
  Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return defaultEditBuilder_js_1.relevantRemovedRoots; } });
18
- var schemaChecker_js_1 = require("./schemaChecker.js");
19
- Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return schemaChecker_js_1.SchemaValidationError; } });
20
- Object.defineProperty(exports, "isNodeInSchema", { enumerable: true, get: function () { return schemaChecker_js_1.isNodeInSchema; } });
21
- Object.defineProperty(exports, "isFieldInSchema", { enumerable: true, get: function () { return schemaChecker_js_1.isFieldInSchema; } });
22
- Object.defineProperty(exports, "throwOutOfSchema", { enumerable: true, get: function () { return schemaChecker_js_1.throwOutOfSchema; } });
23
- var defaultSchema_js_1 = require("./defaultSchema.js");
24
- Object.defineProperty(exports, "defaultSchemaPolicy", { enumerable: true, get: function () { return defaultSchema_js_1.defaultSchemaPolicy; } });
25
19
  var mappedEditBuilder_js_1 = require("./mappedEditBuilder.js");
26
20
  Object.defineProperty(exports, "MappedEditBuilder", { enumerable: true, get: function () { return mappedEditBuilder_js_1.MappedEditBuilder; } });
27
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAWgC;AAV/B,kHAAA,UAAU,OAAA;AAMV,kHAAA,UAAU,OAAA;AACV,+HAAA,uBAAuB,OAAA;AACvB,0IAAA,kCAAkC,OAAA;AAInC,iEAUiC;AARhC,4HAAA,mBAAmB,OAAA;AACnB,2HAAA,kBAAkB,OAAA;AAKlB,kHAAA,SAAS,OAAA;AACT,6HAAA,oBAAoB,OAAA;AAGrB,uDAK4B;AAJ3B,yHAAA,qBAAqB,OAAA;AACrB,kHAAA,cAAc,OAAA;AACd,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAGjB,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA;AAE5B,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./defaultFieldKinds.js\";\n\nexport {\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tintoDelta,\n\trelevantRemovedRoots,\n} from \"./defaultEditBuilder.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport { defaultSchemaPolicy } from \"./defaultSchema.js\";\n\nexport { MappedEditBuilder } from \"./mappedEditBuilder.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAYgC;AAX/B,kHAAA,UAAU,OAAA;AAMV,kHAAA,UAAU,OAAA;AACV,+HAAA,uBAAuB,OAAA;AACvB,0IAAA,kCAAkC,OAAA;AAElC,2HAAA,mBAAmB,OAAA;AAGpB,iEAUiC;AARhC,4HAAA,mBAAmB,OAAA;AACnB,2HAAA,kBAAkB,OAAA;AAKlB,kHAAA,SAAS,OAAA;AACT,6HAAA,oBAAoB,OAAA;AAGrB,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n\tdefaultSchemaPolicy,\n} from \"./defaultFieldKinds.js\";\n\nexport {\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tintoDelta,\n\trelevantRemovedRoots,\n} from \"./defaultEditBuilder.js\";\n\nexport { MappedEditBuilder } from \"./mappedEditBuilder.js\";\n"]}
@@ -37,7 +37,7 @@ class ForestSummarizer {
37
37
  // TODO: this should take in CodecWriteOptions, and use it to pick the write version.
38
38
  this.codec = (0, codec_js_1.makeForestSummarizerCodec)(options, fieldBatchCodec);
39
39
  this.incrementalSummaryBuilder = new incrementalSummaryBuilder_js_1.ForestIncrementalSummaryBuilder(encoderContext.encodeType ===
40
- treeCompressionUtils_js_1.TreeCompressionStrategyExtended.CompressedIncremental /* enableIncrementalSummary */, (cursor) => this.forest.chunkField(cursor), shouldEncodeIncrementally, initialSequenceNumber);
40
+ treeCompressionUtils_js_1.TreeCompressionStrategy.CompressedIncremental /* enableIncrementalSummary */, (cursor) => this.forest.chunkField(cursor), shouldEncodeIncrementally, initialSequenceNumber);
41
41
  }
42
42
  /**
43
43
  * Summarization of the forest's tree content.
@@ -1 +1 @@
1
- {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAU7D,kDAY6B;AAM7B,kDAAgF;AAChF,wDAAwD;AACxD,iEAAsF;AACtF,yDAKoC;AAEpC,yCAAyE;AACzE,iFAIwC;AACxC,wEAA6E;AAG7E;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,QAAQ,CAAC;AAEzC;;GAEG;AACH,MAAa,gBAAgB;IAO5B;;OAEG;IACH,YACkB,MAAuB,EACvB,gBAAkC,EACnD,eAAgC,EACf,cAAyC,EAC1D,OAA0B,EACT,YAA2B,EAC5C,qBAA6B,EAC7B,4BAAuD,2CAAgC;QAPtE,WAAM,GAAN,MAAM,CAAiB;QACvB,qBAAgB,GAAhB,gBAAgB,CAAkB;QAElC,mBAAc,GAAd,cAAc,CAA2B;QAEzC,iBAAY,GAAZ,YAAY,CAAe;QAf7B,QAAG,GAAG,wBAAgB,CAAC;QAmBtC,qFAAqF;QACrF,IAAI,CAAC,KAAK,GAAG,IAAA,oCAAyB,EAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QACjE,IAAI,CAAC,yBAAyB,GAAG,IAAI,8DAA+B,CACnE,cAAc,CAAC,UAAU;YACxB,yDAA+B,CAAC,qBAAqB,C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Y,GAAoC,EAAE,CAAC;QACzD,MAAM,KAAK,GAA6B,EAAE,CAAC;QAC3C,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;YACxC,MAAM,OAAO,GAAG,IAAA,+BAAgB,EAAC,KAAK,EAAE;gBACvC,MAAM,EAAE,iCAAkB;gBAC1B,YAAY,EAAE,IAAI,CAAC,YAAY;aAC/B,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;YACtE,KAAK,CAAC,IAAI,CAAC;gBACV,EAAE,EAAE,OAAO;gBACX,KAAK,EAAE,OAAO;aACd,CAAC,CAAC;YACH,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACrF,CAAC;QAED,IAAA,iBAAM,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9D,IAAA,qBAAU,EACT,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,EAAE,EACxC,SAAS,EACT,IAAI,CAAC,MAAM,EACX,IAAA,iCAAsB,EAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;IACH,CAAC;CACD;AAjJD,4CAiJC","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"]}
1
+ {"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"m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C,CAAC;YACH,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACrF,CAAC;QAED,IAAA,iBAAM,EAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9D,IAAA,qBAAU,EACT,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAG,CAAC,YAAY,CAAC,EAAE,EACxC,SAAS,EACT,IAAI,CAAC,MAAM,EACX,IAAA,iCAAsB,EAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CACxE,CAAC;IACH,CAAC;CACD;AAjJD,4CAiJC","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 { TreeCompressionStrategy } 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\tTreeCompressionStrategy.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,7 @@
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
6
  import { schemaFormatV1 } from "../../core/index.js";
7
- import type { Brand } from "../../util/index.js";
7
+ import { type Brand } from "../../util/index.js";
8
8
  /**
9
9
  * The format version for the forest.
10
10
  */
@@ -13,7 +13,7 @@ export declare const ForestFormatVersion: {
13
13
  };
14
14
  export type ForestFormatVersion = Brand<(typeof ForestFormatVersion)[keyof typeof ForestFormatVersion], "ForestFormatVersion">;
15
15
  export declare const Format: import("@sinclair/typebox").TObject<{
16
- version: import("@sinclair/typebox").TLiteral<1>;
16
+ version: import("@sinclair/typebox").TLiteral<ForestFormatVersion>;
17
17
  keys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKey>>;
18
18
  fields: import("@sinclair/typebox").TObject<{
19
19
  version: import("@sinclair/typebox").TNumber;
@@ -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;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"}
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,EAAS,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAExD;;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;AAgBF,eAAO,MAAM,MAAM;;;;;;EAAoE,CAAC;AACxF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -8,15 +8,17 @@ exports.Format = exports.ForestFormatVersion = void 0;
8
8
  const typebox_1 = require("@sinclair/typebox");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../../core/index.js");
11
+ const index_js_3 = require("../../util/index.js");
11
12
  /**
12
13
  * The format version for the forest.
13
14
  */
14
15
  exports.ForestFormatVersion = {
15
16
  v1: 1,
16
17
  };
17
- exports.Format = typebox_1.Type.Object({
18
- version: typebox_1.Type.Literal(exports.ForestFormatVersion.v1),
18
+ const FormatGeneric = (version) => typebox_1.Type.Object({
19
+ version: typebox_1.Type.Literal(version),
19
20
  keys: typebox_1.Type.Array(index_js_2.schemaFormatV1.FieldKeySchema),
20
21
  fields: index_js_1.Versioned,
21
22
  }, { additionalProperties: false });
23
+ exports.Format = FormatGeneric((0, index_js_3.brand)(exports.ForestFormatVersion.v1));
22
24
  //# sourceMappingURL=format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAsD;AAEtD,mDAAiD;AACjD,kDAAqD;AAGrD;;GAEG;AACU,QAAA,mBAAmB,GAAG;IAClC,EAAE,EAAE,CAAC;CACI,CAAC;AAME,QAAA,MAAM,GAAG,cAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,2BAAmB,CAAC,EAAE,CAAC;IAC7C,IAAI,EAAE,cAAI,CAAC,KAAK,CAAC,yBAAc,CAAC,cAAc,CAAC;IAC/C,MAAM,EAAE,oBAAS;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"]}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/format.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAsD;AAEtD,mDAAiD;AACjD,kDAAqD;AACrD,kDAAwD;AAExD;;GAEG;AACU,QAAA,mBAAmB,GAAG;IAClC,EAAE,EAAE,CAAC;CACI,CAAC;AAMX,MAAM,aAAa,GAAG,CACrB,OAA4B,EAG3B,EAAE,CACH,cAAI,CAAC,MAAM,CACV;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC9B,IAAI,EAAE,cAAI,CAAC,KAAK,CAAC,yBAAc,CAAC,cAAc,CAAC;IAC/C,MAAM,EAAE,oBAAS;CACjB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEU,QAAA,MAAM,GAAG,aAAa,CAAC,IAAA,gBAAK,EAAsB,2BAAmB,CAAC,EAAE,CAAC,CAAC,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 { brand, 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\nconst FormatGeneric = (\n\tversion: ForestFormatVersion,\n\t// Return type is intentionally derived.\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n) =>\n\tType.Object(\n\t\t{\n\t\t\tversion: Type.Literal(version),\n\t\t\tkeys: Type.Array(schemaFormatV1.FieldKeySchema),\n\t\t\tfields: Versioned,\n\t\t},\n\t\t{ additionalProperties: false },\n\t);\n\nexport const Format = FormatGeneric(brand<ForestFormatVersion>(ForestFormatVersion.v1));\nexport type Format = Static<typeof Format>;\n"]}
@@ -12,13 +12,14 @@ export { stackTreeNodeCursor, type CursorAdapter, prefixPath, prefixFieldPath, t
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
- 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";
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, 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, 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, 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
- 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";
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, getCodecTreeForModularChangeFormat, type ModularChangeFormatVersion, } from "./default-schema/index.js";
20
+ export { SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./schemaChecker.js";
20
21
  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
- export { TreeCompressionStrategy, TreeCompressionStrategyExtended, type TreeCompressionStrategyPrivate, } from "./treeCompressionUtils.js";
22
+ export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
22
23
  export { valueSchemaAllows } from "./valueUtilities.js";
23
24
  export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js";
24
25
  export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, getCodecTreeForSchemaChangeFormat, } from "./schema-edits/index.js";
@@ -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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AAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,8BAA8B,GACnC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,iBAAiB,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"}
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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1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,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"}
@@ -27,8 +27,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
27
  return result;
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.getCodecTreeForFieldBatchFormat = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.mapRootChanges = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.FieldKindWithEditor = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.clientVersionToSchemaVersion = exports.getCodecTreeForSchemaFormat = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.getCodecTreeForForestFormat = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
- exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.getCodecTreeForSchemaChangeFormat = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategyExtended = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.getCodecTreeForModularChangeFormat = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = void 0;
30
+ exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.getCodecTreeForFieldBatchFormat = exports.FieldBatchFormatVersion = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkField = exports.chunkTree = exports.mapRootChanges = exports.isNeverTree = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.clientVersionToSchemaVersion = exports.getCodecTreeForSchemaFormat = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.getCodecTreeForForestFormat = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
+ exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.getCodecTreeForSchemaChangeFormat = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.withObservation = exports.currentObserver = exports.getOrCreateHydratedFlexTreeNode = exports.FlexTreeEntityKind = exports.indexForAt = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.throwOutOfSchema = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.getCodecTreeForModularChangeFormat = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.defaultIncrementalEncodingPolicy = exports.combineChunks = exports.emptyChunk = void 0;
32
32
  var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
33
33
  Object.defineProperty(exports, "toDownPath", { enumerable: true, get: function () { return editableTreeBinder_js_1.toDownPath; } });
34
34
  var valueUtilities_js_1 = require("./valueUtilities.js");
@@ -76,7 +76,6 @@ Object.defineProperty(exports, "CrossFieldTarget", { enumerable: true, get: func
76
76
  Object.defineProperty(exports, "FlexFieldKind", { enumerable: true, get: function () { return index_js_4.FlexFieldKind; } });
77
77
  Object.defineProperty(exports, "allowsRepoSuperset", { enumerable: true, get: function () { return index_js_4.allowsRepoSuperset; } });
78
78
  Object.defineProperty(exports, "genericFieldKind", { enumerable: true, get: function () { return index_js_4.genericFieldKind; } });
79
- Object.defineProperty(exports, "FieldKindWithEditor", { enumerable: true, get: function () { return index_js_4.FieldKindWithEditor; } });
80
79
  Object.defineProperty(exports, "ModularChangeFamily", { enumerable: true, get: function () { return index_js_4.ModularChangeFamily; } });
81
80
  Object.defineProperty(exports, "EncodedModularChangeset", { enumerable: true, get: function () { return index_js_4.EncodedModularChangeset; } });
82
81
  Object.defineProperty(exports, "updateRefreshers", { enumerable: true, get: function () { return index_js_4.updateRefreshers; } });
@@ -89,6 +88,7 @@ Object.defineProperty(exports, "chunkField", { enumerable: true, get: function (
89
88
  Object.defineProperty(exports, "chunkFieldSingle", { enumerable: true, get: function () { return index_js_5.chunkFieldSingle; } });
90
89
  Object.defineProperty(exports, "buildChunkedForest", { enumerable: true, get: function () { return index_js_5.buildChunkedForest; } });
91
90
  Object.defineProperty(exports, "defaultChunkPolicy", { enumerable: true, get: function () { return index_js_5.defaultChunkPolicy; } });
91
+ Object.defineProperty(exports, "FieldBatchFormatVersion", { enumerable: true, get: function () { return index_js_5.FieldBatchFormatVersion; } });
92
92
  Object.defineProperty(exports, "getCodecTreeForFieldBatchFormat", { enumerable: true, get: function () { return index_js_5.getCodecTreeForFieldBatchFormat; } });
93
93
  Object.defineProperty(exports, "makeTreeChunker", { enumerable: true, get: function () { return index_js_5.makeTreeChunker; } });
94
94
  Object.defineProperty(exports, "makeFieldBatchCodec", { enumerable: true, get: function () { return index_js_5.makeFieldBatchCodec; } });
@@ -110,11 +110,12 @@ Object.defineProperty(exports, "fieldKinds", { enumerable: true, get: function (
110
110
  Object.defineProperty(exports, "fieldKindConfigurations", { enumerable: true, get: function () { return index_js_7.fieldKindConfigurations; } });
111
111
  Object.defineProperty(exports, "intoDelta", { enumerable: true, get: function () { return index_js_7.intoDelta; } });
112
112
  Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get: function () { return index_js_7.relevantRemovedRoots; } });
113
- Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return index_js_7.SchemaValidationError; } });
114
- Object.defineProperty(exports, "isNodeInSchema", { enumerable: true, get: function () { return index_js_7.isNodeInSchema; } });
115
- Object.defineProperty(exports, "isFieldInSchema", { enumerable: true, get: function () { return index_js_7.isFieldInSchema; } });
116
- Object.defineProperty(exports, "throwOutOfSchema", { enumerable: true, get: function () { return index_js_7.throwOutOfSchema; } });
117
113
  Object.defineProperty(exports, "getCodecTreeForModularChangeFormat", { enumerable: true, get: function () { return index_js_7.getCodecTreeForModularChangeFormat; } });
114
+ var schemaChecker_js_1 = require("./schemaChecker.js");
115
+ Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return schemaChecker_js_1.SchemaValidationError; } });
116
+ Object.defineProperty(exports, "isNodeInSchema", { enumerable: true, get: function () { return schemaChecker_js_1.isNodeInSchema; } });
117
+ Object.defineProperty(exports, "isFieldInSchema", { enumerable: true, get: function () { return schemaChecker_js_1.isFieldInSchema; } });
118
+ Object.defineProperty(exports, "throwOutOfSchema", { enumerable: true, get: function () { return schemaChecker_js_1.throwOutOfSchema; } });
118
119
  var index_js_8 = require("./flex-tree/index.js");
119
120
  Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function () { return index_js_8.TreeStatus; } });
120
121
  Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return index_js_8.Context; } });
@@ -134,7 +135,6 @@ Object.defineProperty(exports, "currentObserver", { enumerable: true, get: funct
134
135
  Object.defineProperty(exports, "withObservation", { enumerable: true, get: function () { return index_js_8.withObservation; } });
135
136
  var treeCompressionUtils_js_1 = require("./treeCompressionUtils.js");
136
137
  Object.defineProperty(exports, "TreeCompressionStrategy", { enumerable: true, get: function () { return treeCompressionUtils_js_1.TreeCompressionStrategy; } });
137
- Object.defineProperty(exports, "TreeCompressionStrategyExtended", { enumerable: true, get: function () { return treeCompressionUtils_js_1.TreeCompressionStrategyExtended; } });
138
138
  var valueUtilities_js_2 = require("./valueUtilities.js");
139
139
  Object.defineProperty(exports, "valueSchemaAllows", { enumerable: true, get: function () { return valueUtilities_js_2.valueSchemaAllows; } });
140
140
  var detachedFieldIndexSummarizer_js_1 = require("./detachedFieldIndexSummarizer.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE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AAA,eAAe,OAAA;AAIhB,qEAImC;AAHlC,kIAAA,uBAAuB,OAAA;AACvB,0IAAA,+BAA+B,OAAA;AAIhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAKiC;AAHhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,6HAAA,iCAAiC,OAAA;AAGlC,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA","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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAGiC;AADhC,mHAAA,UAAU,OAAA;AAEX,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAErD,sDAImC;AAHlC,4GAAA,gBAAgB,OAAA;AAChB,uHAAA,2BAA2B,OAAA;AAG5B,uDAW4B;AAV3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEtB,0HAAA,sBAAsB,OAAA;AACtB,oHAAA,gBAAgB,OAAA;AAKjB,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAOiC;AANhC,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,uHAAA,2BAA2B,OAAA;AAC3B,wHAAA,4BAA4B,OAAA;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AAA,mBAAmB,OAAA;AACnB,8GAAA,kBAAkB,OAAA;AAKlB,+GAAA,mBAAmB,OAAA;AACnB,sGAAA,UAAU,OAAA;AACV,mHAAA,uBAAuB,OAAA;AACvB,qGAAA,SAAS,OAAA;AACT,gHAAA,oBAAoB,OAAA;AACpB,8HAAA,kCAAkC,OAAA;AAInC,uDAK4B;AAJ3B,yHAAA,qBAAqB,OAAA;AACrB,kHAAA,cAAc,OAAA;AACd,mHAAA,eAAe,OAAA;AACf,oHAAA,gBAAgB,OAAA;AAGjB,iDAiC8B;AAvB7B,sGAAA,UAAU,OAAA;AACV,mGAAA,OAAO,OAAA;AAGP,0GAAA,cAAc,OAAA;AACd,uGAAA,WAAW,OAAA;AACX,WAAW;AACX,0GAAA,cAAc,OAAA;AACd,wHAAA,4BAA4B,OAAA;AAC5B,wGAAA,YAAY,OAAA;AACZ,8GAAA,kBAAkB,OAAA;AAClB,sGAAA,UAAU,OAAA;AACV,qHAAA,yBAAyB,OAAA;AACzB,sGAAA,UAAU,OAAA;AACV,8GAAA,kBAAkB,OAAA;AAKlB,2HAAA,+BAA+B,OAAA;AAC/B,2GAAA,eAAe,OAAA;AACf,2GAAA,eAAe,OAAA;AAIhB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,oDAKiC;AAHhC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA;AACnB,6HAAA,iCAAiC,OAAA;AAGlC,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,iDAO6B;AAL5B,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA","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\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\tFieldBatchFormatVersion,\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\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.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 { TreeCompressionStrategy } 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CA0ET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAwBT"}
1
+ {"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAA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