@fluidframework/tree 2.80.0 → 2.81.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 (1138) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-report/tree.alpha.api.md +42 -7
  3. package/dist/alpha.d.ts +5 -0
  4. package/dist/codec/codec.d.ts +2 -2
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +8 -8
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/versioned/codec.d.ts +1 -1
  9. package/dist/codec/versioned/codec.d.ts.map +1 -1
  10. package/dist/codec/versioned/codec.js +12 -12
  11. package/dist/codec/versioned/codec.js.map +1 -1
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js.map +1 -1
  15. package/dist/core/rebase/index.d.ts +1 -1
  16. package/dist/core/rebase/index.d.ts.map +1 -1
  17. package/dist/core/rebase/index.js.map +1 -1
  18. package/dist/core/rebase/types.d.ts +44 -7
  19. package/dist/core/rebase/types.d.ts.map +1 -1
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/rebase/utils.d.ts.map +1 -1
  22. package/dist/core/rebase/utils.js +5 -1
  23. package/dist/core/rebase/utils.js.map +1 -1
  24. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  25. package/dist/core/schema-stored/formatV2.js +4 -4
  26. package/dist/core/schema-stored/formatV2.js.map +1 -1
  27. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  28. package/dist/core/tree/anchorSet.js +2 -1
  29. package/dist/core/tree/anchorSet.js.map +1 -1
  30. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  31. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  32. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  33. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  34. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  35. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  36. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -3
  37. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  38. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  39. package/dist/core/tree/detachedFieldIndexCodecV2.js +2 -2
  40. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  41. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  42. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  43. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  44. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  45. package/dist/core/tree/detachedFieldIndexFormatV2.js +4 -4
  46. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  47. package/dist/core/tree/visitDelta.d.ts +1 -1
  48. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  49. package/dist/core/tree/visitDelta.js +3 -2
  50. package/dist/core/tree/visitDelta.js.map +1 -1
  51. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  52. package/dist/core/tree/visitorUtils.js +59 -19
  53. package/dist/core/tree/visitorUtils.js.map +1 -1
  54. package/dist/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  55. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  56. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  57. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  58. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  59. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  60. package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  61. package/dist/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  62. package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  63. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  64. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  65. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  66. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  67. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  68. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  69. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  70. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  71. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  72. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  73. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  74. package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  75. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  76. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  77. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  79. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  80. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/codec/format.js +1 -1
  82. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  84. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  88. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  89. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  90. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +17 -15
  91. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  92. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  93. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  94. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +23 -64
  95. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  96. package/dist/feature-libraries/default-schema/index.d.ts +1 -1
  97. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  98. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  99. package/dist/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  100. package/dist/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  101. package/dist/feature-libraries/fieldKindIdentifiers.js +16 -0
  102. package/dist/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  103. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  104. package/dist/feature-libraries/flex-tree/lazyField.js +8 -8
  105. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  106. package/dist/feature-libraries/flex-tree/observer.d.ts +1 -1
  107. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  108. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  109. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  110. package/dist/feature-libraries/forest-summary/codec.js +1 -1
  111. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  112. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  113. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  114. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  115. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  116. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  117. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  118. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  119. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  120. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  121. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  122. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  123. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  124. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  125. package/dist/feature-libraries/index.d.ts +1 -1
  126. package/dist/feature-libraries/index.d.ts.map +1 -1
  127. package/dist/feature-libraries/index.js.map +1 -1
  128. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  129. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  130. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  131. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  132. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  133. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  134. package/dist/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  135. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  136. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  137. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  138. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  139. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  140. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  141. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  142. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  143. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  144. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  145. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  146. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  147. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  148. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  149. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  150. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  151. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  152. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  153. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  154. package/dist/feature-libraries/object-forest/objectForest.js +5 -3
  155. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  156. package/dist/feature-libraries/optional-field/index.d.ts +3 -3
  157. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  158. package/dist/feature-libraries/optional-field/index.js +4 -8
  159. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  160. package/dist/feature-libraries/optional-field/optionalField.d.ts +10 -2
  161. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  162. package/dist/feature-libraries/optional-field/optionalField.js +13 -1
  163. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  164. package/dist/feature-libraries/optional-field/requiredField.d.ts +36 -0
  165. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  166. package/dist/feature-libraries/optional-field/requiredField.js +27 -0
  167. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -0
  168. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  169. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  170. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +7 -7
  171. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  172. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  173. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  174. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  175. package/dist/feature-libraries/schemaChecker.js +1 -1
  176. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  177. package/dist/feature-libraries/sequence-field/index.d.ts +2 -14
  178. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  179. package/dist/feature-libraries/sequence-field/index.js +3 -30
  180. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  181. package/dist/feature-libraries/sequence-field/rebase.js +1 -1
  182. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  183. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  184. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  185. package/dist/feature-libraries/sequence-field/sequenceKind.js +24 -0
  186. package/dist/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  187. package/dist/index.d.ts +3 -2
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +5 -1
  190. package/dist/index.js.map +1 -1
  191. package/dist/packageVersion.d.ts +1 -1
  192. package/dist/packageVersion.js +1 -1
  193. package/dist/packageVersion.js.map +1 -1
  194. package/dist/shared-tree/independentView.d.ts.map +1 -1
  195. package/dist/shared-tree/independentView.js +7 -7
  196. package/dist/shared-tree/independentView.js.map +1 -1
  197. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  198. package/dist/shared-tree/schematizingTreeView.js +12 -10
  199. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  200. package/dist/shared-tree/sharedTree.d.ts +2 -2
  201. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  202. package/dist/shared-tree/sharedTree.js +6 -33
  203. package/dist/shared-tree/sharedTree.js.map +1 -1
  204. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  205. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  206. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  207. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  208. package/dist/shared-tree/sharedTreeChangeEnricher.js +75 -58
  209. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  210. package/dist/shared-tree/tree.d.ts.map +1 -1
  211. package/dist/shared-tree/tree.js +14 -14
  212. package/dist/shared-tree/tree.js.map +1 -1
  213. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  214. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  215. package/dist/shared-tree/treeAlpha.js +77 -77
  216. package/dist/shared-tree/treeAlpha.js.map +1 -1
  217. package/dist/shared-tree/treeCheckout.d.ts +21 -6
  218. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  219. package/dist/shared-tree/treeCheckout.js +93 -37
  220. package/dist/shared-tree/treeCheckout.js.map +1 -1
  221. package/dist/shared-tree-core/branch.d.ts +1 -1
  222. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  223. package/dist/shared-tree-core/branch.js +5 -1
  224. package/dist/shared-tree-core/branch.js.map +1 -1
  225. package/dist/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  226. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  227. package/dist/shared-tree-core/branchCommitEnricher.js +24 -76
  228. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  229. package/dist/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  230. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  231. package/dist/shared-tree-core/changeEnricher.d.ts +8 -43
  232. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  233. package/dist/shared-tree-core/changeEnricher.js +0 -13
  234. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  235. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  236. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  237. package/dist/shared-tree-core/defaultResubmitMachine.js +26 -36
  238. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  239. package/dist/shared-tree-core/editManager.d.ts +1 -1
  240. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  241. package/dist/shared-tree-core/editManager.js +13 -7
  242. package/dist/shared-tree-core/editManager.js.map +1 -1
  243. package/dist/shared-tree-core/editManagerCodecs.d.ts +1 -1
  244. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  245. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  246. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  247. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  248. package/dist/shared-tree-core/editManagerCodecsCommons.js +1 -2
  249. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  250. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  251. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  252. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  253. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  254. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  255. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  256. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  257. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  258. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  259. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  260. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  261. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  262. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  263. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  264. package/dist/shared-tree-core/index.d.ts +2 -2
  265. package/dist/shared-tree-core/index.d.ts.map +1 -1
  266. package/dist/shared-tree-core/index.js +1 -3
  267. package/dist/shared-tree-core/index.js.map +1 -1
  268. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  269. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  270. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -1
  271. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  272. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  273. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  274. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  275. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  276. package/dist/shared-tree-core/messageCodecs.d.ts +2 -2
  277. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  278. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  279. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  280. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  281. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  282. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  283. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  284. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  285. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -4
  286. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  287. package/dist/shared-tree-core/sharedTreeCore.js +13 -13
  288. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  289. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  290. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  291. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  292. package/dist/simple-tree/api/configuration.d.ts +2 -2
  293. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  294. package/dist/simple-tree/api/configuration.js +14 -14
  295. package/dist/simple-tree/api/configuration.js.map +1 -1
  296. package/dist/simple-tree/api/create.d.ts +1 -1
  297. package/dist/simple-tree/api/create.d.ts.map +1 -1
  298. package/dist/simple-tree/api/create.js +7 -7
  299. package/dist/simple-tree/api/create.js.map +1 -1
  300. package/dist/simple-tree/api/dirtyIndex.d.ts +1 -1
  301. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  302. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  303. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  304. package/dist/simple-tree/api/discrepancies.js +23 -23
  305. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  306. package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
  307. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  308. package/dist/simple-tree/api/getJsonSchema.js +1 -1
  309. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  310. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  311. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  312. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  313. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  314. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  315. package/dist/simple-tree/api/incrementalAllowedTypes.js +6 -6
  316. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  317. package/dist/simple-tree/api/index.d.ts +1 -1
  318. package/dist/simple-tree/api/index.d.ts.map +1 -1
  319. package/dist/simple-tree/api/index.js +2 -1
  320. package/dist/simple-tree/api/index.js.map +1 -1
  321. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  322. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  323. package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
  324. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  325. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  326. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  327. package/dist/simple-tree/api/schemaCreationUtilities.js +7 -7
  328. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  329. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  330. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  331. package/dist/simple-tree/api/schemaFactory.js +7 -7
  332. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  333. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  334. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  335. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  336. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  337. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  338. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  339. package/dist/simple-tree/api/schemaFactoryBeta.js +2 -1
  340. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  341. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  342. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  343. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  344. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  345. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  346. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  347. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  348. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  349. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  350. package/dist/simple-tree/api/simpleSchemaCodec.js +17 -17
  351. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  352. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  353. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  354. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  355. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  356. package/dist/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  357. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  358. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  359. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  360. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  361. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  362. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +298 -2
  363. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  364. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  365. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  366. package/dist/simple-tree/api/tree.d.ts +5 -3
  367. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  368. package/dist/simple-tree/api/tree.js.map +1 -1
  369. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  370. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  371. package/dist/simple-tree/api/treeBeta.js +2 -2
  372. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  373. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  374. package/dist/simple-tree/api/treeNodeApi.js +4 -4
  375. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  376. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  377. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  378. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  379. package/dist/simple-tree/api/verboseTree.d.ts +1 -1
  380. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  381. package/dist/simple-tree/api/verboseTree.js +22 -22
  382. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  383. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  384. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  385. package/dist/simple-tree/core/allowedTypes.js +7 -7
  386. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  387. package/dist/simple-tree/core/context.d.ts.map +1 -1
  388. package/dist/simple-tree/core/context.js.map +1 -1
  389. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  390. package/dist/simple-tree/core/treeNode.js +1 -1
  391. package/dist/simple-tree/core/treeNode.js.map +1 -1
  392. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  393. package/dist/simple-tree/core/treeNodeKernel.js +7 -5
  394. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  395. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -5
  396. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  397. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  398. package/dist/simple-tree/core/treeNodeValid.d.ts +3 -3
  399. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  400. package/dist/simple-tree/core/treeNodeValid.js +2 -2
  401. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  402. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  403. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  404. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  405. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  406. package/dist/simple-tree/core/withType.js.map +1 -1
  407. package/dist/simple-tree/createContext.d.ts.map +1 -1
  408. package/dist/simple-tree/createContext.js.map +1 -1
  409. package/dist/simple-tree/fieldSchema.d.ts +1 -1
  410. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  411. package/dist/simple-tree/fieldSchema.js.map +1 -1
  412. package/dist/simple-tree/index.d.ts +1 -1
  413. package/dist/simple-tree/index.d.ts.map +1 -1
  414. package/dist/simple-tree/index.js +3 -2
  415. package/dist/simple-tree/index.js.map +1 -1
  416. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  417. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  418. package/dist/simple-tree/leafNodeSchema.js +15 -15
  419. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  420. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  421. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  422. package/dist/simple-tree/node-kinds/array/arrayNode.js +46 -46
  423. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  424. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  425. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  426. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  427. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  428. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  429. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  430. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  431. package/dist/simple-tree/node-kinds/map/mapNode.js +24 -24
  432. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  433. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  434. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  435. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  436. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  437. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  438. package/dist/simple-tree/node-kinds/object/objectNode.js +9 -9
  439. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  440. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  441. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  442. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  443. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  444. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  445. package/dist/simple-tree/node-kinds/record/recordNode.js +34 -34
  446. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  447. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  448. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  449. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  450. package/dist/simple-tree/prepareForInsertion.d.ts +2 -2
  451. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  452. package/dist/simple-tree/prepareForInsertion.js +13 -13
  453. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  454. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  455. package/dist/simple-tree/simpleSchema.js.map +1 -1
  456. package/dist/simple-tree/treeSchema.d.ts.map +1 -1
  457. package/dist/simple-tree/treeSchema.js.map +1 -1
  458. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  459. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  460. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +10 -10
  461. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  462. package/dist/tableSchema.d.ts.map +1 -1
  463. package/dist/tableSchema.js +22 -21
  464. package/dist/tableSchema.js.map +1 -1
  465. package/dist/text/index.d.ts +7 -0
  466. package/dist/text/index.d.ts.map +1 -0
  467. package/dist/text/index.js +12 -0
  468. package/dist/text/index.js.map +1 -0
  469. package/dist/text/textDomain.d.ts +146 -0
  470. package/dist/text/textDomain.d.ts.map +1 -0
  471. package/dist/text/textDomain.js +122 -0
  472. package/dist/text/textDomain.js.map +1 -0
  473. package/dist/text/textDomainFormatted.d.ts +572 -0
  474. package/dist/text/textDomainFormatted.d.ts.map +1 -0
  475. package/dist/text/textDomainFormatted.js +183 -0
  476. package/dist/text/textDomainFormatted.js.map +1 -0
  477. package/dist/treeFactory.d.ts.map +1 -1
  478. package/dist/treeFactory.js +9 -9
  479. package/dist/treeFactory.js.map +1 -1
  480. package/dist/util/bTreeUtils.d.ts +12 -4
  481. package/dist/util/bTreeUtils.d.ts.map +1 -1
  482. package/dist/util/bTreeUtils.js +14 -18
  483. package/dist/util/bTreeUtils.js.map +1 -1
  484. package/dist/util/nestedMap.js +12 -12
  485. package/dist/util/nestedMap.js.map +1 -1
  486. package/dist/util/readSnapshotBlob.d.ts +1 -1
  487. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  488. package/dist/util/readSnapshotBlob.js.map +1 -1
  489. package/docs/user-facing/merge-semantics.md +3 -2
  490. package/eslint.config.mts +8 -36
  491. package/lib/alpha.d.ts +5 -0
  492. package/lib/codec/codec.d.ts +2 -2
  493. package/lib/codec/codec.d.ts.map +1 -1
  494. package/lib/codec/codec.js +1 -1
  495. package/lib/codec/codec.js.map +1 -1
  496. package/lib/codec/versioned/codec.d.ts +1 -1
  497. package/lib/codec/versioned/codec.d.ts.map +1 -1
  498. package/lib/codec/versioned/codec.js +2 -2
  499. package/lib/codec/versioned/codec.js.map +1 -1
  500. package/lib/core/index.d.ts +1 -1
  501. package/lib/core/index.d.ts.map +1 -1
  502. package/lib/core/index.js.map +1 -1
  503. package/lib/core/rebase/index.d.ts +1 -1
  504. package/lib/core/rebase/index.d.ts.map +1 -1
  505. package/lib/core/rebase/index.js.map +1 -1
  506. package/lib/core/rebase/types.d.ts +44 -7
  507. package/lib/core/rebase/types.d.ts.map +1 -1
  508. package/lib/core/rebase/types.js.map +1 -1
  509. package/lib/core/rebase/utils.d.ts.map +1 -1
  510. package/lib/core/rebase/utils.js +5 -1
  511. package/lib/core/rebase/utils.js.map +1 -1
  512. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  513. package/lib/core/schema-stored/formatV2.js +1 -1
  514. package/lib/core/schema-stored/formatV2.js.map +1 -1
  515. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  516. package/lib/core/tree/anchorSet.js +2 -1
  517. package/lib/core/tree/anchorSet.js.map +1 -1
  518. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  519. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  520. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  521. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  522. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  523. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  524. package/lib/core/tree/detachedFieldIndexCodecV1.js +1 -1
  525. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  526. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  527. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -2
  528. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  529. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  530. package/lib/core/tree/detachedFieldIndexFormatV1.js +2 -2
  531. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  532. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  533. package/lib/core/tree/detachedFieldIndexFormatV2.js +2 -2
  534. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  535. package/lib/core/tree/visitDelta.d.ts +1 -1
  536. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  537. package/lib/core/tree/visitDelta.js +3 -2
  538. package/lib/core/tree/visitDelta.js.map +1 -1
  539. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  540. package/lib/core/tree/visitorUtils.js +59 -19
  541. package/lib/core/tree/visitorUtils.js.map +1 -1
  542. package/lib/feature-libraries/changeAtomIdBTree.d.ts +6 -1
  543. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  544. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  545. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  546. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  547. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  548. package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
  549. package/lib/feature-libraries/chunked-forest/chunkedForest.js +3 -1
  550. package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
  551. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  552. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  553. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  554. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  555. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  556. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  557. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  558. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  559. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  560. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  561. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  562. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  563. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  564. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  565. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  566. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -0
  567. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  568. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  569. package/lib/feature-libraries/chunked-forest/codec/format.js +1 -1
  570. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  571. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  572. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  573. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  574. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  575. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  576. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  577. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  578. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -3
  579. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  580. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +10 -52
  581. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  582. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +4 -45
  583. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  584. package/lib/feature-libraries/default-schema/index.d.ts +1 -1
  585. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  586. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  587. package/lib/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  588. package/lib/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  589. package/lib/feature-libraries/fieldKindIdentifiers.js +13 -0
  590. package/lib/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  591. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  592. package/lib/feature-libraries/flex-tree/lazyField.js +1 -1
  593. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  594. package/lib/feature-libraries/flex-tree/observer.d.ts +1 -1
  595. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  596. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  597. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  598. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  599. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  600. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  601. package/lib/feature-libraries/forest-summary/forestSummarizer.js +6 -4
  602. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  603. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  604. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  605. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  606. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  607. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  608. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  609. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  610. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  611. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  612. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  613. package/lib/feature-libraries/index.d.ts +1 -1
  614. package/lib/feature-libraries/index.d.ts.map +1 -1
  615. package/lib/feature-libraries/index.js.map +1 -1
  616. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  617. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  618. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  619. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  620. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  621. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  622. package/lib/feature-libraries/modular-schema/genericFieldKind.js +2 -2
  623. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  624. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +1 -1
  625. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  626. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +2 -0
  627. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  628. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  629. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  630. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  631. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  632. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
  633. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  634. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -2
  635. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  636. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +52 -43
  637. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  638. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +3 -3
  639. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  640. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  641. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  642. package/lib/feature-libraries/object-forest/objectForest.js +5 -3
  643. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  644. package/lib/feature-libraries/optional-field/index.d.ts +3 -3
  645. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  646. package/lib/feature-libraries/optional-field/index.js +2 -2
  647. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  648. package/lib/feature-libraries/optional-field/optionalField.d.ts +10 -2
  649. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  650. package/lib/feature-libraries/optional-field/optionalField.js +14 -2
  651. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  652. package/lib/feature-libraries/optional-field/requiredField.d.ts +36 -0
  653. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  654. package/lib/feature-libraries/optional-field/requiredField.js +24 -0
  655. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -0
  656. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  657. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  658. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -1
  659. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  660. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  661. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  662. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  663. package/lib/feature-libraries/schemaChecker.js +1 -1
  664. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  665. package/lib/feature-libraries/sequence-field/index.d.ts +2 -14
  666. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  667. package/lib/feature-libraries/sequence-field/index.js +1 -13
  668. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  669. package/lib/feature-libraries/sequence-field/rebase.js +1 -1
  670. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  671. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  672. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  673. package/lib/feature-libraries/sequence-field/sequenceKind.js +21 -0
  674. package/lib/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  675. package/lib/index.d.ts +3 -2
  676. package/lib/index.d.ts.map +1 -1
  677. package/lib/index.js +2 -1
  678. package/lib/index.js.map +1 -1
  679. package/lib/packageVersion.d.ts +1 -1
  680. package/lib/packageVersion.js +1 -1
  681. package/lib/packageVersion.js.map +1 -1
  682. package/lib/shared-tree/independentView.d.ts.map +1 -1
  683. package/lib/shared-tree/independentView.js +3 -3
  684. package/lib/shared-tree/independentView.js.map +1 -1
  685. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  686. package/lib/shared-tree/schematizingTreeView.js +12 -10
  687. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  688. package/lib/shared-tree/sharedTree.d.ts +2 -2
  689. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  690. package/lib/shared-tree/sharedTree.js +6 -33
  691. package/lib/shared-tree/sharedTree.js.map +1 -1
  692. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  693. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  694. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  695. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  696. package/lib/shared-tree/sharedTreeChangeEnricher.js +73 -55
  697. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  698. package/lib/shared-tree/tree.d.ts.map +1 -1
  699. package/lib/shared-tree/tree.js +7 -7
  700. package/lib/shared-tree/tree.js.map +1 -1
  701. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  702. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  703. package/lib/shared-tree/treeAlpha.js +3 -3
  704. package/lib/shared-tree/treeAlpha.js.map +1 -1
  705. package/lib/shared-tree/treeCheckout.d.ts +21 -6
  706. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  707. package/lib/shared-tree/treeCheckout.js +67 -11
  708. package/lib/shared-tree/treeCheckout.js.map +1 -1
  709. package/lib/shared-tree-core/branch.d.ts +1 -1
  710. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  711. package/lib/shared-tree-core/branch.js +5 -1
  712. package/lib/shared-tree-core/branch.js.map +1 -1
  713. package/lib/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  714. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  715. package/lib/shared-tree-core/branchCommitEnricher.js +24 -76
  716. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  717. package/lib/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  718. package/lib/shared-tree-core/branchIdCodec.js.map +1 -1
  719. package/lib/shared-tree-core/changeEnricher.d.ts +8 -43
  720. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  721. package/lib/shared-tree-core/changeEnricher.js +1 -11
  722. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  723. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  724. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  725. package/lib/shared-tree-core/defaultResubmitMachine.js +28 -38
  726. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  727. package/lib/shared-tree-core/editManager.d.ts +1 -1
  728. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  729. package/lib/shared-tree-core/editManager.js +13 -7
  730. package/lib/shared-tree-core/editManager.js.map +1 -1
  731. package/lib/shared-tree-core/editManagerCodecs.d.ts +1 -1
  732. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  733. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  734. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  735. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  736. package/lib/shared-tree-core/editManagerCodecsCommons.js +1 -2
  737. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  738. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  739. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  740. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  741. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  742. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  743. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  744. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  745. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  746. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  747. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  748. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  749. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  750. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  751. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  752. package/lib/shared-tree-core/index.d.ts +2 -2
  753. package/lib/shared-tree-core/index.d.ts.map +1 -1
  754. package/lib/shared-tree-core/index.js +0 -1
  755. package/lib/shared-tree-core/index.js.map +1 -1
  756. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +1 -1
  757. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  758. package/lib/shared-tree-core/messageCodecV1ToV4.js +1 -1
  759. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  760. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  761. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  762. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  763. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  764. package/lib/shared-tree-core/messageCodecs.d.ts +2 -2
  765. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  766. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  767. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  768. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  769. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  770. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  771. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  772. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  773. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -4
  774. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  775. package/lib/shared-tree-core/sharedTreeCore.js +14 -14
  776. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  777. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  778. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  779. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  780. package/lib/simple-tree/api/configuration.d.ts +2 -2
  781. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  782. package/lib/simple-tree/api/configuration.js +4 -4
  783. package/lib/simple-tree/api/configuration.js.map +1 -1
  784. package/lib/simple-tree/api/create.d.ts +1 -1
  785. package/lib/simple-tree/api/create.d.ts.map +1 -1
  786. package/lib/simple-tree/api/create.js +1 -1
  787. package/lib/simple-tree/api/create.js.map +1 -1
  788. package/lib/simple-tree/api/dirtyIndex.d.ts +1 -1
  789. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  790. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  791. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  792. package/lib/simple-tree/api/discrepancies.js +3 -3
  793. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  794. package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
  795. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  796. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  797. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  798. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  799. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  800. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  801. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  802. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  803. package/lib/simple-tree/api/incrementalAllowedTypes.js +3 -3
  804. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  805. package/lib/simple-tree/api/index.d.ts +1 -1
  806. package/lib/simple-tree/api/index.d.ts.map +1 -1
  807. package/lib/simple-tree/api/index.js +1 -1
  808. package/lib/simple-tree/api/index.js.map +1 -1
  809. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  810. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  811. package/lib/simple-tree/api/schemaCompatibilityTester.js +1 -1
  812. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  813. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  814. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  815. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
  816. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  817. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  818. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  819. package/lib/simple-tree/api/schemaFactory.js +2 -2
  820. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  821. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  822. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  823. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  824. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  825. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  826. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  827. package/lib/simple-tree/api/schemaFactoryBeta.js +2 -1
  828. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  829. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  830. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  831. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  832. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  833. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  834. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  835. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  836. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  837. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  838. package/lib/simple-tree/api/simpleSchemaCodec.js +3 -3
  839. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  840. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  841. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  842. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +6 -6
  843. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  844. package/lib/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  845. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  846. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  847. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  848. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +244 -0
  849. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  850. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +271 -1
  851. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  852. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  853. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  854. package/lib/simple-tree/api/tree.d.ts +5 -3
  855. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  856. package/lib/simple-tree/api/tree.js.map +1 -1
  857. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  858. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  859. package/lib/simple-tree/api/treeBeta.js +2 -2
  860. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  861. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  862. package/lib/simple-tree/api/treeNodeApi.js +4 -4
  863. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  864. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  865. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  866. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  867. package/lib/simple-tree/api/verboseTree.d.ts +1 -1
  868. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  869. package/lib/simple-tree/api/verboseTree.js +3 -3
  870. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  871. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  872. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  873. package/lib/simple-tree/core/allowedTypes.js +2 -2
  874. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  875. package/lib/simple-tree/core/context.d.ts.map +1 -1
  876. package/lib/simple-tree/core/context.js.map +1 -1
  877. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  878. package/lib/simple-tree/core/treeNode.js +1 -1
  879. package/lib/simple-tree/core/treeNode.js.map +1 -1
  880. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  881. package/lib/simple-tree/core/treeNodeKernel.js +7 -5
  882. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  883. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -5
  884. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  885. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  886. package/lib/simple-tree/core/treeNodeValid.d.ts +3 -3
  887. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  888. package/lib/simple-tree/core/treeNodeValid.js +2 -2
  889. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  890. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -1
  891. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  892. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  893. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  894. package/lib/simple-tree/core/withType.js.map +1 -1
  895. package/lib/simple-tree/createContext.d.ts.map +1 -1
  896. package/lib/simple-tree/createContext.js.map +1 -1
  897. package/lib/simple-tree/fieldSchema.d.ts +1 -1
  898. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  899. package/lib/simple-tree/fieldSchema.js.map +1 -1
  900. package/lib/simple-tree/index.d.ts +1 -1
  901. package/lib/simple-tree/index.d.ts.map +1 -1
  902. package/lib/simple-tree/index.js +1 -1
  903. package/lib/simple-tree/index.js.map +1 -1
  904. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  905. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  906. package/lib/simple-tree/leafNodeSchema.js +2 -2
  907. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  908. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  909. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  910. package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -5
  911. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  912. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  913. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  914. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  915. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  916. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  917. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  918. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  919. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -6
  920. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  921. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  922. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  923. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  924. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  925. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  926. package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
  927. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  928. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  929. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  930. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  931. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  932. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  933. package/lib/simple-tree/node-kinds/record/recordNode.js +4 -4
  934. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  935. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  936. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  937. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  938. package/lib/simple-tree/prepareForInsertion.d.ts +2 -2
  939. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  940. package/lib/simple-tree/prepareForInsertion.js +4 -4
  941. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  942. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  943. package/lib/simple-tree/simpleSchema.js.map +1 -1
  944. package/lib/simple-tree/treeSchema.d.ts.map +1 -1
  945. package/lib/simple-tree/treeSchema.js.map +1 -1
  946. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +1 -1
  947. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  948. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +2 -2
  949. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  950. package/lib/tableSchema.d.ts.map +1 -1
  951. package/lib/tableSchema.js +2 -1
  952. package/lib/tableSchema.js.map +1 -1
  953. package/lib/text/index.d.ts +7 -0
  954. package/lib/text/index.d.ts.map +1 -0
  955. package/lib/text/index.js +7 -0
  956. package/lib/text/index.js.map +1 -0
  957. package/lib/text/textDomain.d.ts +146 -0
  958. package/lib/text/textDomain.d.ts.map +1 -0
  959. package/lib/text/textDomain.js +118 -0
  960. package/lib/text/textDomain.js.map +1 -0
  961. package/lib/text/textDomainFormatted.d.ts +572 -0
  962. package/lib/text/textDomainFormatted.d.ts.map +1 -0
  963. package/lib/text/textDomainFormatted.js +180 -0
  964. package/lib/text/textDomainFormatted.js.map +1 -0
  965. package/lib/treeFactory.d.ts.map +1 -1
  966. package/lib/treeFactory.js +2 -2
  967. package/lib/treeFactory.js.map +1 -1
  968. package/lib/util/bTreeUtils.d.ts +12 -4
  969. package/lib/util/bTreeUtils.d.ts.map +1 -1
  970. package/lib/util/bTreeUtils.js +15 -19
  971. package/lib/util/bTreeUtils.js.map +1 -1
  972. package/lib/util/nestedMap.js +12 -12
  973. package/lib/util/nestedMap.js.map +1 -1
  974. package/lib/util/readSnapshotBlob.d.ts +1 -1
  975. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  976. package/lib/util/readSnapshotBlob.js.map +1 -1
  977. package/package.json +25 -25
  978. package/src/codec/codec.ts +10 -7
  979. package/src/codec/versioned/codec.ts +3 -3
  980. package/src/core/index.ts +2 -0
  981. package/src/core/rebase/index.ts +2 -0
  982. package/src/core/rebase/types.ts +57 -20
  983. package/src/core/rebase/utils.ts +8 -4
  984. package/src/core/schema-stored/formatV2.ts +2 -1
  985. package/src/core/tree/anchorSet.ts +2 -1
  986. package/src/core/tree/detachedFieldIndex.ts +1 -1
  987. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  988. package/src/core/tree/detachedFieldIndexCodecV1.ts +2 -2
  989. package/src/core/tree/detachedFieldIndexCodecV2.ts +3 -3
  990. package/src/core/tree/detachedFieldIndexFormatV1.ts +3 -2
  991. package/src/core/tree/detachedFieldIndexFormatV2.ts +3 -2
  992. package/src/core/tree/visitDelta.ts +8 -5
  993. package/src/core/tree/visitorUtils.ts +57 -20
  994. package/src/feature-libraries/changeAtomIdBTree.ts +9 -1
  995. package/src/feature-libraries/chunked-forest/chunkTree.ts +1 -1
  996. package/src/feature-libraries/chunked-forest/chunkedForest.ts +3 -1
  997. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +1 -1
  998. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  999. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
  1000. package/src/feature-libraries/chunked-forest/codec/codecs.ts +2 -2
  1001. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -1
  1002. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1003. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -0
  1004. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +3 -3
  1005. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -10
  1006. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -110
  1007. package/src/feature-libraries/default-schema/index.ts +0 -5
  1008. package/src/feature-libraries/fieldKindIdentifiers.ts +16 -0
  1009. package/src/feature-libraries/flex-tree/lazyField.ts +1 -1
  1010. package/src/feature-libraries/flex-tree/observer.ts +3 -1
  1011. package/src/feature-libraries/forest-summary/codec.ts +1 -1
  1012. package/src/feature-libraries/forest-summary/forestSummarizer.ts +9 -7
  1013. package/src/feature-libraries/forest-summary/formatV1.ts +1 -0
  1014. package/src/feature-libraries/forest-summary/formatV2.ts +1 -0
  1015. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +9 -7
  1016. package/src/feature-libraries/forest-summary/summaryTypes.ts +1 -0
  1017. package/src/feature-libraries/index.ts +0 -5
  1018. package/src/feature-libraries/mapTreeCursor.ts +1 -1
  1019. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +1 -0
  1020. package/src/feature-libraries/modular-schema/genericFieldKind.ts +2 -2
  1021. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +3 -1
  1022. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +2 -2
  1023. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -2
  1024. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +83 -74
  1025. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +3 -3
  1026. package/src/feature-libraries/object-forest/objectForest.ts +5 -3
  1027. package/src/feature-libraries/optional-field/index.ts +6 -8
  1028. package/src/feature-libraries/optional-field/optionalField.ts +31 -0
  1029. package/src/feature-libraries/optional-field/requiredField.ts +62 -0
  1030. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +1 -1
  1031. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -0
  1032. package/src/feature-libraries/schemaChecker.ts +3 -2
  1033. package/src/feature-libraries/sequence-field/index.ts +2 -51
  1034. package/src/feature-libraries/sequence-field/rebase.ts +1 -1
  1035. package/src/feature-libraries/sequence-field/sequenceKind.ts +40 -0
  1036. package/src/index.ts +7 -0
  1037. package/src/packageVersion.ts +1 -1
  1038. package/src/shared-tree/independentView.ts +4 -3
  1039. package/src/shared-tree/schematizingTreeView.ts +17 -13
  1040. package/src/shared-tree/sharedTree.ts +9 -46
  1041. package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -0
  1042. package/src/shared-tree/sharedTreeChangeEnricher.ts +87 -66
  1043. package/src/shared-tree/tree.ts +10 -10
  1044. package/src/shared-tree/treeAlpha.ts +26 -25
  1045. package/src/shared-tree/treeCheckout.ts +119 -23
  1046. package/src/shared-tree-core/branch.ts +9 -5
  1047. package/src/shared-tree-core/branchCommitEnricher.ts +25 -77
  1048. package/src/shared-tree-core/branchIdCodec.ts +1 -0
  1049. package/src/shared-tree-core/changeEnricher.ts +8 -52
  1050. package/src/shared-tree-core/defaultResubmitMachine.ts +39 -51
  1051. package/src/shared-tree-core/editManager.ts +32 -32
  1052. package/src/shared-tree-core/editManagerCodecs.ts +2 -2
  1053. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -6
  1054. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1055. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1056. package/src/shared-tree-core/editManagerFormatCommons.ts +1 -0
  1057. package/src/shared-tree-core/editManagerFormatV1toV4.ts +1 -0
  1058. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +3 -2
  1059. package/src/shared-tree-core/index.ts +2 -5
  1060. package/src/shared-tree-core/messageCodecV1ToV4.ts +3 -3
  1061. package/src/shared-tree-core/messageCodecVSharedBranches.ts +4 -4
  1062. package/src/shared-tree-core/messageCodecs.ts +2 -2
  1063. package/src/shared-tree-core/messageFormatV1ToV4.ts +1 -0
  1064. package/src/shared-tree-core/messageFormatVSharedBranches.ts +1 -0
  1065. package/src/shared-tree-core/messageTypes.ts +1 -0
  1066. package/src/shared-tree-core/sharedTreeCore.ts +27 -28
  1067. package/src/shared-tree-core/versionedSummarizer.ts +3 -1
  1068. package/src/simple-tree/api/configuration.ts +9 -9
  1069. package/src/simple-tree/api/create.ts +7 -6
  1070. package/src/simple-tree/api/dirtyIndex.ts +4 -2
  1071. package/src/simple-tree/api/discrepancies.ts +9 -8
  1072. package/src/simple-tree/api/getJsonSchema.ts +4 -3
  1073. package/src/simple-tree/api/identifierIndex.ts +4 -2
  1074. package/src/simple-tree/api/incrementalAllowedTypes.ts +6 -5
  1075. package/src/simple-tree/api/index.ts +3 -0
  1076. package/src/simple-tree/api/schemaCompatibilityTester.ts +3 -3
  1077. package/src/simple-tree/api/schemaCreationUtilities.ts +4 -3
  1078. package/src/simple-tree/api/schemaFactory.ts +16 -17
  1079. package/src/simple-tree/api/schemaFactoryAlpha.ts +22 -22
  1080. package/src/simple-tree/api/schemaFactoryBeta.ts +18 -16
  1081. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
  1082. package/src/simple-tree/api/schemaFromSimple.ts +1 -1
  1083. package/src/simple-tree/api/schemaStatics.ts +2 -0
  1084. package/src/simple-tree/api/simpleSchemaCodec.ts +12 -11
  1085. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +24 -22
  1086. package/src/simple-tree/api/simpleTreeIndex.ts +6 -4
  1087. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +504 -1
  1088. package/src/simple-tree/api/storedSchema.ts +2 -1
  1089. package/src/simple-tree/api/tree.ts +5 -3
  1090. package/src/simple-tree/api/treeBeta.ts +3 -3
  1091. package/src/simple-tree/api/treeNodeApi.ts +14 -13
  1092. package/src/simple-tree/api/typesUnsafe.ts +7 -8
  1093. package/src/simple-tree/api/verboseTree.ts +6 -5
  1094. package/src/simple-tree/core/allowedTypes.ts +4 -4
  1095. package/src/simple-tree/core/context.ts +1 -1
  1096. package/src/simple-tree/core/treeNode.ts +1 -1
  1097. package/src/simple-tree/core/treeNodeKernel.ts +7 -5
  1098. package/src/simple-tree/core/treeNodeSchema.ts +7 -6
  1099. package/src/simple-tree/core/treeNodeValid.ts +9 -9
  1100. package/src/simple-tree/core/unhydratedFlexTree.ts +1 -1
  1101. package/src/simple-tree/core/withType.ts +3 -2
  1102. package/src/simple-tree/createContext.ts +1 -0
  1103. package/src/simple-tree/fieldSchema.ts +1 -2
  1104. package/src/simple-tree/index.ts +3 -0
  1105. package/src/simple-tree/leafNodeSchema.ts +3 -3
  1106. package/src/simple-tree/node-kinds/array/arrayNode.ts +17 -16
  1107. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +2 -2
  1108. package/src/simple-tree/node-kinds/common.ts +1 -1
  1109. package/src/simple-tree/node-kinds/map/mapNode.ts +16 -15
  1110. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +2 -2
  1111. package/src/simple-tree/node-kinds/object/objectNode.ts +11 -11
  1112. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +8 -7
  1113. package/src/simple-tree/node-kinds/record/recordNode.ts +12 -12
  1114. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +1 -2
  1115. package/src/simple-tree/prepareForInsertion.ts +10 -8
  1116. package/src/simple-tree/simpleSchema.ts +1 -0
  1117. package/src/simple-tree/treeSchema.ts +1 -0
  1118. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +2 -2
  1119. package/src/tableSchema.ts +3 -1
  1120. package/src/text/README.md +8 -0
  1121. package/src/text/index.ts +7 -0
  1122. package/src/text/textDomain.ts +199 -0
  1123. package/src/text/textDomainFormatted.ts +309 -0
  1124. package/src/treeFactory.ts +4 -4
  1125. package/src/util/bTreeUtils.ts +33 -22
  1126. package/src/util/nestedMap.ts +12 -12
  1127. package/src/util/readSnapshotBlob.ts +4 -2
  1128. package/.eslintrc.cjs +0 -125
  1129. package/assertTagging.config.mjs +0 -14
  1130. package/dist/shared-tree-core/transactionEnricher.d.ts +0 -23
  1131. package/dist/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1132. package/dist/shared-tree-core/transactionEnricher.js +0 -74
  1133. package/dist/shared-tree-core/transactionEnricher.js.map +0 -1
  1134. package/lib/shared-tree-core/transactionEnricher.d.ts +0 -23
  1135. package/lib/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1136. package/lib/shared-tree-core/transactionEnricher.js +0 -70
  1137. package/lib/shared-tree-core/transactionEnricher.js.map +0 -1
  1138. package/src/shared-tree-core/transactionEnricher.ts +0 -74
