@fluidframework/tree 2.71.0 → 2.73.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 (941) hide show
  1. package/CHANGELOG.md +125 -40
  2. package/api-report/tree.alpha.api.md +44 -48
  3. package/api-report/tree.beta.api.md +42 -0
  4. package/api-report/tree.legacy.beta.api.md +42 -0
  5. package/dist/alpha.d.ts +12 -8
  6. package/dist/api.d.ts +6 -2
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js +2 -11
  9. package/dist/api.js.map +1 -1
  10. package/dist/beta.d.ts +7 -0
  11. package/dist/codec/codec.d.ts +23 -1
  12. package/dist/codec/codec.d.ts.map +1 -1
  13. package/dist/codec/codec.js +23 -3
  14. package/dist/codec/codec.js.map +1 -1
  15. package/dist/codec/index.d.ts +1 -1
  16. package/dist/codec/index.d.ts.map +1 -1
  17. package/dist/codec/index.js +2 -1
  18. package/dist/codec/index.js.map +1 -1
  19. package/dist/codec/versioned/codec.d.ts +7 -2
  20. package/dist/codec/versioned/codec.d.ts.map +1 -1
  21. package/dist/codec/versioned/codec.js +24 -1
  22. package/dist/codec/versioned/codec.js.map +1 -1
  23. package/dist/codec/versioned/index.d.ts +1 -1
  24. package/dist/codec/versioned/index.d.ts.map +1 -1
  25. package/dist/codec/versioned/index.js +2 -1
  26. package/dist/codec/versioned/index.js.map +1 -1
  27. package/dist/core/index.d.ts +1 -1
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/core/index.js +2 -2
  30. package/dist/core/index.js.map +1 -1
  31. package/dist/core/schema-stored/index.d.ts +1 -1
  32. package/dist/core/schema-stored/index.d.ts.map +1 -1
  33. package/dist/core/schema-stored/index.js +2 -2
  34. package/dist/core/schema-stored/index.js.map +1 -1
  35. package/dist/core/schema-stored/schema.d.ts +18 -7
  36. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  37. package/dist/core/schema-stored/schema.js +6 -7
  38. package/dist/core/schema-stored/schema.js.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  40. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  43. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
  45. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  46. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  47. package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
  48. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  49. package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  50. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  51. package/dist/core/tree/detachedFieldIndexCodecs.js +31 -8
  52. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  53. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  54. package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  55. package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
  56. package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  57. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  58. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  59. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  60. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  61. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  62. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  63. package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
  64. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  65. package/dist/core/tree/index.d.ts +2 -1
  66. package/dist/core/tree/index.d.ts.map +1 -1
  67. package/dist/core/tree/index.js.map +1 -1
  68. package/dist/external-utilities/typeboxValidator.js +1 -1
  69. package/dist/external-utilities/typeboxValidator.js.map +1 -1
  70. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  71. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
  75. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  77. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  79. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  80. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/codecs.js +39 -21
  82. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  84. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
  86. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
  88. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  89. package/dist/feature-libraries/chunked-forest/codec/format.js +13 -4
  90. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  91. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  92. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  93. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  94. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  95. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  96. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  97. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
  98. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  99. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  100. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  101. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
  102. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  103. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  104. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
  106. package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  107. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  108. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  109. package/dist/feature-libraries/chunked-forest/index.js +2 -2
  110. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  111. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
  112. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  113. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +54 -74
  114. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  115. package/dist/feature-libraries/default-schema/index.d.ts +1 -3
  116. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  117. package/dist/feature-libraries/default-schema/index.js +2 -8
  118. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
  120. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/codec.js +15 -4
  122. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  123. package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  124. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  125. package/dist/feature-libraries/forest-summary/format.d.ts +9 -2
  126. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  127. package/dist/feature-libraries/forest-summary/format.js +11 -4
  128. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  129. package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
  130. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  131. package/dist/feature-libraries/forest-summary/index.js +3 -1
  132. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  133. package/dist/feature-libraries/index.d.ts +6 -5
  134. package/dist/feature-libraries/index.d.ts.map +1 -1
  135. package/dist/feature-libraries/index.js +9 -8
  136. package/dist/feature-libraries/index.js.map +1 -1
  137. package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/comparison.js +1 -2
  139. package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  141. package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  142. package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
  143. package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  144. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  145. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  146. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  147. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  148. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  149. package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  150. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  151. package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
  152. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  153. package/dist/feature-libraries/modular-schema/index.js +1 -3
  154. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  155. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  156. package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  157. package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  158. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  159. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  160. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  161. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  162. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  163. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  164. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  165. package/dist/feature-libraries/object-forest/objectForest.js +3 -2
  166. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  167. package/dist/feature-libraries/optional-field/index.d.ts +1 -1
  168. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  169. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  170. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  171. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  172. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  173. package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
  174. package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
  175. package/dist/feature-libraries/schema-edits/index.js.map +1 -1
  176. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  177. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  178. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
  179. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  180. package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
  181. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  182. package/dist/feature-libraries/schema-index/codec.js +24 -18
  183. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  184. package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
  185. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  186. package/dist/feature-libraries/schema-index/formatV1.js +1 -1
  187. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
  188. package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
  189. package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  190. package/dist/feature-libraries/schema-index/formatV2.js +1 -1
  191. package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
  192. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  193. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  194. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  195. package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  196. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
  197. package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  198. package/dist/feature-libraries/schemaChecker.js.map +1 -0
  199. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  200. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  201. package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  202. package/dist/index.d.ts +2 -2
  203. package/dist/index.d.ts.map +1 -1
  204. package/dist/index.js +7 -3
  205. package/dist/index.js.map +1 -1
  206. package/dist/legacy.d.ts +7 -0
  207. package/dist/packageVersion.d.ts +1 -1
  208. package/dist/packageVersion.js +1 -1
  209. package/dist/packageVersion.js.map +1 -1
  210. package/dist/shared-tree/independentView.d.ts +1 -1
  211. package/dist/shared-tree/independentView.d.ts.map +1 -1
  212. package/dist/shared-tree/independentView.js +22 -15
  213. package/dist/shared-tree/independentView.js.map +1 -1
  214. package/dist/shared-tree/index.d.ts +1 -1
  215. package/dist/shared-tree/index.d.ts.map +1 -1
  216. package/dist/shared-tree/index.js +1 -2
  217. package/dist/shared-tree/index.js.map +1 -1
  218. package/dist/shared-tree/sharedTree.d.ts +12 -60
  219. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  220. package/dist/shared-tree/sharedTree.js +68 -159
  221. package/dist/shared-tree/sharedTree.js.map +1 -1
  222. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
  223. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  224. package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -11
  225. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  226. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  227. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  228. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  229. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  230. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  231. package/dist/shared-tree/treeAlpha.js +4 -2
  232. package/dist/shared-tree/treeAlpha.js.map +1 -1
  233. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  234. package/dist/shared-tree/treeCheckout.js +1 -3
  235. package/dist/shared-tree/treeCheckout.js.map +1 -1
  236. package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
  237. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  238. package/dist/shared-tree-core/editManagerCodecs.js +42 -18
  239. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  240. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
  241. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  242. package/dist/shared-tree-core/editManagerFormatCommons.js +40 -1
  243. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  244. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  245. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  246. package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
  247. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  248. package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  249. package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  250. package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
  251. package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
  252. package/dist/shared-tree-core/index.d.ts +5 -3
  253. package/dist/shared-tree-core/index.d.ts.map +1 -1
  254. package/dist/shared-tree-core/index.js +12 -3
  255. package/dist/shared-tree-core/index.js.map +1 -1
  256. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  257. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  258. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  259. package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
  260. package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  261. package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
  262. package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
  263. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  264. package/dist/shared-tree-core/messageCodecs.js +49 -21
  265. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  266. package/dist/shared-tree-core/messageFormat.d.ts +48 -0
  267. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
  268. package/dist/shared-tree-core/messageFormat.js +53 -0
  269. package/dist/shared-tree-core/messageFormat.js.map +1 -0
  270. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
  271. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  272. package/dist/shared-tree-core/sharedTreeCore.js +3 -3
  273. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  274. package/dist/simple-tree/api/configuration.d.ts +2 -0
  275. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  276. package/dist/simple-tree/api/configuration.js +10 -0
  277. package/dist/simple-tree/api/configuration.js.map +1 -1
  278. package/dist/simple-tree/api/discrepancies.d.ts +2 -2
  279. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  280. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  281. package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
  282. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  283. package/dist/simple-tree/api/index.d.ts +4 -2
  284. package/dist/simple-tree/api/index.d.ts.map +1 -1
  285. package/dist/simple-tree/api/index.js +8 -1
  286. package/dist/simple-tree/api/index.js.map +1 -1
  287. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  288. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  289. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
  290. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  291. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  292. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  293. package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
  294. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  295. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  296. package/dist/simple-tree/api/schemaFromSimple.js +13 -4
  297. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  298. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  299. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  300. package/dist/simple-tree/api/simpleSchemaCodec.js +290 -0
  301. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  302. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  303. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  304. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
  305. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  306. package/dist/simple-tree/api/storedSchema.d.ts +2 -2
  307. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/api/storedSchema.js +8 -6
  309. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  310. package/dist/simple-tree/api/tree.d.ts +3 -3
  311. package/dist/simple-tree/api/tree.js +1 -1
  312. package/dist/simple-tree/api/tree.js.map +1 -1
  313. package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
  314. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  315. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
  316. package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  317. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
  318. package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  319. package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
  320. package/dist/simple-tree/core/allowedTypes.js +2 -2
  321. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  322. package/dist/simple-tree/core/index.d.ts +3 -3
  323. package/dist/simple-tree/core/index.d.ts.map +1 -1
  324. package/dist/simple-tree/core/index.js +3 -1
  325. package/dist/simple-tree/core/index.js.map +1 -1
  326. package/dist/simple-tree/core/toStored.d.ts +12 -5
  327. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  328. package/dist/simple-tree/core/toStored.js +26 -10
  329. package/dist/simple-tree/core/toStored.js.map +1 -1
  330. package/dist/simple-tree/core/treeNode.js +1 -1
  331. package/dist/simple-tree/core/treeNode.js.map +1 -1
  332. package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
  333. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  334. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  335. package/dist/simple-tree/core/treeNodeValid.d.ts +1 -1
  336. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  337. package/dist/simple-tree/core/treeNodeValid.js +1 -2
  338. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  339. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  340. package/dist/simple-tree/fieldSchema.js +1 -8
  341. package/dist/simple-tree/fieldSchema.js.map +1 -1
  342. package/dist/simple-tree/index.d.ts +3 -2
  343. package/dist/simple-tree/index.d.ts.map +1 -1
  344. package/dist/simple-tree/index.js +12 -2
  345. package/dist/simple-tree/index.js.map +1 -1
  346. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  347. package/dist/simple-tree/leafNodeSchema.js +0 -1
  348. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  349. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  350. package/dist/simple-tree/node-kinds/array/arrayNode.js +14 -50
  351. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  352. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  353. package/dist/simple-tree/node-kinds/map/mapNode.js +2 -6
  354. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  355. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  356. package/dist/simple-tree/node-kinds/object/objectNode.js +4 -12
  357. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  358. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  359. package/dist/simple-tree/node-kinds/record/recordNode.js +3 -7
  360. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  361. package/dist/simple-tree/simpleSchema.d.ts +25 -5
  362. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  363. package/dist/simple-tree/simpleSchema.js.map +1 -1
  364. package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  365. package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  366. package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
  367. package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  368. package/dist/simple-tree/toStoredSchema.d.ts +20 -8
  369. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  370. package/dist/simple-tree/toStoredSchema.js +27 -22
  371. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  372. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  373. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
  374. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  375. package/dist/tableSchema.d.ts +22 -52
  376. package/dist/tableSchema.d.ts.map +1 -1
  377. package/dist/tableSchema.js +141 -277
  378. package/dist/tableSchema.js.map +1 -1
  379. package/dist/treeFactory.d.ts +3 -1
  380. package/dist/treeFactory.d.ts.map +1 -1
  381. package/dist/treeFactory.js +26 -2
  382. package/dist/treeFactory.js.map +1 -1
  383. package/dist/util/arrayUtilities.d.ts +45 -0
  384. package/dist/util/arrayUtilities.d.ts.map +1 -0
  385. package/dist/util/arrayUtilities.js +76 -0
  386. package/dist/util/arrayUtilities.js.map +1 -0
  387. package/dist/util/brand.d.ts +31 -2
  388. package/dist/util/brand.d.ts.map +1 -1
  389. package/dist/util/brand.js +28 -2
  390. package/dist/util/brand.js.map +1 -1
  391. package/dist/util/brandedMap.d.ts +3 -1
  392. package/dist/util/brandedMap.d.ts.map +1 -1
  393. package/dist/util/brandedMap.js.map +1 -1
  394. package/dist/util/index.d.ts +2 -1
  395. package/dist/util/index.d.ts.map +1 -1
  396. package/dist/util/index.js +8 -2
  397. package/dist/util/index.js.map +1 -1
  398. package/lib/alpha.d.ts +12 -8
  399. package/lib/api.d.ts +6 -2
  400. package/lib/api.d.ts.map +1 -1
  401. package/lib/api.js +2 -13
  402. package/lib/api.js.map +1 -1
  403. package/lib/beta.d.ts +7 -0
  404. package/lib/codec/codec.d.ts +23 -1
  405. package/lib/codec/codec.d.ts.map +1 -1
  406. package/lib/codec/codec.js +23 -3
  407. package/lib/codec/codec.js.map +1 -1
  408. package/lib/codec/index.d.ts +1 -1
  409. package/lib/codec/index.d.ts.map +1 -1
  410. package/lib/codec/index.js +1 -1
  411. package/lib/codec/index.js.map +1 -1
  412. package/lib/codec/versioned/codec.d.ts +7 -2
  413. package/lib/codec/versioned/codec.d.ts.map +1 -1
  414. package/lib/codec/versioned/codec.js +22 -0
  415. package/lib/codec/versioned/codec.js.map +1 -1
  416. package/lib/codec/versioned/index.d.ts +1 -1
  417. package/lib/codec/versioned/index.d.ts.map +1 -1
  418. package/lib/codec/versioned/index.js +1 -1
  419. package/lib/codec/versioned/index.js.map +1 -1
  420. package/lib/core/index.d.ts +1 -1
  421. package/lib/core/index.d.ts.map +1 -1
  422. package/lib/core/index.js +1 -1
  423. package/lib/core/index.js.map +1 -1
  424. package/lib/core/schema-stored/index.d.ts +1 -1
  425. package/lib/core/schema-stored/index.d.ts.map +1 -1
  426. package/lib/core/schema-stored/index.js +1 -1
  427. package/lib/core/schema-stored/index.js.map +1 -1
  428. package/lib/core/schema-stored/schema.d.ts +18 -7
  429. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  430. package/lib/core/schema-stored/schema.js +6 -7
  431. package/lib/core/schema-stored/schema.js.map +1 -1
  432. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
  433. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  434. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  435. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
  436. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  437. package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
  438. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  439. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  440. package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
  441. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  442. package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
  443. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  444. package/lib/core/tree/detachedFieldIndexCodecs.js +31 -8
  445. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  446. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
  447. package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
  448. package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
  449. package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
  450. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
  451. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  452. package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
  453. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  454. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
  455. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  456. package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
  457. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  458. package/lib/core/tree/index.d.ts +2 -1
  459. package/lib/core/tree/index.d.ts.map +1 -1
  460. package/lib/core/tree/index.js +1 -1
  461. package/lib/core/tree/index.js.map +1 -1
  462. package/lib/external-utilities/typeboxValidator.js +1 -1
  463. package/lib/external-utilities/typeboxValidator.js.map +1 -1
  464. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
  465. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  466. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  467. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  468. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
  469. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  470. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
  471. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  472. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  473. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
  474. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  475. package/lib/feature-libraries/chunked-forest/codec/codecs.js +42 -23
  476. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  477. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
  478. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  479. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +5 -3
  480. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  481. package/lib/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
  482. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  483. package/lib/feature-libraries/chunked-forest/codec/format.js +12 -3
  484. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  485. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
  486. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  487. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
  488. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  489. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
  490. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  491. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  492. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  493. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
  494. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  495. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
  496. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  497. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
  498. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
  499. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
  500. package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
  501. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  502. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  503. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  504. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  505. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
  506. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  507. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +56 -76
  508. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  509. package/lib/feature-libraries/default-schema/index.d.ts +1 -3
  510. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  511. package/lib/feature-libraries/default-schema/index.js +1 -3
  512. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  513. package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
  514. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  515. package/lib/feature-libraries/forest-summary/codec.js +16 -5
  516. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  517. package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
  518. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  519. package/lib/feature-libraries/forest-summary/format.d.ts +9 -2
  520. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  521. package/lib/feature-libraries/forest-summary/format.js +9 -2
  522. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  523. package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
  524. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  525. package/lib/feature-libraries/forest-summary/index.js +1 -0
  526. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  527. package/lib/feature-libraries/index.d.ts +6 -5
  528. package/lib/feature-libraries/index.d.ts.map +1 -1
  529. package/lib/feature-libraries/index.js +5 -4
  530. package/lib/feature-libraries/index.js.map +1 -1
  531. package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
  532. package/lib/feature-libraries/modular-schema/comparison.js +1 -2
  533. package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
  534. package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
  535. package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
  536. package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
  537. package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
  538. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
  539. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  540. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  541. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
  542. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  543. package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
  544. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  545. package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
  546. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  547. package/lib/feature-libraries/modular-schema/index.js +0 -1
  548. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  549. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
  550. package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
  551. package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
  552. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
  553. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  554. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
  555. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  556. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
  557. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  558. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  559. package/lib/feature-libraries/object-forest/objectForest.js +2 -1
  560. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  561. package/lib/feature-libraries/optional-field/index.d.ts +1 -1
  562. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  563. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  564. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  565. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  566. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  567. package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
  568. package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
  569. package/lib/feature-libraries/schema-edits/index.js.map +1 -1
  570. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
  571. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  572. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
  573. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  574. package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
  575. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  576. package/lib/feature-libraries/schema-index/codec.js +26 -20
  577. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  578. package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
  579. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
  580. package/lib/feature-libraries/schema-index/formatV1.js +2 -2
  581. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
  582. package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
  583. package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
  584. package/lib/feature-libraries/schema-index/formatV2.js +2 -2
  585. package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
  586. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
  587. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  588. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  589. package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
  590. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
  591. package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
  592. package/lib/feature-libraries/schemaChecker.js.map +1 -0
  593. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
  594. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
  595. package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
  596. package/lib/index.d.ts +2 -2
  597. package/lib/index.d.ts.map +1 -1
  598. package/lib/index.js +2 -2
  599. package/lib/index.js.map +1 -1
  600. package/lib/legacy.d.ts +7 -0
  601. package/lib/packageVersion.d.ts +1 -1
  602. package/lib/packageVersion.js +1 -1
  603. package/lib/packageVersion.js.map +1 -1
  604. package/lib/shared-tree/independentView.d.ts +1 -1
  605. package/lib/shared-tree/independentView.d.ts.map +1 -1
  606. package/lib/shared-tree/independentView.js +11 -4
  607. package/lib/shared-tree/independentView.js.map +1 -1
  608. package/lib/shared-tree/index.d.ts +1 -1
  609. package/lib/shared-tree/index.d.ts.map +1 -1
  610. package/lib/shared-tree/index.js +1 -1
  611. package/lib/shared-tree/index.js.map +1 -1
  612. package/lib/shared-tree/sharedTree.d.ts +12 -60
  613. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  614. package/lib/shared-tree/sharedTree.js +70 -161
  615. package/lib/shared-tree/sharedTree.js.map +1 -1
  616. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
  617. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  618. package/lib/shared-tree/sharedTreeChangeCodecs.js +5 -6
  619. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  620. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
  621. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  622. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  623. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  624. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  625. package/lib/shared-tree/treeAlpha.js +5 -3
  626. package/lib/shared-tree/treeAlpha.js.map +1 -1
  627. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  628. package/lib/shared-tree/treeCheckout.js +1 -3
  629. package/lib/shared-tree/treeCheckout.js.map +1 -1
  630. package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
  631. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  632. package/lib/shared-tree-core/editManagerCodecs.js +39 -17
  633. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  634. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
  635. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  636. package/lib/shared-tree-core/editManagerFormatCommons.js +39 -0
  637. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  638. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  639. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  640. package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
  641. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  642. package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
  643. package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
  644. package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
  645. package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
  646. package/lib/shared-tree-core/index.d.ts +5 -3
  647. package/lib/shared-tree-core/index.d.ts.map +1 -1
  648. package/lib/shared-tree-core/index.js +4 -2
  649. package/lib/shared-tree-core/index.js.map +1 -1
  650. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
  651. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  652. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  653. package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
  654. package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
  655. package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
  656. package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
  657. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  658. package/lib/shared-tree-core/messageCodecs.js +46 -20
  659. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  660. package/lib/shared-tree-core/messageFormat.d.ts +48 -0
  661. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
  662. package/lib/shared-tree-core/messageFormat.js +50 -0
  663. package/lib/shared-tree-core/messageFormat.js.map +1 -0
  664. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
  665. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  666. package/lib/shared-tree-core/sharedTreeCore.js +3 -3
  667. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  668. package/lib/simple-tree/api/configuration.d.ts +2 -0
  669. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  670. package/lib/simple-tree/api/configuration.js +10 -0
  671. package/lib/simple-tree/api/configuration.js.map +1 -1
  672. package/lib/simple-tree/api/discrepancies.d.ts +2 -2
  673. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  674. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  675. package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
  676. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  677. package/lib/simple-tree/api/index.d.ts +4 -2
  678. package/lib/simple-tree/api/index.d.ts.map +1 -1
  679. package/lib/simple-tree/api/index.js +2 -0
  680. package/lib/simple-tree/api/index.js.map +1 -1
  681. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
  682. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  683. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
  684. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  685. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
  686. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  687. package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
  688. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  689. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  690. package/lib/simple-tree/api/schemaFromSimple.js +14 -5
  691. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  692. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
  693. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
  694. package/lib/simple-tree/api/simpleSchemaCodec.js +262 -0
  695. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
  696. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
  697. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
  698. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
  699. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
  700. package/lib/simple-tree/api/storedSchema.d.ts +2 -2
  701. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  702. package/lib/simple-tree/api/storedSchema.js +5 -3
  703. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  704. package/lib/simple-tree/api/tree.d.ts +3 -3
  705. package/lib/simple-tree/api/tree.js +1 -1
  706. package/lib/simple-tree/api/tree.js.map +1 -1
  707. package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
  708. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  709. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
  710. package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
  711. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
  712. package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
  713. package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
  714. package/lib/simple-tree/core/allowedTypes.js +2 -2
  715. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  716. package/lib/simple-tree/core/index.d.ts +3 -3
  717. package/lib/simple-tree/core/index.d.ts.map +1 -1
  718. package/lib/simple-tree/core/index.js +2 -2
  719. package/lib/simple-tree/core/index.js.map +1 -1
  720. package/lib/simple-tree/core/toStored.d.ts +12 -5
  721. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  722. package/lib/simple-tree/core/toStored.js +25 -9
  723. package/lib/simple-tree/core/toStored.js.map +1 -1
  724. package/lib/simple-tree/core/treeNode.js +1 -1
  725. package/lib/simple-tree/core/treeNode.js.map +1 -1
  726. package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
  727. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  728. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  729. package/lib/simple-tree/core/treeNodeValid.d.ts +1 -1
  730. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  731. package/lib/simple-tree/core/treeNodeValid.js +1 -2
  732. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  733. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  734. package/lib/simple-tree/fieldSchema.js +2 -9
  735. package/lib/simple-tree/fieldSchema.js.map +1 -1
  736. package/lib/simple-tree/index.d.ts +3 -2
  737. package/lib/simple-tree/index.d.ts.map +1 -1
  738. package/lib/simple-tree/index.js +2 -1
  739. package/lib/simple-tree/index.js.map +1 -1
  740. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  741. package/lib/simple-tree/leafNodeSchema.js +1 -2
  742. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  743. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  744. package/lib/simple-tree/node-kinds/array/arrayNode.js +17 -53
  745. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  746. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  747. package/lib/simple-tree/node-kinds/map/mapNode.js +5 -9
  748. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  749. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  750. package/lib/simple-tree/node-kinds/object/objectNode.js +6 -14
  751. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  752. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  753. package/lib/simple-tree/node-kinds/record/recordNode.js +6 -10
  754. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  755. package/lib/simple-tree/simpleSchema.d.ts +25 -5
  756. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  757. package/lib/simple-tree/simpleSchema.js.map +1 -1
  758. package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
  759. package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
  760. package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
  761. package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
  762. package/lib/simple-tree/toStoredSchema.d.ts +20 -8
  763. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  764. package/lib/simple-tree/toStoredSchema.js +28 -24
  765. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  766. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  767. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
  768. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  769. package/lib/tableSchema.d.ts +22 -52
  770. package/lib/tableSchema.d.ts.map +1 -1
  771. package/lib/tableSchema.js +143 -279
  772. package/lib/tableSchema.js.map +1 -1
  773. package/lib/treeFactory.d.ts +3 -1
  774. package/lib/treeFactory.d.ts.map +1 -1
  775. package/lib/treeFactory.js +23 -1
  776. package/lib/treeFactory.js.map +1 -1
  777. package/lib/util/arrayUtilities.d.ts +45 -0
  778. package/lib/util/arrayUtilities.d.ts.map +1 -0
  779. package/lib/util/arrayUtilities.js +69 -0
  780. package/lib/util/arrayUtilities.js.map +1 -0
  781. package/lib/util/brand.d.ts +31 -2
  782. package/lib/util/brand.d.ts.map +1 -1
  783. package/lib/util/brand.js +26 -1
  784. package/lib/util/brand.js.map +1 -1
  785. package/lib/util/brandedMap.d.ts +3 -1
  786. package/lib/util/brandedMap.d.ts.map +1 -1
  787. package/lib/util/brandedMap.js.map +1 -1
  788. package/lib/util/index.d.ts +2 -1
  789. package/lib/util/index.d.ts.map +1 -1
  790. package/lib/util/index.js +2 -1
  791. package/lib/util/index.js.map +1 -1
  792. package/package.json +24 -24
  793. package/src/api.ts +22 -11
  794. package/src/codec/codec.ts +25 -3
  795. package/src/codec/index.ts +1 -0
  796. package/src/codec/versioned/codec.ts +40 -2
  797. package/src/codec/versioned/index.ts +1 -0
  798. package/src/core/index.ts +1 -2
  799. package/src/core/schema-stored/index.ts +1 -2
  800. package/src/core/schema-stored/schema.ts +22 -8
  801. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  802. package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
  803. package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
  804. package/src/core/tree/detachedFieldIndexCodecs.ts +40 -11
  805. package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
  806. package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
  807. package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
  808. package/src/core/tree/index.ts +2 -4
  809. package/src/external-utilities/typeboxValidator.ts +1 -1
  810. package/src/feature-libraries/README.md +1 -1
  811. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
  812. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
  813. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
  814. package/src/feature-libraries/chunked-forest/codec/codecs.ts +65 -27
  815. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +9 -4
  816. package/src/feature-libraries/chunked-forest/codec/format.ts +26 -5
  817. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
  818. package/src/feature-libraries/chunked-forest/codec/index.ts +1 -2
  819. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
  820. package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
  821. package/src/feature-libraries/chunked-forest/index.ts +1 -2
  822. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +88 -103
  823. package/src/feature-libraries/default-schema/index.ts +1 -9
  824. package/src/feature-libraries/forest-summary/codec.ts +24 -9
  825. package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
  826. package/src/feature-libraries/forest-summary/format.ts +25 -9
  827. package/src/feature-libraries/forest-summary/index.ts +2 -1
  828. package/src/feature-libraries/index.ts +8 -7
  829. package/src/feature-libraries/modular-schema/comparison.ts +2 -3
  830. package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
  831. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
  832. package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
  833. package/src/feature-libraries/modular-schema/index.ts +0 -1
  834. package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
  835. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
  836. package/src/feature-libraries/object-forest/objectForest.ts +2 -6
  837. package/src/feature-libraries/optional-field/index.ts +1 -0
  838. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  839. package/src/feature-libraries/schema-edits/index.ts +0 -1
  840. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
  841. package/src/feature-libraries/schema-index/codec.ts +41 -22
  842. package/src/feature-libraries/schema-index/formatV1.ts +2 -2
  843. package/src/feature-libraries/schema-index/formatV2.ts +2 -2
  844. package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
  845. package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
  846. package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
  847. package/src/index.ts +6 -2
  848. package/src/packageVersion.ts +1 -1
  849. package/src/shared-tree/independentView.ts +16 -5
  850. package/src/shared-tree/index.ts +0 -1
  851. package/src/shared-tree/sharedTree.ts +92 -222
  852. package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -13
  853. package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
  854. package/src/shared-tree/treeAlpha.ts +6 -5
  855. package/src/shared-tree/treeCheckout.ts +1 -3
  856. package/src/shared-tree-core/editManagerCodecs.ts +69 -20
  857. package/src/shared-tree-core/editManagerFormatCommons.ts +46 -0
  858. package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
  859. package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
  860. package/src/shared-tree-core/index.ts +15 -5
  861. package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
  862. package/src/shared-tree-core/messageCodecV5.ts +2 -1
  863. package/src/shared-tree-core/messageCodecs.ts +77 -28
  864. package/src/shared-tree-core/messageFormat.ts +58 -0
  865. package/src/shared-tree-core/sharedTreeCore.ts +11 -13
  866. package/src/simple-tree/api/configuration.ts +17 -4
  867. package/src/simple-tree/api/discrepancies.ts +2 -2
  868. package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
  869. package/src/simple-tree/api/index.ts +11 -2
  870. package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
  871. package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
  872. package/src/simple-tree/api/schemaFromSimple.ts +20 -9
  873. package/src/simple-tree/api/simpleSchemaCodec.ts +361 -0
  874. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
  875. package/src/simple-tree/api/storedSchema.ts +8 -5
  876. package/src/simple-tree/api/tree.ts +3 -3
  877. package/src/simple-tree/api/typesUnsafe.ts +6 -6
  878. package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
  879. package/src/simple-tree/core/allowedTypes.ts +4 -4
  880. package/src/simple-tree/core/index.ts +3 -1
  881. package/src/simple-tree/core/toStored.ts +42 -18
  882. package/src/simple-tree/core/treeNode.ts +2 -2
  883. package/src/simple-tree/core/treeNodeSchema.ts +1 -7
  884. package/src/simple-tree/core/treeNodeValid.ts +0 -2
  885. package/src/simple-tree/fieldSchema.ts +2 -11
  886. package/src/simple-tree/index.ts +11 -2
  887. package/src/simple-tree/leafNodeSchema.ts +1 -2
  888. package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -77
  889. package/src/simple-tree/node-kinds/map/mapNode.ts +3 -17
  890. package/src/simple-tree/node-kinds/object/objectNode.ts +5 -20
  891. package/src/simple-tree/node-kinds/record/recordNode.ts +4 -18
  892. package/src/simple-tree/simpleSchema.ts +27 -5
  893. package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
  894. package/src/simple-tree/toStoredSchema.ts +54 -38
  895. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
  896. package/src/tableSchema.ts +110 -331
  897. package/src/treeFactory.ts +33 -1
  898. package/src/util/arrayUtilities.ts +88 -0
  899. package/src/util/brand.ts +40 -2
  900. package/src/util/brandedMap.ts +3 -1
  901. package/src/util/index.ts +7 -0
  902. package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  903. package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  904. package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
  905. package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  906. package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  907. package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  908. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  909. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  910. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
  911. package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  912. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  913. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  914. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
  915. package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  916. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  917. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  918. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
  919. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  920. package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
  921. package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
  922. package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
  923. package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
  924. package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
  925. package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
  926. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
  927. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
  928. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
  929. package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
  930. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
  931. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
  932. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
  933. package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
  934. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
  935. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
  936. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
  937. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
  938. package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
  939. package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
  940. package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
  941. package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
