@fluidframework/tree 2.51.0 → 2.53.0-350190

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 (730) hide show
  1. package/.vscode/settings.json +0 -1
  2. package/CHANGELOG.md +43 -0
  3. package/api-report/tree.alpha.api.md +40 -30
  4. package/dist/alpha.d.ts +2 -1
  5. package/dist/codec/codec.d.ts +2 -1
  6. package/dist/codec/codec.d.ts.map +1 -1
  7. package/dist/codec/codec.js +4 -3
  8. package/dist/codec/codec.js.map +1 -1
  9. package/dist/core/index.d.ts +1 -1
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/index.js +3 -2
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/core/rebase/index.d.ts +1 -1
  14. package/dist/core/rebase/index.d.ts.map +1 -1
  15. package/dist/core/rebase/index.js +2 -1
  16. package/dist/core/rebase/index.js.map +1 -1
  17. package/dist/core/rebase/types.d.ts +3 -1
  18. package/dist/core/rebase/types.d.ts.map +1 -1
  19. package/dist/core/rebase/types.js +2 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/schema-stored/schema.d.ts +1 -23
  22. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  23. package/dist/core/schema-stored/schema.js +2 -2
  24. package/dist/core/schema-stored/schema.js.map +1 -1
  25. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  26. package/dist/core/tree/detachedFieldIndex.js +2 -3
  27. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  28. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
  29. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
  30. package/dist/core/tree/detachedFieldIndexCodecCommon.js +68 -0
  31. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
  32. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
  33. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
  34. package/dist/core/tree/detachedFieldIndexCodecV1.js +55 -0
  35. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
  36. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
  37. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
  38. package/dist/core/tree/detachedFieldIndexCodecV2.js +49 -0
  39. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
  40. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
  41. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
  42. package/dist/core/tree/detachedFieldIndexCodecs.js +26 -0
  43. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -0
  44. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
  45. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
  46. package/dist/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +18 -13
  47. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
  48. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
  49. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
  50. package/dist/core/tree/detachedFieldIndexFormatV1.js +12 -0
  51. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
  52. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
  53. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
  54. package/dist/core/tree/detachedFieldIndexFormatV2.js +14 -0
  55. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
  56. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
  57. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  58. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +21 -21
  59. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
  61. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  62. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
  65. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +74 -61
  67. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
  69. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/format.js +18 -12
  71. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  72. package/{lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts → dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
  73. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
  74. package/dist/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +23 -17
  75. package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
  76. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
  77. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -22
  79. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  81. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  82. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
  83. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  84. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +15 -2
  85. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  86. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  87. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -2
  88. package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  90. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  91. package/dist/feature-libraries/default-schema/index.js +2 -2
  92. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  93. package/dist/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
  94. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  95. package/dist/feature-libraries/default-schema/schemaChecker.js +31 -26
  96. package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  97. package/dist/feature-libraries/index.d.ts +1 -2
  98. package/dist/feature-libraries/index.d.ts.map +1 -1
  99. package/dist/feature-libraries/index.js +2 -4
  100. package/dist/feature-libraries/index.js.map +1 -1
  101. package/dist/feature-libraries/modular-schema/comparison.d.ts +5 -6
  102. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  103. package/dist/feature-libraries/modular-schema/comparison.js +15 -16
  104. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  105. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
  106. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  107. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
  108. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  109. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  110. package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -0
  111. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  112. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
  113. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  114. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +49 -20
  115. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  116. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
  117. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  118. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  119. package/dist/feature-libraries/object-forest/objectForest.js +2 -3
  120. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  121. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  122. package/dist/feature-libraries/optional-field/optionalField.js +3 -0
  123. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  124. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
  125. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  126. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
  127. package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  128. package/dist/index.d.ts +1 -1
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +6 -2
  131. package/dist/index.js.map +1 -1
  132. package/dist/jsonDomainSchema.d.ts +5 -3
  133. package/dist/jsonDomainSchema.d.ts.map +1 -1
  134. package/dist/jsonDomainSchema.js.map +1 -1
  135. package/dist/packageVersion.d.ts +1 -1
  136. package/dist/packageVersion.d.ts.map +1 -1
  137. package/dist/packageVersion.js +1 -1
  138. package/dist/packageVersion.js.map +1 -1
  139. package/dist/shared-tree/independentView.d.ts +8 -0
  140. package/dist/shared-tree/independentView.d.ts.map +1 -1
  141. package/dist/shared-tree/independentView.js +23 -11
  142. package/dist/shared-tree/independentView.js.map +1 -1
  143. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  144. package/dist/shared-tree/schematizeTree.js +1 -1
  145. package/dist/shared-tree/schematizeTree.js.map +1 -1
  146. package/dist/shared-tree/schematizingTreeView.d.ts +0 -1
  147. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  148. package/dist/shared-tree/schematizingTreeView.js +9 -12
  149. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  150. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  151. package/dist/shared-tree/sharedTree.js +1 -29
  152. package/dist/shared-tree/sharedTree.js.map +1 -1
  153. package/dist/shared-tree/treeAlpha.d.ts +20 -6
  154. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  155. package/dist/shared-tree/treeAlpha.js +18 -7
  156. package/dist/shared-tree/treeAlpha.js.map +1 -1
  157. package/dist/shared-tree/treeCheckout.d.ts +2 -1
  158. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  159. package/dist/shared-tree/treeCheckout.js +32 -0
  160. package/dist/shared-tree/treeCheckout.js.map +1 -1
  161. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  162. package/dist/shared-tree-core/branch.js +1 -1
  163. package/dist/shared-tree-core/branch.js.map +1 -1
  164. package/dist/simple-tree/api/conciseTree.d.ts +2 -2
  165. package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
  166. package/dist/simple-tree/api/conciseTree.js +6 -6
  167. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  168. package/dist/simple-tree/api/configuration.d.ts +11 -2
  169. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  170. package/dist/simple-tree/api/configuration.js +5 -1
  171. package/dist/simple-tree/api/configuration.js.map +1 -1
  172. package/dist/simple-tree/api/create.d.ts +8 -7
  173. package/dist/simple-tree/api/create.d.ts.map +1 -1
  174. package/dist/simple-tree/api/create.js +33 -23
  175. package/dist/simple-tree/api/create.js.map +1 -1
  176. package/dist/simple-tree/api/customTree.d.ts +25 -4
  177. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  178. package/dist/simple-tree/api/customTree.js +42 -16
  179. package/dist/simple-tree/api/customTree.js.map +1 -1
  180. package/dist/simple-tree/api/discrepancies.d.ts +94 -0
  181. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -0
  182. package/dist/simple-tree/api/discrepancies.js +256 -0
  183. package/dist/simple-tree/api/discrepancies.js.map +1 -0
  184. package/dist/simple-tree/api/index.d.ts +3 -2
  185. package/dist/simple-tree/api/index.d.ts.map +1 -1
  186. package/dist/simple-tree/api/index.js +3 -2
  187. package/dist/simple-tree/api/index.js.map +1 -1
  188. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
  189. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  190. package/dist/simple-tree/api/schemaCompatibilityTester.js +17 -117
  191. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  192. package/dist/simple-tree/api/schemaFactory.d.ts +16 -159
  193. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  194. package/dist/simple-tree/api/schemaFactory.js +4 -47
  195. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  196. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
  197. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  198. package/dist/simple-tree/api/schemaFactoryAlpha.js +33 -11
  199. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  200. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
  201. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  202. package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -7
  203. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  204. package/dist/simple-tree/api/schemaStatics.d.ts +158 -0
  205. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -0
  206. package/dist/simple-tree/api/schemaStatics.js +59 -0
  207. package/dist/simple-tree/api/schemaStatics.js.map +1 -0
  208. package/dist/simple-tree/api/storedSchema.d.ts +5 -3
  209. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  210. package/dist/simple-tree/api/storedSchema.js +9 -3
  211. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  212. package/dist/simple-tree/api/treeBeta.d.ts +2 -2
  213. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  214. package/dist/simple-tree/api/treeBeta.js +16 -4
  215. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  216. package/dist/simple-tree/api/verboseTree.d.ts +2 -2
  217. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  218. package/dist/simple-tree/api/verboseTree.js +15 -15
  219. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  220. package/dist/simple-tree/core/allowedTypes.d.ts +43 -11
  221. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  222. package/dist/simple-tree/core/allowedTypes.js +51 -11
  223. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  224. package/dist/simple-tree/core/context.d.ts +13 -2
  225. package/dist/simple-tree/core/context.d.ts.map +1 -1
  226. package/dist/simple-tree/core/context.js +22 -9
  227. package/dist/simple-tree/core/context.js.map +1 -1
  228. package/dist/simple-tree/core/index.d.ts +6 -4
  229. package/dist/simple-tree/core/index.d.ts.map +1 -1
  230. package/dist/simple-tree/core/index.js +8 -1
  231. package/dist/simple-tree/core/index.js.map +1 -1
  232. package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
  233. package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
  234. package/dist/simple-tree/core/simpleNodeSchemaBase.js +7 -0
  235. package/dist/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
  236. package/dist/simple-tree/core/toStored.d.ts +32 -0
  237. package/dist/simple-tree/core/toStored.d.ts.map +1 -0
  238. package/dist/simple-tree/core/toStored.js +37 -0
  239. package/dist/simple-tree/core/toStored.js.map +1 -0
  240. package/dist/simple-tree/core/treeNodeKernel.d.ts +1 -1
  241. package/dist/simple-tree/core/treeNodeKernel.js +1 -1
  242. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  243. package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -2
  244. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  245. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  246. package/dist/simple-tree/core/treeNodeValid.d.ts +7 -2
  247. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  248. package/dist/simple-tree/core/treeNodeValid.js +19 -4
  249. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  250. package/dist/simple-tree/core/walkSchema.d.ts +22 -5
  251. package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
  252. package/dist/simple-tree/core/walkSchema.js +6 -2
  253. package/dist/simple-tree/core/walkSchema.js.map +1 -1
  254. package/dist/simple-tree/createContext.d.ts +2 -0
  255. package/dist/simple-tree/createContext.d.ts.map +1 -1
  256. package/dist/simple-tree/createContext.js +4 -2
  257. package/dist/simple-tree/createContext.js.map +1 -1
  258. package/dist/simple-tree/fieldSchema.d.ts +1 -0
  259. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  260. package/dist/simple-tree/fieldSchema.js +2 -1
  261. package/dist/simple-tree/fieldSchema.js.map +1 -1
  262. package/dist/simple-tree/index.d.ts +7 -7
  263. package/dist/simple-tree/index.d.ts.map +1 -1
  264. package/dist/simple-tree/index.js +13 -8
  265. package/dist/simple-tree/index.js.map +1 -1
  266. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  267. package/dist/simple-tree/leafNodeSchema.js +1 -0
  268. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  269. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  270. package/dist/simple-tree/node-kinds/array/arrayNode.js +18 -4
  271. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  272. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  273. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  274. package/dist/simple-tree/node-kinds/index.js +1 -2
  275. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  276. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  277. package/dist/simple-tree/node-kinds/map/mapNode.js +9 -2
  278. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  279. package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
  280. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  281. package/dist/simple-tree/node-kinds/object/index.js +1 -2
  282. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  283. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +3 -8
  284. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  285. package/dist/simple-tree/node-kinds/object/objectNode.js +41 -44
  286. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  287. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  288. package/dist/simple-tree/node-kinds/record/recordNode.js +9 -2
  289. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  290. package/dist/simple-tree/prepareForInsertion.d.ts +6 -6
  291. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  292. package/dist/simple-tree/prepareForInsertion.js +19 -13
  293. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  294. package/dist/simple-tree/simpleSchema.d.ts +6 -21
  295. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  296. package/dist/simple-tree/simpleSchema.js.map +1 -1
  297. package/dist/simple-tree/toStoredSchema.d.ts +38 -11
  298. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  299. package/dist/simple-tree/toStoredSchema.js +71 -33
  300. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  301. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  302. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  303. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  304. package/dist/simple-tree/walkFieldSchema.d.ts +1 -0
  305. package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
  306. package/dist/simple-tree/walkFieldSchema.js +1 -0
  307. package/dist/simple-tree/walkFieldSchema.js.map +1 -1
  308. package/lib/alpha.d.ts +2 -1
  309. package/lib/codec/codec.d.ts +2 -1
  310. package/lib/codec/codec.d.ts.map +1 -1
  311. package/lib/codec/codec.js +4 -3
  312. package/lib/codec/codec.js.map +1 -1
  313. package/lib/core/index.d.ts +1 -1
  314. package/lib/core/index.d.ts.map +1 -1
  315. package/lib/core/index.js +1 -1
  316. package/lib/core/index.js.map +1 -1
  317. package/lib/core/rebase/index.d.ts +1 -1
  318. package/lib/core/rebase/index.d.ts.map +1 -1
  319. package/lib/core/rebase/index.js +1 -1
  320. package/lib/core/rebase/index.js.map +1 -1
  321. package/lib/core/rebase/types.d.ts +3 -1
  322. package/lib/core/rebase/types.d.ts.map +1 -1
  323. package/lib/core/rebase/types.js +1 -0
  324. package/lib/core/rebase/types.js.map +1 -1
  325. package/lib/core/schema-stored/schema.d.ts +1 -23
  326. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  327. package/lib/core/schema-stored/schema.js +2 -2
  328. package/lib/core/schema-stored/schema.js.map +1 -1
  329. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  330. package/lib/core/tree/detachedFieldIndex.js +2 -3
  331. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  332. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
  333. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
  334. package/lib/core/tree/detachedFieldIndexCodecCommon.js +64 -0
  335. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
  336. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
  337. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
  338. package/lib/core/tree/detachedFieldIndexCodecV1.js +51 -0
  339. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
  340. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
  341. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
  342. package/lib/core/tree/detachedFieldIndexCodecV2.js +45 -0
  343. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
  344. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
  345. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
  346. package/lib/core/tree/detachedFieldIndexCodecs.js +21 -0
  347. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -0
  348. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
  349. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
  350. package/lib/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +13 -10
  351. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
  352. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
  353. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
  354. package/lib/core/tree/detachedFieldIndexFormatV1.js +9 -0
  355. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
  356. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
  357. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
  358. package/lib/core/tree/detachedFieldIndexFormatV2.js +11 -0
  359. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
  360. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
  361. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  362. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +19 -19
  363. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  364. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
  365. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  366. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
  367. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  368. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
  369. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  370. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +70 -57
  371. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  372. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
  373. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  374. package/lib/feature-libraries/chunked-forest/codec/format.js +17 -11
  375. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  376. package/{dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts → lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
  377. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
  378. package/lib/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +21 -15
  379. package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
  380. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
  381. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  382. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +19 -19
  383. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  384. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
  385. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  386. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
  387. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  388. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +15 -2
  389. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  390. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
  391. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -2
  392. package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
  393. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  394. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  395. package/lib/feature-libraries/default-schema/index.js +1 -1
  396. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  397. package/lib/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
  398. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
  399. package/lib/feature-libraries/default-schema/schemaChecker.js +29 -24
  400. package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
  401. package/lib/feature-libraries/index.d.ts +1 -2
  402. package/lib/feature-libraries/index.d.ts.map +1 -1
  403. package/lib/feature-libraries/index.js +1 -2
  404. package/lib/feature-libraries/index.js.map +1 -1
  405. package/lib/feature-libraries/modular-schema/comparison.d.ts +5 -6
  406. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  407. package/lib/feature-libraries/modular-schema/comparison.js +14 -14
  408. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  409. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
  410. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  411. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
  412. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  413. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  414. package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -0
  415. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  416. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
  417. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  418. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +50 -21
  419. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  420. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
  421. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  422. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  423. package/lib/feature-libraries/object-forest/objectForest.js +3 -4
  424. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  425. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  426. package/lib/feature-libraries/optional-field/optionalField.js +3 -0
  427. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  428. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
  429. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
  430. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
  431. package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
  432. package/lib/index.d.ts +1 -1
  433. package/lib/index.d.ts.map +1 -1
  434. package/lib/index.js +2 -2
  435. package/lib/index.js.map +1 -1
  436. package/lib/jsonDomainSchema.d.ts +5 -3
  437. package/lib/jsonDomainSchema.d.ts.map +1 -1
  438. package/lib/jsonDomainSchema.js.map +1 -1
  439. package/lib/packageVersion.d.ts +1 -1
  440. package/lib/packageVersion.d.ts.map +1 -1
  441. package/lib/packageVersion.js +1 -1
  442. package/lib/packageVersion.js.map +1 -1
  443. package/lib/shared-tree/independentView.d.ts +8 -0
  444. package/lib/shared-tree/independentView.d.ts.map +1 -1
  445. package/lib/shared-tree/independentView.js +21 -10
  446. package/lib/shared-tree/independentView.js.map +1 -1
  447. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  448. package/lib/shared-tree/schematizeTree.js +2 -2
  449. package/lib/shared-tree/schematizeTree.js.map +1 -1
  450. package/lib/shared-tree/schematizingTreeView.d.ts +0 -1
  451. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  452. package/lib/shared-tree/schematizingTreeView.js +10 -13
  453. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  454. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  455. package/lib/shared-tree/sharedTree.js +2 -30
  456. package/lib/shared-tree/sharedTree.js.map +1 -1
  457. package/lib/shared-tree/treeAlpha.d.ts +20 -6
  458. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  459. package/lib/shared-tree/treeAlpha.js +19 -8
  460. package/lib/shared-tree/treeAlpha.js.map +1 -1
  461. package/lib/shared-tree/treeCheckout.d.ts +2 -1
  462. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  463. package/lib/shared-tree/treeCheckout.js +33 -1
  464. package/lib/shared-tree/treeCheckout.js.map +1 -1
  465. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  466. package/lib/shared-tree-core/branch.js +1 -1
  467. package/lib/shared-tree-core/branch.js.map +1 -1
  468. package/lib/simple-tree/api/conciseTree.d.ts +2 -2
  469. package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
  470. package/lib/simple-tree/api/conciseTree.js +6 -6
  471. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  472. package/lib/simple-tree/api/configuration.d.ts +11 -2
  473. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  474. package/lib/simple-tree/api/configuration.js +6 -2
  475. package/lib/simple-tree/api/configuration.js.map +1 -1
  476. package/lib/simple-tree/api/create.d.ts +8 -7
  477. package/lib/simple-tree/api/create.d.ts.map +1 -1
  478. package/lib/simple-tree/api/create.js +35 -25
  479. package/lib/simple-tree/api/create.js.map +1 -1
  480. package/lib/simple-tree/api/customTree.d.ts +25 -4
  481. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  482. package/lib/simple-tree/api/customTree.js +43 -17
  483. package/lib/simple-tree/api/customTree.js.map +1 -1
  484. package/lib/simple-tree/api/discrepancies.d.ts +94 -0
  485. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -0
  486. package/lib/simple-tree/api/discrepancies.js +251 -0
  487. package/lib/simple-tree/api/discrepancies.js.map +1 -0
  488. package/lib/simple-tree/api/index.d.ts +3 -2
  489. package/lib/simple-tree/api/index.d.ts.map +1 -1
  490. package/lib/simple-tree/api/index.js +2 -1
  491. package/lib/simple-tree/api/index.js.map +1 -1
  492. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
  493. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  494. package/lib/simple-tree/api/schemaCompatibilityTester.js +19 -119
  495. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  496. package/lib/simple-tree/api/schemaFactory.d.ts +16 -159
  497. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  498. package/lib/simple-tree/api/schemaFactory.js +2 -45
  499. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  500. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
  501. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  502. package/lib/simple-tree/api/schemaFactoryAlpha.js +23 -1
  503. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  504. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
  505. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  506. package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -5
  507. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  508. package/lib/simple-tree/api/schemaStatics.d.ts +158 -0
  509. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -0
  510. package/lib/simple-tree/api/schemaStatics.js +56 -0
  511. package/lib/simple-tree/api/schemaStatics.js.map +1 -0
  512. package/lib/simple-tree/api/storedSchema.d.ts +5 -3
  513. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  514. package/lib/simple-tree/api/storedSchema.js +12 -6
  515. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  516. package/lib/simple-tree/api/treeBeta.d.ts +2 -2
  517. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  518. package/lib/simple-tree/api/treeBeta.js +14 -2
  519. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  520. package/lib/simple-tree/api/verboseTree.d.ts +2 -2
  521. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  522. package/lib/simple-tree/api/verboseTree.js +9 -9
  523. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  524. package/lib/simple-tree/core/allowedTypes.d.ts +43 -11
  525. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  526. package/lib/simple-tree/core/allowedTypes.js +52 -11
  527. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  528. package/lib/simple-tree/core/context.d.ts +13 -2
  529. package/lib/simple-tree/core/context.d.ts.map +1 -1
  530. package/lib/simple-tree/core/context.js +22 -9
  531. package/lib/simple-tree/core/context.js.map +1 -1
  532. package/lib/simple-tree/core/index.d.ts +6 -4
  533. package/lib/simple-tree/core/index.d.ts.map +1 -1
  534. package/lib/simple-tree/core/index.js +4 -3
  535. package/lib/simple-tree/core/index.js.map +1 -1
  536. package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
  537. package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
  538. package/lib/simple-tree/core/simpleNodeSchemaBase.js +6 -0
  539. package/lib/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
  540. package/lib/simple-tree/core/toStored.d.ts +32 -0
  541. package/lib/simple-tree/core/toStored.d.ts.map +1 -0
  542. package/lib/simple-tree/core/toStored.js +32 -0
  543. package/lib/simple-tree/core/toStored.js.map +1 -0
  544. package/lib/simple-tree/core/treeNodeKernel.d.ts +1 -1
  545. package/lib/simple-tree/core/treeNodeKernel.js +1 -1
  546. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  547. package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -2
  548. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  549. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  550. package/lib/simple-tree/core/treeNodeValid.d.ts +7 -2
  551. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  552. package/lib/simple-tree/core/treeNodeValid.js +17 -3
  553. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  554. package/lib/simple-tree/core/walkSchema.d.ts +22 -5
  555. package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
  556. package/lib/simple-tree/core/walkSchema.js +6 -2
  557. package/lib/simple-tree/core/walkSchema.js.map +1 -1
  558. package/lib/simple-tree/createContext.d.ts +2 -0
  559. package/lib/simple-tree/createContext.d.ts.map +1 -1
  560. package/lib/simple-tree/createContext.js +5 -3
  561. package/lib/simple-tree/createContext.js.map +1 -1
  562. package/lib/simple-tree/fieldSchema.d.ts +1 -0
  563. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  564. package/lib/simple-tree/fieldSchema.js +2 -1
  565. package/lib/simple-tree/fieldSchema.js.map +1 -1
  566. package/lib/simple-tree/index.d.ts +7 -7
  567. package/lib/simple-tree/index.d.ts.map +1 -1
  568. package/lib/simple-tree/index.js +5 -5
  569. package/lib/simple-tree/index.js.map +1 -1
  570. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  571. package/lib/simple-tree/leafNodeSchema.js +2 -1
  572. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  573. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  574. package/lib/simple-tree/node-kinds/array/arrayNode.js +21 -7
  575. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  576. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  577. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  578. package/lib/simple-tree/node-kinds/index.js +1 -1
  579. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  580. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  581. package/lib/simple-tree/node-kinds/map/mapNode.js +12 -5
  582. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  583. package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
  584. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  585. package/lib/simple-tree/node-kinds/object/index.js +1 -1
  586. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  587. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +3 -8
  588. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  589. package/lib/simple-tree/node-kinds/object/objectNode.js +19 -21
  590. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  591. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  592. package/lib/simple-tree/node-kinds/record/recordNode.js +12 -5
  593. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  594. package/lib/simple-tree/prepareForInsertion.d.ts +6 -6
  595. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  596. package/lib/simple-tree/prepareForInsertion.js +21 -15
  597. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  598. package/lib/simple-tree/simpleSchema.d.ts +6 -21
  599. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  600. package/lib/simple-tree/simpleSchema.js.map +1 -1
  601. package/lib/simple-tree/toStoredSchema.d.ts +38 -11
  602. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  603. package/lib/simple-tree/toStoredSchema.js +70 -34
  604. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  605. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
  606. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  607. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
  608. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  609. package/lib/simple-tree/walkFieldSchema.d.ts +1 -0
  610. package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
  611. package/lib/simple-tree/walkFieldSchema.js +1 -0
  612. package/lib/simple-tree/walkFieldSchema.js.map +1 -1
  613. package/package.json +23 -23
  614. package/src/codec/codec.ts +4 -3
  615. package/src/core/index.ts +2 -0
  616. package/src/core/rebase/index.ts +2 -0
  617. package/src/core/rebase/types.ts +4 -0
  618. package/src/core/schema-stored/schema.ts +2 -26
  619. package/src/core/tree/detachedFieldIndex.ts +4 -6
  620. package/src/core/tree/detachedFieldIndexCodecCommon.ts +87 -0
  621. package/src/core/tree/{detachedFieldIndexCodec.ts → detachedFieldIndexCodecV1.ts} +22 -68
  622. package/src/core/tree/detachedFieldIndexCodecV2.ts +72 -0
  623. package/src/core/tree/detachedFieldIndexCodecs.ts +44 -0
  624. package/src/core/tree/{detachedFieldIndexFormat.ts → detachedFieldIndexFormatCommon.ts} +32 -23
  625. package/src/core/tree/detachedFieldIndexFormatV1.ts +15 -0
  626. package/src/core/tree/detachedFieldIndexFormatV2.ts +17 -0
  627. package/src/feature-libraries/chunked-forest/codec/README.md +1 -1
  628. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +25 -25
  629. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +10 -6
  630. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +96 -73
  631. package/src/feature-libraries/chunked-forest/codec/format.ts +20 -14
  632. package/src/feature-libraries/chunked-forest/codec/{nodeShape.ts → nodeEncoder.ts} +23 -17
  633. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +34 -34
  634. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +5 -5
  635. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -0
  636. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -2
  637. package/src/feature-libraries/default-schema/index.ts +1 -1
  638. package/src/feature-libraries/default-schema/schemaChecker.ts +47 -30
  639. package/src/feature-libraries/index.ts +1 -3
  640. package/src/feature-libraries/modular-schema/comparison.ts +14 -29
  641. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +9 -0
  642. package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -0
  643. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +61 -19
  644. package/src/feature-libraries/object-forest/objectForest.ts +10 -6
  645. package/src/feature-libraries/optional-field/optionalField.ts +4 -0
  646. package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +4 -0
  647. package/src/index.ts +7 -1
  648. package/src/jsonDomainSchema.ts +4 -0
  649. package/src/packageVersion.ts +1 -1
  650. package/src/shared-tree/independentView.ts +45 -19
  651. package/src/shared-tree/schematizeTree.ts +2 -2
  652. package/src/shared-tree/schematizingTreeView.ts +24 -15
  653. package/src/shared-tree/sharedTree.ts +2 -42
  654. package/src/shared-tree/treeAlpha.ts +48 -22
  655. package/src/shared-tree/treeCheckout.ts +54 -10
  656. package/src/shared-tree-core/branch.ts +1 -6
  657. package/src/simple-tree/api/conciseTree.ts +9 -7
  658. package/src/simple-tree/api/configuration.ts +18 -4
  659. package/src/simple-tree/api/create.ts +44 -36
  660. package/src/simple-tree/api/customTree.ts +59 -20
  661. package/src/simple-tree/api/discrepancies.ts +474 -0
  662. package/src/simple-tree/api/index.ts +2 -3
  663. package/src/simple-tree/api/schemaCompatibilityTester.ts +23 -151
  664. package/src/simple-tree/api/schemaFactory.ts +13 -254
  665. package/src/simple-tree/api/schemaFactoryAlpha.ts +174 -1
  666. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -25
  667. package/src/simple-tree/api/schemaStatics.ts +291 -0
  668. package/src/simple-tree/api/storedSchema.ts +18 -14
  669. package/src/simple-tree/api/treeBeta.ts +24 -4
  670. package/src/simple-tree/api/verboseTree.ts +17 -8
  671. package/src/simple-tree/core/allowedTypes.ts +87 -34
  672. package/src/simple-tree/core/context.ts +24 -22
  673. package/src/simple-tree/core/index.ts +11 -2
  674. package/src/simple-tree/core/simpleNodeSchemaBase.ts +30 -0
  675. package/src/simple-tree/core/toStored.ts +58 -0
  676. package/src/simple-tree/core/treeNodeKernel.ts +1 -1
  677. package/src/simple-tree/core/treeNodeSchema.ts +8 -2
  678. package/src/simple-tree/core/treeNodeValid.ts +23 -4
  679. package/src/simple-tree/core/walkSchema.ts +26 -6
  680. package/src/simple-tree/createContext.ts +11 -3
  681. package/src/simple-tree/fieldSchema.ts +3 -1
  682. package/src/simple-tree/index.ts +19 -13
  683. package/src/simple-tree/leafNodeSchema.ts +2 -1
  684. package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -23
  685. package/src/simple-tree/node-kinds/index.ts +0 -1
  686. package/src/simple-tree/node-kinds/map/mapNode.ts +23 -2
  687. package/src/simple-tree/node-kinds/object/index.ts +0 -1
  688. package/src/simple-tree/node-kinds/object/objectNode.ts +42 -30
  689. package/src/simple-tree/node-kinds/record/recordNode.ts +20 -2
  690. package/src/simple-tree/prepareForInsertion.ts +28 -15
  691. package/src/simple-tree/simpleSchema.ts +6 -26
  692. package/src/simple-tree/toStoredSchema.ts +110 -44
  693. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +6 -2
  694. package/src/simple-tree/walkFieldSchema.ts +1 -0
  695. package/dist/core/tree/detachedFieldIndexCodec.d.ts +0 -11
  696. package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
  697. package/dist/core/tree/detachedFieldIndexCodec.js +0 -100
  698. package/dist/core/tree/detachedFieldIndexCodec.js.map +0 -1
  699. package/dist/core/tree/detachedFieldIndexFormat.d.ts +0 -33
  700. package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
  701. package/dist/core/tree/detachedFieldIndexFormat.js.map +0 -1
  702. package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
  703. package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
  704. package/dist/feature-libraries/initializeForest.d.ts +0 -18
  705. package/dist/feature-libraries/initializeForest.d.ts.map +0 -1
  706. package/dist/feature-libraries/initializeForest.js +0 -35
  707. package/dist/feature-libraries/initializeForest.js.map +0 -1
  708. package/dist/simple-tree/discrepancies.d.ts +0 -167
  709. package/dist/simple-tree/discrepancies.d.ts.map +0 -1
  710. package/dist/simple-tree/discrepancies.js +0 -382
  711. package/dist/simple-tree/discrepancies.js.map +0 -1
  712. package/lib/core/tree/detachedFieldIndexCodec.d.ts +0 -11
  713. package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
  714. package/lib/core/tree/detachedFieldIndexCodec.js +0 -96
  715. package/lib/core/tree/detachedFieldIndexCodec.js.map +0 -1
  716. package/lib/core/tree/detachedFieldIndexFormat.d.ts +0 -33
  717. package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
  718. package/lib/core/tree/detachedFieldIndexFormat.js.map +0 -1
  719. package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
  720. package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
  721. package/lib/feature-libraries/initializeForest.d.ts +0 -18
  722. package/lib/feature-libraries/initializeForest.d.ts.map +0 -1
  723. package/lib/feature-libraries/initializeForest.js +0 -31
  724. package/lib/feature-libraries/initializeForest.js.map +0 -1
  725. package/lib/simple-tree/discrepancies.d.ts +0 -167
  726. package/lib/simple-tree/discrepancies.d.ts.map +0 -1
  727. package/lib/simple-tree/discrepancies.js +0 -376
  728. package/lib/simple-tree/discrepancies.js.map +0 -1
  729. package/src/feature-libraries/initializeForest.ts +0 -55
  730. package/src/simple-tree/discrepancies.ts +0 -648
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.compliesWithMultiplicity = exports.isFieldInSchema = exports.isNodeInSchema = exports.inSchemaOrThrow = exports.SchemaValidationError = void 0;
7
+ exports.compliesWithMultiplicity = exports.isFieldInSchema = exports.isNodeInSchema = exports.throwOutOfSchema = exports.SchemaValidationError = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const index_js_1 = require("../../core/index.js");
@@ -24,58 +24,59 @@ var SchemaValidationError;
24
24
  SchemaValidationError[SchemaValidationError["Node_MissingSchema"] = 9] = "Node_MissingSchema";
25
25
  })(SchemaValidationError || (exports.SchemaValidationError = SchemaValidationError = {}));