@@ -1 +1 @@
1
- {"version":3,"file":"dirtyIndex.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/dirtyIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAE,QAAQ,EAAsB,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,KAAK,E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,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,IAAI,YAAY,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tcreateAnnouncedVisitor,\n\tCursorLocationType,\n\ttype AnnouncedVisitor,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype UpPath,\n} from \"../../core/index.js\";\nimport { TreeNode, treeNodeFromAnchor } from \"../core/index.js\";\nimport type { TreeViewAlpha } from \"./tree.js\";\nimport type { SchematizingSimpleTreeView } from \"../../shared-tree/index.js\";\nimport type { ImplicitFieldSchema } from \"../fieldSchema.js\";\n\n/**\n * The status of a node in a that has been {@link trackDirtyNodes | tracked for changes}.\n * @remarks Nodes can be marked \"new\", \"changed\", or \"moved\", with \"new\" taking precedence over \"changed\" and \"changed\" taking precedence over \"moved\".\n * * \"new\": The node was added.\n * * \"changed\": A direct child was updated, added, removed, or moved (and the node is not \"new\").\n * * \"moved\": The node was moved between/within arrays (and the node is not \"new\" or \"changed\").\n * @privateRemarks\n * It is unclear how this will handle forward compatibility with other kinds of edits, like moves that are not limited to arrays (attach, detach, swap):\n * this needs to be sorted out before this is stabilized.\n * It is also unclear how this is supposed to handle schema changes (which can result in new TreeNode instance, but I think won't trigger \"new\" here).\n * @alpha\n */\nexport type DirtyTreeStatus = \"new\" | \"changed\" | \"moved\";\n\n/**\n * A map-like interface for tracking the {@link DirtyTreeStatus | status} of nodes that have been {@link trackDirtyNodes | tracked for changes}.\n * @privateRemarks TODO: Replace this with `MapGetSet` from `@fluidframework/core-interfaces`.\n * @alpha\n */\nexport interface DirtyTreeMap {\n\tget(node: TreeNode): DirtyTreeStatus | undefined;\n\tset(node: TreeNode, status: DirtyTreeStatus): void;\n}\n\n/**\n * Registers a visitor on the view's forest that tracks which nodes are dirty.\n * @param view - The view to track dirty nodes on\n * @param dirty - A {@link DirtyTreeMap | map} that will be updated over time to reflect the {@link DirtyTreeStatus | status} of nodes as they change.\n * Nodes that have not changed will not be inserted/updated in the map.\n * @returns a cleanup function that should be called when the tracking is no longer needed.\n * @example\n * ```typescript\n * const dirty = new Map<TreeNode, DirtyTreeStatus>();\n * const stopTracking = trackDirtyNodes(view, dirty);\n * // ... make changes to the view ...\n * console.log(`The root of the tree is ${dirty.get(view.root) ?? \"unchanged\"}`);\n * stopTracking();\n * ```\n * @privateRemarks\n * This provides an opportunity for user code (\"set\" on dirty) to run during forest changes, in the middle of processing an edit.\n * We have generally avoided exposing such times to users and instead flush events after the edit has finished and user facing invariants are known to be restored.\n * Before stabilizing, how this event relates to other events time/ordering wise should be clarified, and if any APIs have been provided to defer events, that mentioned as well.\n * Maybe updates should be deferred?\n *\n * This is also documented in terms of \"forest\" which is not a concept in the public API, and thus needs to be redefined in terms of public concepts.\n * @alpha\n */\nexport function trackDirtyNodes(\n\tview: TreeViewAlpha<ImplicitFieldSchema>,\n\tdirty: DirtyTreeMap,\n): () => void {\n\tconst forest = (view as SchematizingSimpleTreeView<ImplicitFieldSchema>).checkout.forest;\n\tconst announcedVisitor = (): AnnouncedVisitor => createDirtyVisitor(forest, dirty);\n\tforest.registerAnnouncedVisitor(announcedVisitor);\n\treturn () => {\n\t\tforest.deregisterAnnouncedVisitor(announcedVisitor);\n\t};\n}\n\nfunction createDirtyVisitor(forest: IEditableForest, dirty: DirtyTreeMap): AnnouncedVisitor {\n\t// When cursor is in Fields mode, `parentField` is the field and `parent` is the parent node above that field (if any).\n\t// When cursor is in Nodes mode, `parent` is the current node and `parentField` is undefined.\n\tlet parentField: FieldKey | undefined;\n\tlet parent: UpPath | undefined;\n\n\treturn createAnnouncedVisitor({\n\t\tbeforeDetach: (src) => {\n\t\t\tassert(parent !== undefined, 0xc48 /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc49 /* Expected field */);\n\t\t\tfor (let parentIndex = src.start; parentIndex < src.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\t// The only way a detached node can be re-attached (and become visible/usable again) is via a move, so mark it as moved ahead of time.\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as moved if it is not already marked as something else.\n\t\t\t\t\tdirty.set(node, \"moved\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tafterAttach: (_, dst) => {\n\t\t\tassert(parent !== undefined, 0xc4a /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc4b /* Expected field */);\n\t\t\tfor (let parentIndex = dst.start; parentIndex < dst.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as new if it is not already marked as something else - this ensures that a moved node is not marked as new (since nodes are marked move when detached).\n\t\t\t\t\tdirty.set(node, \"new\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tenterNode(index: number): void {\n\t\t\tassert(parentField !== undefined, 0xc4c /* Expected field */);\n\t\t\tparent = {\n\t\t\t\tparent,\n\t\t\t\tparentField,\n\t\t\t\tparentIndex: index,\n\t\t\t};\n\t\t\tparentField = undefined;\n\t\t},\n\t\texitNode(): void {\n\t\t\tassert(parent !== undefined, 0xc4d /* Expected node */);\n\t\t\tparentField = parent.parentField;\n\t\t\tparent = parent.parent;\n\t\t},\n\t\tenterField: (key: FieldKey) => {\n\t\t\tparentField = key;\n\t\t},\n\t\texitField(): void {\n\t\t\tparentField = undefined;\n\t\t},\n\t});\n}\n\nfunction getNodeAtPath(forest: IEditableForest, path: UpPath): TreeNode | undefined {\n\tconst cursor = forest.allocateCursor();\n\tforest.moveCursorToPath(path, cursor);\n\tassert(cursor.mode === CursorLocationType.Nodes, 0xc4e /* attach should happen in a node */);\n\tconst anchor = cursor.buildAnchor();\n\tconst anchorNode = forest.anchors.locate(anchor);\n\tcursor.free();\n\tif (anchorNode !== undefined) {\n\t\tconst node = treeNodeFromAnchor(anchorNode);\n\t\tif (node instanceof TreeNode) {\n\t\t\treturn node;\n\t\t}\n\t}\n\treturn undefined;\n}\n"]}
1
+ {"version":3,"file":"dirtyIndex.js","sourceRoot":"","sources":["../../../src/simple-tree/api/dirtyIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EACN,sBAAsB,GAMtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AA6BhE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,eAAe,CAC9B,IAAwC,EACxC,KAAmB;IAEnB,MAAM,MAAM,GAAI,IAAwD,CAAC,QAAQ,CAAC,MAAM,CAAC;IACzF,MAAM,gBAAgB,GAAG,GAAqB,EAAE,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC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AAC;YACxD,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;YACjC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACxB,CAAC;QACD,UAAU,EAAE,CAAC,GAAa,EAAE,EAAE;YAC7B,WAAW,GAAG,GAAG,CAAC;QACnB,CAAC;QACD,SAAS;YACR,WAAW,GAAG,SAAS,CAAC;QACzB,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAuB,EAAE,IAAY;IAC3D,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC;IACvC,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,CAAC,IAAI,qCAA6B,EAAE,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC7F,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,IAAI,YAAY,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACb,CAAC;IACF,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tcreateAnnouncedVisitor,\n\tCursorLocationType,\n\ttype AnnouncedVisitor,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype UpPath,\n} from \"../../core/index.js\";\nimport type { SchematizingSimpleTreeView } from \"../../shared-tree/index.js\";\nimport { TreeNode, treeNodeFromAnchor } from \"../core/index.js\";\nimport type { ImplicitFieldSchema } from \"../fieldSchema.js\";\n\nimport type { TreeViewAlpha } from \"./tree.js\";\n\n/**\n * The status of a node in a that has been {@link trackDirtyNodes | tracked for changes}.\n * @remarks Nodes can be marked \"new\", \"changed\", or \"moved\", with \"new\" taking precedence over \"changed\" and \"changed\" taking precedence over \"moved\".\n * * \"new\": The node was added.\n * * \"changed\": A direct child was updated, added, removed, or moved (and the node is not \"new\").\n * * \"moved\": The node was moved between/within arrays (and the node is not \"new\" or \"changed\").\n * @privateRemarks\n * It is unclear how this will handle forward compatibility with other kinds of edits, like moves that are not limited to arrays (attach, detach, swap):\n * this needs to be sorted out before this is stabilized.\n * It is also unclear how this is supposed to handle schema changes (which can result in new TreeNode instance, but I think won't trigger \"new\" here).\n * @alpha\n */\nexport type DirtyTreeStatus = \"new\" | \"changed\" | \"moved\";\n\n/**\n * A map-like interface for tracking the {@link DirtyTreeStatus | status} of nodes that have been {@link trackDirtyNodes | tracked for changes}.\n * @privateRemarks TODO: Replace this with `MapGetSet` from `@fluidframework/core-interfaces`.\n * @alpha\n */\nexport interface DirtyTreeMap {\n\tget(node: TreeNode): DirtyTreeStatus | undefined;\n\tset(node: TreeNode, status: DirtyTreeStatus): void;\n}\n\n/**\n * Registers a visitor on the view's forest that tracks which nodes are dirty.\n * @param view - The view to track dirty nodes on\n * @param dirty - A {@link DirtyTreeMap | map} that will be updated over time to reflect the {@link DirtyTreeStatus | status} of nodes as they change.\n * Nodes that have not changed will not be inserted/updated in the map.\n * @returns a cleanup function that should be called when the tracking is no longer needed.\n * @example\n * ```typescript\n * const dirty = new Map<TreeNode, DirtyTreeStatus>();\n * const stopTracking = trackDirtyNodes(view, dirty);\n * // ... make changes to the view ...\n * console.log(`The root of the tree is ${dirty.get(view.root) ?? \"unchanged\"}`);\n * stopTracking();\n * ```\n * @privateRemarks\n * This provides an opportunity for user code (\"set\" on dirty) to run during forest changes, in the middle of processing an edit.\n * We have generally avoided exposing such times to users and instead flush events after the edit has finished and user facing invariants are known to be restored.\n * Before stabilizing, how this event relates to other events time/ordering wise should be clarified, and if any APIs have been provided to defer events, that mentioned as well.\n * Maybe updates should be deferred?\n *\n * This is also documented in terms of \"forest\" which is not a concept in the public API, and thus needs to be redefined in terms of public concepts.\n * @alpha\n */\nexport function trackDirtyNodes(\n\tview: TreeViewAlpha<ImplicitFieldSchema>,\n\tdirty: DirtyTreeMap,\n): () => void {\n\tconst forest = (view as SchematizingSimpleTreeView<ImplicitFieldSchema>).checkout.forest;\n\tconst announcedVisitor = (): AnnouncedVisitor => createDirtyVisitor(forest, dirty);\n\tforest.registerAnnouncedVisitor(announcedVisitor);\n\treturn () => {\n\t\tforest.deregisterAnnouncedVisitor(announcedVisitor);\n\t};\n}\n\nfunction createDirtyVisitor(forest: IEditableForest, dirty: DirtyTreeMap): AnnouncedVisitor {\n\t// When cursor is in Fields mode, `parentField` is the field and `parent` is the parent node above that field (if any).\n\t// When cursor is in Nodes mode, `parent` is the current node and `parentField` is undefined.\n\tlet parentField: FieldKey | undefined;\n\tlet parent: UpPath | undefined;\n\n\treturn createAnnouncedVisitor({\n\t\tbeforeDetach: (src) => {\n\t\t\tassert(parent !== undefined, 0xc48 /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc49 /* Expected field */);\n\t\t\tfor (let parentIndex = src.start; parentIndex < src.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\t// The only way a detached node can be re-attached (and become visible/usable again) is via a move, so mark it as moved ahead of time.\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as moved if it is not already marked as something else.\n\t\t\t\t\tdirty.set(node, \"moved\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tafterAttach: (_, dst) => {\n\t\t\tassert(parent !== undefined, 0xc4a /* Expected node */);\n\t\t\tassert(parentField !== undefined, 0xc4b /* Expected field */);\n\t\t\tfor (let parentIndex = dst.start; parentIndex < dst.end; parentIndex++) {\n\t\t\t\tconst path: UpPath = {\n\t\t\t\t\tparent,\n\t\t\t\t\tparentField,\n\t\t\t\t\tparentIndex,\n\t\t\t\t};\n\t\t\t\tconst node = getNodeAtPath(forest, path);\n\t\t\t\tif (node !== undefined && dirty.get(node) === undefined) {\n\t\t\t\t\t// Only mark the node as new if it is not already marked as something else - this ensures that a moved node is not marked as new (since nodes are marked move when detached).\n\t\t\t\t\tdirty.set(node, \"new\");\n\t\t\t\t}\n\t\t\t\t// Mark the parent as changed unless it is already marked as new.\n\t\t\t\tconst parentNode = getNodeAtPath(forest, parent);\n\t\t\t\tif (parentNode !== undefined && dirty.get(parentNode) !== \"new\") {\n\t\t\t\t\tdirty.set(parentNode, \"changed\");\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tenterNode(index: number): void {\n\t\t\tassert(parentField !== undefined, 0xc4c /* Expected field */);\n\t\t\tparent = {\n\t\t\t\tparent,\n\t\t\t\tparentField,\n\t\t\t\tparentIndex: index,\n\t\t\t};\n\t\t\tparentField = undefined;\n\t\t},\n\t\texitNode(): void {\n\t\t\tassert(parent !== undefined, 0xc4d /* Expected node */);\n\t\t\tparentField = parent.parentField;\n\t\t\tparent = parent.parent;\n\t\t},\n\t\tenterField: (key: FieldKey) => {\n\t\t\tparentField = key;\n\t\t},\n\t\texitField(): void {\n\t\t\tparentField = undefined;\n\t\t},\n\t});\n}\n\nfunction getNodeAtPath(forest: IEditableForest, path: UpPath): TreeNode | undefined {\n\tconst cursor = forest.allocateCursor();\n\tforest.moveCursorToPath(path, cursor);\n\tassert(cursor.mode === CursorLocationType.Nodes, 0xc4e /* attach should happen in a node */);\n\tconst anchor = cursor.buildAnchor();\n\tconst anchorNode = forest.anchors.locate(anchor);\n\tcursor.free();\n\tif (anchorNode !== undefined) {\n\t\tconst node = treeNodeFromAnchor(anchorNode);\n\t\tif (node instanceof TreeNode) {\n\t\t\treturn node;\n\t\t}\n\t}\n\treturn undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"discrepancies.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,QAAQ,EACb,KAAK,mBAAmB,EAExB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EAGtB,KAAK,wBAAwB,EAE7B,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,QAAQ,EAER,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,MAAM,kBAAkB,CAAC;AAgB1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACzB,sBAAsB,GACtB,oBAAoB,GACpB,sBAAsB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;CACxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAuB,SAAQ,wBAAwB;IACvE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,oBAAoB,CAAC,cAAc,CAAC,EAAE,CA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AC9B,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,wBAAwB,CAAC;IACrC,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,qBAAqB,CAAC;CAC9B;AAED,KAAK,qBAAqB,GACvB,OAAO,sBAAsB,GAC7B,OAAO,mBAAmB,GAC1B,OAAO,oBAAoB,CAAC;AAqC/B;;;;GAIG;AACH,wBAAiB,gCAAgC,CAChD,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,gBAAgB,GACtB,QAAQ,CAAC,WAAW,CAAC,CAcvB;AA4GD;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,gBAAgB,EAAE,SAAS,oBAAoB,CAAC,cAAc,CAAC,EAAE,EACjE,kBAAkB,EAAE,WAAW,GAC7B,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,QAAQ,CAAC,CAkBjD"}
@@ -4,14 +4,14 @@
4
4
  */
5
5
  import { assert, fail, unreachableCase } from "@fluidframework/core-utils/internal";
6
6
  import { EmptyKey, forbiddenFieldKindIdentifier, LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, storedEmptyFieldSchema, } from "../../core/index.js";
7
+ import { FieldKinds } from "../../feature-libraries/index.js";
7
8
  import { brand } from "../../util/index.js";
8
9
  import { NodeKind, normalizeAndEvaluateAnnotatedAllowedTypes, } from "../core/index.js";
9
- import { isArrayNodeSchema, isMapNodeSchema, isObjectNodeSchema, isRecordNodeSchema, } from "../node-kinds/index.js";
10
- import { convertFieldKind } from "../toStoredSchema.js";
11
10
  import { createFieldSchema, FieldKind, FieldSchemaAlpha, } from "../fieldSchema.js";
12
11
  import { LeafNodeSchema } from "../leafNodeSchema.js";
12
+ import { isArrayNodeSchema, isMapNodeSchema, isObjectNodeSchema, isRecordNodeSchema, } from "../node-kinds/index.js";
13
+ import { convertFieldKind } from "../toStoredSchema.js";
13
14
  import { tryStoredSchemaAsArray } from "./customTree.js";
14
- import { FieldKinds } from "../../feature-libraries/index.js";
15
15
  function getStoredNodeSchemaType(nodeSchema) {
16
16
  if (nodeSchema instanceof ObjectNodeStoredSchema) {
17
17
  return ObjectNodeStoredSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EACN,QAAQ,EAGR,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GAOtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACN,QAAQ,EACR,yCAAyC,GAGzC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GAElB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACN,iBAAiB,EACjB,SAAS,EACT,gBAAgB,GAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AA2F9D,SAAS,uBAAuB,CAAC,UAAgC;IAChE,IAAI,UAAU,YAAY,sBAAsB,EAAE,CAAC;QAClD,OAAO,sBAAsB,CAAC;IAC/B,CAAC;IACD,IAAI,UAAU,YAAY,mBAAmB,EAAE,CAAC;QAC/C,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IACD,IAAI,UAAU,YAAY,oBAAoB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B,CAAC,IAAI;aACJ,CAAC;QAClC,CAAC;aAAM,CAAC;YACP,KAAK,CAAC,CAAC,qBAAqB,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC/E,CAAC;IACF,CAAC;IAED,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1D,IAAI,MAAM,CAAC,IAAI,KAAK,4BAA4B,EAAE,CAAC;YAClD,0DAA0D;YAC1D,qFAAqF;YACrF,2BAA2B;YAC3B,SAAS;QACV,CAAC;QAED,iEAAiE;QACjE,2FAA2F;QAC3F,gFAAgF;QAChF,IACC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;YACvB,CAAC,CAAC,IAAI,CAAC,0BAA0B,IAAI,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,EACnF,CAAC;YACF,MAAM;gBACL,UAAU;gBACV,QAAQ;gBACR,QAAQ,EAAE,WAAW;gBACrB,IAAI,EAAE,sBAAsB,CAAC,IAAI;gBACjC,MAAM,EAAE,MAAM,CAAC,IAAI;aACY,CAAC;QAClC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tstoredEmptyFieldSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\tNodeKind,\n\tnormalizeAndEvaluateAnnotatedAllowedTypes,\n\ttype AnnotatedAllowedType,\n\ttype TreeNodeSchema,\n} from \"../core/index.js\";\nimport {\n\tisArrayNodeSchema,\n\tisMapNodeSchema,\n\tisObjectNodeSchema,\n\tisRecordNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n} from \"../node-kinds/index.js\";\nimport { convertFieldKind } from \"../toStoredSchema.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tFieldSchemaAlpha,\n\ttype FieldSchema,\n} from \"../fieldSchema.js\";\nimport { LeafNodeSchema } from \"../leafNodeSchema.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\nimport { tryStoredSchemaAsArray } from \"./customTree.js\";\nimport { FieldKinds } from \"../../feature-libraries/index.js\";\n\n/**\n * Discriminated union (keyed on `mismatch`) of discrepancies between a view and stored schema which\n * make it possible for content matching the stored schema to be incompatible with the view schema.\n */\nexport type Discrepancy = FieldDiscrepancy | NodeKindDiscrepancy;\n\n/**\n * A discrepancy in the declaration of a field.\n */\nexport type FieldDiscrepancy =\n\t| AllowedTypeDiscrepancy\n\t| FieldKindDiscrepancy\n\t| ValueSchemaDiscrepancy;\n\n/**\n * Information about where a field discrepancy is located within a collection of schema.\n */\nexport interface FieldDiscrepancyLocation {\n\t/**\n\t * The {@link TreeNodeSchemaIdentifier} that contains the discrepancy.\n\t *\n\t * Undefined iff the discrepancy is part of the root field schema.\n\t */\n\treadonly identifier: TreeNodeSchemaIdentifier | undefined;\n\t/**\n\t * The {@link FieldKey} for the field that contains the discrepancy.\n\t * Undefined when:\n\t * - the discrepancy is part of the root field schema\n\t * - the discrepancy is for 'all fields' of a map node\n\t */\n\treadonly fieldKey: FieldKey | undefined;\n}\n\n/**\n * A discrepancy in the allowed types of a field.\n *\n * @remarks\n * This reports the symmetric difference of allowed types.\n */\nexport interface AllowedTypeDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"allowedTypes\";\n\t/**\n\t * Annotated allowed types in viewed schema\n\t * (excluding {@link SchemaStaticsBeta.staged | staged} schema) which are not allowed in stored schema.\n\t */\n\treadonly view: readonly AnnotatedAllowedType<TreeNodeSchema>[];\n\t/**\n\t * Allowed type identifiers in stored schema which are not allowed in view schema\n\t * (including the view schema's {@link SchemaStaticsBeta.staged | staged} schema).\n\t */\n\treadonly stored: readonly TreeNodeSchemaIdentifier[];\n}\n\n/**\n * Differences in `FieldKindIdentifier` between two schema.\n */\nexport interface FieldKindDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"fieldKind\";\n\treadonly view: FieldKindIdentifier;\n\treadonly stored: FieldKindIdentifier;\n}\n\n/**\n * Differences in the `ValueSchema` of two `LeafNodeStoredSchema` objects.\n */\nexport interface ValueSchemaDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\n/**\n * Differences in the kind of node schema.\n *\n * Includes when stored object schema are expected to be compatible with an array node schema.\n */\nexport interface NodeKindDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"nodeKind\";\n\tview: NodeKind;\n\tstored: SchemaFactoryNodeKind;\n}\n\ntype SchemaFactoryNodeKind =\n\t| typeof ObjectNodeStoredSchema\n\t| typeof MapNodeStoredSchema\n\t| typeof LeafNodeStoredSchema;\n\nfunction getStoredNodeSchemaType(nodeSchema: TreeNodeStoredSchema): SchemaFactoryNodeKind {\n\tif (nodeSchema instanceof ObjectNodeStoredSchema) {\n\t\treturn ObjectNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof MapNodeStoredSchema) {\n\t\treturn MapNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof LeafNodeStoredSchema) {\n\t\treturn LeafNodeStoredSchema;\n\t}\n\tfail(0xbe8 /* Invalid stored node schema type */);\n}\n\nfunction doesNodeKindMatchStoredNodeKind(\n\tviewKind: NodeKind,\n\tstoredType: SchemaFactoryNodeKind,\n): boolean {\n\tswitch (viewKind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\treturn storedType === LeafNodeStoredSchema;\n\t\t}\n\t\tcase NodeKind.Array:\n\t\tcase NodeKind.Object: {\n\t\t\treturn storedType === ObjectNodeStoredSchema;\n\t\t}\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record: {\n\t\t\treturn storedType === MapNodeStoredSchema;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(viewKind);\n\t\t}\n\t}\n}\n\n/**\n * Finds and reports discrepancies between a view schema and a stored schema which make \"canView\" false.\n * @remarks\n * See documentation on {@link Discrepancy} and its subtypes for details of possible discrepancies.\n */\nexport function* getDiscrepanciesInAllowedContent(\n\tview: TreeSchema,\n\tstored: TreeStoredSchema,\n): Iterable<Discrepancy> {\n\t// check root field discrepancies\n\tyield* getFieldDiscrepancies(view.root, stored.rootFieldSchema, undefined, undefined);\n\n\t// Check all of the stored nodes, including their fields for discrepancies.\n\tfor (const [identifier, storedSchema] of stored.nodeSchema) {\n\t\tconst viewSchema = view.definitions.get(identifier);\n\n\t\t// if the view schema has a node that's also in the stored schema, check it.\n\t\tif (viewSchema !== undefined) {\n\t\t\tyield* getNodeDiscrepancies(identifier, viewSchema, storedSchema);\n\t\t}\n\t\t// Note that nodes that are missing in the view schema are only a problem if other stored schema nodes actually reference them which will produce its own discrepancy, so we can rely on that to produce any needed discrepancies.\n\t}\n}\n\nfunction* getNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: TreeNodeSchema,\n\tstored: TreeNodeStoredSchema,\n): Iterable<Discrepancy> {\n\tif (!doesNodeKindMatchStoredNodeKind(view.kind, getStoredNodeSchemaType(stored))) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tmismatch: \"nodeKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t};\n\t\treturn;\n\t}\n\n\tswitch (view.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tassert(\n\t\t\t\tisObjectNodeSchema(view),\n\t\t\t\t0xbe9 /* schema with node kind of object must implement ObjectNodeSchema */,\n\t\t\t);\n\t\t\tyield* computeObjectNodeDiscrepancies(\n\t\t\t\tidentifier,\n\t\t\t\tview,\n\t\t\t\tstored as ObjectNodeStoredSchema,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\tassert(\n\t\t\t\tisArrayNodeSchema(view),\n\t\t\t\t0xbea /* schema with node kind of array must implement ArrayNodeSchema */,\n\t\t\t);\n\n\t\t\tconst arrayStoredSchema = tryStoredSchemaAsArray(stored);\n\t\t\tif (arrayStoredSchema === undefined) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: NodeKind.Array,\n\t\t\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tyield* getAllowedTypeDiscrepancies(\n\t\t\t\tnormalizeAndEvaluateAnnotatedAllowedTypes(view.info).types,\n\t\t\t\tarrayStoredSchema,\n\t\t\t\tbrand(view.identifier),\n\t\t\t\tEmptyKey,\n\t\t\t);\n\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tassert(\n\t\t\t\tisMapNodeSchema(view),\n\t\t\t\t0xbeb /* schema with node kind of map must implement MapNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Record: {\n\t\t\tassert(\n\t\t\t\tisRecordNodeSchema(view),\n\t\t\t\t0xbec /* schema with node kind of record must implement RecordNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Leaf: {\n\t\t\tassert(\n\t\t\t\tview instanceof LeafNodeSchema,\n\t\t\t\t0xbed /* schema with node kind of leaf must implement LeafNodeSchema */,\n\t\t\t);\n\t\t\t// TODO: leafKind seems like a bad name\n\t\t\tconst viewValue = view.leafKind;\n\t\t\tconst storedValue = (stored as LeafNodeStoredSchema).leafValue;\n\t\t\tif (viewValue !== storedValue) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\tview: viewValue,\n\t\t\t\t\tstored: storedValue,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Returns the allowed types that are not present in both the given view and stored schemas.\n */\nexport function findExtraAllowedTypes(\n\tviewAllowedTypes: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstoredAllowedTypes: TreeTypeSet,\n): Pick<AllowedTypeDiscrepancy, \"view\" | \"stored\"> {\n\tconst viewNodeSchemaIdentifiers = new Set(\n\t\tviewAllowedTypes.map((value) => value.type.identifier),\n\t);\n\n\t// TODO:\n\t// Add detecting which SchemaUpgrades have been made.\n\t// When doing so, each will fall into one of three states: staged, partially applied, or fully applied.\n\t// This would allow for nicer compatibility errors and more detailed compatibility status in the future.\n\tconst view = viewAllowedTypes.filter(\n\t\t(value) =>\n\t\t\t!storedAllowedTypes.has(brand(value.type.identifier)) &&\n\t\t\tvalue.metadata.stagedSchemaUpgrade === undefined,\n\t);\n\tconst stored = [...storedAllowedTypes].filter(\n\t\t(value) => !viewNodeSchemaIdentifiers.has(value),\n\t);\n\treturn { view, stored };\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n * 3. If the field kind in the view schema is not compatible with the stored schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getFieldDiscrepancies(\n\tview: FieldSchema,\n\tstored: TreeFieldStoredSchema,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tassert(\n\t\tview instanceof FieldSchemaAlpha,\n\t\t0xbee /* all field schema should be FieldSchemaAlpha */,\n\t);\n\tyield* getAllowedTypeDiscrepancies(\n\t\tview.allowedTypesFull.evaluate().types,\n\t\tstored.types,\n\t\tidentifier,\n\t\tfieldKey,\n\t);\n\n\tconst viewKind =\n\t\tconvertFieldKind.get(view.kind) ??\n\t\tfail(0xbef /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\n\t// This checks if the field kind in the view schema is not compatible with the stored schema.\n\tif (viewKind.identifier !== stored.kind) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: viewKind.identifier,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindDiscrepancy;\n\t}\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getAllowedTypeDiscrepancies(\n\tview: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstored: TreeTypeSet,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tconst discrepancies = findExtraAllowedTypes(view, stored);\n\tif (discrepancies.view.length > 0 || discrepancies.stored.length > 0) {\n\t\tyield {\n\t\t\t...discrepancies,\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t} satisfies AllowedTypeDiscrepancy;\n\t}\n}\n\n/**\n * Computes discrepancies between a view schema and a stored schema for nodes that are treated as object nodes in the stored schema.\n * This includes both view object nodes and view array nodes.\n *\n * This function yields discrepancies in the following cases:\n *\n * 1. If the view schema has fields that are not present in the stored schema.\n * 2. If the stored schema has fields that are not present in the view schema.\n * 3. If the field kind or allowed types of a field in the view schema is not compatible with the stored schema.\n *\n * This function includes discrepancies within the common fields and their allowed types, but does NOT recurse to report and discrepancies within the node types referenced by those fields.\n */\nfunction* computeObjectNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: ObjectNodeSchemaPrivate,\n\tstored: ObjectNodeStoredSchema,\n): Iterable<FieldDiscrepancy> {\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tconst viewKeys = new Set<FieldKey>();\n\n\tfor (const [_, { storedKey: fieldKey, schema: fieldSchema }] of view.flexKeyMap) {\n\t\tconst storedSchema = stored.objectNodeFields.get(fieldKey);\n\t\tviewKeys.add(fieldKey);\n\n\t\t// If the view schema has a field that's not in the stored schema\n\t\tif (storedSchema === undefined) {\n\t\t\tconst viewKind =\n\t\t\t\tconvertFieldKind.get(fieldSchema.kind) ??\n\t\t\t\tfail(0xbf0 /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: viewKind.identifier,\n\t\t\t\tstored: storedEmptyFieldSchema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t} else {\n\t\t\tyield* getFieldDiscrepancies(fieldSchema, storedSchema, identifier, fieldKey);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, schema] of stored.objectNodeFields) {\n\t\tif (schema.kind === forbiddenFieldKindIdentifier) {\n\t\t\t// In the stored schema the field is explicitly forbidden.\n\t\t\t// This has the same semantics of the field not being mentioned in the stored schema,\n\t\t\t// and thus can be skipped.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the stored schema has a field that's not in the view schema\n\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\tif (\n\t\t\t!viewKeys.has(fieldKey) &&\n\t\t\t(!view.allowUnknownOptionalFields || schema.kind !== FieldKinds.optional.identifier)\n\t\t) {\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: storedEmptyFieldSchema.kind,\n\t\t\t\tstored: schema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/simple-tree/api/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EACN,QAAQ,EAGR,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GAOtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,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BACL,UAAU;gBACV,QAAQ;gBACR,QAAQ,EAAE,WAAW;gBACrB,IAAI,EAAE,sBAAsB,CAAC,IAAI;gBACjC,MAAM,EAAE,MAAM,CAAC,IAAI;aACY,CAAC;QAClC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tEmptyKey,\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tstoredEmptyFieldSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\nimport { FieldKinds } from \"../../feature-libraries/index.js\";\nimport { brand } from \"../../util/index.js\";\nimport {\n\tNodeKind,\n\tnormalizeAndEvaluateAnnotatedAllowedTypes,\n\ttype AnnotatedAllowedType,\n\ttype TreeNodeSchema,\n} from \"../core/index.js\";\nimport {\n\tcreateFieldSchema,\n\tFieldKind,\n\tFieldSchemaAlpha,\n\ttype FieldSchema,\n} from \"../fieldSchema.js\";\nimport { LeafNodeSchema } from \"../leafNodeSchema.js\";\nimport {\n\tisArrayNodeSchema,\n\tisMapNodeSchema,\n\tisObjectNodeSchema,\n\tisRecordNodeSchema,\n\ttype ObjectNodeSchemaPrivate,\n} from \"../node-kinds/index.js\";\nimport { convertFieldKind } from \"../toStoredSchema.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\n\nimport { tryStoredSchemaAsArray } from \"./customTree.js\";\n\n/**\n * Discriminated union (keyed on `mismatch`) of discrepancies between a view and stored schema which\n * make it possible for content matching the stored schema to be incompatible with the view schema.\n */\nexport type Discrepancy = FieldDiscrepancy | NodeKindDiscrepancy;\n\n/**\n * A discrepancy in the declaration of a field.\n */\nexport type FieldDiscrepancy =\n\t| AllowedTypeDiscrepancy\n\t| FieldKindDiscrepancy\n\t| ValueSchemaDiscrepancy;\n\n/**\n * Information about where a field discrepancy is located within a collection of schema.\n */\nexport interface FieldDiscrepancyLocation {\n\t/**\n\t * The {@link TreeNodeSchemaIdentifier} that contains the discrepancy.\n\t *\n\t * Undefined iff the discrepancy is part of the root field schema.\n\t */\n\treadonly identifier: TreeNodeSchemaIdentifier | undefined;\n\t/**\n\t * The {@link FieldKey} for the field that contains the discrepancy.\n\t * Undefined when:\n\t * - the discrepancy is part of the root field schema\n\t * - the discrepancy is for 'all fields' of a map node\n\t */\n\treadonly fieldKey: FieldKey | undefined;\n}\n\n/**\n * A discrepancy in the allowed types of a field.\n *\n * @remarks\n * This reports the symmetric difference of allowed types.\n */\nexport interface AllowedTypeDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"allowedTypes\";\n\t/**\n\t * Annotated allowed types in viewed schema\n\t * (excluding {@link SchemaStaticsBeta.staged | staged} schema) which are not allowed in stored schema.\n\t */\n\treadonly view: readonly AnnotatedAllowedType<TreeNodeSchema>[];\n\t/**\n\t * Allowed type identifiers in stored schema which are not allowed in view schema\n\t * (including the view schema's {@link SchemaStaticsBeta.staged | staged} schema).\n\t */\n\treadonly stored: readonly TreeNodeSchemaIdentifier[];\n}\n\n/**\n * Differences in `FieldKindIdentifier` between two schema.\n */\nexport interface FieldKindDiscrepancy extends FieldDiscrepancyLocation {\n\treadonly mismatch: \"fieldKind\";\n\treadonly view: FieldKindIdentifier;\n\treadonly stored: FieldKindIdentifier;\n}\n\n/**\n * Differences in the `ValueSchema` of two `LeafNodeStoredSchema` objects.\n */\nexport interface ValueSchemaDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\n/**\n * Differences in the kind of node schema.\n *\n * Includes when stored object schema are expected to be compatible with an array node schema.\n */\nexport interface NodeKindDiscrepancy {\n\tidentifier: TreeNodeSchemaIdentifier;\n\tmismatch: \"nodeKind\";\n\tview: NodeKind;\n\tstored: SchemaFactoryNodeKind;\n}\n\ntype SchemaFactoryNodeKind =\n\t| typeof ObjectNodeStoredSchema\n\t| typeof MapNodeStoredSchema\n\t| typeof LeafNodeStoredSchema;\n\nfunction getStoredNodeSchemaType(nodeSchema: TreeNodeStoredSchema): SchemaFactoryNodeKind {\n\tif (nodeSchema instanceof ObjectNodeStoredSchema) {\n\t\treturn ObjectNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof MapNodeStoredSchema) {\n\t\treturn MapNodeStoredSchema;\n\t}\n\tif (nodeSchema instanceof LeafNodeStoredSchema) {\n\t\treturn LeafNodeStoredSchema;\n\t}\n\tfail(0xbe8 /* Invalid stored node schema type */);\n}\n\nfunction doesNodeKindMatchStoredNodeKind(\n\tviewKind: NodeKind,\n\tstoredType: SchemaFactoryNodeKind,\n): boolean {\n\tswitch (viewKind) {\n\t\tcase NodeKind.Leaf: {\n\t\t\treturn storedType === LeafNodeStoredSchema;\n\t\t}\n\t\tcase NodeKind.Array:\n\t\tcase NodeKind.Object: {\n\t\t\treturn storedType === ObjectNodeStoredSchema;\n\t\t}\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record: {\n\t\t\treturn storedType === MapNodeStoredSchema;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(viewKind);\n\t\t}\n\t}\n}\n\n/**\n * Finds and reports discrepancies between a view schema and a stored schema which make \"canView\" false.\n * @remarks\n * See documentation on {@link Discrepancy} and its subtypes for details of possible discrepancies.\n */\nexport function* getDiscrepanciesInAllowedContent(\n\tview: TreeSchema,\n\tstored: TreeStoredSchema,\n): Iterable<Discrepancy> {\n\t// check root field discrepancies\n\tyield* getFieldDiscrepancies(view.root, stored.rootFieldSchema, undefined, undefined);\n\n\t// Check all of the stored nodes, including their fields for discrepancies.\n\tfor (const [identifier, storedSchema] of stored.nodeSchema) {\n\t\tconst viewSchema = view.definitions.get(identifier);\n\n\t\t// if the view schema has a node that's also in the stored schema, check it.\n\t\tif (viewSchema !== undefined) {\n\t\t\tyield* getNodeDiscrepancies(identifier, viewSchema, storedSchema);\n\t\t}\n\t\t// Note that nodes that are missing in the view schema are only a problem if other stored schema nodes actually reference them which will produce its own discrepancy, so we can rely on that to produce any needed discrepancies.\n\t}\n}\n\nfunction* getNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: TreeNodeSchema,\n\tstored: TreeNodeStoredSchema,\n): Iterable<Discrepancy> {\n\tif (!doesNodeKindMatchStoredNodeKind(view.kind, getStoredNodeSchemaType(stored))) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tmismatch: \"nodeKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t};\n\t\treturn;\n\t}\n\n\tswitch (view.kind) {\n\t\tcase NodeKind.Object: {\n\t\t\tassert(\n\t\t\t\tisObjectNodeSchema(view),\n\t\t\t\t0xbe9 /* schema with node kind of object must implement ObjectNodeSchema */,\n\t\t\t);\n\t\t\tyield* computeObjectNodeDiscrepancies(\n\t\t\t\tidentifier,\n\t\t\t\tview,\n\t\t\t\tstored as ObjectNodeStoredSchema,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Array: {\n\t\t\tassert(\n\t\t\t\tisArrayNodeSchema(view),\n\t\t\t\t0xbea /* schema with node kind of array must implement ArrayNodeSchema */,\n\t\t\t);\n\n\t\t\tconst arrayStoredSchema = tryStoredSchemaAsArray(stored);\n\t\t\tif (arrayStoredSchema === undefined) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: NodeKind.Array,\n\t\t\t\t\tstored: getStoredNodeSchemaType(stored),\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tyield* getAllowedTypeDiscrepancies(\n\t\t\t\tnormalizeAndEvaluateAnnotatedAllowedTypes(view.info).types,\n\t\t\t\tarrayStoredSchema,\n\t\t\t\tbrand(view.identifier),\n\t\t\t\tEmptyKey,\n\t\t\t);\n\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Map: {\n\t\t\tassert(\n\t\t\t\tisMapNodeSchema(view),\n\t\t\t\t0xbeb /* schema with node kind of map must implement MapNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Record: {\n\t\t\tassert(\n\t\t\t\tisRecordNodeSchema(view),\n\t\t\t\t0xbec /* schema with node kind of record must implement RecordNodeSchema */,\n\t\t\t);\n\n\t\t\tyield* getFieldDiscrepancies(\n\t\t\t\tcreateFieldSchema(FieldKind.Optional, view.info),\n\t\t\t\t(stored as MapNodeStoredSchema).mapFields,\n\t\t\t\tidentifier,\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\tbreak;\n\t\t}\n\t\tcase NodeKind.Leaf: {\n\t\t\tassert(\n\t\t\t\tview instanceof LeafNodeSchema,\n\t\t\t\t0xbed /* schema with node kind of leaf must implement LeafNodeSchema */,\n\t\t\t);\n\t\t\t// TODO: leafKind seems like a bad name\n\t\t\tconst viewValue = view.leafKind;\n\t\t\tconst storedValue = (stored as LeafNodeStoredSchema).leafValue;\n\t\t\tif (viewValue !== storedValue) {\n\t\t\t\tyield {\n\t\t\t\t\tidentifier,\n\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\tview: viewValue,\n\t\t\t\t\tstored: storedValue,\n\t\t\t\t};\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * Returns the allowed types that are not present in both the given view and stored schemas.\n */\nexport function findExtraAllowedTypes(\n\tviewAllowedTypes: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstoredAllowedTypes: TreeTypeSet,\n): Pick<AllowedTypeDiscrepancy, \"view\" | \"stored\"> {\n\tconst viewNodeSchemaIdentifiers = new Set(\n\t\tviewAllowedTypes.map((value) => value.type.identifier),\n\t);\n\n\t// TODO:\n\t// Add detecting which SchemaUpgrades have been made.\n\t// When doing so, each will fall into one of three states: staged, partially applied, or fully applied.\n\t// This would allow for nicer compatibility errors and more detailed compatibility status in the future.\n\tconst view = viewAllowedTypes.filter(\n\t\t(value) =>\n\t\t\t!storedAllowedTypes.has(brand(value.type.identifier)) &&\n\t\t\tvalue.metadata.stagedSchemaUpgrade === undefined,\n\t);\n\tconst stored = [...storedAllowedTypes].filter(\n\t\t(value) => !viewNodeSchemaIdentifiers.has(value),\n\t);\n\treturn { view, stored };\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n * 3. If the field kind in the view schema is not compatible with the stored schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getFieldDiscrepancies(\n\tview: FieldSchema,\n\tstored: TreeFieldStoredSchema,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tassert(\n\t\tview instanceof FieldSchemaAlpha,\n\t\t0xbee /* all field schema should be FieldSchemaAlpha */,\n\t);\n\tyield* getAllowedTypeDiscrepancies(\n\t\tview.allowedTypesFull.evaluate().types,\n\t\tstored.types,\n\t\tidentifier,\n\t\tfieldKey,\n\t);\n\n\tconst viewKind =\n\t\tconvertFieldKind.get(view.kind) ??\n\t\tfail(0xbef /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\n\t// This checks if the field kind in the view schema is not compatible with the stored schema.\n\tif (viewKind.identifier !== stored.kind) {\n\t\tyield {\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: viewKind.identifier,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindDiscrepancy;\n\t}\n}\n\n/**\n * The function to track the discrepancies between a field view schema and a stored schema.\n *\n * @remarks\n * This function yields discrepancies in the following cases:\n * 1. If the view schema has allowed types that are not present in the stored schema.\n * 2. If the stored schema has allowed types that are not present in the view schema.\n *\n * This function does not recurse into the nodes of the view schema and only makes comparisons at the field level.\n *\n * @param fieldKey - If the key is missing, it indicates that this is the root field schema.\n */\nfunction* getAllowedTypeDiscrepancies(\n\tview: readonly AnnotatedAllowedType<TreeNodeSchema>[],\n\tstored: TreeTypeSet,\n\tidentifier: TreeNodeSchemaIdentifier | undefined,\n\tfieldKey: FieldKey | undefined,\n): Iterable<FieldDiscrepancy> {\n\tconst discrepancies = findExtraAllowedTypes(view, stored);\n\tif (discrepancies.view.length > 0 || discrepancies.stored.length > 0) {\n\t\tyield {\n\t\t\t...discrepancies,\n\t\t\tidentifier,\n\t\t\tfieldKey,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t} satisfies AllowedTypeDiscrepancy;\n\t}\n}\n\n/**\n * Computes discrepancies between a view schema and a stored schema for nodes that are treated as object nodes in the stored schema.\n * This includes both view object nodes and view array nodes.\n *\n * This function yields discrepancies in the following cases:\n *\n * 1. If the view schema has fields that are not present in the stored schema.\n * 2. If the stored schema has fields that are not present in the view schema.\n * 3. If the field kind or allowed types of a field in the view schema is not compatible with the stored schema.\n *\n * This function includes discrepancies within the common fields and their allowed types, but does NOT recurse to report and discrepancies within the node types referenced by those fields.\n */\nfunction* computeObjectNodeDiscrepancies(\n\tidentifier: TreeNodeSchemaIdentifier,\n\tview: ObjectNodeSchemaPrivate,\n\tstored: ObjectNodeStoredSchema,\n): Iterable<FieldDiscrepancy> {\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tconst viewKeys = new Set<FieldKey>();\n\n\tfor (const [_, { storedKey: fieldKey, schema: fieldSchema }] of view.flexKeyMap) {\n\t\tconst storedSchema = stored.objectNodeFields.get(fieldKey);\n\t\tviewKeys.add(fieldKey);\n\n\t\t// If the view schema has a field that's not in the stored schema\n\t\tif (storedSchema === undefined) {\n\t\t\tconst viewKind =\n\t\t\t\tconvertFieldKind.get(fieldSchema.kind) ??\n\t\t\t\tfail(0xbf0 /* A conversion from a FieldKind to a FlexFieldKind should exist */);\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: viewKind.identifier,\n\t\t\t\tstored: storedEmptyFieldSchema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t} else {\n\t\t\tyield* getFieldDiscrepancies(fieldSchema, storedSchema, identifier, fieldKey);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, schema] of stored.objectNodeFields) {\n\t\tif (schema.kind === forbiddenFieldKindIdentifier) {\n\t\t\t// In the stored schema the field is explicitly forbidden.\n\t\t\t// This has the same semantics of the field not being mentioned in the stored schema,\n\t\t\t// and thus can be skipped.\n\t\t\tcontinue;\n\t\t}\n\n\t\t// If the stored schema has a field that's not in the view schema\n\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\tif (\n\t\t\t!viewKeys.has(fieldKey) &&\n\t\t\t(!view.allowUnknownOptionalFields || schema.kind !== FieldKinds.optional.identifier)\n\t\t) {\n\t\t\tyield {\n\t\t\t\tidentifier,\n\t\t\t\tfieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: storedEmptyFieldSchema.kind,\n\t\t\t\tstored: schema.kind,\n\t\t\t} satisfies FieldKindDiscrepancy;\n\t\t}\n\t}\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { JsonTreeSchema } from "./jsonSchema.js";
6
5
  import type { ImplicitAllowedTypes } from "../core/index.js";
7
6
  import type { TreeParsingOptions } from "./customTree.js";
7
+ import type { JsonTreeSchema } from "./jsonSchema.js";
8
8
  /**
9
9
  * Options for how to interpret or encode a tree when schema information is available.
10
10
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"getJsonSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D;;;;;;;GAOG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACpE;;;;;;OAMG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,QAAQ,CAAC,yBAAyB,CAAC,GAC1C,cAAc,CAGhB"}
1
+ {"version":3,"file":"getJsonSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD;;;;;;;GAOG;AACH,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACpE;;;;;;OAMG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,QAAQ,CAAC,yBAAyB,CAAC,GAC1C,cAAc,CAGhB"}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { toJsonSchema } from "./simpleSchemaToJsonSchema.js";
6
5
  import { TreeViewConfigurationAlpha } from "./configuration.js";
6
+ import { toJsonSchema } from "./simpleSchemaToJsonSchema.js";
7
7
  /**
8
8
  * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAqBhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,UAAU,aAAa,CAC5B,MAA4B,EAC5B,OAA4C;IAE5C,MAAM,UAAU,GAAG,IAAI,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { JsonTreeSchema } from \"./jsonSchema.js\";\nimport type { ImplicitAllowedTypes } from \"../core/index.js\";\nimport { toJsonSchema } from \"./simpleSchemaToJsonSchema.js\";\nimport type { TreeParsingOptions } from \"./customTree.js\";\nimport { TreeViewConfigurationAlpha } from \"./configuration.js\";\n\n/**\n * Options for how to interpret or encode a tree when schema information is available.\n * @remarks\n * This currently extends {@link TreeParsingOptions},\n * removing the option to declare {@link KeyEncodingOptions.allStoredKeys} since this option is currently not supported.\n * @input\n * @alpha\n */\nexport interface TreeSchemaEncodingOptions extends TreeParsingOptions {\n\t/**\n\t * If true, fields with default providers (like {@link SchemaFactory.identifier}) will be required.\n\t * If false, they will be optional.\n\t * @remarks\n\t * Has no effect on {@link NodeKind}s other than {@link NodeKind.Object}.\n\t * @defaultValue false.\n\t */\n\treadonly requireFieldsWithDefaults?: boolean;\n}\n\n/**\n * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.\n *\n * @remarks\n * Useful when communicating the schema to external libraries or services.\n * Caches the result for future calls.\n *\n * @example\n *\n * A Shared Tree schema like the following:\n *\n * ```typescript\n * class MyObject extends schemaFactory.object(\"MyObject\", {\n * \tfoo: schemaFactory.number,\n * \tbar: schemaFactory.optional(schemaFactory.string),\n * });\n * ```\n *\n * Will yield JSON Schema like the following:\n *\n * ```json\n * {\n * \t\"$defs\": {\n * \t\t\"com.fluidframework.leaf.string\": {\n * \t\t\t\"type\": \"string\",\n * \t\t},\n * \t\t\"com.fluidframework.leaf.number\": {\n * \t\t\t\"type\": \"number\",\n * \t\t},\n * \t\t\"com.myapp.MyObject\": {\n * \t\t\t\"type\": \"object\",\n * \t\t\t\"properties\": {\n * \t\t\t\t\"foo\": { \"$ref\": \"com.fluidframework.leaf.number\" },\n * \t\t\t\t\"bar\": { \"$ref\": \"com.fluidframework.leaf.string\" },\n * \t\t\t},\n * \t\t\t\"required\": [\"foo\"],\n * \t\t},\n * \t},\n * \t\"$ref\": \"#/$defs/com.myapp.MyObject\",\n * }\n * ```\n *\n * @privateRemarks In the future, we may wish to move this to a more discoverable API location.\n * For now, while still an experimental API, it is surfaced as a free function.\n *\n * TODO:\n * This API should allow generating JSON schema for the whole matrix of combinations:\n *\n * 1. VerboseTree and (Done) ConciseTree\n * 2. (Done) With and without requiring values with defaults (for insertion vs reading)\n * 3. (Done) Using stored keys and property keys.\n * 4. Control over unknown optional fields and staged allowed types (able to manually control them and/or get them from some context).\n *\n * This takes in `ImplicitAllowedTypes` since underlying `toJsonSchema` can't handle optional roots.\n *\n * @alpha\n */\nexport function getJsonSchema(\n\tschema: ImplicitAllowedTypes,\n\toptions: Required<TreeSchemaEncodingOptions>,\n): JsonTreeSchema {\n\tconst treeSchema = new TreeViewConfigurationAlpha({ schema });\n\treturn toJsonSchema(treeSchema, options);\n}\n"]}
1
+ {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAqB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,MAAM,UAAU,aAAa,CAC5B,MAA4B,EAC5B,OAA4C;IAE5C,MAAM,UAAU,GAAG,IAAI,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ImplicitAllowedTypes } from \"../core/index.js\";\n\nimport { TreeViewConfigurationAlpha } from \"./configuration.js\";\nimport type { TreeParsingOptions } from \"./customTree.js\";\nimport type { JsonTreeSchema } from \"./jsonSchema.js\";\nimport { toJsonSchema } from \"./simpleSchemaToJsonSchema.js\";\n\n/**\n * Options for how to interpret or encode a tree when schema information is available.\n * @remarks\n * This currently extends {@link TreeParsingOptions},\n * removing the option to declare {@link KeyEncodingOptions.allStoredKeys} since this option is currently not supported.\n * @input\n * @alpha\n */\nexport interface TreeSchemaEncodingOptions extends TreeParsingOptions {\n\t/**\n\t * If true, fields with default providers (like {@link SchemaFactory.identifier}) will be required.\n\t * If false, they will be optional.\n\t * @remarks\n\t * Has no effect on {@link NodeKind}s other than {@link NodeKind.Object}.\n\t * @defaultValue false.\n\t */\n\treadonly requireFieldsWithDefaults?: boolean;\n}\n\n/**\n * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.\n *\n * @remarks\n * Useful when communicating the schema to external libraries or services.\n * Caches the result for future calls.\n *\n * @example\n *\n * A Shared Tree schema like the following:\n *\n * ```typescript\n * class MyObject extends schemaFactory.object(\"MyObject\", {\n * \tfoo: schemaFactory.number,\n * \tbar: schemaFactory.optional(schemaFactory.string),\n * });\n * ```\n *\n * Will yield JSON Schema like the following:\n *\n * ```json\n * {\n * \t\"$defs\": {\n * \t\t\"com.fluidframework.leaf.string\": {\n * \t\t\t\"type\": \"string\",\n * \t\t},\n * \t\t\"com.fluidframework.leaf.number\": {\n * \t\t\t\"type\": \"number\",\n * \t\t},\n * \t\t\"com.myapp.MyObject\": {\n * \t\t\t\"type\": \"object\",\n * \t\t\t\"properties\": {\n * \t\t\t\t\"foo\": { \"$ref\": \"com.fluidframework.leaf.number\" },\n * \t\t\t\t\"bar\": { \"$ref\": \"com.fluidframework.leaf.string\" },\n * \t\t\t},\n * \t\t\t\"required\": [\"foo\"],\n * \t\t},\n * \t},\n * \t\"$ref\": \"#/$defs/com.myapp.MyObject\",\n * }\n * ```\n *\n * @privateRemarks In the future, we may wish to move this to a more discoverable API location.\n * For now, while still an experimental API, it is surfaced as a free function.\n *\n * TODO:\n * This API should allow generating JSON schema for the whole matrix of combinations:\n *\n * 1. VerboseTree and (Done) ConciseTree\n * 2. (Done) With and without requiring values with defaults (for insertion vs reading)\n * 3. (Done) Using stored keys and property keys.\n * 4. Control over unknown optional fields and staged allowed types (able to manually control them and/or get them from some context).\n *\n * This takes in `ImplicitAllowedTypes` since underlying `toJsonSchema` can't handle optional roots.\n *\n * @alpha\n */\nexport function getJsonSchema(\n\tschema: ImplicitAllowedTypes,\n\toptions: Required<TreeSchemaEncodingOptions>,\n): JsonTreeSchema {\n\tconst treeSchema = new TreeViewConfigurationAlpha({ schema });\n\treturn toJsonSchema(treeSchema, options);\n}\n"]}
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ImplicitFieldSchema } from "../fieldSchema.js";
6
5
  import type { TreeNode } from "../core/index.js";