@@ -0,0 +1,249 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { type Static } from "@sinclair/typebox";
6
+ /**
7
+ * The format version for the schema.
8
+ */
9
+ export declare const SimpleSchemaFormatVersion: {
10
+ readonly v1: 1;
11
+ };
12
+ /**
13
+ * The allowed types and their attributes in the simple schema format.
14
+ * @see {@link SimpleAllowedTypes}.
15
+ */
16
+ export declare const SimpleAllowedTypeAttributesFormat: import("@sinclair/typebox").TObject<{
17
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
18
+ }>;
19
+ export type SimpleAllowedTypeAttributesFormat = Static<typeof SimpleAllowedTypeAttributesFormat>;
20
+ /**
21
+ * A set of allowed types in the simple schema format.
22
+ * The keys are the type identifiers, and the values are their attributes.
23
+ */
24
+ export declare const SimpleAllowedTypesFormat: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
25
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
26
+ }>>;
27
+ export type SimpleAllowedTypesFormat = Static<typeof SimpleAllowedTypesFormat>;
28
+ /**
29
+ * Persisted format for a field schema in the simple schema format.
30
+ * @see {@link SimpleFieldSchema}.
31
+ */
32
+ export declare const SimpleFieldSchemaFormat: import("@sinclair/typebox").TObject<{
33
+ kind: import("@sinclair/typebox").TInteger;
34
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
35
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
36
+ }>>;
37
+ }>;
38
+ export type SimpleFieldSchemaFormat = Static<typeof SimpleFieldSchemaFormat>;
39
+ /**
40
+ * Persisted format for an object field schema in the simple schema format.
41
+ * @see {@link SimpleObjectFieldSchema}.
42
+ */
43
+ export declare const SimpleObjectFieldSchemaFormat: import("@sinclair/typebox").TObject<{
44
+ kind: import("@sinclair/typebox").TInteger;
45
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
46
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
47
+ }>>;
48
+ storedKey: import("@sinclair/typebox").TString;
49
+ }>;
50
+ export type SimpleObjectFieldSchemaFormat = Static<typeof SimpleObjectFieldSchemaFormat>;
51
+ /**
52
+ * Persisted format for an array node schema in the simple schema format.
53
+ * @see {@link SimpleArrayNodeSchema}.
54
+ */
55
+ export declare const SimpleArrayNodeSchemaFormat: import("@sinclair/typebox").TObject<{
56
+ kind: import("@sinclair/typebox").TInteger;
57
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
58
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
59
+ }>>;
60
+ }>;
61
+ export type SimpleArrayNodeSchemaFormat = Static<typeof SimpleArrayNodeSchemaFormat>;
62
+ /**
63
+ * Persisted format for a map node schema in the simple schema format.
64
+ * @see {@link SimpleMapNodeSchema}.
65
+ */
66
+ export declare const SimpleMapNodeSchemaFormat: import("@sinclair/typebox").TObject<{
67
+ kind: import("@sinclair/typebox").TInteger;
68
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
69
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
70
+ }>>;
71
+ }>;
72
+ export type SimpleMapNodeSchemaFormat = Static<typeof SimpleMapNodeSchemaFormat>;
73
+ /**
74
+ * Persisted format for a record node schema in the simple schema format.
75
+ * @see {@link SimpleRecordNodeSchema}.
76
+ */
77
+ export declare const SimpleRecordNodeSchemaFormat: import("@sinclair/typebox").TObject<{
78
+ kind: import("@sinclair/typebox").TInteger;
79
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
80
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
81
+ }>>;
82
+ }>;
83
+ export type SimpleRecordNodeSchemaFormat = Static<typeof SimpleRecordNodeSchemaFormat>;
84
+ /**
85
+ * Persisted format for a leaf node schema in the simple schema format.
86
+ * @see {@link SimpleLeafNodeSchema}.
87
+ */
88
+ export declare const SimpleLeafNodeSchemaFormat: import("@sinclair/typebox").TObject<{
89
+ kind: import("@sinclair/typebox").TInteger;
90
+ leafKind: import("@sinclair/typebox").TInteger;
91
+ }>;
92
+ export type SimpleLeafNodeSchemaFormat = Static<typeof SimpleLeafNodeSchemaFormat>;
93
+ /**
94
+ * Persisted format for the field schemas of an object node in the simple schema format.
95
+ */
96
+ export declare const SimpleObjectFieldSchemasFormat: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
97
+ kind: import("@sinclair/typebox").TInteger;
98
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
99
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
100
+ }>>;
101
+ storedKey: import("@sinclair/typebox").TString;
102
+ }>>;
103
+ export type SimpleObjectFieldSchemasFormat = Static<typeof SimpleObjectFieldSchemasFormat>;
104
+ /**
105
+ * Persisted format for an object node schema in the simple schema format.
106
+ * @see {@link SimpleObjectNodeSchema}.
107
+ */
108
+ export declare const SimpleObjectNodeSchemaFormat: import("@sinclair/typebox").TObject<{
109
+ kind: import("@sinclair/typebox").TInteger;
110
+ fields: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
111
+ kind: import("@sinclair/typebox").TInteger;
112
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
113
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
114
+ }>>;
115
+ storedKey: import("@sinclair/typebox").TString;
116
+ }>>;
117
+ allowUnknownOptionalFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
118
+ }>;
119
+ export type SimpleObjectNodeSchemaFormat = Static<typeof SimpleObjectNodeSchemaFormat>;
120
+ /**
121
+ * Discriminated union of all possible node schemas.
122
+ *
123
+ * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
124
+ */
125
+ export declare const SimpleNodeSchemaUnionFormat: import("@sinclair/typebox").TObject<{
126
+ array: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
127
+ kind: import("@sinclair/typebox").TInteger;
128
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
129
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
130
+ }>>;
131
+ }>>;
132
+ map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
133
+ kind: import("@sinclair/typebox").TInteger;
134
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
135
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
136
+ }>>;
137
+ }>>;
138
+ record: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
139
+ kind: import("@sinclair/typebox").TInteger;
140
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
141
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
142
+ }>>;
143
+ }>>;
144
+ leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
145
+ kind: import("@sinclair/typebox").TInteger;
146
+ leafKind: import("@sinclair/typebox").TInteger;
147
+ }>>;
148
+ object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
149
+ kind: import("@sinclair/typebox").TInteger;
150
+ fields: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
151
+ kind: import("@sinclair/typebox").TInteger;
152
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
153
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
154
+ }>>;
155
+ storedKey: import("@sinclair/typebox").TString;
156
+ }>>;
157
+ allowUnknownOptionalFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
158
+ }>>;
159
+ }>;
160
+ export type SimpleNodeSchemaUnionFormat = Static<typeof SimpleNodeSchemaUnionFormat>;
161
+ /**
162
+ * Helper type for the schema definitions map in the persisted format.
163
+ */
164
+ export declare const SimpleSchemaDefinitionsFormat: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
165
+ array: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
166
+ kind: import("@sinclair/typebox").TInteger;
167
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
168
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
169
+ }>>;
170
+ }>>;
171
+ map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
172
+ kind: import("@sinclair/typebox").TInteger;
173
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
174
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
175
+ }>>;
176
+ }>>;
177
+ record: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
178
+ kind: import("@sinclair/typebox").TInteger;
179
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
180
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
181
+ }>>;
182
+ }>>;
183
+ leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
184
+ kind: import("@sinclair/typebox").TInteger;
185
+ leafKind: import("@sinclair/typebox").TInteger;
186
+ }>>;
187
+ object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
188
+ kind: import("@sinclair/typebox").TInteger;
189
+ fields: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
190
+ kind: import("@sinclair/typebox").TInteger;
191
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
192
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
193
+ }>>;
194
+ storedKey: import("@sinclair/typebox").TString;
195
+ }>>;
196
+ allowUnknownOptionalFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
197
+ }>>;
198
+ }>>;
199
+ export type SimpleSchemaDefinitionsFormat = Static<typeof SimpleSchemaDefinitionsFormat>;
200
+ /**
201
+ * Persisted format for the entire tree schema in the simple schema format.
202
+ * @see {@link SimpleTreeSchema}.
203
+ */
204
+ export declare const SimpleTreeSchemaFormat: import("@sinclair/typebox").TObject<{
205
+ version: import("@sinclair/typebox").TLiteral<1>;
206
+ root: import("@sinclair/typebox").TObject<{
207
+ kind: import("@sinclair/typebox").TInteger;
208
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
209
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
210
+ }>>;
211
+ }>;
212
+ definitions: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
213
+ array: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
214
+ kind: import("@sinclair/typebox").TInteger;
215
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
216
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
217
+ }>>;
218
+ }>>;
219
+ map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
220
+ kind: import("@sinclair/typebox").TInteger;
221
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
222
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
223
+ }>>;
224
+ }>>;
225
+ record: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
226
+ kind: import("@sinclair/typebox").TInteger;
227
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
228
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
229
+ }>>;
230
+ }>>;
231
+ leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
232
+ kind: import("@sinclair/typebox").TInteger;
233
+ leafKind: import("@sinclair/typebox").TInteger;
234
+ }>>;
235
+ object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
236
+ kind: import("@sinclair/typebox").TInteger;
237
+ fields: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
238
+ kind: import("@sinclair/typebox").TInteger;
239
+ simpleAllowedTypes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
240
+ isStaged: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
241
+ }>>;
242
+ storedKey: import("@sinclair/typebox").TString;
243
+ }>>;
244
+ allowUnknownOptionalFields: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
245
+ }>>;
246
+ }>>;
247
+ }>;
248
+ export type SimpleTreeSchemaFormat = Static<typeof SimpleTreeSchemaFormat>;
249
+ //# sourceMappingURL=simpleSchemaFormatV1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleSchemaFormatV1.d.ts","sourceRoot":"","sources":["../../src/simple-tree/simpleSchemaFormatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI1E;;GAEG;AACH,eAAO,MAAM,yBAAyB;;CAE5B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,iCAAiC;;EAK7C,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,MAAM,CACrD,OAAO,iCAAiC,CACxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBA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M,2BAA2B,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAGzC,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEzF;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOlC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,112 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { Type } from "@sinclair/typebox";
6
+ const noAdditionalProps = { additionalProperties: false };
7
+ /**
8
+ * The format version for the schema.
9
+ */
10
+ export const SimpleSchemaFormatVersion = {
11
+ v1: 1,
12
+ };
13
+ /**
14
+ * The allowed types and their attributes in the simple schema format.
15
+ * @see {@link SimpleAllowedTypes}.
16
+ */
17
+ export const SimpleAllowedTypeAttributesFormat = Type.Object({
18
+ isStaged: Type.Optional(Type.Boolean()),
19
+ }, noAdditionalProps);
20
+ /**
21
+ * A set of allowed types in the simple schema format.
22
+ * The keys are the type identifiers, and the values are their attributes.
23
+ */
24
+ export const SimpleAllowedTypesFormat = Type.Record(Type.String(), SimpleAllowedTypeAttributesFormat);
25
+ /**
26
+ * Persisted format for a field schema in the simple schema format.
27
+ * @see {@link SimpleFieldSchema}.
28
+ */
29
+ export const SimpleFieldSchemaFormat = Type.Object({
30
+ kind: Type.Integer(),
31
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
32
+ }, noAdditionalProps);
33
+ /**
34
+ * Persisted format for an object field schema in the simple schema format.
35
+ * @see {@link SimpleObjectFieldSchema}.
36
+ */
37
+ export const SimpleObjectFieldSchemaFormat = Type.Object({
38
+ kind: Type.Integer(),
39
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
40
+ storedKey: Type.String(),
41
+ }, noAdditionalProps);
42
+ /**
43
+ * Persisted format for an array node schema in the simple schema format.
44
+ * @see {@link SimpleArrayNodeSchema}.
45
+ */
46
+ export const SimpleArrayNodeSchemaFormat = Type.Object({
47
+ kind: Type.Integer(),
48
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
49
+ }, noAdditionalProps);
50
+ /**
51
+ * Persisted format for a map node schema in the simple schema format.
52
+ * @see {@link SimpleMapNodeSchema}.
53
+ */
54
+ export const SimpleMapNodeSchemaFormat = Type.Object({
55
+ kind: Type.Integer(),
56
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
57
+ }, noAdditionalProps);
58
+ /**
59
+ * Persisted format for a record node schema in the simple schema format.
60
+ * @see {@link SimpleRecordNodeSchema}.
61
+ */
62
+ export const SimpleRecordNodeSchemaFormat = Type.Object({
63
+ kind: Type.Integer(),
64
+ simpleAllowedTypes: SimpleAllowedTypesFormat,
65
+ }, noAdditionalProps);
66
+ /**
67
+ * Persisted format for a leaf node schema in the simple schema format.
68
+ * @see {@link SimpleLeafNodeSchema}.
69
+ */
70
+ export const SimpleLeafNodeSchemaFormat = Type.Object({
71
+ kind: Type.Integer(),
72
+ leafKind: Type.Integer(),
73
+ }, noAdditionalProps);
74
+ /**
75
+ * Persisted format for the field schemas of an object node in the simple schema format.
76
+ */
77
+ export const SimpleObjectFieldSchemasFormat = Type.Record(Type.String(), SimpleObjectFieldSchemaFormat);
78
+ /**
79
+ * Persisted format for an object node schema in the simple schema format.
80
+ * @see {@link SimpleObjectNodeSchema}.
81
+ */
82
+ export const SimpleObjectNodeSchemaFormat = Type.Object({
83
+ kind: Type.Integer(),
84
+ fields: SimpleObjectFieldSchemasFormat,
85
+ allowUnknownOptionalFields: Type.Optional(Type.Boolean()),
86
+ }, noAdditionalProps);
87
+ /**
88
+ * Discriminated union of all possible node schemas.
89
+ *
90
+ * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.
91
+ */
92
+ export const SimpleNodeSchemaUnionFormat = Type.Object({
93
+ array: Type.Optional(SimpleArrayNodeSchemaFormat),
94
+ map: Type.Optional(SimpleMapNodeSchemaFormat),
95
+ record: Type.Optional(SimpleRecordNodeSchemaFormat),
96
+ leaf: Type.Optional(SimpleLeafNodeSchemaFormat),
97
+ object: Type.Optional(SimpleObjectNodeSchemaFormat),
98
+ });
99
+ /**
100
+ * Helper type for the schema definitions map in the persisted format.
101
+ */
102
+ export const SimpleSchemaDefinitionsFormat = Type.Record(Type.String(), SimpleNodeSchemaUnionFormat);
103
+ /**
104
+ * Persisted format for the entire tree schema in the simple schema format.
105
+ * @see {@link SimpleTreeSchema}.
106
+ */
107
+ export const SimpleTreeSchemaFormat = Type.Object({
108
+ version: Type.Literal(SimpleSchemaFormatVersion.v1),
109
+ root: SimpleFieldSchemaFormat,
110
+ definitions: SimpleSchemaDefinitionsFormat,
111
+ }, noAdditionalProps);
112
+ //# sourceMappingURL=simpleSchemaFormatV1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleSchemaFormatV1.js","sourceRoot":"","sources":["../../src/simple-tree/simpleSchemaFormatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAmC,MAAM,mBAAmB,CAAC;AAE1E,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,EAAE,EAAE,CAAC;CACI,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,MAAM,CAC3D;IACC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;CACvC,EACD,iBAAiB,CACjB,CAAC;AAMF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,MAAM,CA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,CAAC,MAAM,CACxD,IAAI,CAAC,MAAM,EAAE,EACb,6BAA6B,CAC7B,CAAC;AAGF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,MAAM,CACtD;IACC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;IACpB,MAAM,EAAE,8BAA8B;IACtC,0BAA0B,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;CACzD,EACD,iBAAiB,CACjB,CAAC;AAGF;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC,MAAM,CAAC;IACtD,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,2BAA2B,CAAC;IACjD,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAC7C,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACnD,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC/C,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CACnD,CAAC,CAAC;AAGH;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC,MAAM,CACvD,IAAI,CAAC,MAAM,EAAE,EACb,2BAA2B,CAC3B,CAAC;AAGF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,MAAM,CAChD;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,EAAE,CAAC;IACnD,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,6BAA6B;CAC1C,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Type, type ObjectOptions, type Static } from \"@sinclair/typebox\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n/**\n * The format version for the schema.\n */\nexport const SimpleSchemaFormatVersion = {\n\tv1: 1,\n} as const;\n\n/**\n * The allowed types and their attributes in the simple schema format.\n * @see {@link SimpleAllowedTypes}.\n */\nexport const SimpleAllowedTypeAttributesFormat = Type.Object(\n\t{\n\t\tisStaged: Type.Optional(Type.Boolean()),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type SimpleAllowedTypeAttributesFormat = Static<\n\ttypeof SimpleAllowedTypeAttributesFormat\n>;\n\n/**\n * A set of allowed types in the simple schema format.\n * The keys are the type identifiers, and the values are their attributes.\n */\nexport const SimpleAllowedTypesFormat = Type.Record(\n\tType.String(),\n\tSimpleAllowedTypeAttributesFormat,\n);\nexport type SimpleAllowedTypesFormat = Static<typeof SimpleAllowedTypesFormat>;\n\n/**\n * Persisted format for a field schema in the simple schema format.\n * @see {@link SimpleFieldSchema}.\n */\nexport const SimpleFieldSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tsimpleAllowedTypes: SimpleAllowedTypesFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleFieldSchemaFormat = Static<typeof SimpleFieldSchemaFormat>;\n\n/**\n * Persisted format for an object field schema in the simple schema format.\n * @see {@link SimpleObjectFieldSchema}.\n */\nexport const SimpleObjectFieldSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tsimpleAllowedTypes: SimpleAllowedTypesFormat,\n\t\tstoredKey: Type.String(),\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleObjectFieldSchemaFormat = Static<typeof SimpleObjectFieldSchemaFormat>;\n\n/**\n * Persisted format for an array node schema in the simple schema format.\n * @see {@link SimpleArrayNodeSchema}.\n */\nexport const SimpleArrayNodeSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tsimpleAllowedTypes: SimpleAllowedTypesFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleArrayNodeSchemaFormat = Static<typeof SimpleArrayNodeSchemaFormat>;\n\n/**\n * Persisted format for a map node schema in the simple schema format.\n * @see {@link SimpleMapNodeSchema}.\n */\nexport const SimpleMapNodeSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tsimpleAllowedTypes: SimpleAllowedTypesFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleMapNodeSchemaFormat = Static<typeof SimpleMapNodeSchemaFormat>;\n\n/**\n * Persisted format for a record node schema in the simple schema format.\n * @see {@link SimpleRecordNodeSchema}.\n */\nexport const SimpleRecordNodeSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tsimpleAllowedTypes: SimpleAllowedTypesFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleRecordNodeSchemaFormat = Static<typeof SimpleRecordNodeSchemaFormat>;\n\n/**\n * Persisted format for a leaf node schema in the simple schema format.\n * @see {@link SimpleLeafNodeSchema}.\n */\nexport const SimpleLeafNodeSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tleafKind: Type.Integer(),\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleLeafNodeSchemaFormat = Static<typeof SimpleLeafNodeSchemaFormat>;\n\n/**\n * Persisted format for the field schemas of an object node in the simple schema format.\n */\nexport const SimpleObjectFieldSchemasFormat = Type.Record(\n\tType.String(),\n\tSimpleObjectFieldSchemaFormat,\n);\nexport type SimpleObjectFieldSchemasFormat = Static<typeof SimpleObjectFieldSchemasFormat>;\n\n/**\n * Persisted format for an object node schema in the simple schema format.\n * @see {@link SimpleObjectNodeSchema}.\n */\nexport const SimpleObjectNodeSchemaFormat = Type.Object(\n\t{\n\t\tkind: Type.Integer(),\n\t\tfields: SimpleObjectFieldSchemasFormat,\n\t\tallowUnknownOptionalFields: Type.Optional(Type.Boolean()),\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleObjectNodeSchemaFormat = Static<typeof SimpleObjectNodeSchemaFormat>;\n\n/**\n * Discriminated union of all possible node schemas.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const SimpleNodeSchemaUnionFormat = Type.Object({\n\tarray: Type.Optional(SimpleArrayNodeSchemaFormat),\n\tmap: Type.Optional(SimpleMapNodeSchemaFormat),\n\trecord: Type.Optional(SimpleRecordNodeSchemaFormat),\n\tleaf: Type.Optional(SimpleLeafNodeSchemaFormat),\n\tobject: Type.Optional(SimpleObjectNodeSchemaFormat),\n});\nexport type SimpleNodeSchemaUnionFormat = Static<typeof SimpleNodeSchemaUnionFormat>;\n\n/**\n * Helper type for the schema definitions map in the persisted format.\n */\nexport const SimpleSchemaDefinitionsFormat = Type.Record(\n\tType.String(),\n\tSimpleNodeSchemaUnionFormat,\n);\nexport type SimpleSchemaDefinitionsFormat = Static<typeof SimpleSchemaDefinitionsFormat>;\n\n/**\n * Persisted format for the entire tree schema in the simple schema format.\n * @see {@link SimpleTreeSchema}.\n */\nexport const SimpleTreeSchemaFormat = Type.Object(\n\t{\n\t\tversion: Type.Literal(SimpleSchemaFormatVersion.v1),\n\t\troot: SimpleFieldSchemaFormat,\n\t\tdefinitions: SimpleSchemaDefinitionsFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type SimpleTreeSchemaFormat = Static<typeof SimpleTreeSchemaFormat>;\n"]}
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ObjectNodeStoredSchema, type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeTypeSet } from "../core/index.js";
5
+ import { ObjectNodeStoredSchema, type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema } from "../core/index.js";
6
6
  import { type FlexFieldKind } from "../feature-libraries/index.js";
