@fluidframework/tree 2.33.1 → 2.40.0-336023

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 (315) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/api-report/tree.alpha.api.md +120 -50
  3. package/api-report/tree.beta.api.md +31 -27
  4. package/api-report/tree.legacy.alpha.api.md +24 -23
  5. package/api-report/tree.legacy.public.api.md +24 -23
  6. package/api-report/tree.public.api.md +24 -23
  7. package/dist/alpha.d.ts +16 -1
  8. package/dist/beta.d.ts +2 -0
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/internalTypes.d.ts +0 -1
  13. package/dist/internalTypes.d.ts.map +1 -1
  14. package/dist/internalTypes.js.map +1 -1
  15. package/dist/jsonDomainSchema.d.ts +2 -2
  16. package/dist/jsonDomainSchema.js +2 -2
  17. package/dist/jsonDomainSchema.js.map +1 -1
  18. package/dist/legacy.d.ts +2 -0
  19. package/dist/packageVersion.d.ts +1 -1
  20. package/dist/packageVersion.d.ts.map +1 -1
  21. package/dist/packageVersion.js +1 -1
  22. package/dist/packageVersion.js.map +1 -1
  23. package/dist/public.d.ts +2 -0
  24. package/dist/serializableDomainSchema.d.ts +3 -3
  25. package/dist/serializableDomainSchema.js +2 -2
  26. package/dist/serializableDomainSchema.js.map +1 -1
  27. package/dist/shared-tree/independentView.d.ts +1 -1
  28. package/dist/shared-tree/independentView.js.map +1 -1
  29. package/dist/shared-tree/index.d.ts +3 -2
  30. package/dist/shared-tree/index.d.ts.map +1 -1
  31. package/dist/shared-tree/index.js +4 -4
  32. package/dist/shared-tree/index.js.map +1 -1
  33. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  34. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  35. package/dist/shared-tree/schematizeTree.js +2 -3
  36. package/dist/shared-tree/schematizeTree.js.map +1 -1
  37. package/dist/shared-tree/schematizingTreeView.d.ts +3 -3
  38. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  39. package/dist/shared-tree/schematizingTreeView.js +4 -4
  40. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  41. package/dist/shared-tree/{treeApi.d.ts → tree.d.ts} +34 -34
  42. package/dist/shared-tree/tree.d.ts.map +1 -0
  43. package/dist/shared-tree/{treeApi.js → tree.js} +6 -6
  44. package/dist/shared-tree/tree.js.map +1 -0
  45. package/dist/shared-tree/{treeApiAlpha.d.ts → treeAlpha.d.ts} +22 -14
  46. package/dist/shared-tree/treeAlpha.d.ts.map +1 -0
  47. package/dist/shared-tree/{treeApiAlpha.js → treeAlpha.js} +4 -3
  48. package/dist/shared-tree/treeAlpha.js.map +1 -0
  49. package/dist/simple-tree/api/conciseTree.d.ts +1 -1
  50. package/dist/simple-tree/api/conciseTree.js.map +1 -1
  51. package/dist/simple-tree/api/configuration.d.ts +177 -0
  52. package/dist/simple-tree/api/configuration.d.ts.map +1 -0
  53. package/dist/simple-tree/api/configuration.js +163 -0
  54. package/dist/simple-tree/api/configuration.js.map +1 -0
  55. package/dist/simple-tree/api/getJsonSchema.js +2 -2
  56. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  57. package/dist/simple-tree/api/index.d.ts +7 -4
  58. package/dist/simple-tree/api/index.d.ts.map +1 -1
  59. package/dist/simple-tree/api/index.js +8 -7
  60. package/dist/simple-tree/api/index.js.map +1 -1
  61. package/dist/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  62. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  63. package/dist/simple-tree/api/{view.js → schemaCompatibilityTester.js} +9 -9
  64. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  65. package/dist/simple-tree/api/schemaFactory.d.ts +16 -10
  66. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  67. package/dist/simple-tree/api/schemaFactory.js +20 -12
  68. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  69. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  70. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  71. package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
  72. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  73. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  74. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  75. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  76. package/dist/simple-tree/api/schemaFromSimple.d.ts +1 -1
  77. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  78. package/dist/simple-tree/api/schemaFromSimple.js +1 -1
  79. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  80. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  81. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  82. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  83. package/dist/simple-tree/api/storedSchema.d.ts +3 -3
  84. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  85. package/dist/simple-tree/api/storedSchema.js +3 -2
  86. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  87. package/dist/simple-tree/api/tree.d.ts +5 -174
  88. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  89. package/dist/simple-tree/api/tree.js +1 -156
  90. package/dist/simple-tree/api/tree.js.map +1 -1
  91. package/{lib/simple-tree/api/treeApiBeta.d.ts → dist/simple-tree/api/treeBeta.d.ts} +13 -5
  92. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -0
  93. package/dist/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  94. package/dist/simple-tree/api/treeBeta.js.map +1 -0
  95. package/dist/simple-tree/api/typesUnsafe.d.ts +4 -9
  96. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  97. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  98. package/dist/simple-tree/arrayNode.d.ts +2 -2
  99. package/dist/simple-tree/arrayNode.d.ts.map +1 -1
  100. package/dist/simple-tree/arrayNode.js +3 -2
  101. package/dist/simple-tree/arrayNode.js.map +1 -1
  102. package/dist/simple-tree/arrayNodeTypes.d.ts +3 -3
  103. package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  104. package/dist/simple-tree/arrayNodeTypes.js.map +1 -1
  105. package/dist/simple-tree/index.d.ts +3 -3
  106. package/dist/simple-tree/index.d.ts.map +1 -1
  107. package/dist/simple-tree/index.js +2 -2
  108. package/dist/simple-tree/index.js.map +1 -1
  109. package/dist/simple-tree/mapNode.d.ts +2 -2
  110. package/dist/simple-tree/mapNode.d.ts.map +1 -1
  111. package/dist/simple-tree/mapNode.js +1 -1
  112. package/dist/simple-tree/mapNode.js.map +1 -1
  113. package/dist/simple-tree/mapNodeTypes.d.ts +3 -3
  114. package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -1
  115. package/dist/simple-tree/mapNodeTypes.js.map +1 -1
  116. package/dist/simple-tree/objectNode.d.ts +18 -5
  117. package/dist/simple-tree/objectNode.d.ts.map +1 -1
  118. package/dist/simple-tree/objectNode.js +4 -3
  119. package/dist/simple-tree/objectNode.js.map +1 -1
  120. package/dist/simple-tree/objectNodeTypes.d.ts +4 -4
  121. package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
  122. package/dist/simple-tree/objectNodeTypes.js.map +1 -1
  123. package/dist/simple-tree/schemaTypes.d.ts +163 -13
  124. package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
  125. package/dist/simple-tree/schemaTypes.js +107 -8
  126. package/dist/simple-tree/schemaTypes.js.map +1 -1
  127. package/dist/simple-tree/treeNodeValid.js +2 -2
  128. package/dist/simple-tree/treeNodeValid.js.map +1 -1
  129. package/dist/tableSchema.d.ts +197 -86
  130. package/dist/tableSchema.d.ts.map +1 -1
  131. package/dist/tableSchema.js +100 -45
  132. package/dist/tableSchema.js.map +1 -1
  133. package/dist/util/typeUtils.d.ts +1 -1
  134. package/dist/util/typeUtils.js.map +1 -1
  135. package/lib/alpha.d.ts +16 -1
  136. package/lib/beta.d.ts +2 -0
  137. package/lib/index.d.ts +2 -2
  138. package/lib/index.d.ts.map +1 -1
  139. package/lib/index.js.map +1 -1
  140. package/lib/internalTypes.d.ts +0 -1
  141. package/lib/internalTypes.d.ts.map +1 -1
  142. package/lib/internalTypes.js.map +1 -1
  143. package/lib/jsonDomainSchema.d.ts +2 -2
  144. package/lib/jsonDomainSchema.js +2 -2
  145. package/lib/jsonDomainSchema.js.map +1 -1
  146. package/lib/legacy.d.ts +2 -0
  147. package/lib/packageVersion.d.ts +1 -1
  148. package/lib/packageVersion.d.ts.map +1 -1
  149. package/lib/packageVersion.js +1 -1
  150. package/lib/packageVersion.js.map +1 -1
  151. package/lib/public.d.ts +2 -0
  152. package/lib/serializableDomainSchema.d.ts +3 -3
  153. package/lib/serializableDomainSchema.js +2 -2
  154. package/lib/serializableDomainSchema.js.map +1 -1
  155. package/lib/shared-tree/independentView.d.ts +1 -1
  156. package/lib/shared-tree/independentView.js.map +1 -1
  157. package/lib/shared-tree/index.d.ts +3 -2
  158. package/lib/shared-tree/index.d.ts.map +1 -1
  159. package/lib/shared-tree/index.js +2 -2
  160. package/lib/shared-tree/index.js.map +1 -1
  161. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  162. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  163. package/lib/shared-tree/schematizeTree.js +2 -3
  164. package/lib/shared-tree/schematizeTree.js.map +1 -1
  165. package/lib/shared-tree/schematizingTreeView.d.ts +3 -3
  166. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  167. package/lib/shared-tree/schematizingTreeView.js +5 -5
  168. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  169. package/lib/shared-tree/{treeApi.d.ts → tree.d.ts} +34 -34
  170. package/lib/shared-tree/tree.d.ts.map +1 -0
  171. package/lib/shared-tree/{treeApi.js → tree.js} +5 -5
  172. package/lib/shared-tree/tree.js.map +1 -0
  173. package/lib/shared-tree/{treeApiAlpha.d.ts → treeAlpha.d.ts} +22 -14
  174. package/lib/shared-tree/treeAlpha.d.ts.map +1 -0
  175. package/lib/shared-tree/{treeApiAlpha.js → treeAlpha.js} +4 -3
  176. package/lib/shared-tree/treeAlpha.js.map +1 -0
  177. package/lib/simple-tree/api/conciseTree.d.ts +1 -1
  178. package/lib/simple-tree/api/conciseTree.js.map +1 -1
  179. package/lib/simple-tree/api/configuration.d.ts +177 -0
  180. package/lib/simple-tree/api/configuration.d.ts.map +1 -0
  181. package/lib/simple-tree/api/configuration.js +157 -0
  182. package/lib/simple-tree/api/configuration.js.map +1 -0
  183. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  184. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  185. package/lib/simple-tree/api/index.d.ts +7 -4
  186. package/lib/simple-tree/api/index.d.ts.map +1 -1
  187. package/lib/simple-tree/api/index.js +4 -3
  188. package/lib/simple-tree/api/index.js.map +1 -1
  189. package/lib/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
  190. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
  191. package/lib/simple-tree/api/{view.js → schemaCompatibilityTester.js} +7 -7
  192. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
  193. package/lib/simple-tree/api/schemaFactory.d.ts +16 -10
  194. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  195. package/lib/simple-tree/api/schemaFactory.js +20 -12
  196. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  197. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
  198. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  199. package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
  200. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  201. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
  202. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  203. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  204. package/lib/simple-tree/api/schemaFromSimple.d.ts +1 -1
  205. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  206. package/lib/simple-tree/api/schemaFromSimple.js +1 -1
  207. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  208. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
  209. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  210. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  211. package/lib/simple-tree/api/storedSchema.d.ts +3 -3
  212. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  213. package/lib/simple-tree/api/storedSchema.js +3 -2
  214. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  215. package/lib/simple-tree/api/tree.d.ts +5 -174
  216. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  217. package/lib/simple-tree/api/tree.js +0 -152
  218. package/lib/simple-tree/api/tree.js.map +1 -1
  219. package/{dist/simple-tree/api/treeApiBeta.d.ts → lib/simple-tree/api/treeBeta.d.ts} +13 -5
  220. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -0
  221. package/lib/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
  222. package/lib/simple-tree/api/treeBeta.js.map +1 -0
  223. package/lib/simple-tree/api/typesUnsafe.d.ts +4 -9
  224. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  225. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  226. package/lib/simple-tree/arrayNode.d.ts +2 -2
  227. package/lib/simple-tree/arrayNode.d.ts.map +1 -1
  228. package/lib/simple-tree/arrayNode.js +4 -3
  229. package/lib/simple-tree/arrayNode.js.map +1 -1
  230. package/lib/simple-tree/arrayNodeTypes.d.ts +3 -3
  231. package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -1
  232. package/lib/simple-tree/arrayNodeTypes.js.map +1 -1
  233. package/lib/simple-tree/index.d.ts +3 -3
  234. package/lib/simple-tree/index.d.ts.map +1 -1
  235. package/lib/simple-tree/index.js +1 -1
  236. package/lib/simple-tree/index.js.map +1 -1
  237. package/lib/simple-tree/mapNode.d.ts +2 -2
  238. package/lib/simple-tree/mapNode.d.ts.map +1 -1
  239. package/lib/simple-tree/mapNode.js +2 -2
  240. package/lib/simple-tree/mapNode.js.map +1 -1
  241. package/lib/simple-tree/mapNodeTypes.d.ts +3 -3
  242. package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -1
  243. package/lib/simple-tree/mapNodeTypes.js.map +1 -1
  244. package/lib/simple-tree/objectNode.d.ts +18 -5
  245. package/lib/simple-tree/objectNode.d.ts.map +1 -1
  246. package/lib/simple-tree/objectNode.js +5 -4
  247. package/lib/simple-tree/objectNode.js.map +1 -1
  248. package/lib/simple-tree/objectNodeTypes.d.ts +4 -4
  249. package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
  250. package/lib/simple-tree/objectNodeTypes.js.map +1 -1
  251. package/lib/simple-tree/schemaTypes.d.ts +163 -13
  252. package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
  253. package/lib/simple-tree/schemaTypes.js +96 -8
  254. package/lib/simple-tree/schemaTypes.js.map +1 -1
  255. package/lib/simple-tree/treeNodeValid.js +2 -2
  256. package/lib/simple-tree/treeNodeValid.js.map +1 -1
  257. package/lib/tableSchema.d.ts +197 -86
  258. package/lib/tableSchema.d.ts.map +1 -1
  259. package/lib/tableSchema.js +100 -45
  260. package/lib/tableSchema.js.map +1 -1
  261. package/lib/util/typeUtils.d.ts +1 -1
  262. package/lib/util/typeUtils.js.map +1 -1
  263. package/package.json +20 -20
  264. package/src/index.ts +17 -1
  265. package/src/internalTypes.ts +0 -2
  266. package/src/jsonDomainSchema.ts +2 -2
  267. package/src/packageVersion.ts +1 -1
  268. package/src/serializableDomainSchema.ts +3 -3
  269. package/src/shared-tree/independentView.ts +1 -1
  270. package/src/shared-tree/index.ts +3 -6
  271. package/src/shared-tree/schematizeTree.ts +5 -5
  272. package/src/shared-tree/schematizingTreeView.ts +11 -8
  273. package/src/shared-tree/{treeApi.ts → tree.ts} +51 -51
  274. package/src/shared-tree/{treeApiAlpha.ts → treeAlpha.ts} +22 -13
  275. package/src/simple-tree/api/conciseTree.ts +1 -1
  276. package/src/simple-tree/api/configuration.ts +353 -0
  277. package/src/simple-tree/api/getJsonSchema.ts +1 -1
  278. package/src/simple-tree/api/index.ts +21 -15
  279. package/src/simple-tree/api/{view.ts → schemaCompatibilityTester.ts} +8 -15
  280. package/src/simple-tree/api/schemaFactory.ts +130 -19
  281. package/src/simple-tree/api/schemaFactoryAlpha.ts +7 -5
  282. package/src/simple-tree/api/schemaFactoryRecursive.ts +102 -38
  283. package/src/simple-tree/api/schemaFromSimple.ts +2 -2
  284. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
  285. package/src/simple-tree/api/storedSchema.ts +8 -4
  286. package/src/simple-tree/api/tree.ts +13 -354
  287. package/src/simple-tree/api/{treeApiBeta.ts → treeBeta.ts} +17 -5
  288. package/src/simple-tree/api/typesUnsafe.ts +15 -11
  289. package/src/simple-tree/arrayNode.ts +10 -5
  290. package/src/simple-tree/arrayNodeTypes.ts +8 -7
  291. package/src/simple-tree/index.ts +17 -1
  292. package/src/simple-tree/mapNode.ts +11 -3
  293. package/src/simple-tree/mapNodeTypes.ts +10 -7
  294. package/src/simple-tree/objectNode.ts +39 -15
  295. package/src/simple-tree/objectNodeTypes.ts +9 -5
  296. package/src/simple-tree/schemaTypes.ts +353 -25
  297. package/src/simple-tree/treeNodeValid.ts +2 -2
  298. package/src/tableSchema.ts +749 -445
  299. package/src/util/typeUtils.ts +1 -1
  300. package/dist/shared-tree/treeApi.d.ts.map +0 -1
  301. package/dist/shared-tree/treeApi.js.map +0 -1
  302. package/dist/shared-tree/treeApiAlpha.d.ts.map +0 -1
  303. package/dist/shared-tree/treeApiAlpha.js.map +0 -1
  304. package/dist/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  305. package/dist/simple-tree/api/treeApiBeta.js.map +0 -1
  306. package/dist/simple-tree/api/view.d.ts.map +0 -1
  307. package/dist/simple-tree/api/view.js.map +0 -1
  308. package/lib/shared-tree/treeApi.d.ts.map +0 -1
  309. package/lib/shared-tree/treeApi.js.map +0 -1
  310. package/lib/shared-tree/treeApiAlpha.d.ts.map +0 -1
  311. package/lib/shared-tree/treeApiAlpha.js.map +0 -1
  312. package/lib/simple-tree/api/treeApiBeta.d.ts.map +0 -1
  313. package/lib/simple-tree/api/treeApiBeta.js.map +0 -1
  314. package/lib/simple-tree/api/view.d.ts.map +0 -1
  315. package/lib/simple-tree/api/view.js.map +0 -1
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ /*!
3
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
4
+ * Licensed under the MIT License.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.checkUnion = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = void 0;
8
+ const internal_1 = require("@fluidframework/core-utils/internal");
9
+ const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
+ const schemaTypes_js_1 = require("../schemaTypes.js");
11
+ const index_js_1 = require("../core/index.js");
12
+ const toStoredSchema_js_1 = require("../toStoredSchema.js");
13
+ const leafNodeSchema_js_1 = require("../leafNodeSchema.js");
14
+ const objectNodeTypes_js_1 = require("../objectNodeTypes.js");
15
+ const index_js_2 = require("../../util/index.js");
16
+ const walkFieldSchema_js_1 = require("../walkFieldSchema.js");
17
+ const defaultTreeConfigurationOptions = {
18
+ enableSchemaValidation: false,
19
+ preventAmbiguity: false,
20
+ };
21
+ /**
22
+ * Configuration for {@link ViewableTree.viewWith}.
23
+ * @sealed @public
24
+ */
25
+ class TreeViewConfiguration {
26
+ /**
27
+ * Construct a new {@link TreeViewConfiguration}.
28
+ *
29
+ * @param props - Property bag of configuration options.
30
+ *
31
+ * @remarks
32
+ * Performing this construction deeply validates the provided schema.
33
+ * This means that when this constructor is called, all {@link LazyItem} {@link TreeNodeSchema} references will be evaluated (using {@link evaluateLazySchema}).
34
+ * This means that the declarations for all transitively reachable {@link TreeNodeSchema} must be available at this time.
35
+ *
36
+ * For example, a schema reachable from this configuration cannot reference this configuration during its declaration,
37
+ * since this would be a cyclic dependency that will cause an error when constructing this configuration.
38
+ */
39
+ constructor(props) {
40
+ const config = { ...defaultTreeConfigurationOptions, ...props };
41
+ this.schema = config.schema;
42
+ this.enableSchemaValidation = config.enableSchemaValidation;
43
+ this.preventAmbiguity = config.preventAmbiguity;
44
+ // Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.
45
+ const ambiguityErrors = [];
46
+ (0, walkFieldSchema_js_1.walkFieldSchema)(config.schema, {
47
+ // Ensure all reachable schema are marked as most derived.
48
+ // This ensures if multiple schema extending the same schema factory generated class are present (or have been constructed, or get constructed in the future),
49
+ // an error is reported.
50
+ node: (schema) => (0, schemaTypes_js_1.markSchemaMostDerived)(schema, true),
51
+ allowedTypes(types) {
52
+ if (config.preventAmbiguity) {
53
+ checkUnion(types, ambiguityErrors);
54
+ }
55
+ },
56
+ });
57
+ if (ambiguityErrors.length !== 0) {
58
+ // Duplicate errors are common since when two types conflict, both orders error:
59
+ const deduplicated = new Set(ambiguityErrors);
60
+ throw new internal_2.UsageError(`Ambiguous schema found:\n${[...deduplicated].join("\n")}`);
61
+ }
62
+ // Eagerly perform this conversion to surface errors sooner.
63
+ (0, toStoredSchema_js_1.toStoredSchema)(config.schema);
64
+ }
65
+ }
66
+ exports.TreeViewConfiguration = TreeViewConfiguration;
67
+ /**
68
+ * {@link TreeViewConfiguration} extended with some alpha APIs.
69
+ * @sealed @alpha
70
+ */
71
+ class TreeViewConfigurationAlpha extends TreeViewConfiguration {
72
+ constructor(props) {
73
+ super(props);
74
+ this.root = (0, schemaTypes_js_1.normalizeFieldSchema)(props.schema);
75
+ const definitions = new Map();
76
+ (0, walkFieldSchema_js_1.walkFieldSchema)(props.schema, {
77
+ node: (schema) => definitions.set(schema.identifier, schema),
78
+ });
79
+ this.definitions = definitions;
80
+ }
81
+ }
82
+ exports.TreeViewConfigurationAlpha = TreeViewConfigurationAlpha;
83
+ /**
84
+ * Pretty print a set of types for use in error messages.
85
+ */
86
+ function formatTypes(allowed) {
87
+ // Use JSON.stringify to quote and escape identifiers.
88
+ // Don't just use a single array JSON.stringify since that omits spaces between items
89
+ return `[${Array.from(allowed, (s) => JSON.stringify(s.identifier)).join(", ")}]`;
90
+ }
91
+ /**
92
+ * Detect cases documented in {@link ITreeConfigurationOptions.preventAmbiguity}.
93
+ */
94
+ function checkUnion(union, errors) {
95
+ const checked = new Set();
96
+ const maps = [];
97
+ const arrays = [];
98
+ const objects = [];
99
+ // Map from key to schema using that key
100
+ const allObjectKeys = new Map();
101
+ for (const schema of union) {
102
+ if (checked.has(schema)) {
103
+ throw new internal_2.UsageError(`Duplicate schema in allowed types: ${schema.identifier}`);
104
+ }
105
+ checked.add(schema);
106
+ if (schema instanceof leafNodeSchema_js_1.LeafNodeSchema) {
107
+ // nothing to do
108
+ }
109
+ else if ((0, objectNodeTypes_js_1.isObjectNodeSchema)(schema)) {
110
+ objects.push(schema);
111
+ for (const key of schema.fields.keys()) {
112
+ (0, index_js_2.getOrCreate)(allObjectKeys, key, () => new Set()).add(schema);
113
+ }
114
+ }
115
+ else if (schema.kind === index_js_1.NodeKind.Array) {
116
+ arrays.push(schema);
117
+ }
118
+ else {
119
+ (0, internal_1.assert)(schema.kind === index_js_1.NodeKind.Map, 0x9e7 /* invalid schema */);
120
+ maps.push(schema);
121
+ }
122
+ }
123
+ if (arrays.length > 1) {
124
+ errors.push(`More than one kind of array allowed within union (${formatTypes(arrays)}). This would require type disambiguation which is not supported by arrays during import or export.`);
125
+ }
126
+ if (maps.length > 1) {
127
+ errors.push(`More than one kind of map allowed within union (${formatTypes(maps)}). This would require type disambiguation which is not supported by maps during import or export.`);
128
+ }
129
+ if (maps.length > 0 && arrays.length > 0) {
130
+ errors.push(`Both a map and an array allowed within union (${formatTypes([...arrays, ...maps])}). Both can be implicitly constructed from iterables like arrays, which are ambiguous when the array is empty.`);
131
+ }
132
+ if (objects.length > 0 && maps.length > 0) {
133
+ errors.push(`Both a object and a map allowed within union (${formatTypes([...objects, ...maps])}). Both can be constructed from objects and can be ambiguous.`);
134
+ }
135
+ // Check for objects which fully overlap:
136
+ for (const schema of objects) {
137
+ // All objects which might be ambiguous relative to `schema`.
138
+ const possiblyAmbiguous = new Set(objects);
139
+ // A schema can't be ambiguous with itself
140
+ possiblyAmbiguous.delete(schema);
141
+ // For each field of schema, remove schema from possiblyAmbiguous that do not have that field
142
+ for (const [key, field] of schema.fields) {
143
+ if (field.kind === schemaTypes_js_1.FieldKind.Required) {
144
+ const withKey = allObjectKeys.get(key) ?? (0, internal_1.fail)(0xb35 /* missing schema */);
145
+ for (const candidate of possiblyAmbiguous) {
146
+ if (!withKey.has(candidate)) {
147
+ possiblyAmbiguous.delete(candidate);
148
+ }
149
+ }
150
+ }
151
+ }
152
+ if (possiblyAmbiguous.size > 0) {
153
+ // TODO: make this check more permissive.
154
+ // Allow using the type of the field to disambiguate, at least for leaf types.
155
+ // Add "constant" fields which can be used to disambiguate even more cases without adding persisted data: maybe make them optional in constructor?
156
+ // Consider separating unambiguous implicit construction format from constructor arguments at type level, allowing constructor to superset the implicit construction options (ex: optional constant fields).
157
+ // The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/toMapTree.ts.
158
+ errors.push(`The required fields of ${JSON.stringify(schema.identifier)} are insufficient to differentiate it from the following types: ${formatTypes(possiblyAmbiguous)}. For objects to be considered unambiguous, each must have required fields that do not all occur on any other object in the union.`);
159
+ }
160
+ }
161
+ }
162
+ exports.checkUnion = checkUnion;
163
+ //# sourceMappingURL=configuration.js.map
@@ -0,0 +1 @@
1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ChC,yCAAyC;YACzC,8EAA8E;YAC9E,kJAAkJ;YAClJ,4MAA4M;YAC5M,4HAA4H;YAE5H,MAAM,CAAC,IAAI,CACV,0BAA0B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,mEAAmE,WAAW,CAAC,iBAAiB,CAAC,oIAAoI,CAChS,CAAC;QACH,CAAC;IACF,CAAC;AACF,CAAC;AAtFD,gCAsFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype FieldSchemaAlpha,\n\ttype ImplicitFieldSchema,\n\tFieldKind,\n\tmarkSchemaMostDerived,\n\tnormalizeFieldSchema,\n} from \"../schemaTypes.js\";\nimport { NodeKind, type TreeNodeSchema } from \"../core/index.js\";\nimport { toStoredSchema } from \"../toStoredSchema.js\";\nimport { LeafNodeSchema } from \"../leafNodeSchema.js\";\nimport { isObjectNodeSchema, type ObjectNodeSchema } from \"../objectNodeTypes.js\";\nimport { getOrCreate } from \"../../util/index.js\";\nimport type { MakeNominal } from \"../../util/index.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\nimport type { SimpleNodeSchema, SimpleTreeSchema } from \"../simpleSchema.js\";\n\n/**\n * Options when constructing a tree view.\n * @public\n */\nexport interface ITreeConfigurationOptions {\n\t/**\n\t * If `true`, the tree will validate new content against its stored schema at insertion time\n\t * and throw an error if the new content doesn't match the expected schema.\n\t *\n\t * @defaultValue `false`.\n\t *\n\t * @remarks Enabling schema validation has a performance penalty when inserting new content into the tree because\n\t * additional checks are done. Enable this option only in scenarios where you are ok with that operation being a\n\t * bit slower.\n\t */\n\tenableSchemaValidation?: boolean;\n\n\t/**\n\t * A flag used to opt into strict rules ensuring that the schema avoids cases which can make the type of nodes ambiguous when importing or exporting data.\n\t * @defaultValue `false`.\n\t *\n\t * @remarks\n\t * When this is true, it ensures that the compile time type safety for data when constructing nodes is sufficient to ensure that the runtime behavior will not give node data ambiguity errors.\n\t *\n\t * This ensures that the canonical JSON-like representation of all unions in the tree are lossless and unambiguous.\n\t * This canonical JSON-like representation consists of arrays, plain old JavaScript objects with string keys, booleans, numbers (excluding NaN, -0 and infinities), strings, null and {@link @fluidframework/core-interfaces#IFluidHandle}s.\n\t * It is compatible with the node creation APIs (such as schema class constructors) and is also compatible with JSON assuming any IFluidHandles get special handling (since they are not JSON compatible).\n\t * Currently these cases can cause ambiguity in a union:\n\t *\n\t * - More than one ArrayNode type: it's impossible to tell which array type is intended in the case of empty arrays (`[]`).\n\t *\n\t * - More than one MapNode type: it's impossible to tell which map type is intended in the case of an empty map (`{}`).\n\t *\n\t * - Both a MapNode and an ArrayNode: this case is not a problem for the canonical JSON representation, but is an issue when constructing from an Iterable, which is supported for both MapNode and ArrayNode.\n\t *\n\t * - Both a MapNode and an ObjectNode: when the input is valid for the ObjectNode, the current parser always considers it ambiguous with being a MapNode.\n\t *\n\t * - ObjectNodes which have fields (required or optional) which include all required fields of another ObjectNode: currently each ObjectNode is differentiated by the presence of its required fields.\n\t *\n\t * This check is conservative: some complex cases may error if the current simple algorithm cannot show no ambiguity is possible.\n\t * This check may become more permissive over time.\n\t *\n\t * @example Ambiguous schema (with `preventAmbiguity: false`), and how to disambiguate it using {@link Unhydrated} nodes:\n\t * ```typescript\n\t * const schemaFactory = new SchemaFactory(\"com.example\");\n\t * class Feet extends schemaFactory.object(\"Feet\", { length: schemaFactory.number }) {}\n\t * class Meters extends schemaFactory.object(\"Meters\", { length: schemaFactory.number }) {}\n\t * const config = new TreeViewConfiguration({\n\t * \t// This combination of schema can lead to ambiguous cases and will error if `preventAmbiguity` is true.\n\t * \tschema: [Feet, Meters],\n\t * \tpreventAmbiguity: false,\n\t * });\n\t * const view = tree.viewWith(config);\n\t * // This is invalid since it is ambiguous which type of node is being constructed:\n\t * // view.initialize({ length: 5 });\n\t * // To work, an explicit type can be provided by using an {@link Unhydrated} Node:\n\t * view.initialize(new Meters({ length: 5 }));\n\t * ```\n\t *\n\t * @example Schema disambiguated by adjusting field names, validated with `preventAmbiguity: true:`\n\t * ```typescript\n\t * const schemaFactory = new SchemaFactory(\"com.example\");\n\t * class Feet extends schemaFactory.object(\"Feet\", { length: schemaFactory.number }) {}\n\t * class Meters extends schemaFactory.object(\"Meters\", {\n\t * \t// To avoid ambiguity when parsing unions of Feet and Meters, this renames the length field to \"meters\".\n\t * \t// To preserve compatibility with existing data from the ambiguous case,\n\t * \t// `{ key: \"length\" }` is set, so when persisted in the tree \"length\" is used as the field name.\n\t * \tmeters: schemaFactory.required(schemaFactory.number, { key: \"length\" }),\n\t * }) {}\n\t * const config = new TreeViewConfiguration({\n\t * \t// This combination of schema is not ambiguous because `Feet` and `Meters` have different required keys.\n\t * \tschema: [Feet, Meters],\n\t * \tpreventAmbiguity: true,\n\t * });\n\t * const view = tree.viewWith(config);\n\t * // This now works, since the field is sufficient to determine this is a `Meters` node.\n\t * view.initialize({ meters: 5 });\n\t * ```\n\t *\n\t * @privateRemarks\n\t * In the future, we can support lossless round tripping via the canonical JSON-like representation above when unambiguous.\n\t * This could be done via methods added to `Tree` to export and import such objects, which would give us a place to explicitly define the type of this representation.\n\t *\n\t * To make this more permissive in the future we can:\n\t *\n\t * - Make toMapTree more permissive (ex: allow disambiguation based on leaf type)\n\t * - Update this check to more tightly match toMapTree\n\t * - Add options to help schema authors disambiguate their types, such as \"constant fields\" which are not persisted, and always have a constant value.\n\t *\n\t * The above examples exist in executable form in this files tests, and should be updated there then copied back here.\n\t */\n\treadonly preventAmbiguity?: boolean;\n}\n\nconst defaultTreeConfigurationOptions: Required<ITreeConfigurationOptions> = {\n\tenableSchemaValidation: false,\n\tpreventAmbiguity: false,\n};\n\n/**\n * Property-bag configuration for {@link TreeViewConfiguration} construction.\n * @public\n */\nexport interface ITreeViewConfiguration<\n\tTSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> extends ITreeConfigurationOptions {\n\t/**\n\t * The schema which the application wants to view the tree with.\n\t */\n\treadonly schema: TSchema;\n}\n\n/**\n * Configuration for {@link ViewableTree.viewWith}.\n * @sealed @public\n */\nexport class TreeViewConfiguration<\n\tconst TSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n> implements Required<ITreeViewConfiguration<TSchema>>\n{\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * {@inheritDoc ITreeViewConfiguration.schema}\n\t */\n\tpublic readonly schema: TSchema;\n\n\t/**\n\t * {@inheritDoc ITreeConfigurationOptions.enableSchemaValidation}\n\t */\n\tpublic readonly enableSchemaValidation: boolean;\n\n\t/**\n\t * {@inheritDoc ITreeConfigurationOptions.preventAmbiguity}\n\t */\n\tpublic readonly preventAmbiguity: boolean;\n\n\t/**\n\t * Construct a new {@link TreeViewConfiguration}.\n\t *\n\t * @param props - Property bag of configuration options.\n\t *\n\t * @remarks\n\t * Performing this construction deeply validates the provided schema.\n\t * This means that when this constructor is called, all {@link LazyItem} {@link TreeNodeSchema} references will be evaluated (using {@link evaluateLazySchema}).\n\t * This means that the declarations for all transitively reachable {@link TreeNodeSchema} must be available at this time.\n\t *\n\t * For example, a schema reachable from this configuration cannot reference this configuration during its declaration,\n\t * since this would be a cyclic dependency that will cause an error when constructing this configuration.\n\t */\n\tpublic constructor(props: ITreeViewConfiguration<TSchema>) {\n\t\tconst config = { ...defaultTreeConfigurationOptions, ...props };\n\t\tthis.schema = config.schema;\n\t\tthis.enableSchemaValidation = config.enableSchemaValidation;\n\t\tthis.preventAmbiguity = config.preventAmbiguity;\n\n\t\t// Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.\n\t\tconst ambiguityErrors: string[] = [];\n\n\t\twalkFieldSchema(config.schema, {\n\t\t\t// Ensure all reachable schema are marked as most derived.\n\t\t\t// This ensures if multiple schema extending the same schema factory generated class are present (or have been constructed, or get constructed in the future),\n\t\t\t// an error is reported.\n\n\t\t\tnode: (schema) => markSchemaMostDerived(schema, true),\n\t\t\tallowedTypes(types): void {\n\t\t\t\tif (config.preventAmbiguity) {\n\t\t\t\t\tcheckUnion(types, ambiguityErrors);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\n\t\tif (ambiguityErrors.length !== 0) {\n\t\t\t// Duplicate errors are common since when two types conflict, both orders error:\n\t\t\tconst deduplicated = new Set(ambiguityErrors);\n\t\t\tthrow new UsageError(`Ambiguous schema found:\\n${[...deduplicated].join(\"\\n\")}`);\n\t\t}\n\n\t\t// Eagerly perform this conversion to surface errors sooner.\n\t\ttoStoredSchema(config.schema);\n\t}\n}\n\n/**\n * {@link TreeViewConfiguration} extended with some alpha APIs.\n * @sealed @alpha\n */\nexport class TreeViewConfigurationAlpha<\n\t\tconst TSchema extends ImplicitFieldSchema = ImplicitFieldSchema,\n\t>\n\textends TreeViewConfiguration<TSchema>\n\timplements TreeSchema\n{\n\t/**\n\t * {@inheritDoc TreeSchema.root}\n\t */\n\tpublic readonly root: FieldSchemaAlpha;\n\t/**\n\t * {@inheritDoc TreeSchema.definitions}\n\t */\n\tpublic readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;\n\n\tpublic constructor(props: ITreeViewConfiguration<TSchema>) {\n\t\tsuper(props);\n\t\tthis.root = normalizeFieldSchema(props.schema);\n\t\tconst definitions = new Map<string, SimpleNodeSchema & TreeNodeSchema>();\n\t\twalkFieldSchema(props.schema, {\n\t\t\tnode: (schema) =>\n\t\t\t\tdefinitions.set(schema.identifier, schema as SimpleNodeSchema & TreeNodeSchema),\n\t\t});\n\t\tthis.definitions = definitions;\n\t}\n}\n\n/**\n * {@link TreeViewConfigurationAlpha}\n * @sealed @alpha\n */\nexport interface TreeSchema extends SimpleTreeSchema {\n\t/**\n\t * {@inheritDoc SimpleTreeSchema.root}\n\t */\n\treadonly root: FieldSchemaAlpha;\n\n\t/**\n\t * {@inheritDoc SimpleTreeSchema.definitions}\n\t */\n\treadonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;\n}\n\n/**\n * Pretty print a set of types for use in error messages.\n */\nfunction formatTypes(allowed: Iterable<TreeNodeSchema>): string {\n\t// Use JSON.stringify to quote and escape identifiers.\n\t// Don't just use a single array JSON.stringify since that omits spaces between items\n\treturn `[${Array.from(allowed, (s) => JSON.stringify(s.identifier)).join(\", \")}]`;\n}\n\n/**\n * Detect cases documented in {@link ITreeConfigurationOptions.preventAmbiguity}.\n */\nexport function checkUnion(union: Iterable<TreeNodeSchema>, errors: string[]): void {\n\tconst checked: Set<TreeNodeSchema> = new Set();\n\tconst maps: TreeNodeSchema[] = [];\n\tconst arrays: TreeNodeSchema[] = [];\n\n\tconst objects: ObjectNodeSchema[] = [];\n\t// Map from key to schema using that key\n\tconst allObjectKeys: Map<string, Set<TreeNodeSchema>> = new Map();\n\n\tfor (const schema of union) {\n\t\tif (checked.has(schema)) {\n\t\t\tthrow new UsageError(`Duplicate schema in allowed types: ${schema.identifier}`);\n\t\t}\n\t\tchecked.add(schema);\n\n\t\tif (schema instanceof LeafNodeSchema) {\n\t\t\t// nothing to do\n\t\t} else if (isObjectNodeSchema(schema)) {\n\t\t\tobjects.push(schema);\n\t\t\tfor (const key of schema.fields.keys()) {\n\t\t\t\tgetOrCreate(allObjectKeys, key, () => new Set()).add(schema);\n\t\t\t}\n\t\t} else if (schema.kind === NodeKind.Array) {\n\t\t\tarrays.push(schema);\n\t\t} else {\n\t\t\tassert(schema.kind === NodeKind.Map, 0x9e7 /* invalid schema */);\n\t\t\tmaps.push(schema);\n\t\t}\n\t}\n\n\tif (arrays.length > 1) {\n\t\terrors.push(\n\t\t\t`More than one kind of array allowed within union (${formatTypes(arrays)}). This would require type disambiguation which is not supported by arrays during import or export.`,\n\t\t);\n\t}\n\n\tif (maps.length > 1) {\n\t\terrors.push(\n\t\t\t`More than one kind of map allowed within union (${formatTypes(maps)}). This would require type disambiguation which is not supported by maps during import or export.`,\n\t\t);\n\t}\n\n\tif (maps.length > 0 && arrays.length > 0) {\n\t\terrors.push(\n\t\t\t`Both a map and an array allowed within union (${formatTypes([...arrays, ...maps])}). Both can be implicitly constructed from iterables like arrays, which are ambiguous when the array is empty.`,\n\t\t);\n\t}\n\n\tif (objects.length > 0 && maps.length > 0) {\n\t\terrors.push(\n\t\t\t`Both a object and a map allowed within union (${formatTypes([...objects, ...maps])}). Both can be constructed from objects and can be ambiguous.`,\n\t\t);\n\t}\n\n\t// Check for objects which fully overlap:\n\tfor (const schema of objects) {\n\t\t// All objects which might be ambiguous relative to `schema`.\n\t\tconst possiblyAmbiguous = new Set(objects);\n\n\t\t// A schema can't be ambiguous with itself\n\t\tpossiblyAmbiguous.delete(schema);\n\n\t\t// For each field of schema, remove schema from possiblyAmbiguous that do not have that field\n\t\tfor (const [key, field] of schema.fields) {\n\t\t\tif (field.kind === FieldKind.Required) {\n\t\t\t\tconst withKey = allObjectKeys.get(key) ?? fail(0xb35 /* missing schema */);\n\t\t\t\tfor (const candidate of possiblyAmbiguous) {\n\t\t\t\t\tif (!withKey.has(candidate)) {\n\t\t\t\t\t\tpossiblyAmbiguous.delete(candidate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (possiblyAmbiguous.size > 0) {\n\t\t\t// TODO: make this check more permissive.\n\t\t\t// Allow using the type of the field to disambiguate, at least for leaf types.\n\t\t\t// Add \"constant\" fields which can be used to disambiguate even more cases without adding persisted data: maybe make them optional in constructor?\n\t\t\t// Consider separating unambiguous implicit construction format from constructor arguments at type level, allowing constructor to superset the implicit construction options (ex: optional constant fields).\n\t\t\t// The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/toMapTree.ts.\n\n\t\t\terrors.push(\n\t\t\t\t`The required fields of ${JSON.stringify(schema.identifier)} are insufficient to differentiate it from the following types: ${formatTypes(possiblyAmbiguous)}. For objects to be considered unambiguous, each must have required fields that do not all occur on any other object in the union.`,\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.getJsonSchema = void 0;
8
8
  const simpleSchemaToJsonSchema_js_1 = require("./simpleSchemaToJsonSchema.js");