7
- import type { TreeView } from "./tree.js";
6
+ import { type ImplicitFieldSchema } from "../fieldSchema.js";
8
7
  import { type SimpleTreeIndex } from "./simpleTreeIndex.js";
8
+ import type { TreeView } from "./tree.js";
9
9
  /**
10
10
  * An index that returns tree nodes given their associated identifiers.
11
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"identifierIndex.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/identifierIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEnF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAMhE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,mBAAmB,EACxE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GACrB,eAAe,CA+BjB"}
1
+ {"version":3,"file":"identifierIndex.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/identifierIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxE,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAMhE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,mBAAmB,EACxE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GACrB,eAAe,CA+BjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"identifierIndex.js","sourceRoot":"","sources":["../../../src/simple-tree/api/identifierIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE,OAAO,EAAE,SAAS,EAA4B,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AASnF,SAAS,WAAW,CAAC,GAAiB;IACrC,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACpC,IAAuB;IAEvB,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACnD,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE;QAC5B,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,IAAI,OAAO,YAAY,gBAAgB,EAAE,CAAC;gBACzC,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;oBAChE,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,CAAC,UAAU,EAAE,CAAC;wBAC/C,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;wBACnD,MAAM;oBACP,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAC,CAAC;IAEH,OAAO,qBAAqB,CAC3B,IAAI,EACJ,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EACrD,CAAC,KAAK,EAAE,EAAE;QACT,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,UAAU,CACnB,oFAAoF,CACpF,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,EACD,WAAW,CACX,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport type { TreeIndexKey } from \"../../feature-libraries/index.js\";\nimport { FieldKind, type ImplicitFieldSchema } from \"../fieldSchema.js\";\nimport type { TreeNode } from \"../core/index.js\";\nimport { ObjectNodeSchema } from \"../node-kinds/index.js\";\nimport type { TreeView } from \"./tree.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\nimport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\n\n/**\n * An index that returns tree nodes given their associated identifiers.\n *\n * @alpha\n */\nexport type IdentifierIndex = SimpleTreeIndex<string, TreeNode>;\n\nfunction isStringKey(key: TreeIndexKey): key is string {\n\treturn typeof key === \"string\";\n}\n\n/**\n * Creates an {@link IdentifierIndex} for a given {@link TreeView}.\n *\n * @alpha\n */\nexport function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(\n\tview: TreeView<TSchema>,\n): IdentifierIndex {\n\t// For each node schema, find which field key the identifier field is under.\n\t// This can be done easily because identifiers are their own field kinds.\n\tconst identifierFields = new Map<string, string>();\n\twalkFieldSchema(view.schema, {\n\t\tnode: (schemus) => {\n\t\t\tif (schemus instanceof ObjectNodeSchema) {\n\t\t\t\tfor (const [fieldKey, fieldSchema] of schemus.fields.entries()) {\n\t\t\t\t\tif (fieldSchema.kind === FieldKind.Identifier) {\n\t\t\t\t\t\tidentifierFields.set(schemus.identifier, fieldKey);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\treturn createSimpleTreeIndex(\n\t\tview,\n\t\t(schemus) => identifierFields.get(schemus.identifier),\n\t\t(nodes) => {\n\t\t\tif (nodes.length > 1) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"cannot retrieve node from index: there are multiple nodes with the same identifier\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn nodes[0];\n\t\t},\n\t\tisStringKey,\n\t);\n}\n"]}
1
+ {"version":3,"file":"identifierIndex.js","sourceRoot":"","sources":["../../../src/simple-tree/api/identifierIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EAAE,SAAS,EAA4B,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AAUnF,SAAS,WAAW,CAAC,GAAiB;IACrC,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACpC,IAAuB;IAEvB,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACnD,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE;QAC5B,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,IAAI,OAAO,YAAY,gBAAgB,EAAE,CAAC;gBACzC,KAAK,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;oBAChE,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,CAAC,UAAU,EAAE,CAAC;wBAC/C,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;wBACnD,MAAM;oBACP,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAC,CAAC;IAEH,OAAO,qBAAqB,CAC3B,IAAI,EACJ,CAAC,OAAO,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EACrD,CAAC,KAAK,EAAE,EAAE;QACT,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,UAAU,CACnB,oFAAoF,CACpF,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,EACD,WAAW,CACX,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { TreeIndexKey } from \"../../feature-libraries/index.js\";\nimport type { TreeNode } from \"../core/index.js\";\nimport { FieldKind, type ImplicitFieldSchema } from \"../fieldSchema.js\";\nimport { ObjectNodeSchema } from \"../node-kinds/index.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\n\nimport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nimport type { TreeView } from \"./tree.js\";\n\n/**\n * An index that returns tree nodes given their associated identifiers.\n *\n * @alpha\n */\nexport type IdentifierIndex = SimpleTreeIndex<string, TreeNode>;\n\nfunction isStringKey(key: TreeIndexKey): key is string {\n\treturn typeof key === \"string\";\n}\n\n/**\n * Creates an {@link IdentifierIndex} for a given {@link TreeView}.\n *\n * @alpha\n */\nexport function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(\n\tview: TreeView<TSchema>,\n): IdentifierIndex {\n\t// For each node schema, find which field key the identifier field is under.\n\t// This can be done easily because identifiers are their own field kinds.\n\tconst identifierFields = new Map<string, string>();\n\twalkFieldSchema(view.schema, {\n\t\tnode: (schemus) => {\n\t\t\tif (schemus instanceof ObjectNodeSchema) {\n\t\t\t\tfor (const [fieldKey, fieldSchema] of schemus.fields.entries()) {\n\t\t\t\t\tif (fieldSchema.kind === FieldKind.Identifier) {\n\t\t\t\t\t\tidentifierFields.set(schemus.identifier, fieldKey);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\treturn createSimpleTreeIndex(\n\t\tview,\n\t\t(schemus) => identifierFields.get(schemus.identifier),\n\t\t(nodes) => {\n\t\t\tif (nodes.length > 1) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"cannot retrieve node from index: there are multiple nodes with the same identifier\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn nodes[0];\n\t\t},\n\t\tisStringKey,\n\t);\n}\n"]}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { TreeSchema } from "../treeSchema.js";
6
5
  import type { IncrementalEncodingPolicy } from "../../feature-libraries/index.js";