7
7
  import { type JsonCompatibleReadOnlyObject } from "../util/index.js";
8
- import { type StoredSchemaGenerationOptions } from "./core/index.js";
9
- import { FieldKind, FieldSchemaAlpha, type ImplicitFieldSchema } from "./fieldSchema.js";
10
- import type { SimpleFieldSchema, SimpleNodeSchema } from "./simpleSchema.js";
8
+ import { type StoredFromViewSchemaGenerationOptions, type StoredSchemaGenerationOptions } from "./core/index.js";
9
+ import { FieldKind, type ImplicitFieldSchema } from "./fieldSchema.js";
10
+ import type { SimpleAllowedTypes, SimpleFieldSchema, SimpleNodeSchema, SimpleTreeSchema } from "./simpleSchema.js";
11
11
  export declare const restrictiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions;
12
12
  export declare const permissiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions;
13
13
  /**
@@ -27,7 +27,7 @@ export declare function toInitialSchema(root: ImplicitFieldSchema): TreeStoredSc
27
27
  *
28
28
  * TODO: this should get additional options to enable support for unknown optional fields.
29
29
  */
30
- export declare const toUnhydratedSchema: StoredSchemaGenerationOptions;
30
+ export declare const toUnhydratedSchema: StoredFromViewSchemaGenerationOptions;
31
31
  /**
32
32
  * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema}.
33
33
  *
@@ -35,14 +35,26 @@ export declare const toUnhydratedSchema: StoredSchemaGenerationOptions;
35
35
  * TODO:#38722 When runtime schema upgrades are implemented, this will need to be updated to check if
36
36
  * a staged allowed type has been upgraded and if so, include it in the conversion.
37
37
  *
38
+ * Even if this took in a SimpleTreeSchema,
39
+ * it would still need to walk the schema to avoid including schema that become unreachable due to filtered out staged schema.
40
+ *
38
41
  * @throws
39
42
  * Throws a `UsageError` if multiple schemas are encountered with the same identifier.
40
43
  */
