@fluidframework/tree 2.43.0 → 2.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/api-report/tree.alpha.api.md +73 -16
  3. package/api-report/tree.beta.api.md +9 -3
  4. package/api-report/tree.legacy.alpha.api.md +8 -2
  5. package/api-report/tree.legacy.public.api.md +8 -2
  6. package/api-report/tree.public.api.md +8 -2
  7. package/dist/alpha.d.ts +9 -0
  8. package/dist/core/forest/editableForest.d.ts +0 -2
  9. package/dist/core/forest/editableForest.d.ts.map +1 -1
  10. package/dist/core/forest/editableForest.js.map +1 -1
  11. package/dist/core/forest/forest.d.ts +0 -4
  12. package/dist/core/forest/forest.d.ts.map +1 -1
  13. package/dist/core/forest/forest.js +0 -4
  14. package/dist/core/forest/forest.js.map +1 -1
  15. package/dist/core/rebase/changeRebaser.d.ts +0 -6
  16. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  17. package/dist/core/rebase/changeRebaser.js.map +1 -1
  18. package/dist/core/rebase/types.d.ts +0 -2
  19. package/dist/core/rebase/types.d.ts.map +1 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/schema-stored/schema.d.ts +0 -8
  22. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  23. package/dist/core/schema-stored/schema.js +0 -8
  24. package/dist/core/schema-stored/schema.js.map +1 -1
  25. package/dist/core/schema-view/view.d.ts +0 -2
  26. package/dist/core/schema-view/view.d.ts.map +1 -1
  27. package/dist/core/schema-view/view.js.map +1 -1
  28. package/dist/core/tree/cursor.d.ts +0 -2
  29. package/dist/core/tree/cursor.d.ts.map +1 -1
  30. package/dist/core/tree/cursor.js +0 -2
  31. package/dist/core/tree/cursor.js.map +1 -1
  32. package/dist/core/tree/delta.d.ts +0 -2
  33. package/dist/core/tree/delta.d.ts.map +1 -1
  34. package/dist/core/tree/delta.js.map +1 -1
  35. package/dist/core/tree/types.d.ts +0 -4
  36. package/dist/core/tree/types.d.ts.map +1 -1
  37. package/dist/core/tree/types.js +0 -2
  38. package/dist/core/tree/types.js.map +1 -1
  39. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +0 -4
  40. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  41. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  42. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -10
  43. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  44. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  45. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +0 -2
  46. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  47. package/dist/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
  48. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  49. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
  50. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  51. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +0 -2
  52. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  53. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -10
  54. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  55. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +0 -2
  56. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  57. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -6
  58. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  59. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  60. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -12
  61. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  62. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  63. package/dist/feature-libraries/sequence-field/types.d.ts +0 -2
  64. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  65. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  66. package/dist/index.d.ts +1 -1
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +3 -2
  69. package/dist/index.js.map +1 -1
  70. package/dist/jsonDomainSchema.d.ts +2 -6
  71. package/dist/jsonDomainSchema.d.ts.map +1 -1
  72. package/dist/jsonDomainSchema.js +2 -2
  73. package/dist/jsonDomainSchema.js.map +1 -1
  74. package/dist/packageVersion.d.ts +1 -1
  75. package/dist/packageVersion.js +1 -1
  76. package/dist/packageVersion.js.map +1 -1
  77. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  78. package/dist/shared-tree/treeAlpha.js +3 -1
  79. package/dist/shared-tree/treeAlpha.js.map +1 -1
  80. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +8 -12
  81. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  82. package/dist/shared-tree-core/defaultResubmitMachine.js +54 -46
  83. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  84. package/dist/shared-tree-core/resubmitMachine.d.ts +6 -0
  85. package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  86. package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
  87. package/dist/shared-tree-core/sharedTreeCore.d.ts +1 -0
  88. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  89. package/dist/shared-tree-core/sharedTreeCore.js +16 -3
  90. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  91. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  92. package/dist/simple-tree/api/configuration.js +49 -17
  93. package/dist/simple-tree/api/configuration.js.map +1 -1
  94. package/dist/simple-tree/api/customTree.d.ts +1 -1
  95. package/dist/simple-tree/api/customTree.d.ts.map +1 -1
  96. package/dist/simple-tree/api/customTree.js +3 -4
  97. package/dist/simple-tree/api/customTree.js.map +1 -1
  98. package/dist/simple-tree/api/index.d.ts +2 -2
  99. package/dist/simple-tree/api/index.d.ts.map +1 -1
  100. package/dist/simple-tree/api/index.js.map +1 -1
  101. package/dist/simple-tree/api/jsonSchema.d.ts +32 -8
  102. package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -1
  103. package/dist/simple-tree/api/jsonSchema.js.map +1 -1
  104. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  105. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  106. package/dist/simple-tree/api/schemaFactory.js +1 -1
  107. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  108. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +97 -3
  109. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  110. package/dist/simple-tree/api/schemaFactoryAlpha.js +75 -0
  111. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  112. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +5 -1
  113. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  114. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  115. package/dist/simple-tree/api/schemaFromSimple.js +2 -0
  116. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  117. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  118. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -4
  119. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  120. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  121. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  122. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  123. package/dist/simple-tree/api/treeNodeApi.js +1 -1
  124. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  125. package/dist/simple-tree/api/typesUnsafe.d.ts +12 -0
  126. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  127. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  128. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  129. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +5 -3
  130. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  131. package/dist/simple-tree/core/index.d.ts +1 -1
  132. package/dist/simple-tree/core/index.d.ts.map +1 -1
  133. package/dist/simple-tree/core/index.js +2 -1
  134. package/dist/simple-tree/core/index.js.map +1 -1
  135. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -1
  136. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  137. package/dist/simple-tree/core/treeNodeSchema.js +4 -0
  138. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  139. package/dist/simple-tree/index.d.ts +3 -3
  140. package/dist/simple-tree/index.d.ts.map +1 -1
  141. package/dist/simple-tree/index.js +3 -1
  142. package/dist/simple-tree/index.js.map +1 -1
  143. package/dist/simple-tree/node-kinds/index.d.ts +2 -1
  144. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  145. package/dist/simple-tree/node-kinds/index.js +5 -1
  146. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  147. package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
  148. package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  149. package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
  150. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  151. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  152. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +5 -1
  153. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  154. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  155. package/dist/simple-tree/node-kinds/record/index.d.ts +7 -0
  156. package/dist/simple-tree/node-kinds/record/index.d.ts.map +1 -0
  157. package/dist/simple-tree/node-kinds/record/index.js +13 -0
  158. package/dist/simple-tree/node-kinds/record/index.js.map +1 -0
  159. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +39 -0
  160. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -0
  161. package/dist/simple-tree/node-kinds/record/recordNode.js +234 -0
  162. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -0
  163. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +70 -0
  164. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -0
  165. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js +30 -0
  166. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -0
  167. package/dist/simple-tree/simpleSchema.d.ts +16 -1
  168. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  169. package/dist/simple-tree/simpleSchema.js.map +1 -1
  170. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  171. package/dist/simple-tree/toStoredSchema.js +4 -2
  172. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  173. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  174. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  175. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +56 -32
  176. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  177. package/dist/tableSchema.d.ts +7 -2
  178. package/dist/tableSchema.d.ts.map +1 -1
  179. package/dist/tableSchema.js +21 -7
  180. package/dist/tableSchema.js.map +1 -1
  181. package/dist/util/brandedMap.d.ts +0 -2
  182. package/dist/util/brandedMap.d.ts.map +1 -1
  183. package/dist/util/brandedMap.js.map +1 -1
  184. package/docs/main/compatibility.md +15 -1
  185. package/lib/alpha.d.ts +9 -0
  186. package/lib/core/forest/editableForest.d.ts +0 -2
  187. package/lib/core/forest/editableForest.d.ts.map +1 -1
  188. package/lib/core/forest/editableForest.js.map +1 -1
  189. package/lib/core/forest/forest.d.ts +0 -4
  190. package/lib/core/forest/forest.d.ts.map +1 -1
  191. package/lib/core/forest/forest.js +0 -4
  192. package/lib/core/forest/forest.js.map +1 -1
  193. package/lib/core/rebase/changeRebaser.d.ts +0 -6
  194. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  195. package/lib/core/rebase/changeRebaser.js.map +1 -1
  196. package/lib/core/rebase/types.d.ts +0 -2
  197. package/lib/core/rebase/types.d.ts.map +1 -1
  198. package/lib/core/rebase/types.js.map +1 -1
  199. package/lib/core/schema-stored/schema.d.ts +0 -8
  200. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  201. package/lib/core/schema-stored/schema.js +0 -8
  202. package/lib/core/schema-stored/schema.js.map +1 -1
  203. package/lib/core/schema-view/view.d.ts +0 -2
  204. package/lib/core/schema-view/view.d.ts.map +1 -1
  205. package/lib/core/schema-view/view.js.map +1 -1
  206. package/lib/core/tree/cursor.d.ts +0 -2
  207. package/lib/core/tree/cursor.d.ts.map +1 -1
  208. package/lib/core/tree/cursor.js +0 -2
  209. package/lib/core/tree/cursor.js.map +1 -1
  210. package/lib/core/tree/delta.d.ts +0 -2
  211. package/lib/core/tree/delta.d.ts.map +1 -1
  212. package/lib/core/tree/delta.js.map +1 -1
  213. package/lib/core/tree/types.d.ts +0 -4
  214. package/lib/core/tree/types.d.ts.map +1 -1
  215. package/lib/core/tree/types.js +0 -2
  216. package/lib/core/tree/types.js.map +1 -1
  217. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +0 -4
  218. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  219. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  220. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +0 -10
  221. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  222. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  223. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +0 -2
  224. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  225. package/lib/feature-libraries/flex-tree/flexTreeTypes.js +0 -2
  226. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  227. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +0 -2
  228. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  229. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +0 -2
  230. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  231. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +0 -10
  232. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  233. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +0 -2
  234. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  235. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +0 -6
  236. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  237. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  238. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +0 -12
  239. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  240. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  241. package/lib/feature-libraries/sequence-field/types.d.ts +0 -2
  242. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  243. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  244. package/lib/index.d.ts +1 -1
  245. package/lib/index.d.ts.map +1 -1
  246. package/lib/index.js +1 -1
  247. package/lib/index.js.map +1 -1
  248. package/lib/jsonDomainSchema.d.ts +2 -6
  249. package/lib/jsonDomainSchema.d.ts.map +1 -1
  250. package/lib/jsonDomainSchema.js +3 -3
  251. package/lib/jsonDomainSchema.js.map +1 -1
  252. package/lib/packageVersion.d.ts +1 -1
  253. package/lib/packageVersion.js +1 -1
  254. package/lib/packageVersion.js.map +1 -1
  255. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  256. package/lib/shared-tree/treeAlpha.js +3 -1
  257. package/lib/shared-tree/treeAlpha.js.map +1 -1
  258. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +8 -12
  259. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  260. package/lib/shared-tree-core/defaultResubmitMachine.js +55 -47
  261. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  262. package/lib/shared-tree-core/resubmitMachine.d.ts +6 -0
  263. package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
  264. package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
  265. package/lib/shared-tree-core/sharedTreeCore.d.ts +1 -0
  266. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  267. package/lib/shared-tree-core/sharedTreeCore.js +16 -3
  268. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  269. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  270. package/lib/simple-tree/api/configuration.js +51 -19
  271. package/lib/simple-tree/api/configuration.js.map +1 -1
  272. package/lib/simple-tree/api/customTree.d.ts +1 -1
  273. package/lib/simple-tree/api/customTree.d.ts.map +1 -1
  274. package/lib/simple-tree/api/customTree.js +2 -3
  275. package/lib/simple-tree/api/customTree.js.map +1 -1
  276. package/lib/simple-tree/api/index.d.ts +2 -2
  277. package/lib/simple-tree/api/index.d.ts.map +1 -1
  278. package/lib/simple-tree/api/index.js.map +1 -1
  279. package/lib/simple-tree/api/jsonSchema.d.ts +32 -8
  280. package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -1
  281. package/lib/simple-tree/api/jsonSchema.js.map +1 -1
  282. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  283. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  284. package/lib/simple-tree/api/schemaFactory.js +1 -1
  285. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  286. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +97 -3
  287. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  288. package/lib/simple-tree/api/schemaFactoryAlpha.js +77 -2
  289. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  290. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +5 -1
  291. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  292. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  293. package/lib/simple-tree/api/schemaFromSimple.js +2 -0
  294. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  295. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  296. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +5 -5
  297. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  298. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  299. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  300. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  301. package/lib/simple-tree/api/treeNodeApi.js +2 -2
  302. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  303. package/lib/simple-tree/api/typesUnsafe.d.ts +12 -0
  304. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  305. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  306. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  307. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +6 -4
  308. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  309. package/lib/simple-tree/core/index.d.ts +1 -1
  310. package/lib/simple-tree/core/index.d.ts.map +1 -1
  311. package/lib/simple-tree/core/index.js +1 -1
  312. package/lib/simple-tree/core/index.js.map +1 -1
  313. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -1
  314. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  315. package/lib/simple-tree/core/treeNodeSchema.js +4 -0
  316. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  317. package/lib/simple-tree/index.d.ts +3 -3
  318. package/lib/simple-tree/index.d.ts.map +1 -1
  319. package/lib/simple-tree/index.js +1 -1
  320. package/lib/simple-tree/index.js.map +1 -1
  321. package/lib/simple-tree/node-kinds/index.d.ts +2 -1
  322. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  323. package/lib/simple-tree/node-kinds/index.js +1 -0
  324. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  325. package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
  326. package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
  327. package/lib/simple-tree/node-kinds/object/index.js +1 -1
  328. package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
  329. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  330. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  331. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +5 -1
  332. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  333. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  334. package/lib/simple-tree/node-kinds/record/index.d.ts +7 -0
  335. package/lib/simple-tree/node-kinds/record/index.d.ts.map +1 -0
  336. package/lib/simple-tree/node-kinds/record/index.js +7 -0
  337. package/lib/simple-tree/node-kinds/record/index.js.map +1 -0
  338. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +39 -0
  339. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -0
  340. package/lib/simple-tree/node-kinds/record/recordNode.js +232 -0
  341. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -0
  342. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +70 -0
  343. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -0
  344. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js +26 -0
  345. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -0
  346. package/lib/simple-tree/simpleSchema.d.ts +16 -1
  347. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  348. package/lib/simple-tree/simpleSchema.js.map +1 -1
  349. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  350. package/lib/simple-tree/toStoredSchema.js +4 -2
  351. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  352. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  353. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  354. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +58 -34
  355. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  356. package/lib/tableSchema.d.ts +7 -2
  357. package/lib/tableSchema.d.ts.map +1 -1
  358. package/lib/tableSchema.js +22 -8
  359. package/lib/tableSchema.js.map +1 -1
  360. package/lib/util/brandedMap.d.ts +0 -2
  361. package/lib/util/brandedMap.d.ts.map +1 -1
  362. package/lib/util/brandedMap.js.map +1 -1
  363. package/package.json +34 -22
  364. package/src/core/forest/editableForest.ts +0 -2
  365. package/src/core/forest/forest.ts +0 -4
  366. package/src/core/rebase/changeRebaser.ts +0 -6
  367. package/src/core/rebase/types.ts +0 -2
  368. package/src/core/schema-stored/schema.ts +0 -8
  369. package/src/core/schema-view/view.ts +0 -2
  370. package/src/core/tree/cursor.ts +0 -2
  371. package/src/core/tree/delta.ts +0 -2
  372. package/src/core/tree/types.ts +0 -4
  373. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +0 -4
  374. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +0 -10
  375. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +0 -2
  376. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +0 -2
  377. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +0 -10
  378. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +0 -8
  379. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +0 -12
  380. package/src/feature-libraries/sequence-field/types.ts +0 -2
  381. package/src/index.ts +9 -0
  382. package/src/jsonDomainSchema.ts +3 -3
  383. package/src/packageVersion.ts +1 -1
  384. package/src/shared-tree/treeAlpha.ts +3 -1
  385. package/src/shared-tree-core/defaultResubmitMachine.ts +99 -52
  386. package/src/shared-tree-core/resubmitMachine.ts +7 -0
  387. package/src/shared-tree-core/sharedTreeCore.ts +18 -6
  388. package/src/simple-tree/api/configuration.ts +73 -19
  389. package/src/simple-tree/api/customTree.ts +3 -3
  390. package/src/simple-tree/api/index.ts +3 -0
  391. package/src/simple-tree/api/jsonSchema.ts +35 -8
  392. package/src/simple-tree/api/schemaFactory.ts +5 -13
  393. package/src/simple-tree/api/schemaFactoryAlpha.ts +268 -1
  394. package/src/simple-tree/api/schemaFactoryRecursive.ts +5 -1
  395. package/src/simple-tree/api/schemaFromSimple.ts +6 -0
  396. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +16 -7
  397. package/src/simple-tree/api/treeBeta.ts +2 -2
  398. package/src/simple-tree/api/treeNodeApi.ts +2 -2
  399. package/src/simple-tree/api/typesUnsafe.ts +15 -0
  400. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +14 -6
  401. package/src/simple-tree/core/index.ts +1 -0
  402. package/src/simple-tree/core/treeNodeSchema.ts +8 -4
  403. package/src/simple-tree/index.ts +11 -0
  404. package/src/simple-tree/node-kinds/index.ts +11 -0
  405. package/src/simple-tree/node-kinds/object/index.ts +5 -1
  406. package/src/simple-tree/node-kinds/object/objectNode.ts +3 -2
  407. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -3
  408. package/src/simple-tree/node-kinds/record/index.ts +14 -0
  409. package/src/simple-tree/node-kinds/record/recordNode.ts +410 -0
  410. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +136 -0
  411. package/src/simple-tree/simpleSchema.ts +19 -1
  412. package/src/simple-tree/toStoredSchema.ts +4 -2
  413. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +83 -40
  414. package/src/tableSchema.ts +27 -8
  415. package/src/util/brandedMap.ts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"unhydratedFlexTreeFromInsertable.d.ts","sourceRoot":"","sources":["../../src/simple-tree/unhydratedFlexTreeFromInsertable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EAIN,KAAK,mBAAmB,EAMxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAIN,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,sBAAsB,EAEtB,MAAM,iBAAiB,CAAC;AAOzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAMpE;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,SAAS,iBAAiB,GAAG,SAAS,EACzF,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,mBAAmB,GAC/B,GAAG,SAAS,SAAS,GAAG,SAAS,GAAG,sBAAsB,CAiB5D;AAkVD;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,EACzC,IAAI,EAAE,cAAc,GAClB,cAAc,EAAE,CAclB;AAyHD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GAEP,IAAI,GACJ,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GAC9C,SAAS,iBAAiB,EAAE,GAC5B,oBAAoB,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,iBAAiB;CAC1C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"unhydratedFlexTreeFromInsertable.d.ts","sourceRoot":"","sources":["../../src/simple-tree/unhydratedFlexTreeFromInsertable.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAgBpE,OAAO,EAIN,KAAK,mBAAmB,EAOxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAKN,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,UAAU,EAEf,sBAAsB,EAEtB,MAAM,iBAAiB,CAAC;AAqBzB;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,SAAS,iBAAiB,GAAG,SAAS,EACzF,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,mBAAmB,GAC/B,GAAG,SAAS,SAAS,GAAG,SAAS,GAAG,sBAAsB,CAiB5D;AA6WD;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,EACzC,IAAI,EAAE,cAAc,GAClB,cAAc,EAAE,CAclB;AA6HD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,MAAM,GACN,MAAM,GACN,OAAO,GAEP,IAAI,GACJ,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,GAC9C,SAAS,iBAAiB,EAAE,GAC5B,oBAAoB,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,iBAAiB;CAC1C,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC"}
@@ -14,16 +14,18 @@ const index_js_3 = require("../util/index.js");
14
14
  const leafNodeSchema_js_1 = require("./leafNodeSchema.js");
15
15
  const schemaTypes_js_1 = require("./schemaTypes.js");
16
16
  const index_js_4 = require("./core/index.js");
17
+ const createContext_js_1 = require("./createContext.js");
18
+ const toStoredSchema_js_1 = require("./toStoredSchema.js");
17
19
  // Required to prevent the introduction of new circular dependencies
18
20
  // TODO: Having the schema provide their own policy functions for compatibility which
19
- // unhydratedFlexTreeFromInsertable invokes instead of manually handling each kind would remove this bad
21
+ // `unhydratedFlexTreeFromInsertable` invokes instead of manually handling each kind would remove this bad
20
22
  // dependency, and reduce coupling.
21
- // eslint-disable-next-line import/no-internal-modules
23
+ /* eslint-disable import/no-internal-modules */
24
+ const arrayNodeTypes_js_1 = require("./node-kinds/array/arrayNodeTypes.js");
25
+ const mapNodeTypes_js_1 = require("./node-kinds/map/mapNodeTypes.js");
22
26
  const objectNodeTypes_js_1 = require("./node-kinds/object/objectNodeTypes.js");
23
- // eslint-disable-next-line import/no-internal-modules
24
- const unhydratedFlexTree_js_1 = require("./core/unhydratedFlexTree.js");
25
- const toStoredSchema_js_1 = require("./toStoredSchema.js");
26
- const createContext_js_1 = require("./createContext.js");
27
+ const recordNodeTypes_js_1 = require("./node-kinds/record/recordNodeTypes.js");
28
+ /* eslint-enable import/no-internal-modules */
27
29
  /**
28
30
  * Module notes:
29
31
  *
@@ -98,14 +100,21 @@ function unhydratedFlexTreeFromInsertableNode(data, allowedTypes) {
98
100
  result = leafToFlexContent(data, schema, allowedTypes);
99
101
  break;
100
102
  case index_js_4.NodeKind.Array:
103
+ (0, internal_1.assert)((0, arrayNodeTypes_js_1.isArrayNodeSchema)(schema), 0x922 /* Expected an array schema. */);
101
104
  result = arrayToFlexContent(data, schema);