6
+ import type { TreeSchema } from "../treeSchema.js";
7
7
  /**
8
8
  * A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed
9
9
  * types to incremental summary optimization.
@@ -1 +1 @@
1
- {"version":3,"file":"incrementalAllowedTypes.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/incrementalAllowedTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAMlF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAAO,MAAyC,CAAC;AAatF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wCAAwC,CACvD,UAAU,EAAE,UAAU,GACpB,yBAAyB,CAkD3B"}
1
+ {"version":3,"file":"incrementalAllowedTypes.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/incrementalAllowedTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAIlF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAAO,MAAyC,CAAC;AAatF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wCAAwC,CACvD,UAAU,EAAE,UAAU,GACpB,yBAAyB,CAkD3B"}
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { getTreeNodeSchemaPrivateData } from "../core/index.js";
6
- import { isArrayNodeSchema, isObjectNodeSchema } from "../node-kinds/index.js";
7
- import { oneFromIterable } from "../../util/index.js";
8
5
  import { assert } from "@fluidframework/core-utils/internal";
9
6
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
+ import { oneFromIterable } from "../../util/index.js";
8
+ import { getTreeNodeSchemaPrivateData } from "../core/index.js";
9
+ import { isArrayNodeSchema, isObjectNodeSchema } from "../node-kinds/index.js";
10
10
  /**
11
11
  * A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed
12
12
  * types to incremental summary optimization.
@@ -1 +1 @@
1
- {"version":3,"file":"incrementalAllowedTypes.js","sourceRoot":"","sources":["../../../src/simple-tree/api/incrementalAllowedTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,4BAA4B,EAAyB,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEtF;;GAEG;AACH,SAAS,sCAAsC,CAAC,YAA8B;IAC7E,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpD,OAAO,CACN,cAAc,KAAK,SAAS;QAC3B,cAA0C,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAC5E,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,wCAAwC,CACvD,UAAsB;IAEtB,OAAO,CAAC,oBAAwC,EAAE,cAAuB,EA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C,CAAC;IAC7D,CAAC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { getTreeNodeSchemaPrivateData, type AllowedTypesFull } from \"../core/index.js\";\nimport { isArrayNodeSchema, isObjectNodeSchema } from \"../node-kinds/index.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\nimport type { IncrementalEncodingPolicy } from \"../../feature-libraries/index.js\";\nimport { oneFromIterable } from \"../../util/index.js\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { FieldKey } from \"../../core/index.js\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\n/**\n * A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed\n * types to incremental summary optimization.\n * These allowed types will be optimized during summary such that if they don't change across summaries,\n * they will not be encoded and their content will not be included in the summary that is uploaded to the service.\n * @remarks\n * See {@link incrementalEncodingPolicyForAllowedTypes} for more details.\n *\n * Use {@link SchemaStaticsBeta.types} to add this metadata to allowed types in a schema.\n * @example\n * ```typescript\n * const sf = new SchemaFactoryAlpha(\"IncrementalSummarization\");\n * class Foo extends sf.objectAlpha(\"foo\", {\n * bar: sf.types([{ type: sf.string, metadata: {} }], {\n * custom: { [incrementalSummaryHint]: true },\n * }),\n * }) {}\n * ```\n * @alpha\n */\nexport const incrementalSummaryHint: unique symbol = Symbol(\"IncrementalSummaryHint\");\n\n/**\n * Returns true if the provided allowed types's custom metadata has {@link incrementalSummaryHint} as true.\n */\nfunction isIncrementalSummaryHintInAllowedTypes(allowedTypes: AllowedTypesFull): boolean {\n\tconst customMetadata = allowedTypes.metadata.custom;\n\treturn (\n\t\tcustomMetadata !== undefined &&\n\t\t(customMetadata as Record<symbol, unknown>)[incrementalSummaryHint] === true\n\t);\n}\n\n/**\n * This helper function {@link incrementalEncodingPolicyForAllowedTypes} can be used to generate a callback function\n * of type {@link IncrementalEncodingPolicy}. It determines if each {@link AllowedTypes} in a schema should be\n * incrementally summarized.\n * This callback can be passed as the value for {@link SharedTreeOptions.shouldEncodeIncrementally} parameter\n * when creating the tree.\n *\n * @param rootSchema - The schema for the root of the tree.\n * @returns A callback function of type {@link IncrementalEncodingPolicy} which determines if allowed types should\n * be incrementally summarized based on whether they have opted in via the {@link incrementalSummaryHint} metadata.\n *\n * @remarks\n * This only works for forest type {@link ForestTypeOptimized} and compression strategy\n * {@link TreeCompressionStrategy.CompressedIncremental}.\n *\n * @privateRemarks\n * The {@link incrementalSummaryHint} will be replaced with a specialized metadata property once the\n * incremental summary feature and APIs are stabilized.\n *\n * @alpha\n */\nexport function incrementalEncodingPolicyForAllowedTypes(\n\trootSchema: TreeSchema,\n): IncrementalEncodingPolicy {\n\treturn (targetNodeIdentifier: string | undefined, targetFieldKey?: string) => {\n\t\tif (targetNodeIdentifier === undefined) {\n\t\t\t// Root fields cannot be allowed types, so we don't incrementally summarize them.\n\t\t\treturn false;\n\t\t}\n\n\t\tconst targetNode = rootSchema.definitions.get(targetNodeIdentifier);\n\t\tif (targetNode === undefined) {\n\t\t\t// The requested type is unknown to this schema.\n\t\t\t// In this case we have no hints available from the view schema, and fall back to the default behavior of non-incremental encoding.\n\t\t\t// There are two ways this can happen:\n\t\t\t// 1. The view schema being used does not match the stored schema.\n\t\t\t// 2. The view schema is compatible, but there are unknown optional fields which contain new types not described by the view schema.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isObjectNodeSchema(targetNode)) {\n\t\t\tif (targetFieldKey === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Field key must be provided for object or array node '${targetNodeIdentifier}'`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst targetPropertyKey = targetNode.storedKeyToPropertyKey.get(\n\t\t\t\ttargetFieldKey as FieldKey,\n\t\t\t);\n\t\t\tif (targetPropertyKey !== undefined) {\n\t\t\t\tconst fieldSchema = targetNode.fields.get(targetPropertyKey);\n\t\t\t\tif (fieldSchema !== undefined) {\n\t\t\t\t\treturn isIncrementalSummaryHintInAllowedTypes(fieldSchema.allowedTypesFull);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tif (targetFieldKey !== undefined && !isArrayNodeSchema(targetNode)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Field key must not be provided for leaf, map or record node '${targetNodeIdentifier}'`,\n\t\t\t);\n\t\t}\n\n\t\tconst allowedTypes = oneFromIterable(\n\t\t\tgetTreeNodeSchemaPrivateData(targetNode).childAllowedTypes,\n\t\t);\n\t\tassert(\n\t\t\tallowedTypes !== undefined,\n\t\t\t0xc87 /* Non object nodes with fields should only have one allowedTypes entry */,\n\t\t);\n\t\treturn isIncrementalSummaryHintInAllowedTypes(allowedTypes);\n\t};\n}\n"]}
1
+ {"version":3,"file":"incrementalAllowedTypes.js","sourceRoot":"","sources":["../../../src/simple-tree/api/incrementalAllowedTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAItE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAyB,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAkB,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEtF;;GAEG;AACH,SAAS,sCAAsC,CAAC,YAA8B;IAC7E,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpD,OAAO,CACN,cAAc,KAAK,SAAS;QAC3B,cAA0C,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAC5E,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG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K,SAAS,EAC1B,KAAK,CAAC,0EAA0E,CAChF,CAAC;QACF,OAAO,sCAAsC,CAAC,YAAY,CAAC,CAAC;IAC7D,CAAC,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { FieldKey } from \"../../core/index.js\";\nimport type { IncrementalEncodingPolicy } from \"../../feature-libraries/index.js\";\nimport { oneFromIterable } from \"../../util/index.js\";\nimport { getTreeNodeSchemaPrivateData, type AllowedTypesFull } from \"../core/index.js\";\nimport { isArrayNodeSchema, isObjectNodeSchema } from \"../node-kinds/index.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\n\n/**\n * A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed\n * types to incremental summary optimization.\n * These allowed types will be optimized during summary such that if they don't change across summaries,\n * they will not be encoded and their content will not be included in the summary that is uploaded to the service.\n * @remarks\n * See {@link incrementalEncodingPolicyForAllowedTypes} for more details.\n *\n * Use {@link SchemaStaticsBeta.types} to add this metadata to allowed types in a schema.\n * @example\n * ```typescript\n * const sf = new SchemaFactoryAlpha(\"IncrementalSummarization\");\n * class Foo extends sf.objectAlpha(\"foo\", {\n * bar: sf.types([{ type: sf.string, metadata: {} }], {\n * custom: { [incrementalSummaryHint]: true },\n * }),\n * }) {}\n * ```\n * @alpha\n */\nexport const incrementalSummaryHint: unique symbol = Symbol(\"IncrementalSummaryHint\");\n\n/**\n * Returns true if the provided allowed types's custom metadata has {@link incrementalSummaryHint} as true.\n */\nfunction isIncrementalSummaryHintInAllowedTypes(allowedTypes: AllowedTypesFull): boolean {\n\tconst customMetadata = allowedTypes.metadata.custom;\n\treturn (\n\t\tcustomMetadata !== undefined &&\n\t\t(customMetadata as Record<symbol, unknown>)[incrementalSummaryHint] === true\n\t);\n}\n\n/**\n * This helper function {@link incrementalEncodingPolicyForAllowedTypes} can be used to generate a callback function\n * of type {@link IncrementalEncodingPolicy}. It determines if each {@link AllowedTypes} in a schema should be\n * incrementally summarized.\n * This callback can be passed as the value for {@link SharedTreeOptions.shouldEncodeIncrementally} parameter\n * when creating the tree.\n *\n * @param rootSchema - The schema for the root of the tree.\n * @returns A callback function of type {@link IncrementalEncodingPolicy} which determines if allowed types should\n * be incrementally summarized based on whether they have opted in via the {@link incrementalSummaryHint} metadata.\n *\n * @remarks\n * This only works for forest type {@link ForestTypeOptimized} and compression strategy\n * {@link TreeCompressionStrategy.CompressedIncremental}.\n *\n * @privateRemarks\n * The {@link incrementalSummaryHint} will be replaced with a specialized metadata property once the\n * incremental summary feature and APIs are stabilized.\n *\n * @alpha\n */\nexport function incrementalEncodingPolicyForAllowedTypes(\n\trootSchema: TreeSchema,\n): IncrementalEncodingPolicy {\n\treturn (targetNodeIdentifier: string | undefined, targetFieldKey?: string) => {\n\t\tif (targetNodeIdentifier === undefined) {\n\t\t\t// Root fields cannot be allowed types, so we don't incrementally summarize them.\n\t\t\treturn false;\n\t\t}\n\n\t\tconst targetNode = rootSchema.definitions.get(targetNodeIdentifier);\n\t\tif (targetNode === undefined) {\n\t\t\t// The requested type is unknown to this schema.\n\t\t\t// In this case we have no hints available from the view schema, and fall back to the default behavior of non-incremental encoding.\n\t\t\t// There are two ways this can happen:\n\t\t\t// 1. The view schema being used does not match the stored schema.\n\t\t\t// 2. The view schema is compatible, but there are unknown optional fields which contain new types not described by the view schema.\n\t\t\treturn false;\n\t\t}\n\n\t\tif (isObjectNodeSchema(targetNode)) {\n\t\t\tif (targetFieldKey === undefined) {\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t`Field key must be provided for object or array node '${targetNodeIdentifier}'`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst targetPropertyKey = targetNode.storedKeyToPropertyKey.get(\n\t\t\t\ttargetFieldKey as FieldKey,\n\t\t\t);\n\t\t\tif (targetPropertyKey !== undefined) {\n\t\t\t\tconst fieldSchema = targetNode.fields.get(targetPropertyKey);\n\t\t\t\tif (fieldSchema !== undefined) {\n\t\t\t\t\treturn isIncrementalSummaryHintInAllowedTypes(fieldSchema.allowedTypesFull);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tif (targetFieldKey !== undefined && !isArrayNodeSchema(targetNode)) {\n\t\t\tthrow new UsageError(\n\t\t\t\t`Field key must not be provided for leaf, map or record node '${targetNodeIdentifier}'`,\n\t\t\t);\n\t\t}\n\n\t\tconst allowedTypes = oneFromIterable(\n\t\t\tgetTreeNodeSchemaPrivateData(targetNode).childAllowedTypes,\n\t\t);\n\t\tassert(\n\t\t\tallowedTypes !== undefined,\n\t\t\t0xc87 /* Non object nodes with fields should only have one allowedTypes entry */,\n\t\t);\n\t\treturn isIncrementalSummaryHintInAllowedTypes(allowedTypes);\n\t};\n}\n"]}
@@ -35,5 +35,5 @@ export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
35
35
  export type { TreeChangeEvents } from "./treeChangeEvents.js";