41
44
  export declare function toStoredSchema(root: ImplicitFieldSchema, options: StoredSchemaGenerationOptions): TreeStoredSchema;
42
45
  /**
43
- * Normalizes an {@link ImplicitFieldSchema} into a {@link TreeFieldSchema}.
46
+ * Convert a {@link SimpleTreeSchema} for a stored schema into a {@link TreeStoredSchema}.
47
+ * @remarks
48
+ * This only supports simple schemas that are already logically stored schemas.
49
+ * @privateRemarks
50
+ * To correctly support view schema here, this would need to filter out unreferenced schema after excluding staged schema.
51
+ * @see {@link ExpectStored}.
52
+ */
53
+ export declare function simpleStoredSchemaToStoredSchema(treeSchema: SimpleTreeSchema): TreeStoredSchema;
54
+ /**
55
+ * Convert a {@link SimpleFieldSchema} into a {@link TreeFieldStoredSchema}.
44
56
  */
45
- export declare function convertField(schema: SimpleFieldSchema | FieldSchemaAlpha, options: StoredSchemaGenerationOptions): TreeFieldStoredSchema;
57
+ export declare function convertField(schema: SimpleFieldSchema, options: StoredSchemaGenerationOptions): TreeFieldStoredSchema;
46
58
  /**
47
59
  * A map that converts {@link FieldKind} to {@link FlexFieldKind}.
48
60
  */