102
105
  break;
103
106
  case index_js_4.NodeKind.Map:
107
+ (0, internal_1.assert)((0, mapNodeTypes_js_1.isMapNodeSchema)(schema), 0x923 /* Expected a Map schema. */);
104
108
  result = mapToFlexContent(data, schema);
105
109
  break;
106
110
  case index_js_4.NodeKind.Object:
111
+ (0, internal_1.assert)((0, objectNodeTypes_js_1.isObjectNodeSchema)(schema), 0x924 /* Expected an Object schema. */);
107
112
  result = objectToFlexContent(data, schema);
108
113
  break;
114
+ case index_js_4.NodeKind.Record:
115
+ (0, internal_1.assert)((0, recordNodeTypes_js_1.isRecordNodeSchema)(schema), 0xbdd /* Expected a Record schema. */);
116
+ result = recordToFlexContent(data, schema);
117
+ break;
109
118
  default:
110
119
  (0, internal_1.unreachableCase)(schema.kind);
111
120
  }
@@ -206,7 +215,6 @@ function arrayChildToFlexTree(child, allowedTypes) {
206
215
  * @param schema - The schema associated with the value.
207
216
  */
208
217
  function arrayToFlexContent(data, schema) {
209
- (0, internal_1.assert)(schema.kind === index_js_4.NodeKind.Array, 0x922 /* Expected an array schema. */);
210
218
  if (!(typeof data === "object" && data !== null && Symbol.iterator in data)) {
211
219
  throw new internal_2.UsageError(`Input data is incompatible with Array schema: ${data}`);
212
220
  }
@@ -235,37 +243,15 @@ function arrayToFlexContent(data, schema) {
235
243
  * @param schema - The schema associated with the value.
236
244
  */
237
245
  function mapToFlexContent(data, schema) {
238
- (0, internal_1.assert)(schema.kind === index_js_4.NodeKind.Map, 0x923 /* Expected a Map schema. */);
239
246
  if (!(typeof data === "object" && data !== null)) {
240
247
  throw new internal_2.UsageError(`Input data is incompatible with Map schema: ${data}`);
241
248
  }
242
- const allowedChildTypes = (0, schemaTypes_js_1.normalizeAllowedTypes)(schema.info);
243
249
  const fieldsIterator = (Symbol.iterator in data
244
250
  ? // Support iterables of key value pairs (including Map objects)
245
251
  data
246
252
  : // Support record objects for JSON style Map data
247
253
  Object.entries(data));
248
- const context = (0, createContext_js_1.getUnhydratedContext)(schema).flexContext;
249
- const transformedFields = new Map();
250
- for (const item of fieldsIterator) {
251
- if (!(0, index_js_3.isReadonlyArray)(item) || item.length !== 2 || typeof item[0] !== "string") {
252
- throw new internal_2.UsageError(`Input data is incompatible with map entry: ${item}`);
253
- }
254
- const [key, value] = item;
255
- (0, internal_1.assert)(!transformedFields.has((0, index_js_3.brand)(key)), 0x84c /* Keys should not be duplicated */);
256
- // Omit undefined values - an entry with an undefined value is equivalent to one that has been removed or omitted
257
- if (value !== undefined) {
258
- const child = unhydratedFlexTreeFromInsertableNode(value, allowedChildTypes);
259
- const field = (0, unhydratedFlexTree_js_1.createField)(context, index_js_2.FieldKinds.optional.identifier, (0, index_js_3.brand)(key), [child]);
260
- transformedFields.set((0, index_js_3.brand)(key), field);
261
- }
262
- }
263
- return [
264
- {
265
- type: (0, index_js_3.brand)(schema.identifier),
266
- },
267
- transformedFields,
268
- ];
254
+ return recordLikeDataToFlexContent(fieldsIterator, schema);
269
255
  }
270
256
  /**
271
257
  * Transforms data under an Object schema.
@@ -273,7 +259,6 @@ function mapToFlexContent(data, schema) {
273
259
  * @param schema - The schema associated with the value.
274
260
  */
275
261
  function objectToFlexContent(data, schema) {
276
- (0, internal_1.assert)((0, objectNodeTypes_js_1.isObjectNodeSchema)(schema), 0x924 /* Expected an Object schema. */);
277
262
  if (typeof data !== "object" ||
278
263
  data === null ||
279
264
  Symbol.iterator in data ||
@@ -297,10 +282,46 @@ function objectToFlexContent(data, schema) {
297
282
  ];
298
283
  }
299
284
  const kind = toStoredSchema_js_1.convertFieldKind.get(fieldInfo.schema.kind) ?? (0, internal_1.fail)(0xbb2 /* Invalid field kind */);
300
- fields.set(fieldInfo.storedKey, (0, unhydratedFlexTree_js_1.createField)(context, kind.identifier, fieldInfo.storedKey, children));
285
+ fields.set(fieldInfo.storedKey, (0, index_js_4.createField)(context, kind.identifier, fieldInfo.storedKey, children));
301
286
  }
302
287
  return [{ type: (0, index_js_3.brand)(schema.identifier) }, fields];
303
288
  }
289
+ /**
290
+ * Transforms data under an Object schema.
291
+ * @param data - The tree data to be transformed. Must be a Record-like object.
292
+ * @param schema - The schema associated with the value.
293
+ */
294
+ function recordToFlexContent(data, schema) {
295
+ if (!(typeof data === "object" && data !== null)) {
296
+ throw new internal_2.UsageError(`Input data is incompatible with Record schema: ${data}`);
297
+ }
298
+ const fieldsIterator = Object.entries(data);
299
+ return recordLikeDataToFlexContent(fieldsIterator, schema);
300
+ }
301
+ /**
302
+ * Converts record-like data to a FlexContent representation for map/record schema.
303
+ */
304
+ function recordLikeDataToFlexContent(fieldsIterator, schema) {
305
+ const allowedChildTypes = (0, schemaTypes_js_1.normalizeAllowedTypes)((0, schemaTypes_js_1.unannotateImplicitAllowedTypes)(schema.info));
306
+ const context = (0, createContext_js_1.getUnhydratedContext)(schema).flexContext;
307
+ const transformedFields = new Map();
308
+ for (const item of fieldsIterator) {
309
+ const [key, value] = item;
310
+ (0, internal_1.assert)(!transformedFields.has((0, index_js_3.brand)(key)), 0x84c /* Keys should not be duplicated */);
311
+ // Omit undefined values - an entry with an undefined value is equivalent to one that has been removed or omitted
312
+ if (value !== undefined) {
313
+ const child = unhydratedFlexTreeFromInsertableNode(value, allowedChildTypes);
314
+ const field = (0, index_js_4.createField)(context, index_js_2.FieldKinds.optional.identifier, (0, index_js_3.brand)(key), [child]);
315
+ transformedFields.set((0, index_js_3.brand)(key), field);
316
+ }
317
+ }
318
+ return [
319
+ {
320
+ type: (0, index_js_3.brand)(schema.identifier),
321
+ },
322
+ transformedFields,
323
+ ];
324
+ }
304
325
  /**
305
326
  * Check {@link FactoryContentObject} for a property which could be store a field.
306
327
  *
@@ -427,6 +448,9 @@ function shallowCompatibilityTest(schema, data) {
427
448
  return mapOrArray ? CompatibilityLevel.Normal : CompatibilityLevel.None;
428
449
  }
429
450
  // At this point, it is assumed data is a record-like object since all the other cases have been eliminated.
451
+ if (schema.kind === index_js_4.NodeKind.Record) {
452
+ return CompatibilityLevel.Normal;
453
+ }
430
454
  if (schema.kind === index_js_4.NodeKind.Array) {
431
455
  return CompatibilityLevel.None;
432
456
  }
@@ -1 +1 @@
1
- {"version":3,"file":"unhydratedFlexTreeFromInsertable.js","sourceRoot":"","sources":["../../src/simple-tree/unhydratedFlexTreeFromInsertable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;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C,EAAE,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAEvE,oFAAoF;IACpF,gFAAgF;IAChF,+FAA+F;IAC/F,8IAA8I;IAE9I,qIAAqI;IAErI,wFAAwF;IACxF,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACrD,IAAI,WAAW,CAAC,aAAa,EAAE,CAAC;YAC/B,IAAI,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;gBACpD,OAAO,kBAAkB,CAAC,IAAI,CAAC;YAChC,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,kBAAkB,CAAC,MAAM,CAAC;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,MAAsB,EAAE,KAAgB;IAC5D,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAA,4BAAiB,EAAC,MAAM,CAAC,IAAmB,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype NodeData,\n\ttype TreeValue,\n\ttype ValueSchema,\n} from \"../core/index.js\";\nimport { FieldKinds, isTreeValue, valueSchemaAllows } from \"../feature-libraries/index.js\";\nimport { brand, isReadonlyArray, hasSingle } from \"../util/index.js\";\n\nimport { nullSchema } from \"./leafNodeSchema.js\";\nimport {\n\ttype ImplicitAllowedTypes,\n\tnormalizeAllowedTypes,\n\tisConstant,\n\ttype ImplicitFieldSchema,\n\tnormalizeFieldSchema,\n\tFieldKind,\n\ttype TreeLeafValue,\n\textractFieldProvider,\n\ttype ContextualFieldProvider,\n} from \"./schemaTypes.js\";\nimport {\n\tgetKernel,\n\tisTreeNode,\n\tNodeKind,\n\ttype TreeNode,\n\ttype TreeNodeSchema,\n\ttype Unhydrated,\n\tUnhydratedFlexTreeNode,\n\tUnhydratedSequenceField,\n} from \"./core/index.js\";\n// Required to prevent the introduction of new circular dependencies\n// TODO: Having the schema provide their own policy functions for compatibility which\n// unhydratedFlexTreeFromInsertable invokes instead of manually handling each kind would remove this bad\n// dependency, and reduce coupling.\n// eslint-disable-next-line import/no-internal-modules\nimport { isObjectNodeSchema } from \"./node-kinds/object/objectNodeTypes.js\";\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-internal-modules\nimport { createField, type UnhydratedFlexTreeField } from \"./core/unhydratedFlexTree.js\";\nimport { convertFieldKind } from \"./toStoredSchema.js\";\nimport { getUnhydratedContext } from \"./createContext.js\";\n\n/**\n * Module notes:\n *\n * The flow of the below code is in terms of the structure of the input data. We then verify that the associated\n * schema is appropriate for that kind of data. This is fine while we have a 1:1 mapping of kind of input data to\n * the kind of schema we expect for it (e.g. an input that is an array always need to be associated with a sequence in\n * the schema). If/when we begin accepting kinds of input data that are ambiguous (e.g. accepting an input that is an\n * array of key/value tuples to instantiate a map) we may need to rethink the structure here to be based more on the\n * schema than on the input data.\n */\n\n/**\n * Transforms an input {@link TypedNode} tree to an {@link UnhydratedFlexTreeNode}.\n * @param data - The input tree to be converted.\n * If the data is an unsupported value (e.g. NaN), a fallback value will be used when supported,\n * otherwise an error will be thrown.\n *\n * Fallbacks:\n *\n * * `NaN` =\\> `null`\n *\n * * `+/-∞` =\\> `null`\n *\n * * `-0` =\\> `+0`\n *\n * For fields with a default value, the field may be omitted.\n * If `context` is not provided, defaults which require a context will be left empty which can be out of schema.\n *\n * @param allowedTypes - The set of types allowed by the parent context. Used to validate the input tree.\n * @remarks\n * The resulting tree will be populated with any defaults from {@link FieldProvider}s in the schema.\n *\n * Often throws UsageErrors for invalid data, but may miss some cases.\n *\n * Output should comply with the provided view schema, but this is not explicitly validated:\n * validation against stored schema (to guard against document corruption) is done elsewhere.\n */\nexport function unhydratedFlexTreeFromInsertable<TIn extends InsertableContent | undefined>(\n\tdata: TIn,\n\tallowedTypes: ImplicitFieldSchema,\n): TIn extends undefined ? undefined : UnhydratedFlexTreeNode {\n\tconst normalizedFieldSchema = normalizeFieldSchema(allowedTypes);\n\n\tif (data === undefined) {\n\t\t// TODO: this code-path should support defaults\n\t\tif (normalizedFieldSchema.kind !== FieldKind.Optional) {\n\t\t\tthrow new UsageError(\"Got undefined for non-optional field.\");\n\t\t}\n\t\treturn undefined as TIn extends undefined ? undefined : UnhydratedFlexTreeNode;\n\t}\n\n\tconst flexTree: UnhydratedFlexTreeNode = unhydratedFlexTreeFromInsertableNode(\n\t\tdata,\n\t\tnormalizedFieldSchema.allowedTypeSet,\n\t);\n\n\treturn flexTree as TIn extends undefined ? undefined : UnhydratedFlexTreeNode;\n}\n\n/**\n * Copy content from `data` into a UnhydratedFlexTreeNode.\n */\nfunction unhydratedFlexTreeFromInsertableNode(\n\tdata: InsertableContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): UnhydratedFlexTreeNode {\n\tif (isTreeNode(data)) {\n\t\tconst kernel = getKernel(data);\n\t\tconst inner = kernel.getInnerNodeIfUnhydrated();\n\t\tif (inner === undefined) {\n\t\t\t// The node is already hydrated, meaning that it already got inserted into the tree previously\n\t\t\tthrow new UsageError(\"A node may not be inserted into the tree more than once\");\n\t\t} else {\n\t\t\tif (!allowedTypes.has(kernel.schema)) {\n\t\t\t\tthrow new UsageError(\"Invalid schema for this context.\");\n\t\t\t}\n\t\t\treturn inner;\n\t\t}\n\t}\n\n\tconst schema = getType(data, allowedTypes);\n\n\tlet result: FlexContent;\n\tswitch (schema.kind) {\n\t\tcase NodeKind.Leaf:\n\t\t\tresult = leafToFlexContent(data, schema, allowedTypes);\n\t\t\tbreak;\n\t\tcase NodeKind.Array:\n\t\t\tresult = arrayToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tcase NodeKind.Map:\n\t\t\tresult = mapToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tcase NodeKind.Object:\n\t\t\tresult = objectToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tunreachableCase(schema.kind);\n\t}\n\n\treturn new UnhydratedFlexTreeNode(...result, getUnhydratedContext(schema));\n}\n\ntype FlexContent = [NodeData, Map<FieldKey, UnhydratedFlexTreeField>];\n\n/**\n * Transforms data under a Leaf schema.\n * @param data - The tree data to be transformed. Must be a {@link TreeValue}.\n * @param schema - The schema associated with the value.\n * @param allowedTypes - The allowed types specified by the parent.\n * Used to determine which fallback values may be appropriate.\n */\nfunction leafToFlexContent(\n\tdata: FactoryContent,\n\tschema: TreeNodeSchema,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): FlexContent {\n\tassert(schema.kind === NodeKind.Leaf, 0x921 /* Expected a leaf schema. */);\n\tif (!isTreeValue(data)) {\n\t\t// This rule exists to protect against useless `toString` output like `[object Object]`.\n\t\t// In this case, that's actually reasonable behavior, since object input is not compatible with Leaf schemas.\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with leaf schema: ${data}`);\n\t}\n\n\tconst mappedValue = mapValueWithFallbacks(data, allowedTypes);\n\tconst mappedSchema = getType(mappedValue, allowedTypes);\n\n\tassert(\n\t\tallowsValue(mappedSchema, mappedValue),\n\t\t0x84a /* Unsupported schema for provided primitive. */,\n\t);\n\n\treturn [\n\t\t{\n\t\t\tvalue: mappedValue,\n\t\t\ttype: brand(mappedSchema.identifier),\n\t\t},\n\t\tnew Map<FieldKey, UnhydratedFlexTreeField>(),\n\t];\n}\n\n/**\n * Checks an incoming {@link TreeLeafValue} to ensure it is compatible with its requirements.\n * For unsupported values with a schema-compatible replacement, return the replacement value.\n * For unsupported values without a schema-compatible replacement, throw.\n * For supported values, return the input.\n */\nfunction mapValueWithFallbacks(\n\tvalue: TreeLeafValue,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): TreeValue {\n\tswitch (typeof value) {\n\t\tcase \"number\": {\n\t\t\tif (Object.is(value, -0)) {\n\t\t\t\t// Our serialized data format does not support -0.\n\t\t\t\t// Map such input to +0.\n\t\t\t\treturn 0;\n\t\t\t} else if (!Number.isFinite(value)) {\n\t\t\t\t// Our serialized data format does not support NaN nor +/-∞.\n\t\t\t\t// If the schema supports `null`, fall back to that. Otherwise, throw.\n\t\t\t\t// This is intended to match JSON's behavior for such values.\n\t\t\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new UsageError(`Received unsupported numeric value: ${value}.`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\tcase \"string\":\n\t\t// TODO:\n\t\t// This should detect invalid strings. Something like @stdlib/regexp-utf16-unpaired-surrogate could be used to do this.\n\t\t// See SchemaFactory.string for details.\n\t\tcase \"boolean\":\n\t\t\treturn value;\n\t\tcase \"object\": {\n\t\t\tif (value === null || isFluidHandle(value)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\tdefault:\n\t\t\tthrow new UsageError(`Received unsupported leaf value: ${value}.`);\n\t}\n}\n\n/**\n * Transforms data under an Array schema.\n * @param data - The tree data to be transformed.\n * @param allowedTypes - The set of types allowed by the parent context. Used to validate the input tree.\n */\nfunction arrayChildToFlexTree(\n\tchild: InsertableContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): UnhydratedFlexTreeNode {\n\t// We do not support undefined sequence entries.\n\t// If we encounter an undefined entry, use null instead if supported by the schema, otherwise throw.\n\tlet childWithFallback = child;\n\tif (child === undefined) {\n\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\tchildWithFallback = null;\n\t\t} else {\n\t\t\tthrow new TypeError(`Received unsupported array entry value: ${child}.`);\n\t\t}\n\t}\n\treturn unhydratedFlexTreeFromInsertableNode(childWithFallback, allowedTypes);\n}\n\n/**\n * Transforms data under an Array schema.\n * @param data - The tree data to be transformed. Must be an iterable.\n * @param schema - The schema associated with the value.\n */\nfunction arrayToFlexContent(data: FactoryContent, schema: TreeNodeSchema): FlexContent {\n\tassert(schema.kind === NodeKind.Array, 0x922 /* Expected an array schema. */);\n\tif (!(typeof data === \"object\" && data !== null && Symbol.iterator in data)) {\n\t\tthrow new UsageError(`Input data is incompatible with Array schema: ${data}`);\n\t}\n\n\tconst allowedChildTypes = normalizeAllowedTypes(schema.info as ImplicitAllowedTypes);\n\n\tconst mappedData = Array.from(data, (child) =>\n\t\tarrayChildToFlexTree(child, allowedChildTypes),\n\t);\n\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\t// Array nodes have a single `EmptyKey` field:\n\tconst fieldsEntries =\n\t\tmappedData.length === 0\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t[\n\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\tnew UnhydratedSequenceField(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tFieldKinds.sequence.identifier,\n\t\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\t\tmappedData,\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t] as const);\n\n\treturn [\n\t\t{\n\t\t\ttype: brand(schema.identifier),\n\t\t},\n\t\tnew Map(fieldsEntries),\n\t];\n}\n\n/**\n * Transforms data under a Map schema.\n * @param data - The tree data to be transformed. Must be an iterable.\n * @param schema - The schema associated with the value.\n */\nfunction mapToFlexContent(data: FactoryContent, schema: TreeNodeSchema): FlexContent {\n\tassert(schema.kind === NodeKind.Map, 0x923 /* Expected a Map schema. */);\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Map schema: ${data}`);\n\t}\n\n\tconst allowedChildTypes = normalizeAllowedTypes(schema.info as ImplicitAllowedTypes);\n\n\tconst fieldsIterator = (\n\t\tSymbol.iterator in data\n\t\t\t? // Support iterables of key value pairs (including Map objects)\n\t\t\t\tdata\n\t\t\t: // Support record objects for JSON style Map data\n\t\t\t\tObject.entries(data)\n\t) as Iterable<readonly [string, InsertableContent]>;\n\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\tconst transformedFields = new Map<FieldKey, UnhydratedFlexTreeField>();\n\tfor (const item of fieldsIterator) {\n\t\tif (!isReadonlyArray(item) || item.length !== 2 || typeof item[0] !== \"string\") {\n\t\t\tthrow new UsageError(`Input data is incompatible with map entry: ${item}`);\n\t\t}\n\t\tconst [key, value] = item;\n\t\tassert(!transformedFields.has(brand(key)), 0x84c /* Keys should not be duplicated */);\n\n\t\t// Omit undefined values - an entry with an undefined value is equivalent to one that has been removed or omitted\n\t\tif (value !== undefined) {\n\t\t\tconst child = unhydratedFlexTreeFromInsertableNode(value, allowedChildTypes);\n\t\t\tconst field = createField(context, FieldKinds.optional.identifier, brand(key), [child]);\n\t\t\ttransformedFields.set(brand(key), field);\n\t\t}\n\t}\n\n\treturn [\n\t\t{\n\t\t\ttype: brand(schema.identifier),\n\t\t},\n\t\ttransformedFields,\n\t];\n}\n\n/**\n * Transforms data under an Object schema.\n * @param data - The tree data to be transformed. Must be a Record-like object.\n * @param schema - The schema associated with the value.\n */\nfunction objectToFlexContent(data: FactoryContent, schema: TreeNodeSchema): FlexContent {\n\tassert(isObjectNodeSchema(schema), 0x924 /* Expected an Object schema. */);\n\tif (\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tSymbol.iterator in data ||\n\t\tisFluidHandle(data)\n\t) {\n\t\tthrow new UsageError(`Input data is incompatible with Object schema: ${data}`);\n\t}\n\n\tconst fields = new Map<FieldKey, UnhydratedFlexTreeField>();\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\tfor (const [key, fieldInfo] of schema.flexKeyMap) {\n\t\tconst value = getFieldProperty(data, key);\n\n\t\tlet children: UnhydratedFlexTreeNode[] | ContextualFieldProvider;\n\t\tif (value === undefined) {\n\t\t\tconst defaultProvider =\n\t\t\t\tfieldInfo.schema.props?.defaultProvider ??\n\t\t\t\tfail(0xbb1 /* missing field has no default provider */);\n\t\t\tconst fieldProvider = extractFieldProvider(defaultProvider);\n\t\t\tchildren = isConstant(fieldProvider) ? fieldProvider() : fieldProvider;\n\t\t} else {\n\t\t\tchildren = [\n\t\t\t\tunhydratedFlexTreeFromInsertableNode(value, fieldInfo.schema.allowedTypeSet),\n\t\t\t];\n\t\t}\n\n\t\tconst kind =\n\t\t\tconvertFieldKind.get(fieldInfo.schema.kind) ?? fail(0xbb2 /* Invalid field kind */);\n\t\tfields.set(\n\t\t\tfieldInfo.storedKey,\n\t\t\tcreateField(context, kind.identifier, fieldInfo.storedKey, children),\n\t\t);\n\t}\n\n\treturn [{ type: brand(schema.identifier) }, fields];\n}\n\n/**\n * Check {@link FactoryContentObject} for a property which could be store a field.\n *\n * @returns If the property exists, return its value. Otherwise, returns undefined.\n * @remarks\n * The currently policy is to only consider own properties.\n * See {@link InsertableObjectFromSchemaRecord} for where this policy is documented in the public API.\n *\n * Explicit undefined values are treated the same as missing properties to allow explicit use of undefined with defaulted identifiers.\n *\n * @privateRemarks\n * If we ever want to have an optional field which defaults to something other than undefined, this will need changes.\n * It would need to adjusting the handling of explicit undefined in contexts where undefined is allowed, and a default provider also exists.\n */\nfunction getFieldProperty(\n\tdata: FactoryContentObject,\n\tkey: string | symbol,\n): InsertableContent | undefined {\n\t// This policy only allows own properties.\n\tif (Object.hasOwnProperty.call(data, key)) {\n\t\treturn (data as Record<string, InsertableContent>)[key as string];\n\t}\n\treturn undefined;\n}\n\nfunction getType(\n\tdata: FactoryContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): TreeNodeSchema {\n\tconst possibleTypes = getPossibleTypes(allowedTypes, data);\n\tif (possibleTypes.length === 0) {\n\t\tthrow new UsageError(\n\t\t\t`The provided data is incompatible with all of the types allowed by the schema. The set of allowed types is: ${JSON.stringify(\n\t\t\t\t[...allowedTypes].map((schema) => schema.identifier),\n\t\t\t)}.`,\n\t\t);\n\t}\n\tif (!hasSingle(possibleTypes)) {\n\t\tthrow new UsageError(\n\t\t\t`The provided data is compatible with more than one type allowed by the schema.\nThe set of possible types is ${JSON.stringify([\n\t\t\t\t...possibleTypes.map((schema) => schema.identifier),\n\t\t\t])}.\nExplicitly construct an unhydrated node of the desired type to disambiguate.\nFor class-based schema, this can be done by replacing an expression like \"{foo: 1}\" with \"new MySchema({foo: 1})\".`,\n\t\t);\n\t}\n\treturn possibleTypes[0];\n}\n\n/**\n * Returns all types for which the data is schema-compatible.\n */\nexport function getPossibleTypes(\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\tdata: FactoryContent,\n): TreeNodeSchema[] {\n\tlet best = CompatibilityLevel.None;\n\tconst possibleTypes: TreeNodeSchema[] = [];\n\tfor (const schema of allowedTypes) {\n\t\tconst level = shallowCompatibilityTest(schema, data);\n\t\tif (level > best) {\n\t\t\tpossibleTypes.length = 0;\n\t\t\tbest = level;\n\t\t}\n\t\tif (best === level) {\n\t\t\tpossibleTypes.push(schema);\n\t\t}\n\t}\n\treturn best === CompatibilityLevel.None ? [] : possibleTypes;\n}\n\n/**\n * Indicates a compatibility level for inferring a schema to apply to insertable data.\n * @remarks\n * Only the highest compatibility options are used.\n * This approach allows adding new possible matching at a new lower compatibility level as a non breaking change,\n * since that way they can't make a case that was compatible before ambiguous now.\n */\nenum CompatibilityLevel {\n\t/**\n\t * Not compatible. Constructor typing indicates incompatibility.\n\t */\n\tNone = 0,\n\t/**\n\t * Additional compatibility cases added in Fluid Framework 2.2.\n\t */\n\tLow = 1,\n\t/**\n\t * Compatible in Fluid Framework 2.0.\n\t */\n\tNormal = 2,\n}\n\n/**\n * Checks if data might be schema-compatible.\n *\n * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n *\n * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n */\nfunction shallowCompatibilityTest(\n\tschema: TreeNodeSchema,\n\tdata: FactoryContent,\n): CompatibilityLevel {\n\tassert(data !== undefined, 0x889 /* undefined cannot be used as FactoryContent. */);\n\n\tif (isTreeValue(data)) {\n\t\treturn allowsValue(schema, data) ? CompatibilityLevel.Normal : CompatibilityLevel.None;\n\t}\n\tif (schema.kind === NodeKind.Leaf) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\t// Typing (of schema based constructors and thus implicit node construction)\n\t// allows iterables for constructing maps and arrays.\n\t// Some users of this API may have unions of maps and arrays,\n\t// and rely on Arrays ending up as array nodes and maps as Map nodes,\n\t// despite both being iterable and thus compatible with both.\n\t// This uses a priority based system where an array would be parsed as an array when unioned with a map,\n\t// but if in a map only context, could still be used as a map.\n\n\tif (data instanceof Map) {\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Map:\n\t\t\t\treturn CompatibilityLevel.Normal;\n\t\t\tcase NodeKind.Array:\n\t\t\t\t// Maps are iterable, so type checking does allow constructing an ArrayNode from a map if the array's type is an array that includes the key and value types of the map.\n\t\t\t\treturn CompatibilityLevel.Low;\n\t\t\tdefault:\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t}\n\t}\n\n\tif (isReadonlyArray(data)) {\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array:\n\t\t\t\treturn CompatibilityLevel.Normal;\n\t\t\tcase NodeKind.Map:\n\t\t\t\t// Arrays are iterable, so type checking does allow constructing an array from a MapNode from an if the array's type is key values pairs for the map.\n\t\t\t\treturn CompatibilityLevel.Low;\n\t\t\tdefault:\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t}\n\t}\n\n\tconst mapOrArray = schema.kind === NodeKind.Array || schema.kind === NodeKind.Map;\n\n\tif (Symbol.iterator in data) {\n\t\treturn mapOrArray ? CompatibilityLevel.Normal : CompatibilityLevel.None;\n\t}\n\n\t// At this point, it is assumed data is a record-like object since all the other cases have been eliminated.\n\n\tif (schema.kind === NodeKind.Array) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (schema.kind === NodeKind.Map) {\n\t\t// When not unioned with an ObjectNode, allow objects to be used to create maps.\n\t\treturn CompatibilityLevel.Low;\n\t}\n\n\tassert(isObjectNodeSchema(schema), 0x9e6 /* unexpected schema kind */);\n\n\t// TODO: Improve type inference by making this logic more thorough. Handle at least:\n\t// * Types which are strict subsets of other types in the same polymorphic union\n\t// * Types which have the same keys but different types for those keys in the polymorphic union\n\t// * Types which have the same required fields but different optional fields and enough of those optional fields are populated to disambiguate\n\n\t// TODO#7441: Consider allowing data to be inserted which has keys that are extraneous/unknown to the schema (those keys are ignored)\n\n\t// If the schema has a required key which is not present in the input object, reject it.\n\tfor (const [fieldKey, fieldSchema] of schema.fields) {\n\t\tif (fieldSchema.requiresValue) {\n\t\t\tif (getFieldProperty(data, fieldKey) === undefined) {\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn CompatibilityLevel.Normal;\n}\n\nfunction allowsValue(schema: TreeNodeSchema, value: TreeValue): boolean {\n\tif (schema.kind === NodeKind.Leaf) {\n\t\treturn valueSchemaAllows(schema.info as ValueSchema, value);\n\t}\n\treturn false;\n}\n\n/**\n * Content which can be used to build a node.\n * @remarks\n * Can contain unhydrated nodes, but can not be an unhydrated node at the root.\n * @system @alpha\n */\nexport type FactoryContent =\n\t| IFluidHandle\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| Iterable<readonly [string, InsertableContent]>\n\t| readonly InsertableContent[]\n\t| FactoryContentObject;\n\n/**\n * Record-like object which can be used to build some kinds of nodes.\n * @remarks\n * Can contain unhydrated nodes, but can not be an unhydrated node at the root.\n *\n * Supports object and map nodes.\n * @system @alpha\n */\nexport type FactoryContentObject = {\n\treadonly [P in string]?: InsertableContent;\n};\n\n/**\n * Content which can be inserted into a tree.\n * @system @alpha\n */\nexport type InsertableContent = Unhydrated<TreeNode> | FactoryContent;\n"]}
1
+ {"version":3,"file":"unhydratedFlexTreeFromInsertable.js","sourceRoot":"","sources":["../../src/simple-tree/unhydratedFlexTreeFromInsertable.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAAoF;AACpF,uEAAsE;AACtE,qEAAuE;AAEvE,+CAM0B;AAC1B,4DAA2F;AAC3F,+CAAqE;AAErE,2DAAiD;AACjD,qDAW0B;AAC1B,8CAWyB;AACzB,yDAA0D;AAC1D,2DAAuD;AAEvD,oEAAoE;AACpE,qFAAqF;AACrF,0GAA0G;AAC1G,mCAAmC;AACnC,+CAA+C;AAC/C,4EAA+F;AAC/F,sEAAuF;AACvF,+EAGgD;AAChD,+EAGgD;AAChD,8CAA8C;AAE9C;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,gCAAgC,CAC/C,IAAS,EACT,YAAiC;IAEjC,MAAM,qBAAqB,GAAG,IAAA,qCAAoB,EAAC,YAAY,CAAC,CAAC;IAEjE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxB,+CAA+C;QAC/C,IAAI,qBAAqB,CAAC,IAAI,KAAK,0BAAS,CAAC,QAAQ,EAAE,CAAC;YACvD,MAAM,IAAI,qBAAU,CAAC,uCAAuC,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,SAAuE,CAAC;IAChF,CAAC;IAED,MAAM,QAAQ,GAA2B,oCAAoC,CAC5E,IAAI,EACJ,qBAAqB,CAAC,cAAc,CACpC,CAAC;IAEF,OAAO,QAAsE,CAAC;AAC/E,CAAC;AApBD,4EAoBC;AAED;;GAEG;AACH,SAAS,oCAAoC,CAC5C,IAAuB,EACvB,YAAyC;IAEzC,IAAI,IAAA,qBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,IAAA,oBAAS,EAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,wB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C;AAClC,CAAC;AAED,SAAS,WAAW,CAAC,MAAsB,EAAE,KAAgB;IAC5D,IAAI,MAAM,CAAC,IAAI,KAAK,mBAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAA,4BAAiB,EAAC,MAAM,CAAC,IAAmB,EAAE,KAAK,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { isFluidHandle } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype NodeData,\n\ttype TreeValue,\n\ttype ValueSchema,\n} from \"../core/index.js\";\nimport { FieldKinds, isTreeValue, valueSchemaAllows } from \"../feature-libraries/index.js\";\nimport { brand, isReadonlyArray, hasSingle } from \"../util/index.js\";\n\nimport { nullSchema } from \"./leafNodeSchema.js\";\nimport {\n\ttype ImplicitAllowedTypes,\n\tnormalizeAllowedTypes,\n\tisConstant,\n\ttype ImplicitFieldSchema,\n\tnormalizeFieldSchema,\n\tFieldKind,\n\ttype TreeLeafValue,\n\textractFieldProvider,\n\ttype ContextualFieldProvider,\n\tunannotateImplicitAllowedTypes,\n} from \"./schemaTypes.js\";\nimport {\n\tcreateField,\n\tgetKernel,\n\tisTreeNode,\n\tNodeKind,\n\ttype TreeNode,\n\ttype TreeNodeSchema,\n\ttype Unhydrated,\n\ttype UnhydratedFlexTreeField,\n\tUnhydratedFlexTreeNode,\n\tUnhydratedSequenceField,\n} from \"./core/index.js\";\nimport { getUnhydratedContext } from \"./createContext.js\";\nimport { convertFieldKind } from \"./toStoredSchema.js\";\n\n// Required to prevent the introduction of new circular dependencies\n// TODO: Having the schema provide their own policy functions for compatibility which\n// `unhydratedFlexTreeFromInsertable` invokes instead of manually handling each kind would remove this bad\n// dependency, and reduce coupling.\n/* eslint-disable import/no-internal-modules */\nimport { isArrayNodeSchema, type ArrayNodeSchema } from \"./node-kinds/array/arrayNodeTypes.js\";\nimport { isMapNodeSchema, type MapNodeSchema } from \"./node-kinds/map/mapNodeTypes.js\";\nimport {\n\tisObjectNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n} from \"./node-kinds/object/objectNodeTypes.js\";\nimport {\n\tisRecordNodeSchema,\n\ttype RecordNodeSchema,\n} from \"./node-kinds/record/recordNodeTypes.js\";\n/* eslint-enable import/no-internal-modules */\n\n/**\n * Module notes:\n *\n * The flow of the below code is in terms of the structure of the input data. We then verify that the associated\n * schema is appropriate for that kind of data. This is fine while we have a 1:1 mapping of kind of input data to\n * the kind of schema we expect for it (e.g. an input that is an array always need to be associated with a sequence in\n * the schema). If/when we begin accepting kinds of input data that are ambiguous (e.g. accepting an input that is an\n * array of key/value tuples to instantiate a map) we may need to rethink the structure here to be based more on the\n * schema than on the input data.\n */\n\n/**\n * Transforms an input {@link TypedNode} tree to an {@link UnhydratedFlexTreeNode}.\n * @param data - The input tree to be converted.\n * If the data is an unsupported value (e.g. NaN), a fallback value will be used when supported,\n * otherwise an error will be thrown.\n *\n * Fallbacks:\n *\n * * `NaN` =\\> `null`\n *\n * * `+/-∞` =\\> `null`\n *\n * * `-0` =\\> `+0`\n *\n * For fields with a default value, the field may be omitted.\n * If `context` is not provided, defaults which require a context will be left empty which can be out of schema.\n *\n * @param allowedTypes - The set of types allowed by the parent context. Used to validate the input tree.\n * @remarks\n * The resulting tree will be populated with any defaults from {@link FieldProvider}s in the schema.\n *\n * Often throws UsageErrors for invalid data, but may miss some cases.\n *\n * Output should comply with the provided view schema, but this is not explicitly validated:\n * validation against stored schema (to guard against document corruption) is done elsewhere.\n */\nexport function unhydratedFlexTreeFromInsertable<TIn extends InsertableContent | undefined>(\n\tdata: TIn,\n\tallowedTypes: ImplicitFieldSchema,\n): TIn extends undefined ? undefined : UnhydratedFlexTreeNode {\n\tconst normalizedFieldSchema = normalizeFieldSchema(allowedTypes);\n\n\tif (data === undefined) {\n\t\t// TODO: this code-path should support defaults\n\t\tif (normalizedFieldSchema.kind !== FieldKind.Optional) {\n\t\t\tthrow new UsageError(\"Got undefined for non-optional field.\");\n\t\t}\n\t\treturn undefined as TIn extends undefined ? undefined : UnhydratedFlexTreeNode;\n\t}\n\n\tconst flexTree: UnhydratedFlexTreeNode = unhydratedFlexTreeFromInsertableNode(\n\t\tdata,\n\t\tnormalizedFieldSchema.allowedTypeSet,\n\t);\n\n\treturn flexTree as TIn extends undefined ? undefined : UnhydratedFlexTreeNode;\n}\n\n/**\n * Copy content from `data` into a UnhydratedFlexTreeNode.\n */\nfunction unhydratedFlexTreeFromInsertableNode(\n\tdata: InsertableContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): UnhydratedFlexTreeNode {\n\tif (isTreeNode(data)) {\n\t\tconst kernel = getKernel(data);\n\t\tconst inner = kernel.getInnerNodeIfUnhydrated();\n\t\tif (inner === undefined) {\n\t\t\t// The node is already hydrated, meaning that it already got inserted into the tree previously\n\t\t\tthrow new UsageError(\"A node may not be inserted into the tree more than once\");\n\t\t} else {\n\t\t\tif (!allowedTypes.has(kernel.schema)) {\n\t\t\t\tthrow new UsageError(\"Invalid schema for this context.\");\n\t\t\t}\n\t\t\treturn inner;\n\t\t}\n\t}\n\n\tconst schema = getType(data, allowedTypes);\n\n\tlet result: FlexContent;\n\tswitch (schema.kind) {\n\t\tcase NodeKind.Leaf:\n\t\t\tresult = leafToFlexContent(data, schema, allowedTypes);\n\t\t\tbreak;\n\t\tcase NodeKind.Array:\n\t\t\tassert(isArrayNodeSchema(schema), 0x922 /* Expected an array schema. */);\n\t\t\tresult = arrayToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tcase NodeKind.Map:\n\t\t\tassert(isMapNodeSchema(schema), 0x923 /* Expected a Map schema. */);\n\t\t\tresult = mapToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tcase NodeKind.Object:\n\t\t\tassert(isObjectNodeSchema(schema), 0x924 /* Expected an Object schema. */);\n\t\t\tresult = objectToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tcase NodeKind.Record:\n\t\t\tassert(isRecordNodeSchema(schema), 0xbdd /* Expected a Record schema. */);\n\t\t\tresult = recordToFlexContent(data, schema);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tunreachableCase(schema.kind);\n\t}\n\n\treturn new UnhydratedFlexTreeNode(...result, getUnhydratedContext(schema));\n}\n\ntype FlexContent = [NodeData, Map<FieldKey, UnhydratedFlexTreeField>];\n\n/**\n * Transforms data under a Leaf schema.\n * @param data - The tree data to be transformed. Must be a {@link TreeValue}.\n * @param schema - The schema associated with the value.\n * @param allowedTypes - The allowed types specified by the parent.\n * Used to determine which fallback values may be appropriate.\n */\nfunction leafToFlexContent(\n\tdata: FactoryContent,\n\tschema: TreeNodeSchema,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): FlexContent {\n\tassert(schema.kind === NodeKind.Leaf, 0x921 /* Expected a leaf schema. */);\n\tif (!isTreeValue(data)) {\n\t\t// This rule exists to protect against useless `toString` output like `[object Object]`.\n\t\t// In this case, that's actually reasonable behavior, since object input is not compatible with Leaf schemas.\n\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\tthrow new UsageError(`Input data is incompatible with leaf schema: ${data}`);\n\t}\n\n\tconst mappedValue = mapValueWithFallbacks(data, allowedTypes);\n\tconst mappedSchema = getType(mappedValue, allowedTypes);\n\n\tassert(\n\t\tallowsValue(mappedSchema, mappedValue),\n\t\t0x84a /* Unsupported schema for provided primitive. */,\n\t);\n\n\treturn [\n\t\t{\n\t\t\tvalue: mappedValue,\n\t\t\ttype: brand(mappedSchema.identifier),\n\t\t},\n\t\tnew Map<FieldKey, UnhydratedFlexTreeField>(),\n\t];\n}\n\n/**\n * Checks an incoming {@link TreeLeafValue} to ensure it is compatible with its requirements.\n * For unsupported values with a schema-compatible replacement, return the replacement value.\n * For unsupported values without a schema-compatible replacement, throw.\n * For supported values, return the input.\n */\nfunction mapValueWithFallbacks(\n\tvalue: TreeLeafValue,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): TreeValue {\n\tswitch (typeof value) {\n\t\tcase \"number\": {\n\t\t\tif (Object.is(value, -0)) {\n\t\t\t\t// Our serialized data format does not support -0.\n\t\t\t\t// Map such input to +0.\n\t\t\t\treturn 0;\n\t\t\t} else if (!Number.isFinite(value)) {\n\t\t\t\t// Our serialized data format does not support NaN nor +/-∞.\n\t\t\t\t// If the schema supports `null`, fall back to that. Otherwise, throw.\n\t\t\t\t// This is intended to match JSON's behavior for such values.\n\t\t\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\t\t\treturn null;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new UsageError(`Received unsupported numeric value: ${value}.`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\tcase \"string\":\n\t\t// TODO:\n\t\t// This should detect invalid strings. Something like @stdlib/regexp-utf16-unpaired-surrogate could be used to do this.\n\t\t// See SchemaFactory.string for details.\n\t\tcase \"boolean\":\n\t\t\treturn value;\n\t\tcase \"object\": {\n\t\t\tif (value === null || isFluidHandle(value)) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t\tdefault:\n\t\t\tthrow new UsageError(`Received unsupported leaf value: ${value}.`);\n\t}\n}\n\n/**\n * Transforms data under an Array schema.\n * @param data - The tree data to be transformed.\n * @param allowedTypes - The set of types allowed by the parent context. Used to validate the input tree.\n */\nfunction arrayChildToFlexTree(\n\tchild: InsertableContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): UnhydratedFlexTreeNode {\n\t// We do not support undefined sequence entries.\n\t// If we encounter an undefined entry, use null instead if supported by the schema, otherwise throw.\n\tlet childWithFallback = child;\n\tif (child === undefined) {\n\t\tif (allowedTypes.has(nullSchema)) {\n\t\t\tchildWithFallback = null;\n\t\t} else {\n\t\t\tthrow new TypeError(`Received unsupported array entry value: ${child}.`);\n\t\t}\n\t}\n\treturn unhydratedFlexTreeFromInsertableNode(childWithFallback, allowedTypes);\n}\n\n/**\n * Transforms data under an Array schema.\n * @param data - The tree data to be transformed. Must be an iterable.\n * @param schema - The schema associated with the value.\n */\nfunction arrayToFlexContent(data: FactoryContent, schema: ArrayNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null && Symbol.iterator in data)) {\n\t\tthrow new UsageError(`Input data is incompatible with Array schema: ${data}`);\n\t}\n\n\tconst allowedChildTypes = normalizeAllowedTypes(schema.info as ImplicitAllowedTypes);\n\n\tconst mappedData = Array.from(data, (child) =>\n\t\tarrayChildToFlexTree(child, allowedChildTypes),\n\t);\n\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\t// Array nodes have a single `EmptyKey` field:\n\tconst fieldsEntries =\n\t\tmappedData.length === 0\n\t\t\t? []\n\t\t\t: ([\n\t\t\t\t\t[\n\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\tnew UnhydratedSequenceField(\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tFieldKinds.sequence.identifier,\n\t\t\t\t\t\t\tEmptyKey,\n\t\t\t\t\t\t\tmappedData,\n\t\t\t\t\t\t),\n\t\t\t\t\t],\n\t\t\t\t] as const);\n\n\treturn [\n\t\t{\n\t\t\ttype: brand(schema.identifier),\n\t\t},\n\t\tnew Map(fieldsEntries),\n\t];\n}\n\n/**\n * Transforms data under a Map schema.\n * @param data - The tree data to be transformed. Must be an iterable.\n * @param schema - The schema associated with the value.\n */\nfunction mapToFlexContent(data: FactoryContent, schema: MapNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Map schema: ${data}`);\n\t}\n\n\tconst fieldsIterator = (\n\t\tSymbol.iterator in data\n\t\t\t? // Support iterables of key value pairs (including Map objects)\n\t\t\t\tdata\n\t\t\t: // Support record objects for JSON style Map data\n\t\t\t\tObject.entries(data)\n\t) as Iterable<readonly [string, InsertableContent]>;\n\n\treturn recordLikeDataToFlexContent(fieldsIterator, schema);\n}\n\n/**\n * Transforms data under an Object schema.\n * @param data - The tree data to be transformed. Must be a Record-like object.\n * @param schema - The schema associated with the value.\n */\nfunction objectToFlexContent(\n\tdata: FactoryContent,\n\tschema: ObjectNodeSchemaPrivate,\n): FlexContent {\n\tif (\n\t\ttypeof data !== \"object\" ||\n\t\tdata === null ||\n\t\tSymbol.iterator in data ||\n\t\tisFluidHandle(data)\n\t) {\n\t\tthrow new UsageError(`Input data is incompatible with Object schema: ${data}`);\n\t}\n\n\tconst fields = new Map<FieldKey, UnhydratedFlexTreeField>();\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\tfor (const [key, fieldInfo] of schema.flexKeyMap) {\n\t\tconst value = getFieldProperty(data, key);\n\n\t\tlet children: UnhydratedFlexTreeNode[] | ContextualFieldProvider;\n\t\tif (value === undefined) {\n\t\t\tconst defaultProvider =\n\t\t\t\tfieldInfo.schema.props?.defaultProvider ??\n\t\t\t\tfail(0xbb1 /* missing field has no default provider */);\n\t\t\tconst fieldProvider = extractFieldProvider(defaultProvider);\n\t\t\tchildren = isConstant(fieldProvider) ? fieldProvider() : fieldProvider;\n\t\t} else {\n\t\t\tchildren = [\n\t\t\t\tunhydratedFlexTreeFromInsertableNode(value, fieldInfo.schema.allowedTypeSet),\n\t\t\t];\n\t\t}\n\n\t\tconst kind =\n\t\t\tconvertFieldKind.get(fieldInfo.schema.kind) ?? fail(0xbb2 /* Invalid field kind */);\n\t\tfields.set(\n\t\t\tfieldInfo.storedKey,\n\t\t\tcreateField(context, kind.identifier, fieldInfo.storedKey, children),\n\t\t);\n\t}\n\n\treturn [{ type: brand(schema.identifier) }, fields];\n}\n\n/**\n * Transforms data under an Object schema.\n * @param data - The tree data to be transformed. Must be a Record-like object.\n * @param schema - The schema associated with the value.\n */\nfunction recordToFlexContent(data: FactoryContent, schema: RecordNodeSchema): FlexContent {\n\tif (!(typeof data === \"object\" && data !== null)) {\n\t\tthrow new UsageError(`Input data is incompatible with Record schema: ${data}`);\n\t}\n\n\tconst fieldsIterator: Iterable<readonly [string, InsertableContent]> = Object.entries(data);\n\treturn recordLikeDataToFlexContent(fieldsIterator, schema);\n}\n\n/**\n * Converts record-like data to a FlexContent representation for map/record schema.\n */\nfunction recordLikeDataToFlexContent(\n\tfieldsIterator: Iterable<readonly [string, InsertableContent]>,\n\tschema: MapNodeSchema | RecordNodeSchema,\n): FlexContent {\n\tconst allowedChildTypes = normalizeAllowedTypes(unannotateImplicitAllowedTypes(schema.info));\n\tconst context = getUnhydratedContext(schema).flexContext;\n\n\tconst transformedFields = new Map<FieldKey, UnhydratedFlexTreeField>();\n\tfor (const item of fieldsIterator) {\n\t\tconst [key, value] = item;\n\t\tassert(!transformedFields.has(brand(key)), 0x84c /* Keys should not be duplicated */);\n\n\t\t// Omit undefined values - an entry with an undefined value is equivalent to one that has been removed or omitted\n\t\tif (value !== undefined) {\n\t\t\tconst child = unhydratedFlexTreeFromInsertableNode(value, allowedChildTypes);\n\t\t\tconst field = createField(context, FieldKinds.optional.identifier, brand(key), [child]);\n\t\t\ttransformedFields.set(brand(key), field);\n\t\t}\n\t}\n\n\treturn [\n\t\t{\n\t\t\ttype: brand(schema.identifier),\n\t\t},\n\t\ttransformedFields,\n\t];\n}\n\n/**\n * Check {@link FactoryContentObject} for a property which could be store a field.\n *\n * @returns If the property exists, return its value. Otherwise, returns undefined.\n * @remarks\n * The currently policy is to only consider own properties.\n * See {@link InsertableObjectFromSchemaRecord} for where this policy is documented in the public API.\n *\n * Explicit undefined values are treated the same as missing properties to allow explicit use of undefined with defaulted identifiers.\n *\n * @privateRemarks\n * If we ever want to have an optional field which defaults to something other than undefined, this will need changes.\n * It would need to adjusting the handling of explicit undefined in contexts where undefined is allowed, and a default provider also exists.\n */\nfunction getFieldProperty(\n\tdata: FactoryContentObject,\n\tkey: string | symbol,\n): InsertableContent | undefined {\n\t// This policy only allows own properties.\n\tif (Object.hasOwnProperty.call(data, key)) {\n\t\treturn (data as Record<string, InsertableContent>)[key as string];\n\t}\n\treturn undefined;\n}\n\nfunction getType(\n\tdata: FactoryContent,\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n): TreeNodeSchema {\n\tconst possibleTypes = getPossibleTypes(allowedTypes, data);\n\tif (possibleTypes.length === 0) {\n\t\tthrow new UsageError(\n\t\t\t`The provided data is incompatible with all of the types allowed by the schema. The set of allowed types is: ${JSON.stringify(\n\t\t\t\t[...allowedTypes].map((schema) => schema.identifier),\n\t\t\t)}.`,\n\t\t);\n\t}\n\tif (!hasSingle(possibleTypes)) {\n\t\tthrow new UsageError(\n\t\t\t`The provided data is compatible with more than one type allowed by the schema.\nThe set of possible types is ${JSON.stringify([\n\t\t\t\t...possibleTypes.map((schema) => schema.identifier),\n\t\t\t])}.\nExplicitly construct an unhydrated node of the desired type to disambiguate.\nFor class-based schema, this can be done by replacing an expression like \"{foo: 1}\" with \"new MySchema({foo: 1})\".`,\n\t\t);\n\t}\n\treturn possibleTypes[0];\n}\n\n/**\n * Returns all types for which the data is schema-compatible.\n */\nexport function getPossibleTypes(\n\tallowedTypes: ReadonlySet<TreeNodeSchema>,\n\tdata: FactoryContent,\n): TreeNodeSchema[] {\n\tlet best = CompatibilityLevel.None;\n\tconst possibleTypes: TreeNodeSchema[] = [];\n\tfor (const schema of allowedTypes) {\n\t\tconst level = shallowCompatibilityTest(schema, data);\n\t\tif (level > best) {\n\t\t\tpossibleTypes.length = 0;\n\t\t\tbest = level;\n\t\t}\n\t\tif (best === level) {\n\t\t\tpossibleTypes.push(schema);\n\t\t}\n\t}\n\treturn best === CompatibilityLevel.None ? [] : possibleTypes;\n}\n\n/**\n * Indicates a compatibility level for inferring a schema to apply to insertable data.\n * @remarks\n * Only the highest compatibility options are used.\n * This approach allows adding new possible matching at a new lower compatibility level as a non breaking change,\n * since that way they can't make a case that was compatible before ambiguous now.\n */\nenum CompatibilityLevel {\n\t/**\n\t * Not compatible. Constructor typing indicates incompatibility.\n\t */\n\tNone = 0,\n\t/**\n\t * Additional compatibility cases added in Fluid Framework 2.2.\n\t */\n\tLow = 1,\n\t/**\n\t * Compatible in Fluid Framework 2.0.\n\t */\n\tNormal = 2,\n}\n\n/**\n * Checks if data might be schema-compatible.\n *\n * @returns false if `data` is incompatible with `type` based on a cheap/shallow check.\n *\n * Note that this may return true for cases where data is incompatible, but it must not return false in cases where the data is compatible.\n */\nfunction shallowCompatibilityTest(\n\tschema: TreeNodeSchema,\n\tdata: FactoryContent,\n): CompatibilityLevel {\n\tassert(data !== undefined, 0x889 /* undefined cannot be used as FactoryContent. */);\n\n\tif (isTreeValue(data)) {\n\t\treturn allowsValue(schema, data) ? CompatibilityLevel.Normal : CompatibilityLevel.None;\n\t}\n\tif (schema.kind === NodeKind.Leaf) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\t// Typing (of schema based constructors and thus implicit node construction)\n\t// allows iterables for constructing maps and arrays.\n\t// Some users of this API may have unions of maps and arrays,\n\t// and rely on Arrays ending up as array nodes and maps as Map nodes,\n\t// despite both being iterable and thus compatible with both.\n\t// This uses a priority based system where an array would be parsed as an array when unioned with a map,\n\t// but if in a map only context, could still be used as a map.\n\n\tif (data instanceof Map) {\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Map:\n\t\t\t\treturn CompatibilityLevel.Normal;\n\t\t\tcase NodeKind.Array:\n\t\t\t\t// Maps are iterable, so type checking does allow constructing an ArrayNode from a map if the array's type is an array that includes the key and value types of the map.\n\t\t\t\treturn CompatibilityLevel.Low;\n\t\t\tdefault:\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t}\n\t}\n\n\tif (isReadonlyArray(data)) {\n\t\tswitch (schema.kind) {\n\t\t\tcase NodeKind.Array:\n\t\t\t\treturn CompatibilityLevel.Normal;\n\t\t\tcase NodeKind.Map:\n\t\t\t\t// Arrays are iterable, so type checking does allow constructing an array from a MapNode from an if the array's type is key values pairs for the map.\n\t\t\t\treturn CompatibilityLevel.Low;\n\t\t\tdefault:\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t}\n\t}\n\n\tconst mapOrArray = schema.kind === NodeKind.Array || schema.kind === NodeKind.Map;\n\n\tif (Symbol.iterator in data) {\n\t\treturn mapOrArray ? CompatibilityLevel.Normal : CompatibilityLevel.None;\n\t}\n\n\t// At this point, it is assumed data is a record-like object since all the other cases have been eliminated.\n\n\tif (schema.kind === NodeKind.Record) {\n\t\treturn CompatibilityLevel.Normal;\n\t}\n\n\tif (schema.kind === NodeKind.Array) {\n\t\treturn CompatibilityLevel.None;\n\t}\n\n\tif (schema.kind === NodeKind.Map) {\n\t\t// When not unioned with an ObjectNode, allow objects to be used to create maps.\n\t\treturn CompatibilityLevel.Low;\n\t}\n\n\tassert(isObjectNodeSchema(schema), 0x9e6 /* unexpected schema kind */);\n\n\t// TODO: Improve type inference by making this logic more thorough. Handle at least:\n\t// * Types which are strict subsets of other types in the same polymorphic union\n\t// * Types which have the same keys but different types for those keys in the polymorphic union\n\t// * Types which have the same required fields but different optional fields and enough of those optional fields are populated to disambiguate\n\n\t// TODO#7441: Consider allowing data to be inserted which has keys that are extraneous/unknown to the schema (those keys are ignored)\n\n\t// If the schema has a required key which is not present in the input object, reject it.\n\tfor (const [fieldKey, fieldSchema] of schema.fields) {\n\t\tif (fieldSchema.requiresValue) {\n\t\t\tif (getFieldProperty(data, fieldKey) === undefined) {\n\t\t\t\treturn CompatibilityLevel.None;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn CompatibilityLevel.Normal;\n}\n\nfunction allowsValue(schema: TreeNodeSchema, value: TreeValue): boolean {\n\tif (schema.kind === NodeKind.Leaf) {\n\t\treturn valueSchemaAllows(schema.info as ValueSchema, value);\n\t}\n\treturn false;\n}\n\n/**\n * Content which can be used to build a node.\n * @remarks\n * Can contain unhydrated nodes, but can not be an unhydrated node at the root.\n * @system @alpha\n */\nexport type FactoryContent =\n\t| IFluidHandle\n\t| string\n\t| number\n\t| boolean\n\t// eslint-disable-next-line @rushstack/no-new-null\n\t| null\n\t| Iterable<readonly [string, InsertableContent]>\n\t| readonly InsertableContent[]\n\t| FactoryContentObject;\n\n/**\n * Record-like object which can be used to build some kinds of nodes.\n * @remarks\n * Can contain unhydrated nodes, but can not be an unhydrated node at the root.\n *\n * Supports object and map nodes.\n * @system @alpha\n */\nexport type FactoryContentObject = {\n\treadonly [P in string]?: InsertableContent;\n};\n\n/**\n * Content which can be inserted into a tree.\n * @system @alpha\n */\nexport type InsertableContent = Unhydrated<TreeNode> | FactoryContent;\n"]}
@@ -93,7 +93,7 @@ export declare namespace System_TableSchema {
93
93
  */
94
94
  function createRowSchema<const TInputScope extends string | undefined, const TCellSchema extends ImplicitAllowedTypes, const TPropsSchema extends ImplicitAnnotatedFieldSchema>(inputSchemaFactory: SchemaFactoryAlpha<TInputScope>, cellSchema: TCellSchema, propsSchema: TPropsSchema): TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind.Object, TreeNode & TableSchema.Row<TCellSchema, TPropsSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row">, NodeKind, unknown>, object & {
95
95
  readonly id?: string | undefined;
96
- readonly cells: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/index.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, true, TCellSchema, import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/index.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/index.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, true, TCellSchema, import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/index.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>)>;
96
+ readonly cells: (import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, import("./simple-tree/index.js").TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>, import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, true, TCellSchema, import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/index.js").TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>)> | undefined) & import("./simple-tree/schemaTypes.js").InsertableTypedNode<TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, import("./simple-tree/index.js").TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>, import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, import("./simple-tree/index.js").TreeNodeSchemaCore<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, true, TCellSchema, import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema>, unknown> & (new (data?: InternalTreeNode | import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema> | undefined) => import("./simple-tree/index.js").TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>)>;
97
97
  } & (FieldHasDefault<UnannotateImplicitFieldSchema<TPropsSchema>> extends true ? {
98
98
  /**
99
99
  * The row's properties.
@@ -111,7 +111,12 @@ export declare namespace System_TableSchema {
111
111
  }), true, {
112
112
  readonly props: TPropsSchema;
113
113
  readonly id: import("./simple-tree/schemaTypes.js").FieldSchema<import("./simple-tree/schemaTypes.js").FieldKind.Identifier, import("./simple-tree/leafNodeSchema.js").LeafSchema<"string", string>, unknown>;
114
- readonly cells: import("./simple-tree/schemaTypes.js").FieldSchemaAlpha<import("./simple-tree/schemaTypes.js").FieldKind.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, import("./simple-tree/index.js").TreeMapNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Map, unknown>, import("./simple-tree/index.js").MapNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, unknown>;
114
+ /**
115
+ * The cells of the table row, keyed by column ID.
116
+ * @remarks
117
+ * The table row models its cells as a record, where each key is the ID of the column it belongs to. The choice of record (as opposed to a map) is intended to make interop with common table rendering libraries in TypeScript/JavaScript easier.
118
+ */
119
+ readonly cells: import("./simple-tree/schemaTypes.js").FieldSchemaAlpha<import("./simple-tree/schemaTypes.js").FieldKind.Required, TreeNodeSchemaClass<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, import("./simple-tree/index.js").TreeRecordNode<TCellSchema> & WithType<ScopedSchemaName<ScopedSchemaName<TInputScope, "table">, "Row.cells">, NodeKind.Record, unknown>, import("./simple-tree/index.js").RecordNodeInsertableData<TCellSchema>, true, TCellSchema, undefined>, unknown>;
115
120
  }>;
116
121
  /**
117
122
  * Base row schema type.
@@ -1 +1 @@
1
- {"version":3,"file":"tableSchema.d.ts","sourceRoot":"","sources":["../src/tableSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAEzB,KAAK,0CAA0C,EAC/C,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,gCAAgC,EAErC,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,0BAA0B,EAC/B,KAAK,oCAAoC,EACzC,KAAK,gBAAgB,EACrB,aAAa,EACb,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAElC,MAAM,wBAAwB,CAAC;AA+DhC;;;;;;;;;GASG;AACH,yBAAiB,kBAAkB,CAAC;IACnC;;;;;;;OAOG;IACH,KAAY,gBAAgB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAE7E;;;;;OAKG;IACH,UA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oBAAoB,EACxC,KAAK,CAAC,IAAI,SAAS,kBAAkB,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,EAElE,MAAM,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG;QACvF,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;KACnB,GACC,kBAAkB,CAAC,eAAe,CACpC,MAAM,EACN,KAAK,EACL,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,EACvF,IAAI,CACJ,CAAC;IACF;;;;;;;OAOG;IACH,SAAgB,KAAK,CACpB,KAAK,CAAC,MAAM,SAAS,MAAM,GAAG,SAAS,EACvC,KAAK,CAAC,KAAK,SAAS,oBAAoB,EACxC,KAAK,CAAC,OAAO,SAAS,kBAAkB,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EACxE,KAAK,CAAC,IAAI,SAAS,kBAAkB,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,EAElE,MAAM,EAAE,kBAAkB,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG;QACvF,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC;KACnB,GACC,kBAAkB,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;CA4BpE"}
@@ -134,7 +134,12 @@ var System_TableSchema;
134
134
  // See definition of `RowInsertableType` below.
135
135
  const rowFieldsBuiltInParts = {
136
136
  id: schemaFactory.identifier,
137
- cells: schemaFactory.required(schemaFactory.map("Row.cells", cellSchema), {
137
+ /**
138
+ * The cells of the table row, keyed by column ID.
139
+ * @remarks
140
+ * The table row models its cells as a record, where each key is the ID of the column it belongs to. The choice of record (as opposed to a map) is intended to make interop with common table rendering libraries in TypeScript/JavaScript easier.
141
+ */
142
+ cells: schemaFactory.required(schemaFactory.record("Row.cells", cellSchema), {
138
143
  metadata: {
139
144
  description: "The cells of the table row, keyed by column ID.",
140
145
  },
@@ -164,26 +169,35 @@ var System_TableSchema;
164
169
  }) {
165
170
  getCell(columnOrId) {
166
171
  const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
167
- return this.cells.get(columnId);
172
+ // Unlike most objects, RecordNodes don't have the default inherited object properties, so this is safe
173
+ return this.cells[columnId];
168
174
  }
169
175
  setCell(columnOrId, value) {
170
176
  // TODO: throw if column does not exist in the owning table.
171
- const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
172
- this.cells.set(columnId, value);
177
+ if (value === undefined) {
178
+ this.removeCell(columnOrId);
179
+ }
180
+ else {
181
+ const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
182
+ // TypeScript is unable to narrow the types correctly here, hence the casts.
183
+ // See: https://github.com/microsoft/TypeScript/issues/52144
184
+ this.cells[columnId] = index_js_1.TreeAlpha.create(cellSchema, value);
185
+ }
173
186
  }
174
187
  removeCell(columnOrId) {
175
188
  // TODO: throw if column does not exist in the owning table.
176
189
  const columnId = typeof columnOrId === "string" ? columnOrId : columnOrId.id;
177
- const cell = this.cells.get(columnId);
190
+ const cell = this.getCell(columnId);
178
191
  if (cell === undefined) {
179
192
  return undefined;
180
193
  }
181
- this.cells.delete(columnId);
194
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- The record's values are non-optional, so setting `undefined` as a means to remove the cell is not supported.
195
+ delete this.cells[columnId];
182
196
  return cell;
183
197
  }
184
198
  getCells() {
185
199
  const result = [];
186
- for (const [columnId, cell] of this.cells.entries()) {
200
+ for (const [columnId, cell] of Object.entries(this.cells)) {
187
201
  if (cell !== undefined) {
188
202
  result.push({
189
203
  columnId,