36
36
  export { incrementalEncodingPolicyForAllowedTypes, incrementalSummaryHint, } from "./incrementalAllowedTypes.js";
37
37
  export { encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, } from "./simpleSchemaCodec.js";
38
- export { exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, } from "./snapshotCompatibilityChecker.js";
38
+ export { exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, checkSchemaCompatibilitySnapshots, type SnapshotFileSystem, type SchemaCompatibilitySnapshotsOptions, } from "./snapshotCompatibilityChecker.js";
39
39
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,sBAAsB,EACtB,yBAAyB,GACzB,MAA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B,QAAQ,EACR,KAAK,oBAAoB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,EACrB,KAAK,eAAe,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACN,wCAAwC,EACxC,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,GAClB,MAAM,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,sBAAsB,EACtB,yBAAyB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACX,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,U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B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACN,wCAAwC,EACxC,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,EAClB,iCAAiC,EACjC,KAAK,kBAAkB,EACvB,KAAK,mCAAmC,GACxC,MAAM,mCAAmC,CAAC"}
@@ -28,5 +28,5 @@ export { rollback, } from "./transactionTypes.js";
28
28
  export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
29
29
  export { incrementalEncodingPolicyForAllowedTypes, incrementalSummaryHint, } from "./incrementalAllowedTypes.js";