@@ -53,5 +65,5 @@ export declare const convertFieldKind: ReadonlyMap<FieldKind, FlexFieldKind>;
53
65
  * TODO: Persist node metadata once schema FormatV2 is supported.
54
66
  */
55
67
  export declare function getStoredSchema(schema: SimpleNodeSchema, options: StoredSchemaGenerationOptions): TreeNodeStoredSchema;
56
- export declare function arrayNodeStoredSchema(types: TreeTypeSet, persistedMetadata: JsonCompatibleReadOnlyObject | undefined): ObjectNodeStoredSchema;
68
+ export declare function arrayNodeStoredSchema(schema: SimpleAllowedTypes, options: StoredSchemaGenerationOptions, persistedMetadata: JsonCompatibleReadOnlyObject | undefined): ObjectNodeStoredSchema;
57
69
  //# sourceMappingURL=toStoredSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toStoredSchema.d.ts","sourceRoot":"","sources":["../../src/simple-tree/toStoredSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAIN,sBAAsB,EAGtB,KAAK,qBAAqB,EAE1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAsB,KAAK,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAON,KAAK,6BAA6B,EAClC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,SAAS,EAC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AkB,EAC1B,OAAO,EAAE,6BAA6B,EACtC,iBAAiB,EAAE,4BAA4B,GAAG,SAAS,GACzD,sBAAsB,CAQxB"}