26
26
  /**
27
- * Throws a UsageError if maybeError indicates a tree is out of schema.
27
+ * Throws a UsageError indicating a tree is out of schema.
28
28
  */
29
- function inSchemaOrThrow(maybeError) {
30
- if (maybeError !== undefined) {
31
- throw new internal_2.UsageError(`Tree does not conform to schema: ${SchemaValidationError[maybeError]}`);
32
- }
29
+ function throwOutOfSchema(maybeError) {
30
+ throw new internal_2.UsageError(`Tree does not conform to schema: ${SchemaValidationError[maybeError]}`);
33
31
  }
34
- exports.inSchemaOrThrow = inSchemaOrThrow;
32
+ exports.throwOutOfSchema = throwOutOfSchema;
35
33
  /**
36
34
  * Deeply checks that the provided node complies with the schema based on its identifier.
35
+ *
36
+ * @param onError - Called with the first error (if any).
37
+ *
38
+ * @returns the return value from `onError` if the node or anything inside of it is out of schema, otherwise `undefined`.
37
39
  */
38
- function isNodeInSchema(node, schemaAndPolicy) {
40
+ function isNodeInSchema(node, schemaAndPolicy, onError) {
39
41
  // Validate the schema declared by the node exists
40
42
  const schema = schemaAndPolicy.schema.nodeSchema.get(node.type);
41
43
  if (schema === undefined) {
42
- return SchemaValidationError.Node_MissingSchema;
44
+ return onError(SchemaValidationError.Node_MissingSchema);
43
45
  }
44
46
  // Validate the node is well formed according to its schema
45
47
  if (schema instanceof index_js_1.LeafNodeStoredSchema) {
46
48
  if ((0, index_js_2.iterableHasSome)(node.fields)) {
47
- return SchemaValidationError.LeafNode_FieldsNotAllowed;
49
+ return onError(SchemaValidationError.LeafNode_FieldsNotAllowed);
48
50
  }
49
51
  if (!(0, valueUtilities_js_1.allowsValue)(schema.leafValue, node.value)) {
50
- return SchemaValidationError.LeafNode_InvalidValue;
52
+ return onError(SchemaValidationError.LeafNode_InvalidValue);
51
53
  }
52
54
  }
53
55
  else {
54
56
  if (node.value !== undefined) {
55
- return SchemaValidationError.NonLeafNode_ValueNotAllowed;
57
+ return onError(SchemaValidationError.NonLeafNode_ValueNotAllowed);
56
58
  }
57
59
  if (schema instanceof index_js_1.ObjectNodeStoredSchema) {
58
60
  const uncheckedFieldsFromNode = new Set((0, index_js_2.mapIterable)(node.fields, ([key, field]) => key));
59
61
  for (const [fieldKey, fieldSchema] of schema.objectNodeFields) {
60
62
  const nodeField = node.fields.get(fieldKey) ?? [];
61
- const fieldInSchemaResult = isFieldInSchema(nodeField, fieldSchema, schemaAndPolicy);
63
+ const fieldInSchemaResult = isFieldInSchema(nodeField, fieldSchema, schemaAndPolicy, onError);
62
64
  if (fieldInSchemaResult !== undefined) {
63
65
  return fieldInSchemaResult;
64
66
  }
65
67
  uncheckedFieldsFromNode.delete(fieldKey);
66
68
  }
67
- // The node has fields that we did not check as part of looking at every field defined in the node's schema
68
- if (uncheckedFieldsFromNode.size !== 0 &&
69
- // TODO: AB#43547: This check is wrong. If a given view schema allows an unknown optional field, that does NOT mean the stored schema should allow unknown:
70
- // In-fact, any data the view schema does not know about must still comply with the stored schema:
71
- // if this were not the case schema evolution could not add any fields since they might already have out of schema data.
72
- !schemaAndPolicy.policy.allowUnknownOptionalFields(node.type)) {
73
- return SchemaValidationError.ObjectNode_FieldNotInSchema;
69
+ // The node has fields that we did not check as part of looking at every field defined in the node's schema.
70
+ // Since this is testing compatibility with a stored schema (not view schema), "allowUnknownOptionalFields" does not exist at this layer.
71
+ // Code using this with a stored schema derived from a view schema rather than the document can be problematic because it may be missing unknown fields that the actual document has.
72
+ // Other schema evolution features like "staged" allowed types will likely cause similar issues elsewhere in this checker.
73
+ if (uncheckedFieldsFromNode.size !== 0) {
74
+ return onError(SchemaValidationError.ObjectNode_FieldNotInSchema);
74
75
  }
75
76
  }
76
77
  else if (schema instanceof index_js_1.MapNodeStoredSchema) {
77
78
  for (const [_key, field] of node.fields) {
78
- const fieldInSchemaResult = isFieldInSchema(field, schema.mapFields, schemaAndPolicy);
79
+ const fieldInSchemaResult = isFieldInSchema(field, schema.mapFields, schemaAndPolicy, onError);
79
80
  if (fieldInSchemaResult !== undefined) {
80
81
  return fieldInSchemaResult;
81
82
  }
@@ -90,27 +91,31 @@ function isNodeInSchema(node, schemaAndPolicy) {
90
91
  exports.isNodeInSchema = isNodeInSchema;
91
92
  /**
92
93
  * Deeply checks that the nodes comply with the field schema and included schema.
94
+ *
95
+ * @param onError - Called with the first error (if any).
96
+ *
97
+ * @returns the return value from `onError` if the field or anything inside of it is out of schema, otherwise `undefined`.
93
98
  */
94
- function isFieldInSchema(childNodes, schema, schemaAndPolicy) {
99
+ function isFieldInSchema(childNodes, schema, schemaAndPolicy, onError) {
95
100
  // Validate that the field kind is handled by the schema policy
96
101
  const kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);
97
102
  if (kind === undefined) {
98
- return SchemaValidationError.Field_KindNotInSchemaPolicy;
103
+ return onError(SchemaValidationError.Field_KindNotInSchemaPolicy);
99
104
  }
100
105
  // Validate that the field doesn't contain more nodes than its type supports
101
106
  {
102
107
  const multiplicityCheck = compliesWithMultiplicity(childNodes.length, kind.multiplicity);
103
108
  if (multiplicityCheck !== undefined) {
104
- return multiplicityCheck;
109
+ return onError(multiplicityCheck);
105
110
  }
106
111
  }
107
112
  for (const node of childNodes) {
108
113
  // Validate the type declared by the node is allowed in this field
109
114
  if (schema.types !== undefined && !schema.types.has(node.type)) {
110
- return SchemaValidationError.Field_NodeTypeNotAllowed;
115
+ return onError(SchemaValidationError.Field_NodeTypeNotAllowed);
111
116
  }
112
117
  // Validate the node complies with the type it declares to be.
113
- const nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy);
118
+ const nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy, onError);
114
119
  if (nodeInSchemaResult !== undefined) {
115
120
  return nodeInSchemaResult;
116
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChecker.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/schemaChecker.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4E;AAC5E,uEAAsE;AAEtE,kDAO6B;AAC7B,4DAAmD;AAEnD,kDAAmE;AAEnE,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC,+GAA2B,CAAA;IAC3B,6GAA0B,CAAA;IAC1B,yHAAgC,CAAA;IAChC,+GAA2B,CAAA;IAC3B,yGAAwB,CAAA;IACxB,mGAAqB,CAAA;IACrB,2GAAyB,CAAA;IACzB,+GAA2B,CAAA;IAC3B,+GAA2B,CAAA;IAC3B,6FAAkB,CAAA;AACnB,CAAC,EAXW,qBAAqB,qCAArB,qBAAqB,QAWhC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,UAA6C;IAC5E,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,qBAAU,CACnB,oCAAoC,qBAAqB,CAAC,UAAU,CAAC,EAAE,CACvE,CAAC;IACH,CAAC;AACF,CAAC;AAND,0CAMC;AAED;;GAEG;AACH,SAAgB,cAAc,CAC7B,IAA4B,EAC5B,eAAgC;IAEhC,kDAAkD;IAClD,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,qBAAqB,CAAC,kBAAkB,CAAC;IACjD,CAAC;IAED,2DAA2D;IAE3D,IAAI,MAAM,YAAY,+BAAoB,EAAE,CAAC;QAC5C,IAAI,IAAA,0BAAe,EAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,OAAO,qBAAqB,CAAC,yBAAyB,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,IAAA,+BAAW,EAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,K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C;QAC3B,CAAC;IACF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAjCD,0CAiCC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CACvC,aAAqB,EACrB,YAA0B;IAE1B,QAAQ,YAAY,EAAE,CAAC;QACtB,KAAK,uBAAY,CAAC,MAAM;YACvB,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBACvB,OAAO,qBAAqB,CAAC,0BAA0B,CAAC;YACzD,CAAC;iBAAM,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,qBAAqB,CAAC,gCAAgC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,aAAa,GAAG,CAAC;gBACvB,CAAC,CAAC,qBAAqB,CAAC,gCAAgC;gBACxD,CAAC,CAAC,SAAS,CAAC;QACd,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,SAAS,CAAC;QAClB,KAAK,uBAAY,CAAC,SAAS;YAC1B,OAAO,aAAa,KAAK,CAAC;gBACzB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,qBAAqB,CAAC,2BAA2B,CAAC;QACtD;YACC,IAAA,0BAAe,EAAC,YAAY,CAAC,CAAC;IAChC,CAAC;AACF,CAAC;AA1BD,4DA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype TreeFieldStoredSchema,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\nimport { allowsValue } from \"../valueUtilities.js\";\nimport type { MapTreeFieldViewGeneric, MinimalMapTreeNodeView } from \"../mapTreeCursor.js\";\nimport { iterableHasSome, mapIterable } from \"../../util/index.js\";\n\nexport enum SchemaValidationError {\n\tField_KindNotInSchemaPolicy,\n\tField_MissingRequiredChild,\n\tField_MultipleChildrenNotAllowed,\n\tField_ChildInForbiddenField,\n\tField_NodeTypeNotAllowed,\n\tLeafNode_InvalidValue,\n\tLeafNode_FieldsNotAllowed,\n\tObjectNode_FieldNotInSchema,\n\tNonLeafNode_ValueNotAllowed,\n\tNode_MissingSchema,\n}\n\n/**\n * Throws a UsageError if maybeError indicates a tree is out of schema.\n */\nexport function inSchemaOrThrow(maybeError: SchemaValidationError | undefined): void {\n\tif (maybeError !== undefined) {\n\t\tthrow new UsageError(\n\t\t\t`Tree does not conform to schema: ${SchemaValidationError[maybeError]}`,\n\t\t);\n\t}\n}\n\n/**\n * Deeply checks that the provided node complies with the schema based on its identifier.\n */\nexport function isNodeInSchema(\n\tnode: MinimalMapTreeNodeView,\n\tschemaAndPolicy: SchemaAndPolicy,\n): SchemaValidationError | undefined {\n\t// Validate the schema declared by the node exists\n\tconst schema = schemaAndPolicy.schema.nodeSchema.get(node.type);\n\tif (schema === undefined) {\n\t\treturn SchemaValidationError.Node_MissingSchema;\n\t}\n\n\t// Validate the node is well formed according to its schema\n\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tif (iterableHasSome(node.fields)) {\n\t\t\treturn SchemaValidationError.LeafNode_FieldsNotAllowed;\n\t\t}\n\t\tif (!allowsValue(schema.leafValue, node.value)) {\n\t\t\treturn SchemaValidationError.LeafNode_InvalidValue;\n\t\t}\n\t} else {\n\t\tif (node.value !== undefined) {\n\t\t\treturn SchemaValidationError.NonLeafNode_ValueNotAllowed;\n\t\t}\n\n\t\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t\tconst uncheckedFieldsFromNode = new Set(mapIterable(node.fields, ([key, field]) => key));\n\t\t\tfor (const [fieldKey, fieldSchema] of schema.objectNodeFields) {\n\t\t\t\tconst nodeField = node.fields.get(fieldKey) ?? [];\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(nodeField, fieldSchema, schemaAndPolicy);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t\tuncheckedFieldsFromNode.delete(fieldKey);\n\t\t\t}\n\t\t\t// The node has fields that we did not check as part of looking at every field defined in the node's schema\n\t\t\tif (\n\t\t\t\tuncheckedFieldsFromNode.size !== 0 &&\n\t\t\t\t// TODO: AB#43547: This check is wrong. If a given view schema allows an unknown optional field, that does NOT mean the stored schema should allow unknown:\n\t\t\t\t// In-fact, any data the view schema does not know about must still comply with the stored schema:\n\t\t\t\t// if this were not the case schema evolution could not add any fields since they might already have out of schema data.\n\t\t\t\t!schemaAndPolicy.policy.allowUnknownOptionalFields(node.type)\n\t\t\t) {\n\t\t\t\treturn SchemaValidationError.ObjectNode_FieldNotInSchema;\n\t\t\t}\n\t\t} else if (schema instanceof MapNodeStoredSchema) {\n\t\t\tfor (const [_key, field] of node.fields) {\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(field, schema.mapFields, schemaAndPolicy);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfail(0xb0e /* Unknown TreeNodeStoredSchema type */);\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Deeply checks that the nodes comply with the field schema and included schema.\n */\nexport function isFieldInSchema(\n\tchildNodes: MapTreeFieldViewGeneric<MinimalMapTreeNodeView>,\n\tschema: TreeFieldStoredSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n): SchemaValidationError | undefined {\n\t// Validate that the field kind is handled by the schema policy\n\tconst kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);\n\tif (kind === undefined) {\n\t\treturn SchemaValidationError.Field_KindNotInSchemaPolicy;\n\t}\n\n\t// Validate that the field doesn't contain more nodes than its type supports\n\t{\n\t\tconst multiplicityCheck = compliesWithMultiplicity(childNodes.length, kind.multiplicity);\n\t\tif (multiplicityCheck !== undefined) {\n\t\t\treturn multiplicityCheck;\n\t\t}\n\t}\n\n\tfor (const node of childNodes) {\n\t\t// Validate the type declared by the node is allowed in this field\n\t\tif (schema.types !== undefined && !schema.types.has(node.type)) {\n\t\t\treturn SchemaValidationError.Field_NodeTypeNotAllowed;\n\t\t}\n\n\t\t// Validate the node complies with the type it declares to be.\n\t\tconst nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy);\n\t\tif (nodeInSchemaResult !== undefined) {\n\t\t\treturn nodeInSchemaResult;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validates that a given number of items complies with the specified {@link Multiplicity | multiplicity}.\n * @param numberOfItems - Number of items.\n * @param multiplicity - Kind of multiplicity to validate against.\n * @returns `true` if the specified number of items complies with the specified multiplicity; otherwise, `false`.\n */\nexport function compliesWithMultiplicity(\n\tnumberOfItems: number,\n\tmultiplicity: Multiplicity,\n): SchemaValidationError | undefined {\n\tswitch (multiplicity) {\n\t\tcase Multiplicity.Single:\n\t\t\tif (numberOfItems < 1) {\n\t\t\t\treturn SchemaValidationError.Field_MissingRequiredChild;\n\t\t\t} else if (numberOfItems > 1) {\n\t\t\t\treturn SchemaValidationError.Field_MultipleChildrenNotAllowed;\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\tcase Multiplicity.Optional:\n\t\t\treturn numberOfItems > 1\n\t\t\t\t? SchemaValidationError.Field_MultipleChildrenNotAllowed\n\t\t\t\t: undefined;\n\t\tcase Multiplicity.Sequence:\n\t\t\treturn undefined;\n\t\tcase Multiplicity.Forbidden:\n\t\t\treturn numberOfItems === 0\n\t\t\t\t? undefined\n\t\t\t\t: SchemaValidationError.Field_ChildInForbiddenField;\n\t\tdefault:\n\t\t\tunreachableCase(multiplicity);\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaChecker.js","sourceRoot":"","sources":["../../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AO,kBAAkB,CAAC;QAC3B,CAAC;IACF,CAAC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC;AAlCD,0CAkCC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CACvC,aAAqB,EACrB,YAA0B;IAE1B,QAAQ,YAAY,EAAE,CAAC;QACtB,KAAK,uBAAY,CAAC,MAAM;YACvB,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBACvB,OAAO,qBAAqB,CAAC,0BAA0B,CAAC;YACzD,CAAC;iBAAM,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,qBAAqB,CAAC,gCAAgC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,aAAa,GAAG,CAAC;gBACvB,CAAC,CAAC,qBAAqB,CAAC,gCAAgC;gBACxD,CAAC,CAAC,SAAS,CAAC;QACd,KAAK,uBAAY,CAAC,QAAQ;YACzB,OAAO,SAAS,CAAC;QAClB,KAAK,uBAAY,CAAC,SAAS;YAC1B,OAAO,aAAa,KAAK,CAAC;gBACzB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,qBAAqB,CAAC,2BAA2B,CAAC;QACtD;YACC,IAAA,0BAAe,EAAC,YAAY,CAAC,CAAC;IAChC,CAAC;AACF,CAAC;AA1BD,4DA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype TreeFieldStoredSchema,\n\tLeafNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\nimport { allowsValue } from \"../valueUtilities.js\";\nimport type { MapTreeFieldViewGeneric, MinimalMapTreeNodeView } from \"../mapTreeCursor.js\";\nimport { iterableHasSome, mapIterable } from \"../../util/index.js\";\n\nexport enum SchemaValidationError {\n\tField_KindNotInSchemaPolicy,\n\tField_MissingRequiredChild,\n\tField_MultipleChildrenNotAllowed,\n\tField_ChildInForbiddenField,\n\tField_NodeTypeNotAllowed,\n\tLeafNode_InvalidValue,\n\tLeafNode_FieldsNotAllowed,\n\tObjectNode_FieldNotInSchema,\n\tNonLeafNode_ValueNotAllowed,\n\tNode_MissingSchema,\n}\n\n/**\n * Throws a UsageError indicating a tree is out of schema.\n */\nexport function throwOutOfSchema(maybeError: SchemaValidationError): never {\n\tthrow new UsageError(\n\t\t`Tree does not conform to schema: ${SchemaValidationError[maybeError]}`,\n\t);\n}\n\ntype NotUndefined = number | string | boolean | bigint | symbol | object;\n\n/**\n * Deeply checks that the provided node complies with the schema based on its identifier.\n *\n * @param onError - Called with the first error (if any).\n *\n * @returns the return value from `onError` if the node or anything inside of it is out of schema, otherwise `undefined`.\n */\nexport function isNodeInSchema<T extends NotUndefined>(\n\tnode: MinimalMapTreeNodeView,\n\tschemaAndPolicy: SchemaAndPolicy,\n\tonError: (error: SchemaValidationError) => T,\n): T | undefined {\n\t// Validate the schema declared by the node exists\n\tconst schema = schemaAndPolicy.schema.nodeSchema.get(node.type);\n\tif (schema === undefined) {\n\t\treturn onError(SchemaValidationError.Node_MissingSchema);\n\t}\n\n\t// Validate the node is well formed according to its schema\n\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tif (iterableHasSome(node.fields)) {\n\t\t\treturn onError(SchemaValidationError.LeafNode_FieldsNotAllowed);\n\t\t}\n\t\tif (!allowsValue(schema.leafValue, node.value)) {\n\t\t\treturn onError(SchemaValidationError.LeafNode_InvalidValue);\n\t\t}\n\t} else {\n\t\tif (node.value !== undefined) {\n\t\t\treturn onError(SchemaValidationError.NonLeafNode_ValueNotAllowed);\n\t\t}\n\n\t\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t\tconst uncheckedFieldsFromNode = new Set(mapIterable(node.fields, ([key, field]) => key));\n\t\t\tfor (const [fieldKey, fieldSchema] of schema.objectNodeFields) {\n\t\t\t\tconst nodeField = node.fields.get(fieldKey) ?? [];\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(\n\t\t\t\t\tnodeField,\n\t\t\t\t\tfieldSchema,\n\t\t\t\t\tschemaAndPolicy,\n\t\t\t\t\tonError,\n\t\t\t\t);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t\tuncheckedFieldsFromNode.delete(fieldKey);\n\t\t\t}\n\t\t\t// The node has fields that we did not check as part of looking at every field defined in the node's schema.\n\t\t\t// Since this is testing compatibility with a stored schema (not view schema), \"allowUnknownOptionalFields\" does not exist at this layer.\n\t\t\t// Code using this with a stored schema derived from a view schema rather than the document can be problematic because it may be missing unknown fields that the actual document has.\n\t\t\t// Other schema evolution features like \"staged\" allowed types will likely cause similar issues elsewhere in this checker.\n\t\t\tif (uncheckedFieldsFromNode.size !== 0) {\n\t\t\t\treturn onError(SchemaValidationError.ObjectNode_FieldNotInSchema);\n\t\t\t}\n\t\t} else if (schema instanceof MapNodeStoredSchema) {\n\t\t\tfor (const [_key, field] of node.fields) {\n\t\t\t\tconst fieldInSchemaResult = isFieldInSchema(\n\t\t\t\t\tfield,\n\t\t\t\t\tschema.mapFields,\n\t\t\t\t\tschemaAndPolicy,\n\t\t\t\t\tonError,\n\t\t\t\t);\n\t\t\t\tif (fieldInSchemaResult !== undefined) {\n\t\t\t\t\treturn fieldInSchemaResult;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfail(0xb0e /* Unknown TreeNodeStoredSchema type */);\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Deeply checks that the nodes comply with the field schema and included schema.\n *\n * @param onError - Called with the first error (if any).\n *\n * @returns the return value from `onError` if the field or anything inside of it is out of schema, otherwise `undefined`.\n */\nexport function isFieldInSchema<T extends NotUndefined>(\n\tchildNodes: MapTreeFieldViewGeneric<MinimalMapTreeNodeView>,\n\tschema: TreeFieldStoredSchema,\n\tschemaAndPolicy: SchemaAndPolicy,\n\tonError: (error: SchemaValidationError) => T,\n): T | undefined {\n\t// Validate that the field kind is handled by the schema policy\n\tconst kind = schemaAndPolicy.policy.fieldKinds.get(schema.kind);\n\tif (kind === undefined) {\n\t\treturn onError(SchemaValidationError.Field_KindNotInSchemaPolicy);\n\t}\n\n\t// Validate that the field doesn't contain more nodes than its type supports\n\t{\n\t\tconst multiplicityCheck = compliesWithMultiplicity(childNodes.length, kind.multiplicity);\n\t\tif (multiplicityCheck !== undefined) {\n\t\t\treturn onError(multiplicityCheck);\n\t\t}\n\t}\n\n\tfor (const node of childNodes) {\n\t\t// Validate the type declared by the node is allowed in this field\n\t\tif (schema.types !== undefined && !schema.types.has(node.type)) {\n\t\t\treturn onError(SchemaValidationError.Field_NodeTypeNotAllowed);\n\t\t}\n\n\t\t// Validate the node complies with the type it declares to be.\n\t\tconst nodeInSchemaResult = isNodeInSchema(node, schemaAndPolicy, onError);\n\t\tif (nodeInSchemaResult !== undefined) {\n\t\t\treturn nodeInSchemaResult;\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Validates that a given number of items complies with the specified {@link Multiplicity | multiplicity}.\n * @param numberOfItems - Number of items.\n * @param multiplicity - Kind of multiplicity to validate against.\n * @returns `true` if the specified number of items complies with the specified multiplicity; otherwise, `false`.\n */\nexport function compliesWithMultiplicity(\n\tnumberOfItems: number,\n\tmultiplicity: Multiplicity,\n): SchemaValidationError | undefined {\n\tswitch (multiplicity) {\n\t\tcase Multiplicity.Single:\n\t\t\tif (numberOfItems < 1) {\n\t\t\t\treturn SchemaValidationError.Field_MissingRequiredChild;\n\t\t\t} else if (numberOfItems > 1) {\n\t\t\t\treturn SchemaValidationError.Field_MultipleChildrenNotAllowed;\n\t\t\t} else {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\tcase Multiplicity.Optional:\n\t\t\treturn numberOfItems > 1\n\t\t\t\t? SchemaValidationError.Field_MultipleChildrenNotAllowed\n\t\t\t\t: undefined;\n\t\tcase Multiplicity.Sequence:\n\t\t\treturn undefined;\n\t\tcase Multiplicity.Forbidden:\n\t\t\treturn numberOfItems === 0\n\t\t\t\t? undefined\n\t\t\t\t: SchemaValidationError.Field_ChildInForbiddenField;\n\t\tdefault:\n\t\t\tunreachableCase(multiplicity);\n\t}\n}\n"]}
@@ -16,7 +16,7 @@ export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDesc
16
16
  export { mapRootChanges } from "./deltaUtils.js";
17
17
  export { type TreeChunk, chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, makeTreeChunker, makeFieldBatchCodec, fluidVersionToFieldBatchCodecWriteVersion, type FieldBatchEncodingContext, } 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, inSchemaOrThrow, } 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, SchemaValidationError, isNodeInSchema, isFieldInSchema, throwOutOfSchema, } from "./default-schema/index.js";
20
20
  export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, LazyEntity, treeStatusFromAnchorCache, indexForAt, FlexTreeEntityKind, type FlexibleNodeContent, type FlexibleFieldContent, type FlexTreeHydratedContextMinimal, type HydratedFlexTreeNode, getOrCreateHydratedFlexTreeNode, } from "./flex-tree/index.js";
21
21
  export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
22
22
  export { valueSchemaAllows } from "./valueUtilities.js";
@@ -24,5 +24,4 @@ export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js"
24
24
  export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, } from "./schema-edits/index.js";
25
25
  export { makeMitigatedChangeFamily } from "./mitigatedChangeFamily.js";
26
26
  export { type KeyFinder, AnchorTreeIndex, hasElement, type TreeIndex, type TreeIndexKey, type TreeIndexNodes, } from "./indexing/index.js";
27
- export { initializeForest } from "./initializeForest.js";
28
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB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AAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,GACnB,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"}
@@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.MockNodeIdentifierManager = exports.isStableNodeIdentifier = exports.createNodeIdentifierManager = exports.compareLocalNodeIdentifiers = exports.fluidVersionToFieldBatchCodecWriteVersion = exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = 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.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.mapTreeWithField = exports.mapTreeFieldsWithField = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.toDownPath = void 0;
31
- exports.initializeForest = exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = 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.inSchemaOrThrow = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationError = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = void 0;
31
+ exports.hasElement = exports.AnchorTreeIndex = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = 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.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = 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");
@@ -106,7 +106,7 @@ Object.defineProperty(exports, "relevantRemovedRoots", { enumerable: true, get:
106
106
  Object.defineProperty(exports, "SchemaValidationError", { enumerable: true, get: function () { return index_js_7.SchemaValidationError; } });
107
107
  Object.defineProperty(exports, "isNodeInSchema", { enumerable: true, get: function () { return index_js_7.isNodeInSchema; } });
108
108
  Object.defineProperty(exports, "isFieldInSchema", { enumerable: true, get: function () { return index_js_7.isFieldInSchema; } });
109
- Object.defineProperty(exports, "inSchemaOrThrow", { enumerable: true, get: function () { return index_js_7.inSchemaOrThrow; } });
109
+ Object.defineProperty(exports, "throwOutOfSchema", { enumerable: true, get: function () { return index_js_7.throwOutOfSchema; } });
110
110
  var index_js_8 = require("./flex-tree/index.js");
111
111
  Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function () { return index_js_8.TreeStatus; } });
112
112
  Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return index_js_8.Context; } });
@@ -136,6 +136,4 @@ Object.defineProperty(exports, "makeMitigatedChangeFamily", { enumerable: true,
136
136
  var index_js_10 = require("./indexing/index.js");
137
137
  Object.defineProperty(exports, "AnchorTreeIndex", { enumerable: true, get: function () { return index_js_10.AnchorTreeIndex; } });
138
138
  Object.defineProperty(exports, "hasElement", { enumerable: true, get: function () { return index_js_10.hasElement; } });
139
- var initializeForest_js_1 = require("./initializeForest.js");
140
- Object.defineProperty(exports, "initializeForest", { enumerable: true, get: function () { return initializeForest_js_1.initializeForest; } });
141
139
  //# sourceMappingURL=index.js.map
@@ -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,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;A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AAU,OAAA;AAMX,6DAAyD;AAAhD,uHAAA,gBAAgB,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 { ForestSummarizer } 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} 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\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\tfluidVersionToFieldBatchCodecWriteVersion,\n\ttype FieldBatchEncodingContext,\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\tinSchemaOrThrow,\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} 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} 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\nexport { initializeForest } from \"./initializeForest.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,yDA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AuE;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 { ForestSummarizer } 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} 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\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\tfluidVersionToFieldBatchCodecWriteVersion,\n\ttype FieldBatchEncodingContext,\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} 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} 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} 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"]}
@@ -5,7 +5,7 @@
5
5
  import { type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeTypeSet, type ValueSchema } from "../../core/index.js";