30
30
  export { encodeSchemaCompatibilitySnapshot, decodeSchemaCompatibilitySnapshot, } from "./simpleSchemaCodec.js";
31
- export { exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, } from "./snapshotCompatibilityChecker.js";
31
+ export { exportCompatibilitySchemaSnapshot, importCompatibilitySchemaSnapshot, checkCompatibility, checkSchemaCompatibilitySnapshots, } from "./snapshotCompatibilityChecker.js";
32
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mapp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AAQ,GAER,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,GAErB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAYN,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EACN,wCAAwC,EACxC,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,GAClB,MAAM,mCAAmC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tITreeViewConfiguration,\n\tITreeConfigurationOptions,\n} from \"./configuration.js\";\nexport {\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n} from \"./configuration.js\";\nexport type {\n\tITree,\n\tTreeView,\n\tViewableTree,\n\tTreeViewEvents,\n\tSchemaCompatibilityStatus,\n\tTreeViewAlpha,\n\tTreeViewBeta,\n\tTreeBranch,\n\tTreeBranchAlpha,\n\tTreeBranchEvents,\n\tITreeAlpha,\n} from \"./tree.js\";\nexport { asTreeViewAlpha } from \"./tree.js\";\nexport { type SchemaStatics, schemaStatics } from \"./schemaStatics.js\";\nexport {\n\tSchemaFactory,\n\tscoped,\n\ttype ScopedSchemaName,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype SchemaFactory_base,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryBeta, type SchemaStaticsBeta } from \"./schemaFactoryBeta.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport {\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n} from \"./eraseSchemaDetails.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n\tValidateRecursiveSchemaTemplate,\n\tFixRecursiveRecursionLimit,\n} from \"./schemaFactoryRecursive.js\";\nexport { allowUnused } from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport {\n\tgetIdentifierFromNode,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttryGetSchema,\n} from \"./treeNodeApi.js\";\nexport { createFromCursor } from \"./create.js\";\nexport {\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n} from \"./dirtyIndex.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n} from \"./jsonSchema.js\";\nexport type { TreeSchemaEncodingOptions } from \"./getJsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { SchemaCompatibilityTester } from \"./schemaCompatibilityTester.js\";\nexport type {\n\tUnenforced,\n\tFieldSchemaAlphaUnsafe,\n\tArrayNodeCustomizableSchemaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeRecordNodeUnsafe,\n\tUnannotateAllowedTypeUnsafe,\n\tAnnotatedAllowedTypeUnsafe,\n\tAnnotatedAllowedTypesUnsafe,\n\tAllowedTypesFullUnsafe,\n\tAllowedTypesFullFromMixedUnsafe,\n\tUnannotateAllowedTypesListUnsafe,\n\tAnnotateAllowedTypesListUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\treplaceVerboseTreeHandles,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype TreeEncodingOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\treplaceHandles,\n\ttype HandleConverter,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport {\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n} from \"./treeBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n} from \"./transactionTypes.js\";\n\nexport { generateSchemaFromSimpleSchema } from \"./schemaFromSimple.js\";\nexport type { TreeChangeEvents } from \"./treeChangeEvents.js\";\nexport {\n\tincrementalEncodingPolicyForAllowedTypes,\n\tincrementalSummaryHint,\n} from \"./incrementalAllowedTypes.js\";\nexport {\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n} from \"./simpleSchemaCodec.js\";\nexport {\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n} from \"./snapshotCompatibilityChecker.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAc5B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAsB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACN,aAAa,EACb,MAAM,GAON,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAA0B,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,8BAA8B,GAC9B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,qBAAqB,EACrB,2BAA2B,EAC3B,YAAY,EACZ,WAAW,EAEX,YAAY,GACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAEN,eAAe,GAEf,MAAM,iBAAiB,CAAC;AAmBzB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAiB3E,OAAO,EAGN,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,sBAAsB,EAGtB,sBAAsB,EACtB,cAAc,EAEd,kBAAkB,GAElB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEN,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,+BAA+B,EAC/B,aAAa,EACb,aAAa,EAEb,QAAQ,GAER,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,GAErB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAYN,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EACN,wCAAwC,EACxC,sBAAsB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,GACjC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,iCAAiC,EACjC,kBAAkB,EAClB,iCAAiC,GAGjC,MAAM,mCAAmC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tITreeViewConfiguration,\n\tITreeConfigurationOptions,\n} from \"./configuration.js\";\nexport {\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n} from \"./configuration.js\";\nexport type {\n\tITree,\n\tTreeView,\n\tViewableTree,\n\tTreeViewEvents,\n\tSchemaCompatibilityStatus,\n\tTreeViewAlpha,\n\tTreeViewBeta,\n\tTreeBranch,\n\tTreeBranchAlpha,\n\tTreeBranchEvents,\n\tITreeAlpha,\n} from \"./tree.js\";\nexport { asTreeViewAlpha } from \"./tree.js\";\nexport { type SchemaStatics, schemaStatics } from \"./schemaStatics.js\";\nexport {\n\tSchemaFactory,\n\tscoped,\n\ttype ScopedSchemaName,\n\ttype ObjectSchemaOptionsAlpha,\n\ttype ObjectSchemaOptions,\n\ttype NodeSchemaOptions,\n\ttype NodeSchemaOptionsAlpha,\n\ttype SchemaFactory_base,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryBeta, type SchemaStaticsBeta } from \"./schemaFactoryBeta.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport {\n\teraseSchemaDetails,\n\teraseSchemaDetailsSubclassable,\n} from \"./eraseSchemaDetails.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n\tValidateRecursiveSchemaTemplate,\n\tFixRecursiveRecursionLimit,\n} from \"./schemaFactoryRecursive.js\";\nexport { allowUnused } from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport {\n\tgetIdentifierFromNode,\n\tgetPropertyKeyFromStoredKey,\n\tgetStoredKey,\n\ttreeNodeApi,\n\ttype TreeNodeApi,\n\ttryGetSchema,\n} from \"./treeNodeApi.js\";\nexport { createFromCursor } from \"./create.js\";\nexport {\n\ttype DirtyTreeStatus,\n\ttrackDirtyNodes,\n\ttype DirtyTreeMap,\n} from \"./dirtyIndex.js\";\nexport {\n\ttype JsonSchemaId,\n\ttype JsonSchemaType,\n\ttype JsonObjectNodeSchema,\n\ttype JsonArrayNodeSchema,\n\ttype JsonMapNodeSchema,\n\ttype JsonLeafNodeSchema,\n\ttype JsonSchemaRef,\n\ttype JsonRefPath,\n\ttype JsonNodeSchema,\n\ttype JsonNodeSchemaBase,\n\ttype JsonTreeSchema,\n\ttype JsonFieldSchema,\n\ttype JsonLeafSchemaType,\n\ttype JsonRecordNodeSchema,\n\ttype JsonStringKeyPatternProperties,\n} from \"./jsonSchema.js\";\nexport type { TreeSchemaEncodingOptions } from \"./getJsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { SchemaCompatibilityTester } from \"./schemaCompatibilityTester.js\";\nexport type {\n\tUnenforced,\n\tFieldSchemaAlphaUnsafe,\n\tArrayNodeCustomizableSchemaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\n\tTreeRecordNodeUnsafe,\n\tUnannotateAllowedTypeUnsafe,\n\tAnnotatedAllowedTypeUnsafe,\n\tAnnotatedAllowedTypesUnsafe,\n\tAllowedTypesFullUnsafe,\n\tAllowedTypesFullFromMixedUnsafe,\n\tUnannotateAllowedTypesListUnsafe,\n\tAnnotateAllowedTypesListUnsafe,\n} from \"./typesUnsafe.js\";\n\nexport {\n\ttype VerboseTreeNode,\n\ttype VerboseTree,\n\tapplySchemaToParserOptions,\n\tcursorFromVerbose,\n\tverboseFromCursor,\n\treplaceVerboseTreeHandles,\n} from \"./verboseTree.js\";\n\nexport {\n\ttype TreeEncodingOptions,\n\tcustomFromCursorStored,\n\ttype CustomTreeNode,\n\ttype CustomTreeValue,\n\ttryStoredSchemaAsArray,\n\treplaceHandles,\n\ttype HandleConverter,\n\tKeyEncodingOptions,\n\ttype TreeParsingOptions,\n} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport {\n\tborrowCursorFromTreeNodeOrValue,\n\texportConcise,\n\timportConcise,\n\ttype NodeChangedData,\n\tTreeBeta,\n\ttype TreeChangeEventsBeta,\n} from \"./treeBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype TransactionConstraintAlpha,\n\ttype NodeInDocumentConstraint,\n\ttype NoChangeConstraint,\n\ttype RunTransactionParams,\n\ttype VoidTransactionCallbackStatus,\n\ttype TransactionCallbackStatus,\n\ttype TransactionResult,\n\ttype TransactionResultExt,\n\ttype TransactionResultSuccess,\n\ttype TransactionResultFailed,\n\trollback,\n} from \"./transactionTypes.js\";\n\nexport { generateSchemaFromSimpleSchema } from \"./schemaFromSimple.js\";\nexport type { TreeChangeEvents } from \"./treeChangeEvents.js\";\nexport {\n\tincrementalEncodingPolicyForAllowedTypes,\n\tincrementalSummaryHint,\n} from \"./incrementalAllowedTypes.js\";\nexport {\n\tencodeSchemaCompatibilitySnapshot,\n\tdecodeSchemaCompatibilitySnapshot,\n} from \"./simpleSchemaCodec.js\";\nexport {\n\texportCompatibilitySchemaSnapshot,\n\timportCompatibilitySchemaSnapshot,\n\tcheckCompatibility,\n\tcheckSchemaCompatibilitySnapshots,\n\ttype SnapshotFileSystem,\n\ttype SchemaCompatibilitySnapshotsOptions,\n} from \"./snapshotCompatibilityChecker.js\";\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { TreeStoredSchema } from "../../core/index.js";
6
- import type { SchemaCompatibilityStatus } from "./tree.js";
7
6
  import type { TreeSchema } from "../treeSchema.js";