@@ -2,13 +2,13 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { unreachableCase, fail } from "@fluidframework/core-utils/internal";
5
+ import { unreachableCase, fail, transformMapValues, } from "@fluidframework/core-utils/internal";
6
6
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
7
  import { EmptyKey, LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, } from "../core/index.js";
8
8
  import { FieldKinds } from "../feature-libraries/index.js";
9
9
  import { brand, getOrCreate } from "../util/index.js";
10
- import { allowedTypeFilter, convertAllowedTypes, getTreeNodeSchemaPrivateData, isClassBasedSchema, NodeKind, } from "./core/index.js";
11
- import { FieldKind, FieldSchemaAlpha, normalizeFieldSchema, } from "./fieldSchema.js";
10
+ import { allowedTypeFilter, convertAllowedTypes, ExpectStored, NodeKind, } from "./core/index.js";
11
+ import { FieldKind, normalizeFieldSchema } from "./fieldSchema.js";
12
12
  import { walkFieldSchema } from "./walkFieldSchema.js";
13
13
  const viewToStoredCache = new WeakMap();
14
14
  export const restrictiveStoredSchemaGenerationOptions = {
@@ -46,6 +46,9 @@ export const toUnhydratedSchema = permissiveStoredSchemaGenerationOptions;
46
46
  * TODO:#38722 When runtime schema upgrades are implemented, this will need to be updated to check if
47
47
  * a staged allowed type has been upgraded and if so, include it in the conversion.
48
48
  *
49
+ * Even if this took in a SimpleTreeSchema,
50
+ * it would still need to walk the schema to avoid including schema that become unreachable due to filtered out staged schema.
51
+ *
49
52
  * @throws
50
53
  * Throws a `UsageError` if multiple schemas are encountered with the same identifier.
51
54
  */
@@ -62,7 +65,7 @@ export function toStoredSchema(root, options) {
62
65
  }
63
66
  nodeSchema.set(brand(schema.identifier), getStoredSchema(schema, options));
64
67
  },
65
- allowedTypeFilter: (allowedType) => allowedTypeFilter(allowedType, options),
68
+ allowedTypeFilter: (allowedType) => allowedTypeFilter({ isStaged: allowedType.metadata.stagedSchemaUpgrade ?? false }, options),
66
69
  });
67
70
  const result = {
68
71
  nodeSchema,
@@ -72,19 +75,26 @@ export function toStoredSchema(root, options) {
72
75
  });
73
76
  }
74
77
  /**
75
- * Normalizes an {@link ImplicitFieldSchema} into a {@link TreeFieldSchema}.
78
+ * Convert a {@link SimpleTreeSchema} for a stored schema into a {@link TreeStoredSchema}.
79
+ * @remarks
80
+ * This only supports simple schemas that are already logically stored schemas.
81
+ * @privateRemarks
82
+ * To correctly support view schema here, this would need to filter out unreferenced schema after excluding staged schema.
83
+ * @see {@link ExpectStored}.
84
+ */
85
+ export function simpleStoredSchemaToStoredSchema(treeSchema) {
86
+ const result = {
87
+ nodeSchema: transformMapValues(treeSchema.definitions, (schema) => getStoredSchema(schema, ExpectStored)),
88
+ rootFieldSchema: convertField(treeSchema.root, ExpectStored),
89
+ };
90
+ return result;
91
+ }
92
+ /**
93
+ * Convert a {@link SimpleFieldSchema} into a {@link TreeFieldStoredSchema}.
76
94
  */
77
95
  export function convertField(schema, options) {
78
96
  const kind = convertFieldKind.get(schema.kind)?.identifier ?? fail(0xae3 /* Invalid field kind */);
79
- let types;
80
- // eslint-disable-next-line unicorn/prefer-ternary
81
- if (schema instanceof FieldSchemaAlpha) {
82
- types = convertAllowedTypes(schema.allowedTypes, options);
83
- }
84
- else {
85
- const allowedTypesIdentifiers = new Set(schema.simpleAllowedTypes.keys());
86
- types = allowedTypesIdentifiers;
87
- }
97
+ const types = convertAllowedTypes(schema.simpleAllowedTypes, options);
88
98
  return { kind, types, persistedMetadata: schema.persistedMetadata };
89
99
  }