6
6
  import type { FullSchemaPolicy } from "./fieldKind.js";
7
7
  /**
8
- * @returns true iff `superset` is a superset of `original`.
8
+ * Returns true iff `superset` is a superset of `original`.
9
9
  *
10
10
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
11
11
  *
@@ -13,25 +13,25 @@ import type { FullSchemaPolicy } from "./fieldKind.js";
13
13
  */
14
14
  export declare function allowsTreeSuperset(policy: FullSchemaPolicy, originalData: TreeStoredSchema, original: TreeNodeStoredSchema | undefined, superset: TreeNodeStoredSchema | undefined): boolean;
15
15
  /**
16
- * @returns true iff `superset` is a superset of `original`.
16
+ * Returns true iff `superset` is a superset of `original`.
17
17
  *
18
18
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
19
19
  */
20
20
  export declare function allowsValueSuperset(original: ValueSchema | undefined, superset: ValueSchema | undefined): boolean;
21
21
  /**
22
- * @returns true iff `superset` is a superset of `original`.
22
+ * Returns true iff `superset` is a superset of `original`.
23
23
  *
24
24
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
25
25
  */
26
26
  export declare function allowsFieldSuperset(policy: FullSchemaPolicy, originalData: TreeStoredSchema, original: TreeFieldStoredSchema, superset: TreeFieldStoredSchema): boolean;
