@fluidframework/tree 2.40.0-336023 → 2.40.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 (445) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/api-report/tree.alpha.api.md +4 -1
  3. package/dist/alpha.d.ts +1 -0
  4. package/dist/codec/codec.d.ts +5 -1
  5. package/dist/codec/codec.d.ts.map +1 -1
  6. package/dist/codec/codec.js +6 -2
  7. package/dist/codec/codec.js.map +1 -1
  8. package/dist/codec/index.d.ts +1 -1
  9. package/dist/codec/index.d.ts.map +1 -1
  10. package/dist/codec/index.js +2 -1
  11. package/dist/codec/index.js.map +1 -1
  12. package/dist/core/index.d.ts +2 -2
  13. package/dist/core/index.d.ts.map +1 -1
  14. package/dist/core/index.js +2 -3
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  17. package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
  18. package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
  19. package/dist/core/schema-stored/formatV1.js.map +1 -0
  20. package/dist/core/schema-stored/index.d.ts +3 -3
  21. package/dist/core/schema-stored/index.d.ts.map +1 -1
  22. package/dist/core/schema-stored/index.js +3 -3
  23. package/dist/core/schema-stored/index.js.map +1 -1
  24. package/dist/core/schema-stored/schema.d.ts +3 -1
  25. package/dist/core/schema-stored/schema.d.ts.map +1 -1
  26. package/dist/core/schema-stored/schema.js +8 -6
  27. package/dist/core/schema-stored/schema.js.map +1 -1
  28. package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  29. package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  30. package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
  31. package/dist/core/schema-view/index.d.ts +1 -1
  32. package/dist/core/schema-view/index.d.ts.map +1 -1
  33. package/dist/core/schema-view/index.js +1 -2
  34. package/dist/core/schema-view/index.js.map +1 -1
  35. package/dist/core/schema-view/view.d.ts +0 -27
  36. package/dist/core/schema-view/view.d.ts.map +1 -1
  37. package/dist/core/schema-view/view.js +1 -35
  38. package/dist/core/schema-view/view.js.map +1 -1
  39. package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
  40. package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  41. package/dist/core/tree/persistedTreeTextFormat.js +1 -1
  42. package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
  43. package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
  44. package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
  45. package/dist/feature-libraries/forest-summary/format.js +1 -1
  46. package/dist/feature-libraries/forest-summary/format.js.map +1 -1
  47. package/dist/feature-libraries/index.d.ts +1 -1
  48. package/dist/feature-libraries/index.d.ts.map +1 -1
  49. package/dist/feature-libraries/index.js +4 -2
  50. package/dist/feature-libraries/index.js.map +1 -1
  51. package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
  52. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  53. package/dist/feature-libraries/mapTreeCursor.js +2 -2
  54. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  55. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  56. package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  57. package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
  58. package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  59. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  60. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  61. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
  62. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  63. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  64. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  65. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  66. package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
  67. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  68. package/dist/feature-libraries/schema-index/codec.js +63 -9
  69. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  70. package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  71. package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  72. package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
  73. package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
  74. package/dist/feature-libraries/schema-index/index.d.ts +2 -2
  75. package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
  76. package/dist/feature-libraries/schema-index/index.js +6 -3
  77. package/dist/feature-libraries/schema-index/index.js.map +1 -1
  78. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  79. package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  80. package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
  81. package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  82. package/dist/index.d.ts +1 -0
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +10 -8
  85. package/dist/index.js.map +1 -1
  86. package/dist/packageVersion.d.ts +1 -1
  87. package/dist/packageVersion.d.ts.map +1 -1
  88. package/dist/packageVersion.js +1 -1
  89. package/dist/packageVersion.js.map +1 -1
  90. package/dist/shared-tree/independentView.d.ts.map +1 -1
  91. package/dist/shared-tree/independentView.js +1 -1
  92. package/dist/shared-tree/independentView.js.map +1 -1
  93. package/dist/shared-tree/index.d.ts +1 -1
  94. package/dist/shared-tree/index.d.ts.map +1 -1
  95. package/dist/shared-tree/index.js +2 -1
  96. package/dist/shared-tree/index.js.map +1 -1
  97. package/dist/shared-tree/schematizeTree.d.ts +8 -9
  98. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  99. package/dist/shared-tree/schematizeTree.js +9 -33
  100. package/dist/shared-tree/schematizeTree.js.map +1 -1
  101. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  102. package/dist/shared-tree/schematizingTreeView.js +1 -4
  103. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  104. package/dist/shared-tree/sharedTree.d.ts +28 -3
  105. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  106. package/dist/shared-tree/sharedTree.js +29 -3
  107. package/dist/shared-tree/sharedTree.js.map +1 -1
  108. package/dist/shared-tree/tree.d.ts +24 -0
  109. package/dist/shared-tree/tree.d.ts.map +1 -1
  110. package/dist/shared-tree/tree.js.map +1 -1
  111. package/dist/shared-tree/treeAlpha.d.ts +2 -0
  112. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  113. package/dist/shared-tree/treeAlpha.js +3 -2
  114. package/dist/shared-tree/treeAlpha.js.map +1 -1
  115. package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  116. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  117. package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
  118. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  119. package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
  120. package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  121. package/dist/shared-tree-core/transactionEnricher.js +4 -1
  122. package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
  123. package/dist/simple-tree/api/index.d.ts +2 -1
  124. package/dist/simple-tree/api/index.d.ts.map +1 -1
  125. package/dist/simple-tree/api/index.js +2 -1
  126. package/dist/simple-tree/api/index.js.map +1 -1
  127. package/dist/simple-tree/api/schemaFactory.d.ts +9 -0
  128. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  129. package/dist/simple-tree/api/schemaFactory.js +7 -0
  130. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  131. package/dist/simple-tree/api/storedSchema.d.ts +8 -7
  132. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  133. package/dist/simple-tree/api/storedSchema.js +13 -9
  134. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  135. package/dist/simple-tree/api/tree.d.ts +25 -0
  136. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  137. package/dist/simple-tree/api/tree.js.map +1 -1
  138. package/dist/simple-tree/api/treeBeta.d.ts +4 -1
  139. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  140. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  141. package/dist/simple-tree/api/treeChangeEvents.d.ts +83 -0
  142. package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  143. package/dist/simple-tree/api/treeChangeEvents.js +7 -0
  144. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
  145. package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
  146. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  147. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  148. package/dist/simple-tree/arrayNode.d.ts +28 -0
  149. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  150. package/dist/simple-tree/arrayNode.js.map +1 -1
  151. package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
  152. package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  153. package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
  154. package/dist/simple-tree/core/index.d.ts +2 -1
  155. package/dist/simple-tree/core/index.d.ts.map +1 -1
  156. package/dist/simple-tree/core/index.js +5 -5
  157. package/dist/simple-tree/core/index.js.map +1 -1
  158. package/dist/simple-tree/core/treeNode.d.ts +94 -0
  159. package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
  160. package/dist/simple-tree/core/treeNode.js +123 -0
  161. package/dist/simple-tree/core/treeNode.js.map +1 -0
  162. package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
  163. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  164. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  165. package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
  166. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  167. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  168. package/dist/simple-tree/core/types.d.ts +0 -165
  169. package/dist/simple-tree/core/types.d.ts.map +1 -1
  170. package/dist/simple-tree/core/types.js +1 -113
  171. package/dist/simple-tree/core/types.js.map +1 -1
  172. package/dist/simple-tree/core/withType.d.ts +1 -1
  173. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  174. package/dist/simple-tree/core/withType.js.map +1 -1
  175. package/dist/simple-tree/index.d.ts +2 -2
  176. package/dist/simple-tree/index.d.ts.map +1 -1
  177. package/dist/simple-tree/index.js +3 -2
  178. package/dist/simple-tree/index.js.map +1 -1
  179. package/dist/simple-tree/schemaTypes.d.ts +1 -0
  180. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  181. package/dist/simple-tree/schemaTypes.js.map +1 -1
  182. package/dist/simple-tree/toStoredSchema.d.ts +8 -8
  183. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  184. package/dist/simple-tree/toStoredSchema.js +27 -32
  185. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  186. package/dist/tableSchema.d.ts +302 -83
  187. package/dist/tableSchema.d.ts.map +1 -1
  188. package/dist/tableSchema.js +299 -57
  189. package/dist/tableSchema.js.map +1 -1
  190. package/dist/treeFactory.d.ts +1 -1
  191. package/dist/treeFactory.d.ts.map +1 -1
  192. package/dist/treeFactory.js +30 -75
  193. package/dist/treeFactory.js.map +1 -1
  194. package/lib/alpha.d.ts +1 -0
  195. package/lib/codec/codec.d.ts +5 -1
  196. package/lib/codec/codec.d.ts.map +1 -1
  197. package/lib/codec/codec.js +5 -1
  198. package/lib/codec/codec.js.map +1 -1
  199. package/lib/codec/index.d.ts +1 -1
  200. package/lib/codec/index.d.ts.map +1 -1
  201. package/lib/codec/index.js +1 -1
  202. package/lib/codec/index.js.map +1 -1
  203. package/lib/core/index.d.ts +2 -2
  204. package/lib/core/index.d.ts.map +1 -1
  205. package/lib/core/index.js +2 -2
  206. package/lib/core/index.js.map +1 -1
  207. package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
  208. package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
  209. package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
  210. package/lib/core/schema-stored/formatV1.js.map +1 -0
  211. package/lib/core/schema-stored/index.d.ts +3 -3
  212. package/lib/core/schema-stored/index.d.ts.map +1 -1
  213. package/lib/core/schema-stored/index.js +2 -2
  214. package/lib/core/schema-stored/index.js.map +1 -1
  215. package/lib/core/schema-stored/schema.d.ts +3 -1
  216. package/lib/core/schema-stored/schema.d.ts.map +1 -1
  217. package/lib/core/schema-stored/schema.js +3 -1
  218. package/lib/core/schema-stored/schema.js.map +1 -1
  219. package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
  220. package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
  221. package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
  222. package/lib/core/schema-view/index.d.ts +1 -1
  223. package/lib/core/schema-view/index.d.ts.map +1 -1
  224. package/lib/core/schema-view/index.js +1 -1
  225. package/lib/core/schema-view/index.js.map +1 -1
  226. package/lib/core/schema-view/view.d.ts +0 -27
  227. package/lib/core/schema-view/view.d.ts.map +1 -1
  228. package/lib/core/schema-view/view.js +0 -34
  229. package/lib/core/schema-view/view.js.map +1 -1
  230. package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
  231. package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
  232. package/lib/core/tree/persistedTreeTextFormat.js +2 -2
  233. package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
  234. package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
  235. package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
  236. package/lib/feature-libraries/forest-summary/format.js +2 -2
  237. package/lib/feature-libraries/forest-summary/format.js.map +1 -1
  238. package/lib/feature-libraries/index.d.ts +1 -1
  239. package/lib/feature-libraries/index.d.ts.map +1 -1
  240. package/lib/feature-libraries/index.js +1 -1
  241. package/lib/feature-libraries/index.js.map +1 -1
  242. package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
  243. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  244. package/lib/feature-libraries/mapTreeCursor.js +2 -2
  245. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  246. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
  247. package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
  248. package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
  249. package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
  250. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
  251. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  252. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
  253. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  254. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
  255. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  256. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
  257. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  258. package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
  259. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  260. package/lib/feature-libraries/schema-index/codec.js +61 -9
  261. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  262. package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
  263. package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
  264. package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
  265. package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
  266. package/lib/feature-libraries/schema-index/index.d.ts +2 -2
  267. package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
  268. package/lib/feature-libraries/schema-index/index.js +2 -2
  269. package/lib/feature-libraries/schema-index/index.js.map +1 -1
  270. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
  271. package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
  272. package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
  273. package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
  274. package/lib/index.d.ts +1 -0
  275. package/lib/index.d.ts.map +1 -1
  276. package/lib/index.js +1 -0
  277. package/lib/index.js.map +1 -1
  278. package/lib/packageVersion.d.ts +1 -1
  279. package/lib/packageVersion.d.ts.map +1 -1
  280. package/lib/packageVersion.js +1 -1
  281. package/lib/packageVersion.js.map +1 -1
  282. package/lib/shared-tree/independentView.d.ts.map +1 -1
  283. package/lib/shared-tree/independentView.js +2 -2
  284. package/lib/shared-tree/independentView.js.map +1 -1
  285. package/lib/shared-tree/index.d.ts +1 -1
  286. package/lib/shared-tree/index.d.ts.map +1 -1
  287. package/lib/shared-tree/index.js +1 -1
  288. package/lib/shared-tree/index.js.map +1 -1
  289. package/lib/shared-tree/schematizeTree.d.ts +8 -9
  290. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  291. package/lib/shared-tree/schematizeTree.js +10 -34
  292. package/lib/shared-tree/schematizeTree.js.map +1 -1
  293. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  294. package/lib/shared-tree/schematizingTreeView.js +2 -5
  295. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  296. package/lib/shared-tree/sharedTree.d.ts +28 -3
  297. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  298. package/lib/shared-tree/sharedTree.js +29 -4
  299. package/lib/shared-tree/sharedTree.js.map +1 -1
  300. package/lib/shared-tree/tree.d.ts +24 -0
  301. package/lib/shared-tree/tree.d.ts.map +1 -1
  302. package/lib/shared-tree/tree.js.map +1 -1
  303. package/lib/shared-tree/treeAlpha.d.ts +2 -0
  304. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  305. package/lib/shared-tree/treeAlpha.js +4 -3
  306. package/lib/shared-tree/treeAlpha.js.map +1 -1
  307. package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
  308. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  309. package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
  310. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  311. package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
  312. package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
  313. package/lib/shared-tree-core/transactionEnricher.js +4 -1
  314. package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
  315. package/lib/simple-tree/api/index.d.ts +2 -1
  316. package/lib/simple-tree/api/index.d.ts.map +1 -1
  317. package/lib/simple-tree/api/index.js +1 -1
  318. package/lib/simple-tree/api/index.js.map +1 -1
  319. package/lib/simple-tree/api/schemaFactory.d.ts +9 -0
  320. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  321. package/lib/simple-tree/api/schemaFactory.js +7 -0
  322. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  323. package/lib/simple-tree/api/storedSchema.d.ts +8 -7
  324. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  325. package/lib/simple-tree/api/storedSchema.js +17 -11
  326. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  327. package/lib/simple-tree/api/tree.d.ts +25 -0
  328. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  329. package/lib/simple-tree/api/tree.js.map +1 -1
  330. package/lib/simple-tree/api/treeBeta.d.ts +4 -1
  331. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  332. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  333. package/lib/simple-tree/api/treeChangeEvents.d.ts +83 -0
  334. package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
  335. package/lib/simple-tree/api/treeChangeEvents.js +6 -0
  336. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
  337. package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
  338. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  339. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  340. package/lib/simple-tree/arrayNode.d.ts +28 -0
  341. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  342. package/lib/simple-tree/arrayNode.js.map +1 -1
  343. package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
  344. package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
  345. package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
  346. package/lib/simple-tree/core/index.d.ts +2 -1
  347. package/lib/simple-tree/core/index.d.ts.map +1 -1
  348. package/lib/simple-tree/core/index.js +1 -1
  349. package/lib/simple-tree/core/index.js.map +1 -1
  350. package/lib/simple-tree/core/treeNode.d.ts +94 -0
  351. package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
  352. package/lib/simple-tree/core/treeNode.js +118 -0
  353. package/lib/simple-tree/core/treeNode.js.map +1 -0
  354. package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
  355. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  356. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  357. package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
  358. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  359. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  360. package/lib/simple-tree/core/types.d.ts +0 -165
  361. package/lib/simple-tree/core/types.d.ts.map +1 -1
  362. package/lib/simple-tree/core/types.js +0 -110
  363. package/lib/simple-tree/core/types.js.map +1 -1
  364. package/lib/simple-tree/core/withType.d.ts +1 -1
  365. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  366. package/lib/simple-tree/core/withType.js.map +1 -1
  367. package/lib/simple-tree/index.d.ts +2 -2
  368. package/lib/simple-tree/index.d.ts.map +1 -1
  369. package/lib/simple-tree/index.js +1 -1
  370. package/lib/simple-tree/index.js.map +1 -1
  371. package/lib/simple-tree/schemaTypes.d.ts +1 -0
  372. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  373. package/lib/simple-tree/schemaTypes.js.map +1 -1
  374. package/lib/simple-tree/toStoredSchema.d.ts +8 -8
  375. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  376. package/lib/simple-tree/toStoredSchema.js +26 -31
  377. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  378. package/lib/tableSchema.d.ts +302 -83
  379. package/lib/tableSchema.d.ts.map +1 -1
  380. package/lib/tableSchema.js +299 -57
  381. package/lib/tableSchema.js.map +1 -1
  382. package/lib/treeFactory.d.ts +1 -1
  383. package/lib/treeFactory.d.ts.map +1 -1
  384. package/lib/treeFactory.js +30 -75
  385. package/lib/treeFactory.js.map +1 -1
  386. package/package.json +21 -21
  387. package/src/codec/codec.ts +6 -1
  388. package/src/codec/index.ts +1 -0
  389. package/src/core/index.ts +1 -2
  390. package/src/core/schema-stored/index.ts +3 -3
  391. package/src/core/schema-stored/schema.ts +3 -1
  392. package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
  393. package/src/core/schema-view/index.ts +0 -1
  394. package/src/core/schema-view/view.ts +0 -31
  395. package/src/core/tree/persistedTreeTextFormat.ts +2 -2
  396. package/src/feature-libraries/forest-summary/format.ts +2 -2
  397. package/src/feature-libraries/index.ts +7 -1
  398. package/src/feature-libraries/mapTreeCursor.ts +3 -3
  399. package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
  400. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
  401. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
  402. package/src/feature-libraries/schema-index/codec.ts +80 -12
  403. package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
  404. package/src/feature-libraries/schema-index/index.ts +7 -2
  405. package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
  406. package/src/index.ts +1 -0
  407. package/src/packageVersion.ts +1 -1
  408. package/src/shared-tree/independentView.ts +3 -2
  409. package/src/shared-tree/index.ts +2 -0
  410. package/src/shared-tree/schematizeTree.ts +5 -35
  411. package/src/shared-tree/schematizingTreeView.ts +2 -10
  412. package/src/shared-tree/sharedTree.ts +67 -6
  413. package/src/shared-tree/tree.ts +24 -0
  414. package/src/shared-tree/treeAlpha.ts +6 -3
  415. package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
  416. package/src/shared-tree-core/transactionEnricher.ts +4 -1
  417. package/src/simple-tree/api/index.ts +2 -0
  418. package/src/simple-tree/api/schemaFactory.ts +9 -0
  419. package/src/simple-tree/api/storedSchema.ts +24 -13
  420. package/src/simple-tree/api/tree.ts +25 -0
  421. package/src/simple-tree/api/treeBeta.ts +3 -1
  422. package/src/simple-tree/api/treeChangeEvents.ts +84 -0
  423. package/src/simple-tree/api/treeNodeApi.ts +1 -1
  424. package/src/simple-tree/arrayNode.ts +28 -0
  425. package/src/simple-tree/core/getOrCreateNode.ts +1 -1
  426. package/src/simple-tree/core/index.ts +5 -4
  427. package/src/simple-tree/core/treeNode.ts +163 -0
  428. package/src/simple-tree/core/treeNodeKernel.ts +2 -1
  429. package/src/simple-tree/core/treeNodeSchema.ts +3 -1
  430. package/src/simple-tree/core/types.ts +0 -234
  431. package/src/simple-tree/core/withType.ts +1 -1
  432. package/src/simple-tree/index.ts +2 -1
  433. package/src/simple-tree/schemaTypes.ts +1 -0
  434. package/src/simple-tree/toStoredSchema.ts +42 -41
  435. package/src/tableSchema.ts +665 -197
  436. package/src/treeFactory.ts +56 -173
  437. package/dist/core/schema-stored/format.d.ts.map +0 -1
  438. package/dist/core/schema-stored/format.js.map +0 -1
  439. package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
  440. package/dist/feature-libraries/schema-index/format.js.map +0 -1
  441. package/lib/core/schema-stored/format.d.ts.map +0 -1
  442. package/lib/core/schema-stored/format.js.map +0 -1
  443. package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
  444. package/lib/feature-libraries/schema-index/format.js.map +0 -1
  445. /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