90
100
  /**
@@ -101,9 +111,6 @@ export const convertFieldKind = new Map([
101
111
  * TODO: Persist node metadata once schema FormatV2 is supported.
102
112
  */
103
113
  export function getStoredSchema(schema, options) {
104
- if (isClassBasedSchema(schema)) {
105
- return getTreeNodeSchemaPrivateData(schema).toStored(options);
106
- }
107
114
  const kind = schema.kind;
108
115
  switch (kind) {
109
116
  case NodeKind.Leaf: {
@@ -111,8 +118,7 @@ export function getStoredSchema(schema, options) {
111
118
  }
112
119
  case NodeKind.Map:
113
120
  case NodeKind.Record: {
114
- const allowedTypesIdentifiers = new Set(schema.simpleAllowedTypes.keys());
115
- const types = allowedTypesIdentifiers;
121
+ const types = convertAllowedTypes(schema.simpleAllowedTypes, options);
116
122
  return new MapNodeStoredSchema({
117
123
  kind: FieldKinds.optional.identifier,
118
124
  types,
@@ -122,9 +128,7 @@ export function getStoredSchema(schema, options) {
122
128
  schema.persistedMetadata);
123
129
  }
124
130
  case NodeKind.Array: {
125
- const allowedTypesIdentifiers = new Set(schema.simpleAllowedTypes.keys());
126
- const types = allowedTypesIdentifiers;
127
- return arrayNodeStoredSchema(types, schema.persistedMetadata);
131
+ return arrayNodeStoredSchema(schema.simpleAllowedTypes, options, schema.persistedMetadata);
128
132
  }
129
133
  case NodeKind.Object: {
130
134
  const fields = new Map();
@@ -138,10 +142,10 @@ export function getStoredSchema(schema, options) {
138
142
  }
139
143
  }
140
144
  }
141
- export function arrayNodeStoredSchema(types, persistedMetadata) {
145
+ export function arrayNodeStoredSchema(schema, options, persistedMetadata) {
142
146
  const field = {
143
147
  kind: FieldKinds.sequence.identifier,
144
- types,
148
+ types: convertAllowedTypes(schema, options),
145
149
  persistedMetadata,
146
150
  };
147
151
  const fields = new Map([[EmptyKey, field]]);
@@ -1 +1 @@
1
- {"version":3,"file":"toStoredSchema.js","sourceRoot":"","sources":["../../src/simple-tree/toStoredSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EACN,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,GAQtB,MAAM,kBAAkB,CAAC;AAC1B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K,CAAC,CAAC,CAAC;YACrB,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAC3D,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAChC,CAAC;YACF,MAAM,KAAK,GAAG,uBAAsC,CAAC;YACrD,OAAO,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC/D,CAAC;QACD,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YACtB,MAAM,MAAM,GAAyC,IAAI,GAAG,EAAE,CAAC;YAC/D,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;YAC9E,CAAC;YACD,OAAO,IAAI,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,eAAe,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;AACF,CAAC;AAED,MAAM,UAAU,qBAAqB,CACpC,KAAkB,EAClB,iBAA2D;IAE3D,MAAM,KAAK,GAAG;QACb,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU;QACpC,KAAK;QACL,iBAAiB;KACjB,CAAC;IACF,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5C,OAAO,IAAI,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tEmptyKey,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n} from \"../core/index.js\";\nimport { FieldKinds, type FlexFieldKind } from \"../feature-libraries/index.js\";\nimport { brand, getOrCreate, type JsonCompatibleReadOnlyObject } from \"../util/index.js\";\n\nimport {\n\tallowedTypeFilter,\n\tconvertAllowedTypes,\n\tgetTreeNodeSchemaPrivateData,\n\tisClassBasedSchema,\n\tNodeKind,\n\ttype SimpleNodeSchemaBase,\n\ttype StoredSchemaGenerationOptions,\n} from \"./core/index.js\";\nimport {\n\tFieldKind,\n\tFieldSchemaAlpha,\n\tnormalizeFieldSchema,\n\ttype ImplicitFieldSchema,\n} from \"./fieldSchema.js\";\nimport type { SimpleFieldSchema, SimpleNodeSchema } from \"./simpleSchema.js\";\nimport { walkFieldSchema } from \"./walkFieldSchema.js\";\n\nconst viewToStoredCache = new WeakMap<\n\tStoredSchemaGenerationOptions,\n\tWeakMap<ImplicitFieldSchema, TreeStoredSchema>\n>();\n\nexport const restrictiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions = {\n\tincludeStaged: () => false,\n};\n\nexport const permissiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions = {\n\tincludeStaged: () => true,\n};\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema} for use in schema upgrades.\n *\n * TODO: once upgrades are more flexible, this should take in more options, including the old schema and specific upgrades to enable.\n */\nexport function toUpgradeSchema(root: ImplicitFieldSchema): TreeStoredSchema {\n\treturn toStoredSchema(root, restrictiveStoredSchemaGenerationOptions);\n}\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema} for use as initial document schema.\n */\nexport function toInitialSchema(root: ImplicitFieldSchema): TreeStoredSchema {\n\treturn toStoredSchema(root, restrictiveStoredSchemaGenerationOptions);\n}\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema} to used for unhydrated nodes.\n * @remarks\n * This allows as much as possible, relying on further validation when inserting the content.\n *\n * TODO: this should get additional options to enable support for unknown optional fields.\n */\nexport const toUnhydratedSchema = permissiveStoredSchemaGenerationOptions;\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema}.\n *\n * @privateRemarks\n * TODO:#38722 When runtime schema upgrades are implemented, this will need to be updated to check if\n * a staged allowed type has been upgraded and if so, include it in the conversion.\n *\n * @throws\n * Throws a `UsageError` if multiple schemas are encountered with the same identifier.\n */\nexport function toStoredSchema(\n\troot: ImplicitFieldSchema,\n\toptions: StoredSchemaGenerationOptions,\n): TreeStoredSchema {\n\tconst cache = getOrCreate(viewToStoredCache, options, () => new WeakMap());\n\treturn getOrCreate(cache, root, () => {\n\t\tconst normalized = normalizeFieldSchema(root);\n\t\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\t\twalkFieldSchema(normalized, {\n\t\t\tnode(schema) {\n\t\t\t\tif (nodeSchema.has(brand(schema.identifier))) {\n\t\t\t\t\t// Use JSON.stringify to quote and escape identifier string.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Multiple schema encountered with the identifier ${JSON.stringify(\n\t\t\t\t\t\t\tschema.identifier,\n\t\t\t\t\t\t)}. Remove or rename them to avoid the collision.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tnodeSchema.set(\n\t\t\t\t\tbrand(schema.identifier),\n\t\t\t\t\tgetStoredSchema(\n\t\t\t\t\t\tschema as SimpleNodeSchemaBase<NodeKind> as SimpleNodeSchema,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t},\n\t\t\tallowedTypeFilter: (allowedType) => allowedTypeFilter(allowedType, options),\n\t\t});\n\n\t\tconst result: TreeStoredSchema = {\n\t\t\tnodeSchema,\n\t\t\trootFieldSchema: convertField(normalized, options),\n\t\t};\n\t\treturn result;\n\t});\n}\n\n/**\n * Normalizes an {@link ImplicitFieldSchema} into a {@link TreeFieldSchema}.\n */\nexport function convertField(\n\tschema: SimpleFieldSchema | FieldSchemaAlpha,\n\toptions: StoredSchemaGenerationOptions,\n): TreeFieldStoredSchema {\n\tconst kind: FieldKindIdentifier =\n\t\tconvertFieldKind.get(schema.kind)?.identifier ?? fail(0xae3 /* Invalid field kind */);\n\tlet types: TreeTypeSet;\n\t// eslint-disable-next-line unicorn/prefer-ternary\n\tif (schema instanceof FieldSchemaAlpha) {\n\t\ttypes = convertAllowedTypes(schema.allowedTypes, options);\n\t} else {\n\t\tconst allowedTypesIdentifiers: ReadonlySet<string> = new Set(\n\t\t\tschema.simpleAllowedTypes.keys(),\n\t\t);\n\t\ttypes = allowedTypesIdentifiers as TreeTypeSet;\n\t}\n\treturn { kind, types, persistedMetadata: schema.persistedMetadata };\n}\n\n/**\n * A map that converts {@link FieldKind} to {@link FlexFieldKind}.\n */\nexport const convertFieldKind: ReadonlyMap<FieldKind, FlexFieldKind> = new Map<\n\tFieldKind,\n\tFlexFieldKind\n>([\n\t[FieldKind.Optional, FieldKinds.optional],\n\t[FieldKind.Required, FieldKinds.required],\n\t[FieldKind.Identifier, FieldKinds.identifier],\n]);\n\n/**\n * Converts a {@link TreeNodeSchema} into a {@link TreeNodeStoredSchema}.\n * @privateRemarks\n * TODO: Persist node metadata once schema FormatV2 is supported.\n */\nexport function getStoredSchema(\n\tschema: SimpleNodeSchema,\n\toptions: StoredSchemaGenerationOptions,\n): TreeNodeStoredSchema {\n\tif (isClassBasedSchema(schema)) {\n\t\treturn getTreeNodeSchemaPrivateData(schema).toStored(options);\n\t}\n\tconst kind = schema.kind;\n\tswitch (kind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\treturn new LeafNodeStoredSchema(schema.leafKind);\n\t\t}\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record: {\n\t\t\tconst allowedTypesIdentifiers: ReadonlySet<string> = new Set(\n\t\t\t\tschema.simpleAllowedTypes.keys(),\n\t\t\t);\n\t\t\tconst types = allowedTypesIdentifiers as TreeTypeSet;\n\t\t\treturn new MapNodeStoredSchema(\n\t\t\t\t{\n\t\t\t\t\tkind: FieldKinds.optional.identifier,\n\t\t\t\t\ttypes,\n\t\t\t\t\tpersistedMetadata: schema.persistedMetadata,\n\t\t\t\t},\n\t\t\t\t// TODO: Find a way to avoid injecting persistedMetadata twice in these constructor calls.\n\t\t\t\tschema.persistedMetadata,\n\t\t\t);\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\tconst allowedTypesIdentifiers: ReadonlySet<string> = new Set(\n\t\t\t\tschema.simpleAllowedTypes.keys(),\n\t\t\t);\n\t\t\tconst types = allowedTypesIdentifiers as TreeTypeSet;\n\t\t\treturn arrayNodeStoredSchema(types, schema.persistedMetadata);\n\t\t}\n\t\tcase NodeKind.Object: {\n\t\t\tconst fields: Map<FieldKey, TreeFieldStoredSchema> = new Map();\n\t\t\tfor (const fieldSchema of schema.fields.values()) {\n\t\t\t\tfields.set(brand(fieldSchema.storedKey), convertField(fieldSchema, options));\n\t\t\t}\n\t\t\treturn new ObjectNodeStoredSchema(fields, schema.persistedMetadata);\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(kind);\n\t\t}\n\t}\n}\n\nexport function arrayNodeStoredSchema(\n\ttypes: TreeTypeSet,\n\tpersistedMetadata: JsonCompatibleReadOnlyObject | undefined,\n): ObjectNodeStoredSchema {\n\tconst field = {\n\t\tkind: FieldKinds.sequence.identifier,\n\t\ttypes,\n\t\tpersistedMetadata,\n\t};\n\tconst fields = new Map([[EmptyKey, field]]);\n\treturn new ObjectNodeStoredSchema(fields, persistedMetadata);\n}\n"]}
1
+ {"version":3,"file":"toStoredSchema.js","sourceRoot":"","sources":["../../src/simple-tree/toStoredSchema.ts"],"names":[],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) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tunreachableCase,\n\tfail,\n\ttransformMapValues,\n} from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tEmptyKey,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n} from \"../core/index.js\";\nimport { FieldKinds, type FlexFieldKind } from \"../feature-libraries/index.js\";\nimport { brand, getOrCreate, type JsonCompatibleReadOnlyObject } from \"../util/index.js\";\n\nimport {\n\tallowedTypeFilter,\n\tconvertAllowedTypes,\n\tExpectStored,\n\tNodeKind,\n\ttype SimpleNodeSchemaBase,\n\ttype StoredFromViewSchemaGenerationOptions,\n\ttype StoredSchemaGenerationOptions,\n} from \"./core/index.js\";\nimport { FieldKind, normalizeFieldSchema, type ImplicitFieldSchema } from \"./fieldSchema.js\";\nimport type {\n\tSimpleAllowedTypes,\n\tSimpleFieldSchema,\n\tSimpleNodeSchema,\n\tSimpleTreeSchema,\n} from \"./simpleSchema.js\";\nimport { walkFieldSchema } from \"./walkFieldSchema.js\";\n\nconst viewToStoredCache = new WeakMap<\n\tStoredFromViewSchemaGenerationOptions,\n\tWeakMap<ImplicitFieldSchema, TreeStoredSchema>\n>();\n\nexport const restrictiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions = {\n\tincludeStaged: () => false,\n};\n\nexport const permissiveStoredSchemaGenerationOptions: StoredSchemaGenerationOptions = {\n\tincludeStaged: () => true,\n};\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema} for use in schema upgrades.\n *\n * TODO: once upgrades are more flexible, this should take in more options, including the old schema and specific upgrades to enable.\n */\nexport function toUpgradeSchema(root: ImplicitFieldSchema): TreeStoredSchema {\n\treturn toStoredSchema(root, restrictiveStoredSchemaGenerationOptions);\n}\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema} for use as initial document schema.\n */\nexport function toInitialSchema(root: ImplicitFieldSchema): TreeStoredSchema {\n\treturn toStoredSchema(root, restrictiveStoredSchemaGenerationOptions);\n}\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema} to used for unhydrated nodes.\n * @remarks\n * This allows as much as possible, relying on further validation when inserting the content.\n *\n * TODO: this should get additional options to enable support for unknown optional fields.\n */\nexport const toUnhydratedSchema = permissiveStoredSchemaGenerationOptions;\n\n/**\n * Converts a {@link ImplicitFieldSchema} into a {@link TreeStoredSchema}.\n *\n * @privateRemarks\n * TODO:#38722 When runtime schema upgrades are implemented, this will need to be updated to check if\n * a staged allowed type has been upgraded and if so, include it in the conversion.\n *\n * Even if this took in a SimpleTreeSchema,\n * it would still need to walk the schema to avoid including schema that become unreachable due to filtered out staged schema.\n *\n * @throws\n * Throws a `UsageError` if multiple schemas are encountered with the same identifier.\n */\nexport function toStoredSchema(\n\troot: ImplicitFieldSchema,\n\toptions: StoredSchemaGenerationOptions,\n): TreeStoredSchema {\n\tconst cache = getOrCreate(viewToStoredCache, options, () => new WeakMap());\n\treturn getOrCreate(cache, root, () => {\n\t\tconst normalized = normalizeFieldSchema(root);\n\t\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\t\twalkFieldSchema(normalized, {\n\t\t\tnode(schema) {\n\t\t\t\tif (nodeSchema.has(brand(schema.identifier))) {\n\t\t\t\t\t// Use JSON.stringify to quote and escape identifier string.\n\t\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\t`Multiple schema encountered with the identifier ${JSON.stringify(\n\t\t\t\t\t\t\tschema.identifier,\n\t\t\t\t\t\t)}. Remove or rename them to avoid the collision.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tnodeSchema.set(\n\t\t\t\t\tbrand(schema.identifier),\n\t\t\t\t\tgetStoredSchema(\n\t\t\t\t\t\tschema as SimpleNodeSchemaBase<NodeKind> as SimpleNodeSchema,\n\t\t\t\t\t\toptions,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t},\n\t\t\tallowedTypeFilter: (allowedType) =>\n\t\t\t\tallowedTypeFilter(\n\t\t\t\t\t{ isStaged: allowedType.metadata.stagedSchemaUpgrade ?? false },\n\t\t\t\t\toptions,\n\t\t\t\t),\n\t\t});\n\n\t\tconst result: TreeStoredSchema = {\n\t\t\tnodeSchema,\n\t\t\trootFieldSchema: convertField(normalized, options),\n\t\t};\n\t\treturn result;\n\t});\n}\n\n/**\n * Convert a {@link SimpleTreeSchema} for a stored schema into a {@link TreeStoredSchema}.\n * @remarks\n * This only supports simple schemas that are already logically stored schemas.\n * @privateRemarks\n * To correctly support view schema here, this would need to filter out unreferenced schema after excluding staged schema.\n * @see {@link ExpectStored}.\n */\nexport function simpleStoredSchemaToStoredSchema(\n\ttreeSchema: SimpleTreeSchema,\n): TreeStoredSchema {\n\tconst result: TreeStoredSchema = {\n\t\tnodeSchema: transformMapValues(treeSchema.definitions, (schema) =>\n\t\t\tgetStoredSchema(schema, ExpectStored),\n\t\t) as Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>,\n\t\trootFieldSchema: convertField(treeSchema.root, ExpectStored),\n\t};\n\treturn result;\n}\n\n/**\n * Convert a {@link SimpleFieldSchema} into a {@link TreeFieldStoredSchema}.\n */\nexport function convertField(\n\tschema: SimpleFieldSchema,\n\toptions: StoredSchemaGenerationOptions,\n): TreeFieldStoredSchema {\n\tconst kind: FieldKindIdentifier =\n\t\tconvertFieldKind.get(schema.kind)?.identifier ?? fail(0xae3 /* Invalid field kind */);\n\tconst types = convertAllowedTypes(schema.simpleAllowedTypes, options);\n\treturn { kind, types, persistedMetadata: schema.persistedMetadata };\n}\n\n/**\n * A map that converts {@link FieldKind} to {@link FlexFieldKind}.\n */\nexport const convertFieldKind: ReadonlyMap<FieldKind, FlexFieldKind> = new Map<\n\tFieldKind,\n\tFlexFieldKind\n>([\n\t[FieldKind.Optional, FieldKinds.optional],\n\t[FieldKind.Required, FieldKinds.required],\n\t[FieldKind.Identifier, FieldKinds.identifier],\n]);\n\n/**\n * Converts a {@link TreeNodeSchema} into a {@link TreeNodeStoredSchema}.\n * @privateRemarks\n * TODO: Persist node metadata once schema FormatV2 is supported.\n */\nexport function getStoredSchema(\n\tschema: SimpleNodeSchema,\n\toptions: StoredSchemaGenerationOptions,\n): TreeNodeStoredSchema {\n\tconst kind = schema.kind;\n\tswitch (kind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\treturn new LeafNodeStoredSchema(schema.leafKind);\n\t\t}\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record: {\n\t\t\tconst types = convertAllowedTypes(schema.simpleAllowedTypes, options);\n\t\t\treturn new MapNodeStoredSchema(\n\t\t\t\t{\n\t\t\t\t\tkind: FieldKinds.optional.identifier,\n\t\t\t\t\ttypes,\n\t\t\t\t\tpersistedMetadata: schema.persistedMetadata,\n\t\t\t\t},\n\t\t\t\t// TODO: Find a way to avoid injecting persistedMetadata twice in these constructor calls.\n\t\t\t\tschema.persistedMetadata,\n\t\t\t);\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\treturn arrayNodeStoredSchema(\n\t\t\t\tschema.simpleAllowedTypes,\n\t\t\t\toptions,\n\t\t\t\tschema.persistedMetadata,\n\t\t\t);\n\t\t}\n\t\tcase NodeKind.Object: {\n\t\t\tconst fields: Map<FieldKey, TreeFieldStoredSchema> = new Map();\n\t\t\tfor (const fieldSchema of schema.fields.values()) {\n\t\t\t\tfields.set(brand(fieldSchema.storedKey), convertField(fieldSchema, options));\n\t\t\t}\n\t\t\treturn new ObjectNodeStoredSchema(fields, schema.persistedMetadata);\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(kind);\n\t\t}\n\t}\n}\n\nexport function arrayNodeStoredSchema(\n\tschema: SimpleAllowedTypes,\n\toptions: StoredSchemaGenerationOptions,\n\tpersistedMetadata: JsonCompatibleReadOnlyObject | undefined,\n): ObjectNodeStoredSchema {\n\tconst field = {\n\t\tkind: FieldKinds.sequence.identifier,\n\t\ttypes: convertAllowedTypes(schema, options),\n\t\tpersistedMetadata,\n\t};\n\tconst fields = new Map([[EmptyKey, field]]);\n\treturn new ObjectNodeStoredSchema(fields, persistedMetadata);\n}\n"]}