7
+ import type { SchemaCompatibilityStatus } from "./tree.js";
8
8
  /**
9
9
  * A collection of View information for schema
10
10
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCompatibilityTester.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;;;GAIG;AACH,qBAAa,yBAAyB;IAEpC;;OAEG;aACa,UAAU,EAAE,UAAU;;IAHtC;;OAEG;IACa,UAAU,EAAE,UAAU;IAGvC;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAM,EAAE,gBAAgB,GACtB,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;CA8BnD"}
1
+ {"version":3,"file":"schemaCompatibilityTester.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,yBAAyB;IAEpC;;OAEG;aACa,UAAU,EAAE,UAAU;;IAHtC;;OAEG;IACa,UAAU,EAAE,UAAU;IAGvC;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAM,EAAE,gBAAgB,GACtB,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;CA8BnD"}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { allowsRepoSuperset, defaultSchemaPolicy } from "../../feature-libraries/index.js";
6
- import { getDiscrepanciesInAllowedContent } from "./discrepancies.js";
7
6
  import { toUpgradeSchema } from "../toStoredSchema.js";
7
+ import { getDiscrepanciesInAllowedContent } from "./discrepancies.js";
8
8
  /**
9
9
  * A collection of View information for schema
10
10
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACrC;IACC;;OAEG;IACa,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACpC,CAAC;IAEJ;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAwB;QAExB,qDAAqD;QACrD,MAAM,MAAM,GAAG,mBAAmB,CAAC;QAEnC,gHAAgH;QAChH,6HAA6H;QAC7H,sDAAsD;QACtD,8HAA8H;QAC9H,IAAI,OAAO,GAAG,IAAI,CAAC;QAEnB,KAAK,MAAM,YAAY,IAAI,gCAAgC,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;YACtF,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM;QACP,CAAC;QAED,MAAM,cAAc,GAAG,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE7D,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;QAEtE,+EAA+E;QAC/E,0HAA0H;QAC1H,MAAM,YAAY,GACjB,OAAO,IAAI,UAAU,IAAI,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QAE7E,OAAO;YACN,OAAO;YACP,UAAU;YACV,YAAY;SACZ,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TreeStoredSchema } from \"../../core/index.js\";\nimport { allowsRepoSuperset, defaultSchemaPolicy } from \"../../feature-libraries/index.js\";\n\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\nimport { getDiscrepanciesInAllowedContent } from \"./discrepancies.js\";\nimport { toUpgradeSchema } from \"../toStoredSchema.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\n\n/**\n * A collection of View information for schema\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\tpublic constructor(\n\t\t/**\n\t\t * Schema for the view\n\t\t */\n\t\tpublic readonly viewSchema: TreeSchema,\n\t) {}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// The public API surface assumes defaultSchemaPolicy\n\t\tconst policy = defaultSchemaPolicy;\n\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\n\t\tfor (const _discrepancy of getDiscrepanciesInAllowedContent(this.viewSchema, stored)) {\n\t\t\tcanView = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tconst wouldUpgradeTo = toUpgradeSchema(this.viewSchema.root);\n\n\t\tconst canUpgrade = allowsRepoSuperset(policy, stored, wouldUpgradeTo);\n\n\t\t// If true, then upgrading has no effect on what can be stored in the document.\n\t\t// TODO: This should likely be changed to indicate up a schema upgrade would be a no-op, including stored schema metadata.\n\t\tconst isEquivalent =\n\t\t\tcanView && canUpgrade && allowsRepoSuperset(policy, wouldUpgradeTo, stored);\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AAGtE;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACrC;IACC;;OAEG;IACa,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACpC,CAAC;IAEJ;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAwB;QAExB,qDAAqD;QACrD,MAAM,MAAM,GAAG,mBAAmB,CAAC;QAEnC,gHAAgH;QAChH,6HAA6H;QAC7H,sDAAsD;QACtD,8HAA8H;QAC9H,IAAI,OAAO,GAAG,IAAI,CAAC;QAEnB,KAAK,MAAM,YAAY,IAAI,gCAAgC,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;YACtF,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM;QACP,CAAC;QAED,MAAM,cAAc,GAAG,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE7D,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;QAEtE,+EAA+E;QAC/E,0HAA0H;QAC1H,MAAM,YAAY,GACjB,OAAO,IAAI,UAAU,IAAI,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QAE7E,OAAO;YACN,OAAO;YACP,UAAU;YACV,YAAY;SACZ,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TreeStoredSchema } from \"../../core/index.js\";\nimport { allowsRepoSuperset, defaultSchemaPolicy } from \"../../feature-libraries/index.js\";\nimport { toUpgradeSchema } from \"../toStoredSchema.js\";\nimport type { TreeSchema } from \"../treeSchema.js\";\n\nimport { getDiscrepanciesInAllowedContent } from \"./discrepancies.js\";\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\n\n/**\n * A collection of View information for schema\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\tpublic constructor(\n\t\t/**\n\t\t * Schema for the view\n\t\t */\n\t\tpublic readonly viewSchema: TreeSchema,\n\t) {}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// The public API surface assumes defaultSchemaPolicy\n\t\tconst policy = defaultSchemaPolicy;\n\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\n\t\tfor (const _discrepancy of getDiscrepanciesInAllowedContent(this.viewSchema, stored)) {\n\t\t\tcanView = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tconst wouldUpgradeTo = toUpgradeSchema(this.viewSchema.root);\n\n\t\tconst canUpgrade = allowsRepoSuperset(policy, stored, wouldUpgradeTo);\n\n\t\t// If true, then upgrading has no effect on what can be stored in the document.\n\t\t// TODO: This should likely be changed to indicate up a schema upgrade would be a no-op, including stored schema metadata.\n\t\tconst isEquivalent =\n\t\t\tcanView && canUpgrade && allowsRepoSuperset(policy, wouldUpgradeTo, stored);\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent,\n\t\t};\n\t}\n}\n"]}
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { SchemaFactory, ScopedSchemaName } from "./schemaFactory.js";
6
- import type { NodeKind, TreeNode, TreeNodeSchemaClass } from "../core/index.js";
7
5
  import type { UnionToTuple } from "../../util/index.js";