27
27
  /**
28
- * @returns true iff `superset` is a superset of `original`.
28
+ * Returns true iff `superset` is a superset of `original`.
29
29
  *
30
30
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
31
31
  */
32
32
  export declare function allowsTreeSchemaIdentifierSuperset(original: TreeTypeSet, superset: TreeTypeSet): boolean;
33
33
  /**
34
- * @returns true iff `superset` is a superset of `original`.
34
+ * Returns true iff `superset` is a superset of `original`.
35
35
  *
36
36
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
37
37
  *
@@ -40,5 +40,4 @@ export declare function allowsTreeSchemaIdentifierSuperset(original: TreeTypeSet
40
40
  * it would have to compare everything anyway.
41
41
  */
42
42
  export declare function allowsRepoSuperset(policy: FullSchemaPolicy, original: TreeStoredSchema, superset: TreeStoredSchema): boolean;
43
- export declare function normalizeField(schema: TreeFieldStoredSchema | undefined): TreeFieldStoredSchema;
44
43
  //# sourceMappingURL=comparison.d.ts.map
@@ -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,CAsFT;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,CAqBT;AAED,wBAAgB,cAAc,CAC7B,MAAM,EAAE,qBAAqB,GAAG,SAAS,GACvC,qBAAqB,CAEvB"}
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"}
@@ -4,14 +4,14 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.normalizeField = exports.allowsRepoSuperset = exports.allowsTreeSchemaIdentifierSuperset = exports.allowsFieldSuperset = exports.allowsValueSuperset = exports.allowsTreeSuperset = void 0;
7
+ exports.allowsRepoSuperset = exports.allowsTreeSchemaIdentifierSuperset = exports.allowsFieldSuperset = exports.allowsValueSuperset = exports.allowsTreeSuperset = 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("../../util/index.js");
11
11
  const fieldKindWithEditor_js_1 = require("./fieldKindWithEditor.js");