@@ -3,14 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
- import { type ChangesetLocalId, schemaFormat } from "../../core/index.js";
6
+ import { type ChangesetLocalId, schemaFormatV1 } from "../../core/index.js";
7
7
  import { type JsonCompatibleReadOnly } from "../../util/index.js";
8
8
  export declare const ChangesetLocalIdSchema: import("@sinclair/typebox").TUnsafe<ChangesetLocalId>;
9
9
  export declare const EncodedChangeAtomId: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TUnsafe<ChangesetLocalId>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"root">, import("@sinclair/typebox").TUnsafe<import("../../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>]>, import("@sinclair/typebox").TUnsafe<ChangesetLocalId>]>;
10
10
  export type EncodedChangeAtomId = Static<typeof EncodedChangeAtomId>;
11
11
  declare const EncodedFieldChange: import("@sinclair/typebox").TObject<{
12
- fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKey>;
13
- fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
12
+ fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKey>;
13
+ fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
14
14
  change: import("@sinclair/typebox").TAny;
15
15
  }>;
16
16
  export interface EncodedFieldChange extends Static<typeof EncodedFieldChange> {
@@ -20,8 +20,8 @@ export interface EncodedFieldChange extends Static<typeof EncodedFieldChange> {
20
20
  change: JsonCompatibleReadOnly;
21
21
  }
22
22
  declare const EncodedFieldChangeMap: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
23
- fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKey>;
24
- fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
23
+ fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKey>;
24
+ fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
25
25
  change: import("@sinclair/typebox").TAny;
26
26
  }>>;
27
27
  /**
@@ -34,8 +34,8 @@ declare const EncodedFieldChangeMap: import("@sinclair/typebox").TArray<import("
34
34
  export type EncodedFieldChangeMap = Static<typeof EncodedFieldChangeMap>;
35
35
  export declare const EncodedNodeChangeset: import("@sinclair/typebox").TObject<{
36
36
  fieldChanges: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
37
- fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKey>;
38
- fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
37
+ fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKey>;
38
+ fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
39
39
  change: import("@sinclair/typebox").TAny;
40
40
  }>>>;
41
41
  nodeExistsConstraint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
@@ -89,8 +89,8 @@ export type EncodedBuilds = Static<typeof EncodedBuilds>;
89
89
  export declare const EncodedModularChangeset: import("@sinclair/typebox").TObject<{
90
90
  maxId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnsafe<ChangesetLocalId>>;
91
91
  changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
92
- fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKey>;
93
- fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
92
+ fieldKey: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKey>;
93
+ fieldKind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
94
94
  change: import("@sinclair/typebox").TAny;
95
95
  }>>;
96
96
  revisions: import("@sinclair/typebox").TReadonlyOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,KAAK,gBAAgB,EAAqB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACN,KAAK,sBAAsB,EAG3B,MAAM,qBAAqB,CAAC;AAK7B,eAAO,MAAM,sBAAsB,uDAEjC,CAAC;AAEH,eAAO,MAAM,mBAAmB,2aAG9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,QAAA,MAAM,kBAAkB;;;;EAUvB,CAAC;AAEF,MAAM,WAAW,kBAAmB,SAAQ,MAAM,CAAC,OAAO,kBAAkB,CAAC;IAC5E;;OAEG;IACH,MAAM,EAAE,sBAAsB,CAAC;CAC/B;AAED,QAAA,MAAM,qBAAqB;;;;GAAiC,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAUzE,eAAO,MAAM,oBAAoB;;;;;;;;;EAMhC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEvE,eAAO,MAAM,mB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]);
20
20
  const EncodedFieldChange = typebox_1.Type.Object({
21
- fieldKey: index_js_1.schemaFormat.FieldKeySchema,
22
- fieldKind: index_js_1.schemaFormat.FieldKindIdentifierSchema,
21
+ fieldKey: index_js_1.schemaFormatV1.FieldKeySchema,
22
+ fieldKind: index_js_1.schemaFormatV1.FieldKindIdentifierSchema,
23
23
  // Implementation note: node and field change encoding is mutually recursive.
24
24
  // This field marks a boundary in that recursion to avoid constructing excessively complex
25
25
  // recursive types. Encoded changes are validated at this boundary at runtime--see modularChangeCodecs.ts.
@@ -1 +1 @@
1
- {"version":3,"file":"modularChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAA6F;AAC7F,kDAI6B;AAC7B,yDAA+D;AAE/D,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,sBAAsB,GAAG,IAAA,4BAAiB,EAAmB;IACzE,UAAU,EAAE,CAAC;CACb,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC7C,cAAI,CAAC,KAAK,CAAC,CAAC,8BAAsB,EAAE,4BAAiB,CAAC,CAAC;IACvD,8BAAsB;CACtB,CAAC,CAAC;AAGH,MAAM,kBAAkB,GAAG,cAAI,CAAC,MAAM,CACrC;IACC,QAAQ,EAAE,uBAAY,CAAC,cAAc;IACrC,SAAS,EAAE,uBAAY,CAAC,yBAAyB;IACjD,6EAA6E;IAC7E,0FAA0F;IAC1F,0GAA0G;IAC1G,MAAM,EAAE,uCAA4B;CACpC,EACD,iBAAiB,CACjB,CAAC;AASF,MAAM,qBAAqB,GAAG,cAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAW7D,MAAM,2BAA2B,GAAG,cAAI,CAAC,MAAM,CAC9C;IACC,QAAQ,EAAE,cAAI,CAAC,OAAO,EA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AqB;IAC9B,SAAS,EAAE,cAAI,CAAC,gBAAgB,CAAC,cAAI,CAAC,KAAK,CAAC,2BAAmB,CAAC,CAAC;IACjE,oHAAoH;IACpH,wGAAwG;IACxG,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAa,CAAC;IACpC,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAa,CAAC;IACxC;;OAEG;IACH,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;CACrE,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { type ChangesetLocalId, RevisionTagSchema, schemaFormat } from \"../../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlySchema,\n\tbrandedNumberType,\n} from \"../../util/index.js\";\nimport { EncodedFieldBatch } from \"../chunked-forest/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const ChangesetLocalIdSchema = brandedNumberType<ChangesetLocalId>({\n\tmultipleOf: 1,\n});\n\nexport const EncodedChangeAtomId = Type.Union([\n\tType.Tuple([ChangesetLocalIdSchema, RevisionTagSchema]),\n\tChangesetLocalIdSchema,\n]);\nexport type EncodedChangeAtomId = Static<typeof EncodedChangeAtomId>;\n\nconst EncodedFieldChange = Type.Object(\n\t{\n\t\tfieldKey: schemaFormat.FieldKeySchema,\n\t\tfieldKind: schemaFormat.FieldKindIdentifierSchema,\n\t\t// Implementation note: node and field change encoding is mutually recursive.\n\t\t// This field marks a boundary in that recursion to avoid constructing excessively complex\n\t\t// recursive types. Encoded changes are validated at this boundary at runtime--see modularChangeCodecs.ts.\n\t\tchange: JsonCompatibleReadOnlySchema,\n\t},\n\tnoAdditionalProps,\n);\n\nexport interface EncodedFieldChange extends Static<typeof EncodedFieldChange> {\n\t/**\n\t * Encoded in format selected by `fieldKind`\n\t */\n\tchange: JsonCompatibleReadOnly;\n}\n\nconst EncodedFieldChangeMap = Type.Array(EncodedFieldChange);\n\n/**\n * Format for encoding as json.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n */\nexport type EncodedFieldChangeMap = Static<typeof EncodedFieldChangeMap>;\n\nconst EncodedNodeExistsConstraint = Type.Object(\n\t{\n\t\tviolated: Type.Boolean(),\n\t},\n\tnoAdditionalProps,\n);\ntype EncodedNodeExistsConstraint = Static<typeof EncodedNodeExistsConstraint>;\n\nexport const EncodedNodeChangeset = Type.Object(\n\t{\n\t\tfieldChanges: Type.Optional(EncodedFieldChangeMap),\n\t\tnodeExistsConstraint: Type.Optional(EncodedNodeExistsConstraint),\n\t},\n\tnoAdditionalProps,\n);\n\n/**\n * Format for encoding as json.\n */\nexport type EncodedNodeChangeset = Static<typeof EncodedNodeChangeset>;\n\nexport const EncodedRevisionInfo = Type.Object(\n\t{\n\t\trevision: Type.Readonly(RevisionTagSchema),\n\t\trollbackOf: Type.ReadonlyOptional(RevisionTagSchema),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedRevisionInfo = Static<typeof EncodedRevisionInfo>;\n\n/**\n * Index of field in an EncodedFieldBatch.\n */\nexport const EncodedTreeIndex = Type.Number({ multipleOf: 1, minimum: 0 });\n\nexport const CommitBuilds = Type.Array(\n\tType.Tuple([\n\t\t// ID for first node\n\t\tChangesetLocalIdSchema,\n\t\t// Index for a TreeChunk that represents all the nodes\n\t\tEncodedTreeIndex,\n\t]),\n);\nexport type CommitBuilds = Static<typeof CommitBuilds>;\n\nexport const EncodedBuildsArray = Type.Array(\n\tType.Union([\n\t\tType.Tuple([CommitBuilds, RevisionTagSchema]),\n\t\t// Revision is omitted when undefined\n\t\tType.Tuple([CommitBuilds]),\n\t]),\n);\n\nexport type EncodedBuildsArray = Static<typeof EncodedBuildsArray>;\n\nexport const EncodedBuilds = Type.Object(\n\t{\n\t\tbuilds: EncodedBuildsArray,\n\t\t/**\n\t\t * Fields indexed by the EncodedTreeIndexes above.\n\t\t * TODO: Strongly typing this here may result in redundant schema validation of this data.\n\t\t */\n\t\ttrees: EncodedFieldBatch,\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedBuilds = Static<typeof EncodedBuilds>;\n\nexport const EncodedModularChangeset = Type.Object(\n\t{\n\t\tmaxId: Type.Optional(ChangesetLocalIdSchema),\n\t\tchanges: EncodedFieldChangeMap,\n\t\trevisions: Type.ReadonlyOptional(Type.Array(EncodedRevisionInfo)),\n\t\t// TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.\n\t\t// This can lead to a less efficient wire representation because of duplicated schema/shape information.\n\t\tbuilds: Type.Optional(EncodedBuilds),\n\t\trefreshers: Type.Optional(EncodedBuilds),\n\t\t/**\n\t\t * The number of constraints within this changeset that are violated.\n\t\t */\n\t\tviolations: Type.Optional(Type.Number({ minimum: 0, multipleOf: 1 })),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangeset = Static<typeof EncodedModularChangeset>;\n"]}
1
+ {"version":3,"file":"modularChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/modularChangeFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAA+F;AAC/F,kDAI6B;AAC7B,yDAA+D;AAE/D,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAE5D,QAAA,sBAAsB,GAAG,IAAA,4BAAiB,EAAmB;IACzE,UAAU,EAAE,CAAC;CACb,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC7C,cAAI,CAAC,KAAK,CAA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AC3C,cAAI,CAAC,KAAK,CAAC;IACV,cAAI,CAAC,KAAK,CAAC,CAAC,oBAAY,EAAE,4BAAiB,CAAC,CAAC;IAC7C,qCAAqC;IACrC,cAAI,CAAC,KAAK,CAAC,CAAC,oBAAY,CAAC,CAAC;CAC1B,CAAC,CACF,CAAC;AAIW,QAAA,aAAa,GAAG,cAAI,CAAC,MAAM,CACvC;IACC,MAAM,EAAE,0BAAkB;IAC1B;;;OAGG;IACH,KAAK,EAAE,4BAAiB;CACxB,EACD,iBAAiB,CACjB,CAAC;AAIW,QAAA,uBAAuB,GAAG,cAAI,CAAC,MAAM,CACjD;IACC,KAAK,EAAE,cAAI,CAAC,QAAQ,CAAC,8BAAsB,CAAC;IAC5C,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,cAAI,CAAC,gBAAgB,CAAC,cAAI,CAAC,KAAK,CAAC,2BAAmB,CAAC,CAAC;IACjE,oHAAoH;IACpH,wGAAwG;IACxG,MAAM,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAa,CAAC;IACpC,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,qBAAa,CAAC;IACxC;;OAEG;IACH,UAAU,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;CACrE,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { type ChangesetLocalId, RevisionTagSchema, schemaFormatV1 } from \"../../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\tJsonCompatibleReadOnlySchema,\n\tbrandedNumberType,\n} from \"../../util/index.js\";\nimport { EncodedFieldBatch } from \"../chunked-forest/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\nexport const ChangesetLocalIdSchema = brandedNumberType<ChangesetLocalId>({\n\tmultipleOf: 1,\n});\n\nexport const EncodedChangeAtomId = Type.Union([\n\tType.Tuple([ChangesetLocalIdSchema, RevisionTagSchema]),\n\tChangesetLocalIdSchema,\n]);\nexport type EncodedChangeAtomId = Static<typeof EncodedChangeAtomId>;\n\nconst EncodedFieldChange = Type.Object(\n\t{\n\t\tfieldKey: schemaFormatV1.FieldKeySchema,\n\t\tfieldKind: schemaFormatV1.FieldKindIdentifierSchema,\n\t\t// Implementation note: node and field change encoding is mutually recursive.\n\t\t// This field marks a boundary in that recursion to avoid constructing excessively complex\n\t\t// recursive types. Encoded changes are validated at this boundary at runtime--see modularChangeCodecs.ts.\n\t\tchange: JsonCompatibleReadOnlySchema,\n\t},\n\tnoAdditionalProps,\n);\n\nexport interface EncodedFieldChange extends Static<typeof EncodedFieldChange> {\n\t/**\n\t * Encoded in format selected by `fieldKind`\n\t */\n\tchange: JsonCompatibleReadOnly;\n}\n\nconst EncodedFieldChangeMap = Type.Array(EncodedFieldChange);\n\n/**\n * Format for encoding as json.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n */\nexport type EncodedFieldChangeMap = Static<typeof EncodedFieldChangeMap>;\n\nconst EncodedNodeExistsConstraint = Type.Object(\n\t{\n\t\tviolated: Type.Boolean(),\n\t},\n\tnoAdditionalProps,\n);\ntype EncodedNodeExistsConstraint = Static<typeof EncodedNodeExistsConstraint>;\n\nexport const EncodedNodeChangeset = Type.Object(\n\t{\n\t\tfieldChanges: Type.Optional(EncodedFieldChangeMap),\n\t\tnodeExistsConstraint: Type.Optional(EncodedNodeExistsConstraint),\n\t},\n\tnoAdditionalProps,\n);\n\n/**\n * Format for encoding as json.\n */\nexport type EncodedNodeChangeset = Static<typeof EncodedNodeChangeset>;\n\nexport const EncodedRevisionInfo = Type.Object(\n\t{\n\t\trevision: Type.Readonly(RevisionTagSchema),\n\t\trollbackOf: Type.ReadonlyOptional(RevisionTagSchema),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedRevisionInfo = Static<typeof EncodedRevisionInfo>;\n\n/**\n * Index of field in an EncodedFieldBatch.\n */\nexport const EncodedTreeIndex = Type.Number({ multipleOf: 1, minimum: 0 });\n\nexport const CommitBuilds = Type.Array(\n\tType.Tuple([\n\t\t// ID for first node\n\t\tChangesetLocalIdSchema,\n\t\t// Index for a TreeChunk that represents all the nodes\n\t\tEncodedTreeIndex,\n\t]),\n);\nexport type CommitBuilds = Static<typeof CommitBuilds>;\n\nexport const EncodedBuildsArray = Type.Array(\n\tType.Union([\n\t\tType.Tuple([CommitBuilds, RevisionTagSchema]),\n\t\t// Revision is omitted when undefined\n\t\tType.Tuple([CommitBuilds]),\n\t]),\n);\n\nexport type EncodedBuildsArray = Static<typeof EncodedBuildsArray>;\n\nexport const EncodedBuilds = Type.Object(\n\t{\n\t\tbuilds: EncodedBuildsArray,\n\t\t/**\n\t\t * Fields indexed by the EncodedTreeIndexes above.\n\t\t * TODO: Strongly typing this here may result in redundant schema validation of this data.\n\t\t */\n\t\ttrees: EncodedFieldBatch,\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedBuilds = Static<typeof EncodedBuilds>;\n\nexport const EncodedModularChangeset = Type.Object(\n\t{\n\t\tmaxId: Type.Optional(ChangesetLocalIdSchema),\n\t\tchanges: EncodedFieldChangeMap,\n\t\trevisions: Type.ReadonlyOptional(Type.Array(EncodedRevisionInfo)),\n\t\t// TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.\n\t\t// This can lead to a less efficient wire representation because of duplicated schema/shape information.\n\t\tbuilds: Type.Optional(EncodedBuilds),\n\t\trefreshers: Type.Optional(EncodedBuilds),\n\t\t/**\n\t\t * The number of constraints within this changeset that are violated.\n\t\t */\n\t\tviolations: Type.Optional(Type.Number({ minimum: 0, multipleOf: 1 })),\n\t},\n\tnoAdditionalProps,\n);\n\nexport type EncodedModularChangeset = Static<typeof EncodedModularChangeset>;\n"]}
@@ -2,7 +2,20 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ICodecFamily, type ICodecOptions } from "../../codec/index.js";
5
+ import { type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
6
+ import { SchemaCodecVersion } from "../schema-index/index.js";
6
7
  import type { SchemaChange } from "./schemaChangeTypes.js";
8
+ /**
9
+ * Create a family of schema change codecs.
10
+ * @param options - Specifies common codec options, including which `validator` to use.
11
+ * @returns The composed codec family.
12
+ */
7
13
  export declare function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange>;
14
+ /**
15
+ * Create a schema change codec.
16
+ * @param options - Specifies common codec options, including which `validator` to use.
17
+ * @param writeVersion - The schema change write version.
18
+ * @returns The composed codec.
19
+ */
20
+ export declare function makeSchemaChangeCodec(options: ICodecOptions, writeVersion: SchemaCodecVersion): IJsonCodec<SchemaChange>;
8
21
  //# sourceMappingURL=schemaChangeCodecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAIlB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAEzF"}
1
+ {"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEN,kBAAkB,EAElB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC,YAAY,CAAC,CAEzF;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,kBAAkB,GAC9B,UAAU,CAAC,YAAY,CAAC,CAG1B"}
@@ -4,17 +4,38 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.makeSchemaChangeCodecs = void 0;
7
+ exports.makeSchemaChangeCodec = exports.makeSchemaChangeCodecs = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../schema-index/index.js");
11
11
  const schemaChangeFormat_js_1 = require("./schemaChangeFormat.js");
12
+ /**
13
+ * Create a family of schema change codecs.
14
+ * @param options - Specifies common codec options, including which `validator` to use.
15
+ * @returns The composed codec family.
16
+ */
12
17
  function makeSchemaChangeCodecs(options) {
13
- return (0, index_js_1.makeCodecFamily)([[1, makeSchemaChangeCodec(options)]]);
18
+ return (0, index_js_1.makeCodecFamily)([[index_js_2.SchemaCodecVersion.v1, makeSchemaChangeCodecV1(options)]]);
14
19
  }
15
20
  exports.makeSchemaChangeCodecs = makeSchemaChangeCodecs;
16
- function makeSchemaChangeCodec({ jsonValidator: validator, }) {
17
- const schemaCodec = (0, index_js_2.makeSchemaCodec)({ jsonValidator: validator });
21
+ /**
22
+ * Create a schema change codec.
23
+ * @param options - Specifies common codec options, including which `validator` to use.
24
+ * @param writeVersion - The schema change write version.
25
+ * @returns The composed codec.
26
+ */
27
+ function makeSchemaChangeCodec(options, writeVersion) {
28
+ const family = makeSchemaChangeCodecs(options);
29
+ return (0, index_js_1.makeVersionDispatchingCodec)(family, { ...options, writeVersion });
30
+ }
31
+ exports.makeSchemaChangeCodec = makeSchemaChangeCodec;
32
+ /**
33
+ * Compose the v1 schema change codec.
34
+ * @param options - The codec options.
35
+ * @returns The composed schema change codec.
36
+ */
37
+ function makeSchemaChangeCodecV1(options) {
38
+ const schemaCodec = (0, index_js_2.makeSchemaCodec)(options, index_js_2.SchemaCodecVersion.v1);
18
39
  const schemaChangeCodec = {
19
40
  encode: (schemaChange) => {
20
41
  (0, internal_1.assert)(!schemaChange.isInverse, 0x933 /* Inverse schema changes should never be transmitted */);
@@ -34,6 +55,6 @@ function makeSchemaChangeCodec({ jsonValidator: validator, }) {
34
55
  },
35
56
  encodedSchema: schemaChangeFormat_js_1.EncodedSchemaChange,
36
57
  };
37
- return (0, index_js_1.withSchemaValidation)(schemaChangeFormat_js_1.EncodedSchemaChange, schemaChangeCodec, validator);
58
+ return (0, index_js_1.withSchemaValidation)(schemaChangeFormat_js_1.EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);
38
59
  }
39
60
  //# sourceMappingURL=schemaChangeCodecs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,mDAM8B;AAC9B,uDAA2D;AAE3D,mEAA8D;AAG9D,SAAgB,sBAAsB,CAAC,OAAsB;IAC5D,OAAO,IAAA,0BAAe,EAAC,CAAC,CAAC,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;AAFD,wDAEC;AAED,SAAS,qBAAqB,CAAC,EAC9B,aAAa,EAAE,SAAS,GACT;IACf,MAAM,WAAW,GAAG,IAAA,0BAAe,EAAC,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;IAClE,MAAM,iBAAiB,GAAkD;QACxE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,IAAA,iBAAM,EACL,CAAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;gBAChD,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;aAChD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,2CAAmB;KAClC,CAAC;IAEF,OAAO,IAAA,+BAAoB,EAAC,2CAAmB,EAAE,iBAAiB,EAAE,SAAS,CAAC,CAAC;AAChF,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\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { makeSchemaCodec } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\n\nexport function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([[1, makeSchemaChangeCodec(options)]]);\n}\n\nfunction makeSchemaChangeCodec({\n\tjsonValidator: validator,\n}: ICodecOptions): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec({ jsonValidator: validator });\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, validator);\n}\n"]}
1
+ {"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,mDAO8B;AAC9B,uDAIkC;AAElC,mEAA8D;AAG9D;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,OAAsB;IAC5D,OAAO,IAAA,0BAAe,EAAC,CAAC,CAAC,6BAAkB,CAAC,EAAE,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC;AAFD,wDAEC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CACpC,OAAsB,EACtB,YAAgC;IAEhC,MAAM,MAAM,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,IAAA,sCAA2B,EAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;AAC1E,CAAC;AAND,sDAMC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAC/B,OAAsB;IAEtB,MAAM,WAAW,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,6BAAkB,CAAC,EAAE,CAAC,CAAC;IACpE,MAAM,iBAAiB,GAAkD;QACxE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE;YACxB,IAAA,iBAAM,EACL,CAAC,YAAY,CAAC,SAAS,EACvB,KAAK,CAAC,wDAAwD,CAC9D,CAAC;YACF,OAAO;gBACN,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAa;gBAC5D,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAa;aAC5D,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;YACnB,OAAO;gBACN,MAAM,EAAE;oBACP,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;oBACpC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,2CAAmB;KAClC,CAAC;IAEF,OAAO,IAAA,+BAAoB,EAAC,2CAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,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\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport {\n\tmakeSchemaCodec,\n\tSchemaCodecVersion,\n\ttype Format as FormatV1,\n} from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(options: ICodecOptions): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([[SchemaCodecVersion.v1, makeSchemaChangeCodecV1(options)]]);\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: ICodecOptions,\n\twriteVersion: SchemaCodecVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the v1 schema change codec.\n * @param options - The codec options.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: ICodecOptions,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, SchemaCodecVersion.v1);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new) as FormatV1,\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old) as FormatV1,\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
@@ -15,7 +15,7 @@ export declare const EncodedSchemaChange: import("@sinclair/typebox").TObject<{
15
15
  kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
16
16
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
17
17
  }>>;
18
- leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/format.js").PersistedValueSchema>>;
18
+ leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/formatV1.js").PersistedValueSchema>>;
19
19
  }>>;
20
20
  root: import("@sinclair/typebox").TObject<{
21
21
  kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
@@ -33,7 +33,7 @@ export declare const EncodedSchemaChange: import("@sinclair/typebox").TObject<{
33
33
  kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
34
34
  types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<import("../../core/index.js").TreeNodeSchemaIdentifier<string>>>;
35
35
  }>>;
36
- leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/format.js").PersistedValueSchema>>;
36
+ leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof import("../../core/schema-stored/formatV1.js").PersistedValueSchema>>;
37
37
  }>>;
38
38
  root: import("@sinclair/typebox").TObject<{
39
39
  kind: import("@sinclair/typebox").TUnsafe<import("../../core/index.js").FieldKindIdentifier>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAItD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
1
+ {"version":3,"file":"schemaChangeFormat.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG9B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schemaChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAsD;AAEtD,uDAAkD;AAErC,QAAA,mBAAmB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,iBAAM;IACX,GAAG,EAAE,iBAAM;CACX,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { Format } from \"../schema-index/index.js\";\n\nexport const EncodedSchemaChange = Type.Object({\n\tnew: Format,\n\told: Format,\n});\n\nexport type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;\n"]}
1
+ {"version":3,"file":"schemaChangeFormat.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAAsD;AACtD,uDAA8D;AAEjD,QAAA,mBAAmB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC9C,GAAG,EAAE,iBAAQ;IACb,GAAG,EAAE,iBAAQ;CACb,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { Format as FormatV1 } from \"../schema-index/index.js\";\n\nexport const EncodedSchemaChange = Type.Object({\n\tnew: FormatV1,\n\told: FormatV1,\n});\n\nexport type EncodedSchemaChange = Static<typeof EncodedSchemaChange>;\n"]}
@@ -2,12 +2,41 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
5
+ import { type FluidClientVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../../codec/index.js";
6
6
  import { type TreeStoredSchema } from "../../core/index.js";
7
- import { Format } from "./format.js";
8
- export declare function encodeRepo(repo: TreeStoredSchema): Format;
7
+ import { type JsonCompatible } from "../../util/index.js";
9
8
  /**
10
- * Creates a codec which performs synchronous monolithic encoding of schema content.
9
+ * Versions for the codec that encodes an in-memory representation of a stored schema {@link TreeStoredSchema} into a persisted format (or decodes it in the opposite direction).
11
10
  */
12
- export declare function makeSchemaCodec(options: ICodecOptions): IJsonCodec<TreeStoredSchema, Format>;
11
+ export declare enum SchemaCodecVersion {
12
+ v1 = 1
13
+ }
14
+ /**
15
+ * Convert a FluidClientVersion to a SchemaCodecVersion.
16
+ * @param clientVersion - The FluidClientVersion to convert.
17
+ * @returns The SchemaCodecVersion that corresponds to the provided FluidClientVersion.
18
+ */
19
+ export declare function clientVersionToSchemaVersion(clientVersion: FluidClientVersion): SchemaCodecVersion;
20
+ /**
21
+ * Create a schema codec.
22
+ * @param options - Specifies common codec options, including which `validator` to use.
23
+ * @param writeVersion - The schema write version.
24
+ * @returns The composed codec.
25
+ *
26
+ * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.
27
+ */
28
+ export declare function makeSchemaCodec(options: ICodecOptions, writeVersion: SchemaCodecVersion): IJsonCodec<TreeStoredSchema>;
29
+ /**
30
+ * Create a family of schema codecs.
31
+ * @param options - Specifies common codec options, including which `validator` to use.
32
+ * @returns The composed codec family.
33
+ */
34
+ export declare function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<TreeStoredSchema>;
35
+ /**
36
+ * Encode an in-memory TreeStoredSchema into the specified format version.
37
+ * @param repo - The in-memory schema.
38
+ * @param version - The schema write version.
39
+ * @returns The encoded schema.
40
+ */
41
+ export declare function encodeRepo(repo: TreeStoredSchema, version: SchemaCodecVersion): JsonCompatible;
13
42
  //# sourceMappingURL=codec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGN,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAkBzD;AAaD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,UAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAK5F"}
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGN,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIjE;;GAEG;AACH,oBAAY,kBAAkB;IAC7B,EAAE,IAAI;CACN;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC3C,aAAa,EAAE,kBAAkB,GAC/B,kBAAkB,CAGpB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,kBAAkB,GAC9B,UAAU,CAAC,gBAAgB,CAAC,CAG9B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAEvF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,kBAAkB,GACzB,cAAc,CAOhB"}
@@ -4,13 +4,67 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.makeSchemaCodec = exports.encodeRepo = void 0;
7
+ exports.encodeRepo = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.clientVersionToSchemaVersion = exports.SchemaCodecVersion = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../codec/index.js");
10
10
  const index_js_2 = require("../../core/index.js");
11
11
  const index_js_3 = require("../../util/index.js");
12
- const format_js_1 = require("./format.js");
13
- function encodeRepo(repo) {
12
+ const formatV1_js_1 = require("./formatV1.js");
13
+ /**
14
+ * Versions for the codec that encodes an in-memory representation of a stored schema {@link TreeStoredSchema} into a persisted format (or decodes it in the opposite direction).
15
+ */
16
+ var SchemaCodecVersion;
17
+ (function (SchemaCodecVersion) {
18
+ SchemaCodecVersion[SchemaCodecVersion["v1"] = 1] = "v1";
19
+ })(SchemaCodecVersion || (exports.SchemaCodecVersion = SchemaCodecVersion = {}));
20
+ /**
21
+ * Convert a FluidClientVersion to a SchemaCodecVersion.
22
+ * @param clientVersion - The FluidClientVersion to convert.
23
+ * @returns The SchemaCodecVersion that corresponds to the provided FluidClientVersion.
24
+ */
25
+ function clientVersionToSchemaVersion(clientVersion) {
26
+ // Only one version of the schema codec is currently supported.
27
+ return SchemaCodecVersion.v1;
28
+ }
29
+ exports.clientVersionToSchemaVersion = clientVersionToSchemaVersion;
30
+ /**
31
+ * Create a schema codec.
32
+ * @param options - Specifies common codec options, including which `validator` to use.
33
+ * @param writeVersion - The schema write version.
34
+ * @returns The composed codec.
35
+ *
36
+ * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.
37
+ */
38
+ function makeSchemaCodec(options, writeVersion) {
39
+ const family = makeSchemaCodecs(options);
40
+ return (0, index_js_1.makeVersionDispatchingCodec)(family, { ...options, writeVersion });
41
+ }
42
+ exports.makeSchemaCodec = makeSchemaCodec;
43
+ /**
44
+ * Create a family of schema codecs.
45
+ * @param options - Specifies common codec options, including which `validator` to use.
46
+ * @returns The composed codec family.
47
+ */
48
+ function makeSchemaCodecs(options) {
49
+ return (0, index_js_1.makeCodecFamily)([[SchemaCodecVersion.v1, makeSchemaCodecV1(options)]]);
50
+ }
51
+ exports.makeSchemaCodecs = makeSchemaCodecs;
52
+ /**
53
+ * Encode an in-memory TreeStoredSchema into the specified format version.
54
+ * @param repo - The in-memory schema.
55
+ * @param version - The schema write version.
56
+ * @returns The encoded schema.
57
+ */
58
+ function encodeRepo(repo, version) {
59
+ switch (version) {
60
+ case SchemaCodecVersion.v1:
61
+ return encodeRepoV1(repo);
62
+ default:
63
+ (0, internal_1.unreachableCase)(version);
64
+ }
65
+ }
66
+ exports.encodeRepo = encodeRepo;
67
+ function encodeRepoV1(repo) {
14
68
  const nodeSchema = Object.create(null);
15
69
  const rootFieldSchema = (0, index_js_2.encodeFieldSchema)(repo.rootFieldSchema);
16
70
  for (const name of [...repo.nodeSchema.keys()].sort()) {
@@ -23,12 +77,11 @@ function encodeRepo(repo) {
23
77
  });
24
78
  }
25
79
  return {
26
- version: index_js_2.schemaFormat.version,
80
+ version: index_js_2.schemaFormatV1.version,
27
81
  nodes: nodeSchema,
28
82
  root: rootFieldSchema,
29
83
  };
30
84
  }
31
- exports.encodeRepo = encodeRepo;
32
85
  function decode(f) {
33
86
  const nodeSchema = new Map();
34
87
  for (const [key, schema] of Object.entries(f.nodes)) {
@@ -41,12 +94,13 @@ function decode(f) {
41
94
  }
42
95
  /**
43
96
  * Creates a codec which performs synchronous monolithic encoding of schema content.
97
+ * @param options - Specifies common codec options, including which `validator` to use.
98
+ * @returns The codec.
44
99
  */
45
- function makeSchemaCodec(options) {
46
- return (0, index_js_1.makeVersionedValidatedCodec)(options, new Set([index_js_2.schemaFormat.version]), format_js_1.Format, {
47
- encode: (data) => encodeRepo(data),
100
+ function makeSchemaCodecV1(options) {
101
+ return (0, index_js_1.makeVersionedValidatedCodec)(options, new Set([index_js_2.schemaFormatV1.version]), formatV1_js_1.Format, {
102
+ encode: (data) => encodeRepoV1(data),
48
103
  decode: (data) => decode(data),
49
104
  });
50
105
  }
51
- exports.makeSchemaCodec = makeSchemaCodec;
52
106
  //# sourceMappingURL=codec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAC3D,mDAI8B;AAC9B,kDAQ6B;AAC7B,kDAA4C;AAE5C,2CAAqC;AAErC,SAAgB,UAAU,CAAC,IAAsB;IAChD,MAAM,UAAU,GACf,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACrB,MAAM,eAAe,GAAG,IAAA,4BAAiB,EAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAChE,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC7E,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE;YACvC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;SACtB,CAAC,CAAC;IACJ,CAAC;IACD,OAAO;QACN,OAAO,EAAE,uBAAY,CAAC,OAAO;QAC7B,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,eAAe;KACrB,CAAC;AACH,CAAC;AAlBD,gCAkBC;AAED,SAAS,MAAM,CAAC,CAAS;IACxB,MAAM,UAAU,GAAwD,IAAI,GAAG,EAAE,CAAC;IAClF,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACrD,UAAU,CAAC,GAAG,CAAC,IAAA,gBAAK,EAAC,GAAG,CAAC,EAAE,uCAA4B,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO;QACN,eAAe,EAAE,IAAA,4BAAiB,EAAC,CAAC,CAAC,IAAI,CAAC;QAC1C,UAAU;KACV,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,OAAsB;IACrD,OAAO,IAAA,sCAA2B,EAAC,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,uBAAY,CAAC,OAAO,CAAC,CAAC,EAAE,kBAAM,EAAE;QACpF,MAAM,EAAE,CAAC,IAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;QACpD,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;KACtC,CAAC,CAAC;AACJ,CAAC;AALD,0CAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport {\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tschemaFormat,\n\tstoredSchemaDecodeDispatcher,\n} from \"../../core/index.js\";\nimport { brand } from \"../../util/index.js\";\n\nimport { Format } from \"./format.js\";\n\nexport function encodeRepo(repo: TreeStoredSchema): Format {\n\tconst nodeSchema: Record<string, schemaFormat.TreeNodeSchemaDataFormat> =\n\t\tObject.create(null);\n\tconst rootFieldSchema = encodeFieldSchema(repo.rootFieldSchema);\n\tfor (const name of [...repo.nodeSchema.keys()].sort()) {\n\t\tconst schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);\n\t\tObject.defineProperty(nodeSchema, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: schema.encode(),\n\t\t});\n\t}\n\treturn {\n\t\tversion: schemaFormat.version,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\nfunction decode(f: Format): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tnodeSchema.set(brand(key), storedSchemaDecodeDispatcher.dispatch(schema));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n */\nexport function makeSchemaCodec(options: ICodecOptions): IJsonCodec<TreeStoredSchema, Format> {\n\treturn makeVersionedValidatedCodec(options, new Set([schemaFormat.version]), Format, {\n\t\tencode: (data: TreeStoredSchema) => encodeRepo(data),\n\t\tdecode: (data: Format) => decode(data),\n\t});\n}\n"]}
1
+ {"version":3,"file":"codec.js","sourceRoot":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AAC,YAAY,CAAC,IAAI,CAAC;QACtD,MAAM,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;KACxC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype FluidClientVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport {\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tdecodeFieldSchema,\n\tencodeFieldSchema,\n\tschemaFormatV1,\n\tstoredSchemaDecodeDispatcher,\n} from \"../../core/index.js\";\nimport { brand, type JsonCompatible } from \"../../util/index.js\";\n\nimport { Format as FormatV1 } from \"./formatV1.js\";\n\n/**\n * Versions for the codec that encodes an in-memory representation of a stored schema {@link TreeStoredSchema} into a persisted format (or decodes it in the opposite direction).\n */\nexport enum SchemaCodecVersion {\n\tv1 = 1,\n}\n\n/**\n * Convert a FluidClientVersion to a SchemaCodecVersion.\n * @param clientVersion - The FluidClientVersion to convert.\n * @returns The SchemaCodecVersion that corresponds to the provided FluidClientVersion.\n */\nexport function clientVersionToSchemaVersion(\n\tclientVersion: FluidClientVersion,\n): SchemaCodecVersion {\n\t// Only one version of the schema codec is currently supported.\n\treturn SchemaCodecVersion.v1;\n}\n\n/**\n * Create a schema codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema write version.\n * @returns The composed codec.\n *\n * @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.\n */\nexport function makeSchemaCodec(\n\toptions: ICodecOptions,\n\twriteVersion: SchemaCodecVersion,\n): IJsonCodec<TreeStoredSchema> {\n\tconst family = makeSchemaCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Create a family of schema codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<TreeStoredSchema> {\n\treturn makeCodecFamily([[SchemaCodecVersion.v1, makeSchemaCodecV1(options)]]);\n}\n\n/**\n * Encode an in-memory TreeStoredSchema into the specified format version.\n * @param repo - The in-memory schema.\n * @param version - The schema write version.\n * @returns The encoded schema.\n */\nexport function encodeRepo(\n\trepo: TreeStoredSchema,\n\tversion: SchemaCodecVersion,\n): JsonCompatible {\n\tswitch (version) {\n\t\tcase SchemaCodecVersion.v1:\n\t\t\treturn encodeRepoV1(repo);\n\t\tdefault:\n\t\t\tunreachableCase(version);\n\t}\n}\n\nfunction encodeRepoV1(repo: TreeStoredSchema): FormatV1 {\n\tconst nodeSchema: Record<string, schemaFormatV1.TreeNodeSchemaDataFormat> =\n\t\tObject.create(null);\n\tconst rootFieldSchema = encodeFieldSchema(repo.rootFieldSchema);\n\tfor (const name of [...repo.nodeSchema.keys()].sort()) {\n\t\tconst schema = repo.nodeSchema.get(name) ?? fail(0xb28 /* missing schema */);\n\t\tObject.defineProperty(nodeSchema, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\twritable: true,\n\t\t\tvalue: schema.encode(),\n\t\t});\n\t}\n\treturn {\n\t\tversion: schemaFormatV1.version,\n\t\tnodes: nodeSchema,\n\t\troot: rootFieldSchema,\n\t};\n}\n\nfunction decode(f: FormatV1): TreeStoredSchema {\n\tconst nodeSchema: Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema> = new Map();\n\tfor (const [key, schema] of Object.entries(f.nodes)) {\n\t\tnodeSchema.set(brand(key), storedSchemaDecodeDispatcher.dispatch(schema));\n\t}\n\treturn {\n\t\trootFieldSchema: decodeFieldSchema(f.root),\n\t\tnodeSchema,\n\t};\n}\n\n/**\n * Creates a codec which performs synchronous monolithic encoding of schema content.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The codec.\n */\nfunction makeSchemaCodecV1(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV1> {\n\treturn makeVersionedValidatedCodec(options, new Set([schemaFormatV1.version]), FormatV1, {\n\t\tencode: (data: TreeStoredSchema) => encodeRepoV1(data),\n\t\tdecode: (data: FormatV1) => decode(data),\n\t});\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type Static } from "@sinclair/typebox";
6
- import { schemaFormat } from "../../core/index.js";
6
+ import { schemaFormatV1 } from "../../core/index.js";
7
7
  /**
8
8
  * Format for encoding as json.
9
9
  *
@@ -18,19 +18,19 @@ export declare const Format: import("@sinclair/typebox").TObject<{
18
18
  version: import("@sinclair/typebox").TLiteral<1>;
19
19
  nodes: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
20
20
  object: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
21
- kind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
22
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>;
21
+ kind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
22
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
23
23
  }>>>;
24
24
  map: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
25
- kind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
26
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>;
25
+ kind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
26
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
27
27
  }>>;
28
- leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof schemaFormat.PersistedValueSchema>>;
28
+ leaf: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TEnum<typeof schemaFormatV1.PersistedValueSchema>>;
29
29
  }>>;
30
30
  root: import("@sinclair/typebox").TObject<{
31
- kind: import("@sinclair/typebox").TUnsafe<schemaFormat.FieldKindIdentifier>;
32
- types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormat.TreeNodeSchemaIdentifier<string>>>;
31
+ kind: import("@sinclair/typebox").TUnsafe<schemaFormatV1.FieldKindIdentifier>;
32
+ types: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnsafe<schemaFormatV1.TreeNodeSchemaIdentifier<string>>>;
33
33
  }>;
34
34
  }>;
35
35
  export type Format = Static<typeof Format>;
36
- //# sourceMappingURL=format.d.ts.map
36
+ //# sourceMappingURL=formatV1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatV1.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV1.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAsB,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrD;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;EAOlB,CAAC;AACF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC"}
@@ -19,8 +19,8 @@ const noAdditionalProps = { additionalProperties: false };
19
19
  * It also makes it simpler to determinately sort by keys.
20
20
  */
21
21
  exports.Format = typebox_1.Type.Object({
22
- version: typebox_1.Type.Literal(index_js_1.schemaFormat.version),
23
- nodes: typebox_1.Type.Record(typebox_1.Type.String(), index_js_1.schemaFormat.TreeNodeSchemaDataFormat),
24
- root: index_js_1.schemaFormat.FieldSchemaFormat,
22
+ version: typebox_1.Type.Literal(index_js_1.schemaFormatV1.version),
23
+ nodes: typebox_1.Type.Record(typebox_1.Type.String(), index_js_1.schemaFormatV1.TreeNodeSchemaDataFormat),
24
+ root: index_js_1.schemaFormatV1.FieldSchemaFormat,
25
25
  }, noAdditionalProps);
26
- //# sourceMappingURL=format.js.map
26
+ //# sourceMappingURL=formatV1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatV1.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/formatV1.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA0E;AAE1E,kDAAqD;AAErD,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE;;;;;;;;;GASG;AACU,QAAA,MAAM,GAAG,cAAI,CAAC,MAAM,CAChC;IACC,OAAO,EAAE,cAAI,CAAC,OAAO,CAAC,yBAAc,CAAC,OAAO,CAAC;IAC7C,KAAK,EAAE,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,yBAAc,CAAC,wBAAwB,CAAC;IAC1E,IAAI,EAAE,yBAAc,CAAC,iBAAiB;CACtC,EACD,iBAAiB,CACjB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ObjectOptions, type Static, Type } from \"@sinclair/typebox\";\n\nimport { schemaFormatV1 } from \"../../core/index.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n/**\n * Format for encoding as json.\n *\n * For consistency all lists are sorted and undefined values are omitted.\n *\n * This chooses to use lists of named objects instead of maps:\n * this choice is somewhat arbitrary, but avoids user data being used as object keys,\n * which can sometimes be an issue (for example handling that for \"__proto__\" can require care).\n * It also makes it simpler to determinately sort by keys.\n */\nexport const Format = Type.Object(\n\t{\n\t\tversion: Type.Literal(schemaFormatV1.version),\n\t\tnodes: Type.Record(Type.String(), schemaFormatV1.TreeNodeSchemaDataFormat),\n\t\troot: schemaFormatV1.FieldSchemaFormat,\n\t},\n\tnoAdditionalProps,\n);\nexport type Format = Static<typeof Format>;\n"]}
@@ -3,6 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export { SchemaSummarizer, encodeTreeSchema } from "./schemaSummarizer.js";
6
- export { makeSchemaCodec } from "./codec.js";
7
- export { Format } from "./format.js";
6
+ export { makeSchemaCodec, makeSchemaCodecs, SchemaCodecVersion, clientVersionToSchemaVersion, } from "./codec.js";
7
+ export { Format } from "./formatV1.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,GAC5B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}
@@ -4,12 +4,15 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.Format = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = void 0;
7
+ exports.Format = exports.clientVersionToSchemaVersion = exports.SchemaCodecVersion = exports.makeSchemaCodecs = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = void 0;
8
8
  var schemaSummarizer_js_1 = require("./schemaSummarizer.js");
9
9
  Object.defineProperty(exports, "SchemaSummarizer", { enumerable: true, get: function () { return schemaSummarizer_js_1.SchemaSummarizer; } });
10
10
  Object.defineProperty(exports, "encodeTreeSchema", { enumerable: true, get: function () { return schemaSummarizer_js_1.encodeTreeSchema; } });
11
11
  var codec_js_1 = require("./codec.js");
12
12
  Object.defineProperty(exports, "makeSchemaCodec", { enumerable: true, get: function () { return codec_js_1.makeSchemaCodec; } });
13
- var format_js_1 = require("./format.js");
14
- Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return format_js_1.Format; } });
13
+ Object.defineProperty(exports, "makeSchemaCodecs", { enumerable: true, get: function () { return codec_js_1.makeSchemaCodecs; } });
14
+ Object.defineProperty(exports, "SchemaCodecVersion", { enumerable: true, get: function () { return codec_js_1.SchemaCodecVersion; } });
15
+ Object.defineProperty(exports, "clientVersionToSchemaVersion", { enumerable: true, get: function () { return codec_js_1.clientVersionToSchemaVersion; } });
16
+ var formatV1_js_1 = require("./formatV1.js");
17
+ Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return formatV1_js_1.Format; } });
15
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAA2E;AAAlE,uHAAA,gBAAgB,OAAA;AAAE,uHAAA,gBAAgB,OAAA;AAC3C,uCAA6C;AAApC,2GAAA,eAAe,OAAA;AACxB,yCAAqC;AAA5B,mGAAA,MAAM,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SchemaSummarizer, encodeTreeSchema } from \"./schemaSummarizer.js\";\nexport { makeSchemaCodec } from \"./codec.js\";\nexport { Format } from \"./format.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAA2E;AAAlE,uHAAA,gBAAgB,OAAA;AAAE,uHAAA,gBAAgB,OAAA;AAC3C,uCAKoB;AAJnB,2GAAA,eAAe,OAAA;AACf,4GAAA,gBAAgB,OAAA;AAChB,8GAAA,kBAAkB,OAAA;AAClB,wHAAA,4BAA4B,OAAA;AAE7B,6CAAuC;AAA9B,qGAAA,MAAM,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { SchemaSummarizer, encodeTreeSchema } from \"./schemaSummarizer.js\";\nexport {\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tSchemaCodecVersion,\n\tclientVersionToSchemaVersion,\n} from \"./codec.js\";\nexport { Format } from \"./formatV1.js\";\n"]}
@@ -4,20 +4,20 @@
4
4
  */
5
5
  import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
6
6
  import type { IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
7
- import type { ICodecOptions } from "../../codec/index.js";
7
+ import type { IJsonCodec } from "../../codec/index.js";
8
8
  import { type MutableTreeStoredSchema, type TreeStoredSchema } from "../../core/index.js";
9
9
  import type { Summarizable, SummaryElementParser, SummaryElementStringifier } from "../../shared-tree-core/index.js";
10
10
  import type { CollabWindow } from "../incrementalSummarizationUtils.js";
11
- import type { Format } from "./format.js";
11
+ import type { JsonCompatible } from "../../util/index.js";
12
12
  /**
13
13
  * Provides methods for summarizing and loading a schema repository.
14
14
  */
15
15
  export declare class SchemaSummarizer implements Summarizable {
16
16
  private readonly schema;
17
- readonly key = "Schema";
18
17
  private readonly codec;
18
+ readonly key = "Schema";
19
19
  private schemaIndexLastChangedSeq;
20
- constructor(schema: MutableTreeStoredSchema, options: ICodecOptions, collabWindow: CollabWindow);
20
+ constructor(schema: MutableTreeStoredSchema, collabWindow: CollabWindow, codec: IJsonCodec<TreeStoredSchema>);
21
21
  getAttachSummary(stringify: SummaryElementStringifier, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext | undefined): ISummaryTreeWithStats;
22
22
  summarize(stringify: SummaryElementStringifier, fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext | undefined): Promise<ISummaryTreeWithStats>;
23
23
  load(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
@@ -28,5 +28,5 @@ export declare class SchemaSummarizer implements Summarizable {
28
28
  * @remarks
29
29
  * This can be used to help inspect schema for debugging, and to save a snapshot of schema to help detect and review changes to an applications schema.
30
30
  */
31
- export declare function encodeTreeSchema(schema: TreeStoredSchema): Format;
31
+ export declare function encodeTreeSchema(schema: TreeStoredSchema, writeVersion: number): JsonCompatible;
32
32
  //# sourceMappingURL=schemaSummarizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemaSummarizer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/schemaSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAE7F,OAAO,KAAK,EACX,sCAAsC,EACtC,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AAGtD,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,sBAAsB,CAAC;AACtE,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACX,YAAY,EACZ,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,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