6
+ import type { NodeKind, TreeNode, TreeNodeSchemaClass } from "../core/index.js";
7
+ import type { SchemaFactory, ScopedSchemaName } from "./schemaFactory.js";
8
8
  /**
9
9
  * Create a schema for a node with no state.
10
10
  * @remarks
@@ -1 +1 @@
1
- {"version":3,"file":"schemaCreationUtilities.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCreationUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAGX,QAAQ,EACR,QAAQ,EAER,mBAAmB,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAWxD;;;;;;;GAOG;AAGH,wBAAgB,eAAe,CAAC,MAAM,SAAS,MAAM,EAAE,KAAK,SAAS,MAAM,GAAG,MAAM,EACnF,OAAO,EAAE,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,EACrC,IAAI,EAAE,KAAK;oBAiB2C,KAAK;kEAkB3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,wBAAgB,SAAS,CACxB,MAAM,SAAS,MAAM,EACrB,KAAK,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,E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CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,+CAsBG,MAAM;;;;;;;;EA4BxD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACzC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,CAwB7B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAgB,eAAe,CAC9B,MAAM,SAAS,MAAM,EACrB,KAAK,CAAC,OAAO,SAAS,SAAS,MAAM,EAAE,EACtC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,4CAoBO,MAAM;;;;;;;;EA+B9D"}
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
6
5
  import { assert, fail } from "@fluidframework/core-utils/internal";
6
+ import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
7
  /*
8
8
  * This file does two things:
9
9
  *