12
12
  const isNeverTree_js_1 = require("./isNeverTree.js");
13
13
  /**
14
- * @returns true iff `superset` is a superset of `original`.
14
+ * Returns true iff `superset` is a superset of `original`.
15
15
  *
16
16
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
17
17
  *
@@ -39,14 +39,14 @@ function allowsTreeSuperset(policy, originalData, original, superset) {
39
39
  (0, internal_1.assert)(superset instanceof index_js_1.MapNodeStoredSchema || superset instanceof index_js_1.ObjectNodeStoredSchema, 0x894 /* unsupported node kind */);
40
40
  if (original instanceof index_js_1.MapNodeStoredSchema) {
41
41
  if (superset instanceof index_js_1.MapNodeStoredSchema) {
42
- return allowsFieldSuperset(policy, originalData, normalizeField(original.mapFields), normalizeField(superset.mapFields));
42
+ return allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);
43
43
  }
44
44
  return false;
45
45
  }
46
46
  (0, internal_1.assert)(original instanceof index_js_1.ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);
47
47
  if (superset instanceof index_js_1.MapNodeStoredSchema) {
48
48
  for (const [_key, field] of original.objectNodeFields) {
49
- if (!allowsFieldSuperset(policy, originalData, normalizeField(field), normalizeField(superset.mapFields))) {
49
+ if (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {
50
50
  return false;
51
51
  }
52
52
  }
@@ -57,15 +57,15 @@ function allowsTreeSuperset(policy, originalData, original, superset) {
57
57
  a: original.objectNodeFields,
58
58
  b: superset.objectNodeFields,
59
59
  aExtra: (originalField) => allowsFieldSuperset(policy, originalData, original.objectNodeFields.get(originalField) ??
60
- (0, internal_1.fail)(0xb17 /* missing expected field */), normalizeField(undefined)),
61
- bExtra: (supersetField) => allowsFieldSuperset(policy, originalData, normalizeField(undefined), superset.objectNodeFields.get(supersetField) ??
60
+ (0, internal_1.fail)(0xb17 /* missing expected field */), index_js_1.storedEmptyFieldSchema),
61
+ bExtra: (supersetField) => allowsFieldSuperset(policy, originalData, index_js_1.storedEmptyFieldSchema, superset.objectNodeFields.get(supersetField) ??
62
62
  (0, internal_1.fail)(0xb18 /* missing expected field */)),
63
63
  same: (sameField) => allowsFieldSuperset(policy, originalData, original.objectNodeFields.get(sameField) ?? (0, internal_1.fail)(0xb19 /* missing expected field */), superset.objectNodeFields.get(sameField) ?? (0, internal_1.fail)(0xb1a /* missing expected field */)),
64
64
  });
65
65
  }
66
66
  exports.allowsTreeSuperset = allowsTreeSuperset;
67
67
  /**
68
- * @returns true iff `superset` is a superset of `original`.
68
+ * Returns true iff `superset` is a superset of `original`.
69
69
  *
70
70
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
71
71
  */
@@ -74,7 +74,7 @@ function allowsValueSuperset(original, superset) {
74
74
  }
75
75
  exports.allowsValueSuperset = allowsValueSuperset;
76
76
  /**
77
- * @returns true iff `superset` is a superset of `original`.
77
+ * Returns true iff `superset` is a superset of `original`.
78
78
  *
79
79
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
80
80
  */
@@ -83,7 +83,7 @@ function allowsFieldSuperset(policy, originalData, original, superset) {
83
83
  }
84
84
  exports.allowsFieldSuperset = allowsFieldSuperset;
85
85
  /**
86
- * @returns true iff `superset` is a superset of `original`.
86
+ * Returns true iff `superset` is a superset of `original`.
87
87
  *
88
88
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
89
89
  */
@@ -97,7 +97,7 @@ function allowsTreeSchemaIdentifierSuperset(original, superset) {
97
97
  }
98
98
  exports.allowsTreeSchemaIdentifierSuperset = allowsTreeSchemaIdentifierSuperset;
99
99
  /**
100
- * @returns true iff `superset` is a superset of `original`.
100
+ * Returns true iff `superset` is a superset of `original`.
101
101
  *
102
102
  * This does not require a strict (aka proper) superset: equivalent schema will return true.
103
103
  *
@@ -107,22 +107,21 @@ exports.allowsTreeSchemaIdentifierSuperset = allowsTreeSchemaIdentifierSuperset;
107
107
  */
108
108
  function allowsRepoSuperset(policy, original, superset) {
109
109
  {
110
- // TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.
111
110
  if (!allowsFieldSuperset(policy, original, original.rootFieldSchema, superset.rootFieldSchema)) {
112
111
  return false;
113
112
  }
114
113
  }
114
+ // Check if all schema in original are included in superset, and permit a superset of the node content.
115
+ // Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,
116
+ // so we must check all of them, even if they are not reachable from the root field schema.
115
117
  for (const [key, schema] of original.nodeSchema) {
116
- // TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.
117
118
  if (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {
118
119
  return false;
119
120
  }
120
121
  }
122
+ // Any schema in superset not in original are already known to be superset of original since they are "never" due to being missing.
123
+ // Therefore, we do not need to check them.
121
124
  return true;
122
125
  }
123
126
  exports.allowsRepoSuperset = allowsRepoSuperset;
124
- function normalizeField(schema) {
125
- return schema ?? index_js_1.storedEmptyFieldSchema;
126
- }
127
- exports.normalizeField = normalizeField;
128
127
  //# sourceMappingURL=comparison.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAU6B;AAC7B,kDAAkD;AAGlD,qEAAsD;AACtD,qDAA+C;AAE/C;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YA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G,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAzBD,gDAyBC;AAED,SAAgB,cAAc,CAC7B,MAAyC;IAEzC,OAAO,MAAM,IAAI,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
1
+ {"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAmE;AAEnE,kDAU6B;AAC7B,kDAAkD;AAGlD,qEAAsD;AACtD,qDAA+C;AAE/C;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAI,QAAQ,YAAY,+BAAoB,EAAE,CA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,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC;AATD,kDASC;AAED;;;;GAIG;AACH,SAAgB,kCAAkC,CACjD,QAAqB,EACrB,QAAqB;IAErB,KAAK,MAAM,YAAY,IAAI,QAAQ,EAAE,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAVD,gFAUC;AAED;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,QAA0B,EAC1B,QAA0B;IAE1B,CAAC;QACA,IACC,CAAC,mBAAmB,CACnB,MAAM,EACN,QAAQ,EACR,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,eAAe,CACxB,EACA,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,uGAAuG;IACvG,wHAAwH;IACxH,2FAA2F;IAC3F,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,mIAAmI;IACnI,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACb,CAAC;AA5BD,gDA4BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n"]}
@@ -107,6 +107,11 @@ export interface FieldChangeRebaser<TChangeset> {
107
107
  */
108
108
  prune(change: TChangeset, pruneChild: NodeChangePruner): TChangeset;
109
109
  replaceRevisions(change: TChangeset, oldRevisions: Set<RevisionTag | undefined>, newRevisions: RevisionTag | undefined): TChangeset;
110
+ /**
111
+ * Returns a copy of the given changeset with the same declarations (e.g., new cells) but no actual changes.
112
+ * This is a kludge. TODO: remove once AB#46104 is completed.
113
+ */
114
+ mute(change: TChangeset): TChangeset;
110
115
  }
111
116
  /**
112
117
  * Helper for creating a {@link FieldChangeRebaser} which does not need access to revision tags.
@@ -116,11 +121,13 @@ export declare function referenceFreeFieldChangeRebaser<TChangeset>(data: {
116
121
  compose: (change1: TChangeset, change2: TChangeset) => TChangeset;
117
122
  invert: (change: TChangeset) => TChangeset;
118
123
  rebase: (change: TChangeset, over: TChangeset) => TChangeset;
124
+ mute: (change: TChangeset) => TChangeset;
119
125
  }): FieldChangeRebaser<TChangeset>;
120
126
  export declare function isolatedFieldChangeRebaser<TChangeset>(data: {
121
127
  compose: FieldChangeRebaser<TChangeset>["compose"];
122
128
  invert: FieldChangeRebaser<TChangeset>["invert"];
123
129
  rebase: FieldChangeRebaser<TChangeset>["rebase"];
130
+ mute: FieldChangeRebaser<TChangeset>["mute"];
124
131
  }): FieldChangeRebaser<TChangeset>;
125
132
  export interface FieldEditor<TChangeset> {
126
133
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fieldChangeHandler.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldChangeHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EACX,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,WAAW,EACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE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AAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,KACvB,MAAM,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAE7F,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACrE,QAAQ,CAAC,mBAAmB,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,WAAW,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;IAC5C,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAAC;IACjD,UAAU,CAAC,WAAW,EAAE,oBAAoB,GAAG,MAAM,CAAC;CACtD"}
@@ -14,6 +14,7 @@ function referenceFreeFieldChangeRebaser(data) {
14
14
  compose: (change1, change2, _composeChild, _genId) => data.compose(change1, change2),
15
15
  invert: (change, _invertChild, _genId) => data.invert(change),
16
16
  rebase: (change, over, _rebaseChild, _genId) => data.rebase(change, over),
17
+ mute: (change) => data.mute(change),
17
18
  });
18
19
  }
19
20
  exports.referenceFreeFieldChangeRebaser = referenceFreeFieldChangeRebaser;