9
- const tree_js_1 = require("./tree.js");
9
+ const configuration_js_1 = require("./configuration.js");
10
10
  /**
11
11
  * Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.
12
12
  *
@@ -64,7 +64,7 @@ const tree_js_1 = require("./tree.js");
64
64
  * @alpha
65
65
  */
66
66
  function getJsonSchema(schema, options) {
67
- const treeSchema = new tree_js_1.TreeViewConfigurationAlpha({ schema });
67
+ const treeSchema = new configuration_js_1.TreeViewConfigurationAlpha({ schema });
68
68
  return (0, simpleSchemaToJsonSchema_js_1.toJsonSchema)(treeSchema, options);
69
69
  }
70
70
  exports.getJsonSchema = getJsonSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,+EAA6D;AAE7D,uCAAuD;AAiBvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,SAAgB,aAAa,CAC5B,MAA4B,EAC5B,OAA4C;IAE5C,MAAM,UAAU,GAAG,IAAI,oCAA0B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,IAAA,0CAAY,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAND,sCAMC","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 \"../schemaTypes.js\";\nimport { toJsonSchema } from \"./simpleSchemaToJsonSchema.js\";\nimport type { TreeEncodingOptions } from \"./customTree.js\";\nimport { TreeViewConfigurationAlpha } from \"./tree.js\";\n\n/**\n * Options for how to interpret or encode a tree when schema information is available.\n * @alpha\n */\nexport interface TreeSchemaEncodingOptions extends TreeEncodingOptions {\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 *\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,+EAA6D;AAE7D,yDAAgE;AAiBhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,SAAgB,aAAa,CAC5B,MAA4B,EAC5B,OAA4C;IAE5C,MAAM,UAAU,GAAG,IAAI,6CAA0B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,IAAA,0CAAY,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAND,sCAMC","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 \"../schemaTypes.js\";\nimport { toJsonSchema } from \"./simpleSchemaToJsonSchema.js\";\nimport type { TreeEncodingOptions } 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 * @alpha\n */\nexport interface TreeSchemaEncodingOptions extends TreeEncodingOptions {\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 *\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,13 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type ITree, type TreeView, type ViewableTree, type TreeViewEvents, TreeViewConfiguration, TreeViewConfigurationAlpha, type TreeSchema, type ITreeViewConfiguration, type SchemaCompatibilityStatus, type ITreeConfigurationOptions, type TreeViewAlpha, type TreeBranch, type TreeBranchEvents, type ITreeAlpha, asTreeViewAlpha, } from "./tree.js";
5
+ export type { TreeSchema, ITreeViewConfiguration, ITreeConfigurationOptions, } from "./configuration.js";
6
+ export { TreeViewConfiguration, TreeViewConfigurationAlpha, } from "./configuration.js";
7
+ export type { ITree, TreeView, ViewableTree, TreeViewEvents, SchemaCompatibilityStatus, TreeViewAlpha, TreeBranch, TreeBranchEvents, ITreeAlpha, } from "./tree.js";
8
+ export { asTreeViewAlpha } from "./tree.js";
6
9
  export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, type SchemaStatics, } from "./schemaFactory.js";
7
10
  export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
8
- export type { ValidateRecursiveSchema, FixRecursiveArraySchema, } from "./schemaFactoryRecursive.js";
11
+ export type { ValidateRecursiveSchema, FixRecursiveArraySchema, ValidateRecursiveSchemaTemplate, FixRecursiveRecursionLimit, } from "./schemaFactoryRecursive.js";
9
12
  export { allowUnused } from "./schemaFactoryRecursive.js";
10
13
  export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
11
14
  export { treeNodeApi, type TreeNodeApi, tryGetSchema } from "./treeNodeApi.js";
@@ -14,12 +17,12 @@ export { type JsonSchemaId, type JsonSchemaType, type JsonObjectNodeSchema, type
14
17
  export type { TreeSchemaEncodingOptions } from "./getJsonSchema.js";
15
18
  export { getJsonSchema } from "./getJsonSchema.js";
16
19
  export { getSimpleSchema } from "./getSimpleSchema.js";
17
- export { ViewSchema } from "./view.js";
20
+ export { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
18
21
  export type { Unenforced, FieldSchemaAlphaUnsafe, ArrayNodeCustomizableSchemaUnsafe, MapNodeCustomizableSchemaUnsafe, System_Unsafe, } from "./typesUnsafe.js";
19
22
  export { type VerboseTreeNode, type VerboseTree, applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, replaceVerboseTreeHandles, } from "./verboseTree.js";
20
23
  export { type TreeEncodingOptions, customFromCursorStored, type CustomTreeNode, type CustomTreeValue, tryStoredSchemaAsArray, replaceHandles, type HandleConverter, } from "./customTree.js";
21
24
  export { type ConciseTree, conciseFromCursor, replaceConciseTreeHandles, } from "./conciseTree.js";
22
- export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeApiBeta.js";
25
+ export { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from "./treeBeta.js";
23
26
  export { createSimpleTreeIndex, type SimpleTreeIndex } from "./simpleTreeIndex.js";
24
27
  export { createIdentifierIndex, type IdentifierIndex, } from "./identifierIndex.js";
25
28
  export { extractPersistedSchema, comparePersistedSchemaInternal, comparePersistedSchema, } from "./storedSchema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,eAAe,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,aAAa,EACb,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,aAAa,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EACX,uBAAuB,EACvB,uBAAuB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAC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,mBAAmB,EACxB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,sBAAsB,EACtB,cAAc,EACd,KAAK,eAAe,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACN,KAAK,WAAW,EAChB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1F,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,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,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,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAInE,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC"}
@@ -4,10 +4,11 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.toSimpleTreeSchema = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.comparePersistedSchema = exports.comparePersistedSchemaInternal = exports.extractPersistedSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.replaceConciseTreeHandles = exports.conciseFromCursor = exports.replaceHandles = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.replaceVerboseTreeHandles = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.ViewSchema = exports.getSimpleSchema = exports.getJsonSchema = exports.createFromCursor = exports.cursorFromInsertable = exports.createFromInsertable = exports.tryGetSchema = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.allowUnused = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.asTreeViewAlpha = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = void 0;
7
+ exports.test_RecursiveObjectPojoMode = exports.test_RecursiveObject_base = exports.test_RecursiveObject = exports.toSimpleTreeSchema = exports.generateSchemaFromSimpleSchema = exports.rollback = exports.comparePersistedSchema = exports.comparePersistedSchemaInternal = exports.extractPersistedSchema = exports.createIdentifierIndex = exports.createSimpleTreeIndex = exports.TreeBeta = exports.replaceConciseTreeHandles = exports.conciseFromCursor = exports.replaceHandles = exports.tryStoredSchemaAsArray = exports.customFromCursorStored = exports.replaceVerboseTreeHandles = exports.verboseFromCursor = exports.cursorFromVerbose = exports.applySchemaToParserOptions = exports.SchemaCompatibilityTester = exports.getSimpleSchema = exports.getJsonSchema = exports.createFromCursor = exports.cursorFromInsertable = exports.createFromInsertable = exports.tryGetSchema = exports.treeNodeApi = exports.singletonSchema = exports.enumFromStrings = exports.adaptEnum = exports.allowUnused = exports.SchemaFactoryAlpha = exports.SchemaFactory = exports.asTreeViewAlpha = exports.TreeViewConfigurationAlpha = exports.TreeViewConfiguration = void 0;
8
+ var configuration_js_1 = require("./configuration.js");
9
+ Object.defineProperty(exports, "TreeViewConfiguration", { enumerable: true, get: function () { return configuration_js_1.TreeViewConfiguration; } });
10
+ Object.defineProperty(exports, "TreeViewConfigurationAlpha", { enumerable: true, get: function () { return configuration_js_1.TreeViewConfigurationAlpha; } });
8
11
  var tree_js_1 = require("./tree.js");
9
- Object.defineProperty(exports, "TreeViewConfiguration", { enumerable: true, get: function () { return tree_js_1.TreeViewConfiguration; } });
10
- Object.defineProperty(exports, "TreeViewConfigurationAlpha", { enumerable: true, get: function () { return tree_js_1.TreeViewConfigurationAlpha; } });
11
12
  Object.defineProperty(exports, "asTreeViewAlpha", { enumerable: true, get: function () { return tree_js_1.asTreeViewAlpha; } });
12
13
  var schemaFactory_js_1 = require("./schemaFactory.js");
13
14
  Object.defineProperty(exports, "SchemaFactory", { enumerable: true, get: function () { return schemaFactory_js_1.SchemaFactory; } });
@@ -30,8 +31,8 @@ var getJsonSchema_js_1 = require("./getJsonSchema.js");
30
31
  Object.defineProperty(exports, "getJsonSchema", { enumerable: true, get: function () { return getJsonSchema_js_1.getJsonSchema; } });
31
32
  var getSimpleSchema_js_1 = require("./getSimpleSchema.js");
32
33
  Object.defineProperty(exports, "getSimpleSchema", { enumerable: true, get: function () { return getSimpleSchema_js_1.getSimpleSchema; } });
33
- var view_js_1 = require("./view.js");
34
- Object.defineProperty(exports, "ViewSchema", { enumerable: true, get: function () { return view_js_1.ViewSchema; } });
34
+ var schemaCompatibilityTester_js_1 = require("./schemaCompatibilityTester.js");
35
+ Object.defineProperty(exports, "SchemaCompatibilityTester", { enumerable: true, get: function () { return schemaCompatibilityTester_js_1.SchemaCompatibilityTester; } });
35
36
  var verboseTree_js_1 = require("./verboseTree.js");
36
37
  Object.defineProperty(exports, "applySchemaToParserOptions", { enumerable: true, get: function () { return verboseTree_js_1.applySchemaToParserOptions; } });
37
38
  Object.defineProperty(exports, "cursorFromVerbose", { enumerable: true, get: function () { return verboseTree_js_1.cursorFromVerbose; } });
@@ -44,8 +45,8 @@ Object.defineProperty(exports, "replaceHandles", { enumerable: true, get: functi
44
45
  var conciseTree_js_1 = require("./conciseTree.js");
45
46
  Object.defineProperty(exports, "conciseFromCursor", { enumerable: true, get: function () { return conciseTree_js_1.conciseFromCursor; } });
46
47
  Object.defineProperty(exports, "replaceConciseTreeHandles", { enumerable: true, get: function () { return conciseTree_js_1.replaceConciseTreeHandles; } });
47
- var treeApiBeta_js_1 = require("./treeApiBeta.js");
48
- Object.defineProperty(exports, "TreeBeta", { enumerable: true, get: function () { return treeApiBeta_js_1.TreeBeta; } });
48
+ var treeBeta_js_1 = require("./treeBeta.js");
49
+ Object.defineProperty(exports, "TreeBeta", { enumerable: true, get: function () { return treeBeta_js_1.TreeBeta; } });
49
50
  var simpleTreeIndex_js_1 = require("./simpleTreeIndex.js");
50
51
  Object.defineProperty(exports, "createSimpleTreeIndex", { enumerable: true, get: function () { return simpleTreeIndex_js_1.createSimpleTreeIndex; } });
51
52
  var identifierIndex_js_1 = require("./identifierIndex.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qCAgBmB;AAXlB,gHAAA,qBAAqB,OAAA;AACrB,qHAAA,0BAA0B,OAAA;AAS1B,0GAAA,eAAe,OAAA;AAEhB,uDAK4B;AAJ3B,iHAAA,aAAa,OAAA;AAKd,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAK3B,yEAA0D;AAAjD,wHAAA,WAAW,OAAA;AACpB,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAiBrE,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,qCAAuC;AAA9B,qGAAA,UAAU,OAAA;AASnB,mDAO0B;AAJzB,4HAAA,0BAA0B,OAAA;AAC1B,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,iDAQyB;AANxB,uHAAA,sBAAsB,OAAA;AAGtB,uHAAA,sBAAsB,OAAA;AACtB,+GAAA,cAAc,OAAA;AAIf,mDAI0B;AAFzB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,mDAA6F;AAApF,0GAAA,QAAQ,OAAA;AACjB,2DAAmF;AAA1E,2HAAA,qBAAqB,OAAA;AAC9B,2DAG8B;AAF7B,2HAAA,qBAAqB,OAAA;AAItB,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAC9B,yHAAA,sBAAsB,OAAA;AAGvB,6DAW+B;AAD9B,+GAAA,QAAQ,OAAA;AAGT,6DAAuE;AAA9D,qIAAA,8BAA8B,OAAA;AACvC,6EAAmE;AAA1D,iIAAA,kBAAkB,OAAA;AAE3B,6FAA6F;AAC7F,4IAA4I;AAC5I,mEAIkC;AAHjC,8HAAA,eAAe,OAAwB;AACvC,mIAAA,IAAI,OAA6B;AACjC,sIAAA,uBAAuB,OAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype ITree,\n\ttype TreeView,\n\ttype ViewableTree,\n\ttype TreeViewEvents,\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n\ttype TreeSchema,\n\ttype ITreeViewConfiguration,\n\ttype SchemaCompatibilityStatus,\n\ttype ITreeConfigurationOptions,\n\ttype TreeViewAlpha,\n\ttype TreeBranch,\n\ttype TreeBranchEvents,\n\ttype ITreeAlpha,\n\tasTreeViewAlpha,\n} from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n\ttype SchemaStatics,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.js\";\nexport type {\n\tValidateRecursiveSchema,\n\tFixRecursiveArraySchema,\n} from \"./schemaFactoryRecursive.js\";\nexport { allowUnused } from \"./schemaFactoryRecursive.js\";\nexport {\n\tadaptEnum,\n\tenumFromStrings,\n\tsingletonSchema,\n} from \"./schemaCreationUtilities.js\";\nexport { treeNodeApi, type TreeNodeApi, tryGetSchema } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable, createFromCursor } from \"./create.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} from \"./jsonSchema.js\";\nexport type { TreeSchemaEncodingOptions } from \"./getJsonSchema.js\";\nexport { getJsonSchema } from \"./getJsonSchema.js\";\nexport { getSimpleSchema } from \"./getSimpleSchema.js\";\nexport { ViewSchema } from \"./view.js\";\nexport type {\n\tUnenforced,\n\tFieldSchemaAlphaUnsafe,\n\tArrayNodeCustomizableSchemaUnsafe,\n\tMapNodeCustomizableSchemaUnsafe,\n\tSystem_Unsafe,\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} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } from \"./treeApiBeta.js\";\nexport { createSimpleTreeIndex, type SimpleTreeIndex } from \"./simpleTreeIndex.js\";\nexport {\n\tcreateIdentifierIndex,\n\ttype IdentifierIndex,\n} from \"./identifierIndex.js\";\n\nexport {\n\textractPersistedSchema,\n\tcomparePersistedSchemaInternal,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\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 { toSimpleTreeSchema } from \"./viewSchemaToSimpleSchema.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,uDAG4B;AAF3B,yHAAA,qBAAqB,OAAA;AACrB,8HAAA,0BAA0B,OAAA;AAa3B,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,uDAK4B;AAJ3B,iHAAA,aAAa,OAAA;AAKd,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAO3B,yEAA0D;AAAjD,wHAAA,WAAW,OAAA;AACpB,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAiBrE,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AASlC,mDAO0B;AAJzB,4HAAA,0BAA0B,OAAA;AAC1B,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,iDAQyB;AANxB,uHAAA,sBAAsB,OAAA;AAGtB,uHAAA,sBAAsB,OAAA;AACtB,+GAAA,cAAc,OAAA;AAIf,mDAI0B;AAFzB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,6CAA0F;AAAjF,uGAAA,QAAQ,OAAA;AACjB,2DAAmF;AAA1E,2HAAA,qBAAqB,OAAA;AAC9B,2DAG8B;AAF7B,2HAAA,qBAAqB,OAAA;AAItB,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAC9B,yHAAA,sBAAsB,OAAA;AAGvB,6DAW+B;AAD9B,+GAAA,QAAQ,OAAA;AAGT,6DAAuE;AAA9D,qIAAA,8BAA8B,OAAA;AACvC,6EAAmE;AAA1D,iIAAA,kBAAkB,OAAA;AAE3B,6FAA6F;AAC7F,4IAA4I;AAC5I,mEAIkC;AAHjC,8HAAA,eAAe,OAAwB;AACvC,mIAAA,IAAI,OAA6B;AACjC,sIAAA,uBAAuB,OAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tTreeSchema,\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\tTreeBranch,\n\tTreeBranchEvents,\n\tITreeAlpha,\n} from \"./tree.js\";\nexport { asTreeViewAlpha } from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n\ttype SchemaStatics,\n} from \"./schemaFactory.js\";\nexport { SchemaFactoryAlpha } from \"./schemaFactoryAlpha.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 { treeNodeApi, type TreeNodeApi, tryGetSchema } from \"./treeNodeApi.js\";\nexport { createFromInsertable, cursorFromInsertable, createFromCursor } from \"./create.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} 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} 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} from \"./customTree.js\";\n\nexport {\n\ttype ConciseTree,\n\tconciseFromCursor,\n\treplaceConciseTreeHandles,\n} from \"./conciseTree.js\";\n\nexport { TreeBeta, type NodeChangedData, type TreeChangeEventsBeta } 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\tcomparePersistedSchemaInternal,\n\tcomparePersistedSchema,\n} from \"./storedSchema.js\";\n\nexport {\n\ttype TransactionConstraint,\n\ttype NodeInDocumentConstraint,\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 { toSimpleTreeSchema } from \"./viewSchemaToSimpleSchema.js\";\n\n// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.\n// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639\nexport {\n\tRecursiveObject as test_RecursiveObject,\n\tbase as test_RecursiveObject_base,\n\tRecursiveObjectPojoMode as test_RecursiveObjectPojoMode,\n} from \"./testRecursiveDomain.js\";\n"]}
@@ -4,26 +4,24 @@
4
4
  */
5
5
  import { AdaptedViewSchema, type Adapters, type TreeStoredSchema } from "../../core/index.js";
6
6
  import { type FullSchemaPolicy } from "../../feature-libraries/index.js";
7
- import { type FieldSchema, type ImplicitFieldSchema } from "../schemaTypes.js";
7
+ import type { FieldSchema } from "../schemaTypes.js";
8
8
  import type { SchemaCompatibilityStatus } from "./tree.js";
9
9
  /**
10
10
  * A collection of View information for schema, including policy.
11
+ * @remarks
12
+ * This contains everything needed to determine compatibility with a given stored schema.
11
13
  */
12
- export declare class ViewSchema {
14
+ export declare class SchemaCompatibilityTester {
13
15
  readonly policy: FullSchemaPolicy;
14
16
  readonly adapters: Adapters;
15
17
  /**
16
18
  * Cached conversion of the view schema in the stored schema format.
17
19
  */
18
- private readonly viewSchemaAsStored;
20
+ readonly viewSchemaAsStored: TreeStoredSchema;
19
21
  /**
20
- * Normalized view schema (implicitly allowed view schema types are converted to their canonical form).
22
+ * @param viewSchemaRoot - Schema for the root field.
21
23
  */
22
- readonly schema: FieldSchema;
23
- /**
24
- * @param viewSchema - Schema for the root field of this view.
25
- */
26
- constructor(policy: FullSchemaPolicy, adapters: Adapters, viewSchema: ImplicitFieldSchema);
24
+ constructor(policy: FullSchemaPolicy, adapters: Adapters, viewSchemaRoot: FieldSchema);
27
25
  /**
28
26
  * Determines the compatibility of a stored document
29
27
  * (based on its stored schema) with a viewer (based on its view schema).
@@ -47,4 +45,4 @@ export declare class ViewSchema {
47
45
  private adaptField;
48
46
  private adaptTree;
49
47
  }
50
- //# sourceMappingURL=view.d.ts.map
48
+ //# sourceMappingURL=schemaCompatibilityTester.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaCompatibilityTester.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,iBAAiB,EAEjB,KAAK,QAAQ,EAGb,KAAK,gBAAgB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,gBAAgB,EAOrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,yBAAyB;aAUpB,MAAM,EAAE,gBAAgB;aACxB,QAAQ,EAAE,QAAQ;IAVnC;;OAEG;IACH,SAAgB,kBAAkB,EAAE,gBAAgB,CAAC;IAErD;;OAEG;gBAEc,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,QAAQ,EAClC,cAAc,EAAE,WAAW;IAK5B;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAM,EAAE,gBAAgB,GACtB,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;IAkKnD;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB;IAiC7D;;OAEG;IACH,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,SAAS;CAIjB"}
@@ -4,24 +4,24 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ViewSchema = void 0;
7
+ exports.SchemaCompatibilityTester = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const index_js_1 = require("../../core/index.js");
10
10
  const index_js_2 = require("../../feature-libraries/index.js");
11
- const schemaTypes_js_1 = require("../schemaTypes.js");
12
11
  const toStoredSchema_js_1 = require("../toStoredSchema.js");
13
12
  /**
14
13
  * A collection of View information for schema, including policy.
14
+ * @remarks
15
+ * This contains everything needed to determine compatibility with a given stored schema.
15
16
  */
16
- class ViewSchema {
17
+ class SchemaCompatibilityTester {
17
18
  /**
18
- * @param viewSchema - Schema for the root field of this view.
19
+ * @param viewSchemaRoot - Schema for the root field.
19
20
  */
20
- constructor(policy, adapters, viewSchema) {
21
+ constructor(policy, adapters, viewSchemaRoot) {
21
22
  this.policy = policy;
22
23
  this.adapters = adapters;
23
- this.schema = (0, schemaTypes_js_1.normalizeFieldSchema)(viewSchema);
24
- this.viewSchemaAsStored = (0, toStoredSchema_js_1.toStoredSchema)(this.schema);
24
+ this.viewSchemaAsStored = (0, toStoredSchema_js_1.toStoredSchema)(viewSchemaRoot);
25
25
  }
26
26
  /**
27
27
  * Determines the compatibility of a stored document
@@ -206,5 +206,5 @@ class ViewSchema {
206
206
  return original;
207
207
  }
208
208
  }
209
- exports.ViewSchema = ViewSchema;
210
- //# sourceMappingURL=view.js.map
209
+ exports.SchemaCompatibilityTester = SchemaCompatibilityTester;
210
+ //# sourceMappingURL=schemaCompatibilityTester.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4E;AAC5E,kDAO6B;AAC7B,+DAS0C;AAE1C,4DAAsD;AAGtD;;;;GAIG;AACH,MAAa,yBAAyB;IAMrC;;OAEG;IACH,YACiB,MAAwB,EACxB,QAAkB,EAClC,cAA2B;QAFX,WAAM,GAAN,MAAM,CAAkB;QACxB,aAAQ,GAAR,QAAQ,CAAU;QAGlC,IAAI,CAAC,kBAAkB,GAAG,IAAA,kCAAc,EAAC,cAAc,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAwB;QAExB,yBAAyB;QACzB,0CAA0C;QAE1C,gHAAgH;QAChH,6HAA6H;QAC7H,sDAAsD;QACtD,8HAA8H;QAC9H,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,sIAAsI;QACtI,4CAA4C;QAC5C,IAAI,UAAU,GAAG,IAAI,CAAC;QAEtB,MAAM,uCAAuC,GAAG,CAAC,WAA6B,EAAQ,EAAE;YACvF,QAAQ,WAAW,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AAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrE,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;gBACrD,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;oBAChC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC;YACF,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,QAA8B;QAC/C,sDAAsD;QACtD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AA3PD,8DA2PC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAdaptedViewSchema,\n\ttype TreeNodeStoredSchema,\n\ttype Adapters,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n} from \"../../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FullSchemaPolicy,\n\ttype FieldDiscrepancy,\n\tgetAllowedContentDiscrepancies,\n\tisNeverTree,\n\tPosetComparisonResult,\n\tfieldRealizer,\n\tcomparePosetElements,\n} from \"../../feature-libraries/index.js\";\nimport type { FieldSchema } from \"../schemaTypes.js\";\nimport { toStoredSchema } from \"../toStoredSchema.js\";\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\n\n/**\n * A collection of View information for schema, including policy.\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\t/**\n\t * Cached conversion of the view schema in the stored schema format.\n\t */\n\tpublic readonly viewSchemaAsStored: TreeStoredSchema;\n\n\t/**\n\t * @param viewSchemaRoot - Schema for the root field.\n\t */\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly adapters: Adapters,\n\t\tviewSchemaRoot: FieldSchema,\n\t) {\n\t\tthis.viewSchemaAsStored = toStoredSchema(viewSchemaRoot);\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// TODO: support adapters\n\t\t// const adapted = this.adaptRepo(stored);\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\t\t// View schema allows a superset of documents that stored schema does, hence the document could be upgraded to use a persisted version\n\t\t// of this view schema as its stored schema.\n\t\tlet canUpgrade = true;\n\n\t\tconst updateCompatibilityFromFieldDiscrepancy = (discrepancy: FieldDiscrepancy): void => {\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"allowedTypes\": {\n\t\t\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t\t\t// stored schema.\n\t\t\t\t\tif (\n\t\t\t\t\t\tdiscrepancy.stored.some(\n\t\t\t\t\t\t\t(identifier) =>\n\t\t\t\t\t\t\t\t!isNeverTree(this.policy, stored, stored.nodeSchema.get(identifier)),\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Stored schema has extra allowed types that the view schema does not.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tdiscrepancy.view.some(\n\t\t\t\t\t\t\t(identifier) =>\n\t\t\t\t\t\t\t\t!isNeverTree(\n\t\t\t\t\t\t\t\t\tthis.policy,\n\t\t\t\t\t\t\t\t\tthis.viewSchemaAsStored,\n\t\t\t\t\t\t\t\t\tthis.viewSchemaAsStored.nodeSchema.get(identifier),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// View schema has extra allowed types that the stored schema does not.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tconst result = comparePosetElements(\n\t\t\t\t\t\tdiscrepancy.stored,\n\t\t\t\t\t\tdiscrepancy.view,\n\t\t\t\t\t\tfieldRealizer,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (result === PosetComparisonResult.Greater) {\n\t\t\t\t\t\t// Stored schema is more relaxed than view schema.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdiscrepancy.view === FieldKinds.forbidden.identifier &&\n\t\t\t\t\t\t\tdiscrepancy.identifier !== undefined &&\n\t\t\t\t\t\t\tthis.policy.allowUnknownOptionalFields(discrepancy.identifier)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t\t\t\t\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Less) {\n\t\t\t\t\t\t// View schema is more relaxed than stored schema.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Incomparable) {\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\": {\n\t\t\t\t\tcanView = false;\n\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(discrepancy);\n\t\t\t}\n\t\t};\n\n\t\tfor (const discrepancy of getAllowedContentDiscrepancies(\n\t\t\tthis.viewSchemaAsStored,\n\t\t\tstored,\n\t\t)) {\n\t\t\tif (!canView && !canUpgrade) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"nodeKind\": {\n\t\t\t\t\tconst viewNodeSchema = this.viewSchemaAsStored.nodeSchema.get(\n\t\t\t\t\t\tdiscrepancy.identifier,\n\t\t\t\t\t);\n\t\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(discrepancy.identifier);\n\t\t\t\t\t// We conservatively do not allow node types to change.\n\t\t\t\t\t// The only time this might be valid in the sense that the data canonically converts is converting an object node\n\t\t\t\t\t// to a map node over the union of all the object fields' types.\n\t\t\t\t\tif (discrepancy.stored === undefined) {\n\t\t\t\t\t\tconst viewIsNever =\n\t\t\t\t\t\t\tviewNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, this.viewSchemaAsStored, viewNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!viewIsNever) {\n\t\t\t\t\t\t\t// View schema has added a node type that the stored schema doesn't know about.\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (discrepancy.view === undefined) {\n\t\t\t\t\t\tconst storedIsNever =\n\t\t\t\t\t\t\tstoredNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, stored, storedNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!storedIsNever) {\n\t\t\t\t\t\t\t// Stored schema has a node type that the view schema doesn't know about.\n\t\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Node type exists in both schemas but has changed. We conservatively never allow this.\n\t\t\t\t\t\tconst storedIsNever =\n\t\t\t\t\t\t\tstoredNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, stored, storedNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tconst viewIsNever =\n\t\t\t\t\t\t\tviewNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, this.viewSchemaAsStored, viewNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!storedIsNever || !viewIsNever) {\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\":\n\t\t\t\tcase \"allowedTypes\":\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tupdateCompatibilityFromFieldDiscrepancy(discrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fields\": {\n\t\t\t\t\tdiscrepancy.differences.forEach(updateCompatibilityFromFieldDiscrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// No default\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent: canView && canUpgrade,\n\t\t};\n\t}\n\n\t/**\n\t * Compute a schema that `original` could be viewed as using adapters as needed.\n\t *\n\t * TODO: have a way for callers to get invalidated on schema updates.\n\t */\n\tpublic adaptRepo(stored: TreeStoredSchema): AdaptedViewSchema {\n\t\t// Sanity check on adapters:\n\t\t// it's probably a bug if they use the never types,\n\t\t// since there never is a reason to have a never type as an adapter input,\n\t\t// and its impossible for an adapter to be correctly implemented if its output type is never\n\t\t// (unless its input is also never).\n\n\t\tfor (const adapter of this.adapters?.tree ?? []) {\n\t\t\tif (\n\t\t\t\tisNeverTree(\n\t\t\t\t\tthis.policy,\n\t\t\t\t\tthis.viewSchemaAsStored,\n\t\t\t\t\tthis.viewSchemaAsStored.nodeSchema.get(adapter.output),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfail(0xb3d /* tree adapter for stored adapter.output should not be never */);\n\t\t\t}\n\t\t}\n\n\t\tconst adapted = {\n\t\t\trootFieldSchema: this.adaptField(stored.rootFieldSchema),\n\t\t\tnodeSchema: new Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(),\n\t\t};\n\n\t\tfor (const [key, schema] of stored.nodeSchema) {\n\t\t\tconst adapatedTree = this.adaptTree(schema);\n\t\t\tadapted.nodeSchema.set(key, adapatedTree);\n\t\t}\n\n\t\t// TODO: subset these adapters to the ones that were needed/used.\n\t\treturn new AdaptedViewSchema(this.adapters, adapted);\n\t}\n\n\t/**\n\t * Adapt original such that it allows member types which can be adapted to its specified types.\n\t */\n\tprivate adaptField(original: TreeFieldStoredSchema): TreeFieldStoredSchema {\n\t\tif (original.types !== undefined) {\n\t\t\tconst types: Set<TreeNodeSchemaIdentifier> = new Set(original.types);\n\t\t\tfor (const treeAdapter of this.adapters?.tree ?? []) {\n\t\t\t\tif (types.has(treeAdapter.input)) {\n\t\t\t\t\ttypes.delete(treeAdapter.input);\n\t\t\t\t\ttypes.add(treeAdapter.output);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { kind: original.kind, types };\n\t\t}\n\t\treturn original;\n\t}\n\n\tprivate adaptTree(original: TreeNodeStoredSchema): TreeNodeStoredSchema {\n\t\t// TODO: support adapters like missing field adapters.\n\t\treturn original;\n\t}\n}\n"]}
@@ -6,7 +6,7 @@ import type { IFluidHandle } from "@fluidframework/core-interfaces";
6
6
  import type { TreeValue } from "../../core/index.js";
7
7
  import { type RestrictiveStringRecord } from "../../util/index.js";
8
8
  import { stringSchema, type LeafSchema } from "../leafNodeSchema.js";
9
- import { FieldKind, type FieldSchema, type ImplicitAllowedTypes, type ImplicitFieldSchema, type InsertableTreeNodeFromImplicitAllowedTypes, type FieldProps, type NodeSchemaOptions, type FieldSchemaAlpha } from "../schemaTypes.js";
9
+ import { FieldKind, type FieldSchema, type ImplicitAllowedTypes, type ImplicitFieldSchema, type InsertableTreeNodeFromImplicitAllowedTypes, type FieldProps, type NodeSchemaOptions, type FieldSchemaAlpha, type ImplicitAnnotatedAllowedTypes, type UnannotateImplicitAllowedTypes } from "../schemaTypes.js";
10
10
  import type { NodeKind, WithType, TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaNonClass } from "../core/index.js";
11
11
  import { type TreeArrayNode } from "../arrayNode.js";
12
12
  import { type InsertableObjectFromSchemaRecord, type TreeObjectNode } from "../objectNode.js";
@@ -58,7 +58,7 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends N
58
58
  * ```
59
59
  *
60
60
  * If an application wants to be particularly careful to preserve all data on a node when editing it, it can use
61
- * {@link TreeAlpha.importVerbose|import}/{@link TreeAlpha.exportVerbose|export} APIs with persistent keys.
61
+ * {@link (TreeAlpha:interface).importVerbose|import}/{@link (TreeAlpha:interface).exportVerbose|export} APIs with persistent keys.
62
62
  *
63
63
  * Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter
64
64
  * this problem as SharedTree's implementation stores the entire node in its lower layers. It's only when application code
@@ -178,6 +178,10 @@ export interface SchemaStatics {
178
178
  */
179
179
  readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
180
180
  }
181
+ declare function optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
182
+ declare function optional<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
183
+ declare function required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
184
+ declare function required<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
181
185
  /**
182
186
  * Implementation of {@link SchemaStatics}.
183
187
  * @remarks
@@ -191,10 +195,10 @@ export declare const schemaStaticsBase: {
191
195
  readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
192
196
  readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
193
197
  readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
194
- readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
195
- readonly required: <const T_1 extends ImplicitAllowedTypes, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T_1, TCustomMetadata_1>;
196
- readonly optionalRecursive: <const T_2 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_2 = unknown>(t: T_2, props?: Omit<FieldProps<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T_2, TCustomMetadata_2>;
197
- readonly requiredRecursive: <const T_3 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_3 = unknown>(t: T_3, props?: Omit<FieldProps<TCustomMetadata_3>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_3, TCustomMetadata_3>;
198
+ readonly optional: typeof optional;
199
+ readonly required: typeof required;
200
+ readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
201
+ readonly requiredRecursive: <const T_1 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_1, TCustomMetadata_1>;
198
202
  };
199
203
  /**
200
204
  * Unstable extensions to {@link schemaStaticsBase}.
@@ -207,10 +211,10 @@ export declare const schemaStatics: {
207
211
  readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
208
212
  readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
209
213
  readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
210
- readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata_1 = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata_1>;
211
- readonly required: <const T_1 extends ImplicitAllowedTypes, const TCustomMetadata_2 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlpha<FieldKind.Required, T_1, TCustomMetadata_2>;
212
- readonly optionalRecursive: <const T_2 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_3 = unknown>(t: T_2, props?: Omit<FieldProps<TCustomMetadata_3>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T_2, TCustomMetadata_3>;
213
- readonly requiredRecursive: <const T_3 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_4 = unknown>(t: T_3, props?: Omit<FieldProps<TCustomMetadata_4>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_3, TCustomMetadata_4>;
214
+ readonly optional: typeof optional;
215
+ readonly required: typeof required;
216
+ readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_1 = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata_1>;
217
+ readonly requiredRecursive: <const T_1 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_2 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_1, TCustomMetadata_2>;
214
218
  };
215
219
  /**
216
220
  * Creates various types of {@link TreeNodeSchema|schema} for {@link TreeNode}s.
@@ -627,6 +631,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
627
631
  * @remarks
628
632
  * This version of `SchemaFactory.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
629
633
  * See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
634
+ * See also {@link FixRecursiveArraySchema} for additional information specific to recursive arrays schema exports.
630
635
  */
631
636
  arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
632
637
  /**
@@ -670,4 +675,5 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
670
675
  }, false, T, undefined>;
671
676
  }
672
677
  export declare function structuralName<const T extends string>(collectionName: T, allowedTypes: TreeNodeSchema | readonly TreeNodeSchema[]): `${T}<${string}>`;
678
+ export {};
673
679
  //# sourceMappingURL=schemaFactory.d.ts.map