@fluidframework/tree 2.33.2 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +2 -0
- package/CHANGELOG.md +64 -0
- package/api-report/tree.alpha.api.md +124 -51
- package/api-report/tree.beta.api.md +31 -27
- package/api-report/tree.legacy.alpha.api.md +24 -23
- package/api-report/tree.legacy.public.api.md +24 -23
- package/api-report/tree.public.api.md +24 -23
- package/dist/alpha.d.ts +17 -1
- package/dist/beta.d.ts +2 -0
- package/dist/codec/codec.d.ts +5 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +6 -2
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +2 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
- package/dist/core/schema-stored/formatV1.d.ts.map +1 -0
- package/dist/core/schema-stored/{format.js → formatV1.js} +1 -1
- package/dist/core/schema-stored/formatV1.js.map +1 -0
- package/dist/core/schema-stored/index.d.ts +3 -3
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +3 -3
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +3 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +8 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/dist/core/schema-view/index.d.ts +1 -1
- package/dist/core/schema-view/index.d.ts.map +1 -1
- package/dist/core/schema-view/index.js +1 -2
- package/dist/core/schema-view/index.js.map +1 -1
- package/dist/core/schema-view/view.d.ts +0 -27
- package/dist/core/schema-view/view.d.ts.map +1 -1
- package/dist/core/schema-view/view.js +1 -35
- package/dist/core/schema-view/view.js.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/dist/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js +1 -1
- package/dist/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +1 -1
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +4 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.d.ts +3 -3
- package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/dist/feature-libraries/mapTreeCursor.js +2 -2
- package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -5
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +34 -5
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +63 -9
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/{lib/feature-libraries/schema-index/format.d.ts → dist/feature-libraries/schema-index/formatV1.d.ts} +9 -9
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/schema-index/{format.js → formatV1.js} +4 -4
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -0
- package/dist/feature-libraries/schema-index/index.d.ts +2 -2
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +6 -3
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +4 -4
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/internalTypes.d.ts +0 -1
- package/dist/internalTypes.d.ts.map +1 -1
- package/dist/internalTypes.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +2 -2
- package/dist/jsonDomainSchema.js +2 -2
- package/dist/jsonDomainSchema.js.map +1 -1
- package/dist/legacy.d.ts +2 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/public.d.ts +2 -0
- package/dist/serializableDomainSchema.d.ts +3 -3
- package/dist/serializableDomainSchema.js +2 -2
- package/dist/serializableDomainSchema.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +4 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +6 -5
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +10 -11
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +11 -36
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +3 -3
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +4 -7
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +28 -3
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +29 -3
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/{treeApi.d.ts → tree.d.ts} +58 -34
- package/dist/shared-tree/tree.d.ts.map +1 -0
- package/dist/shared-tree/{treeApi.js → tree.js} +6 -6
- package/dist/shared-tree/tree.js.map +1 -0
- package/{lib/shared-tree/treeApiAlpha.d.ts → dist/shared-tree/treeAlpha.d.ts} +24 -14
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -0
- package/dist/shared-tree/{treeApiAlpha.js → treeAlpha.js} +7 -5
- package/dist/shared-tree/treeAlpha.js.map +1 -0
- package/dist/shared-tree-core/branchCommitEnricher.d.ts +0 -1
- package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/branchCommitEnricher.js +0 -1
- package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts +1 -1
- package/dist/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/dist/shared-tree-core/transactionEnricher.js +4 -1
- package/dist/shared-tree-core/transactionEnricher.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +1 -1
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +177 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -0
- package/dist/simple-tree/api/configuration.js +163 -0
- package/dist/simple-tree/api/configuration.js.map +1 -0
- package/dist/simple-tree/api/getJsonSchema.js +2 -2
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +9 -5
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +9 -7
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
- package/dist/simple-tree/api/{view.js → schemaCompatibilityTester.js} +9 -9
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
- package/dist/simple-tree/api/schemaFactory.d.ts +25 -10
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +27 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +2 -2
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +11 -10
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +16 -11
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +30 -174
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +1 -156
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/{lib/simple-tree/api/treeApiBeta.d.ts → dist/simple-tree/api/treeBeta.d.ts} +17 -6
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
- package/dist/simple-tree/api/treeBeta.js.map +1 -0
- package/dist/simple-tree/api/treeChangeEvents.d.ts +83 -0
- package/dist/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
- package/dist/simple-tree/api/treeChangeEvents.js +7 -0
- package/dist/simple-tree/api/treeChangeEvents.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts +2 -1
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +4 -9
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +30 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +3 -2
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/dist/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/dist/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +5 -5
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +94 -0
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -0
- package/dist/simple-tree/core/treeNode.js +123 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +2 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +3 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +0 -165
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js +1 -113
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +1 -1
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +4 -4
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +2 -2
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +1 -1
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +18 -5
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +4 -3
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/objectNodeTypes.d.ts +4 -4
- package/dist/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +164 -13
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +107 -8
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +8 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -32
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +2 -2
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/tableSchema.d.ts +455 -125
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +398 -101
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +1 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +30 -75
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/typeUtils.d.ts +1 -1
- package/dist/util/typeUtils.js.map +1 -1
- package/lib/alpha.d.ts +17 -1
- package/lib/beta.d.ts +2 -0
- package/lib/codec/codec.d.ts +5 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +5 -1
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +2 -2
- package/lib/core/index.js.map +1 -1
- package/lib/core/schema-stored/{format.d.ts → formatV1.d.ts} +1 -1
- package/lib/core/schema-stored/formatV1.d.ts.map +1 -0
- package/lib/core/schema-stored/{format.js → formatV1.js} +1 -1
- package/lib/core/schema-stored/formatV1.js.map +1 -0
- package/lib/core/schema-stored/index.d.ts +3 -3
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +2 -2
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +3 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.js.map +1 -1
- package/lib/core/schema-view/index.d.ts +1 -1
- package/lib/core/schema-view/index.d.ts.map +1 -1
- package/lib/core/schema-view/index.js +1 -1
- package/lib/core/schema-view/index.js.map +1 -1
- package/lib/core/schema-view/view.d.ts +0 -27
- package/lib/core/schema-view/view.d.ts.map +1 -1
- package/lib/core/schema-view/view.js +0 -34
- package/lib/core/schema-view/view.js.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.d.ts +4 -4
- package/lib/core/tree/persistedTreeTextFormat.d.ts.map +1 -1
- package/lib/core/tree/persistedTreeTextFormat.js +2 -2
- package/lib/core/tree/persistedTreeTextFormat.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +2 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.d.ts +3 -3
- package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
- package/lib/feature-libraries/mapTreeCursor.js +2 -2
- package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js +3 -3
- package/lib/feature-libraries/modular-schema/modularChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +14 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +26 -6
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +2 -2
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js +3 -3
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +34 -5
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +61 -9
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/{dist/feature-libraries/schema-index/format.d.ts → lib/feature-libraries/schema-index/formatV1.d.ts} +9 -9
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/schema-index/{format.js → formatV1.js} +5 -5
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -0
- package/lib/feature-libraries/schema-index/index.d.ts +2 -2
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +2 -2
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +5 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +5 -5
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/internalTypes.d.ts +0 -1
- package/lib/internalTypes.d.ts.map +1 -1
- package/lib/internalTypes.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +2 -2
- package/lib/jsonDomainSchema.js +2 -2
- package/lib/jsonDomainSchema.js.map +1 -1
- package/lib/legacy.d.ts +2 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/public.d.ts +2 -0
- package/lib/serializableDomainSchema.d.ts +3 -3
- package/lib/serializableDomainSchema.js +2 -2
- package/lib/serializableDomainSchema.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +4 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +3 -3
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +10 -11
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +12 -37
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +3 -3
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +6 -9
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +28 -3
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +29 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/{treeApi.d.ts → tree.d.ts} +58 -34
- package/lib/shared-tree/tree.d.ts.map +1 -0
- package/lib/shared-tree/{treeApi.js → tree.js} +5 -5
- package/lib/shared-tree/tree.js.map +1 -0
- package/{dist/shared-tree/treeApiAlpha.d.ts → lib/shared-tree/treeAlpha.d.ts} +24 -14
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -0
- package/lib/shared-tree/{treeApiAlpha.js → treeAlpha.js} +8 -6
- package/lib/shared-tree/treeAlpha.js.map +1 -0
- package/lib/shared-tree-core/branchCommitEnricher.d.ts +0 -1
- package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/branchCommitEnricher.js +0 -1
- package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts +1 -1
- package/lib/shared-tree-core/transactionEnricher.d.ts.map +1 -1
- package/lib/shared-tree-core/transactionEnricher.js +4 -1
- package/lib/shared-tree-core/transactionEnricher.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +1 -1
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +177 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -0
- package/lib/simple-tree/api/configuration.js +157 -0
- package/lib/simple-tree/api/configuration.js.map +1 -0
- package/lib/simple-tree/api/getJsonSchema.js +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +9 -5
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +5 -4
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/{view.d.ts → schemaCompatibilityTester.d.ts} +8 -10
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -0
- package/lib/simple-tree/api/{view.js → schemaCompatibilityTester.js} +7 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -0
- package/lib/simple-tree/api/schemaFactory.d.ts +25 -10
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +27 -12
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +12 -6
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +2 -2
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +67 -4
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +11 -10
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +20 -13
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +30 -174
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +0 -152
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/{dist/simple-tree/api/treeApiBeta.d.ts → lib/simple-tree/api/treeBeta.d.ts} +17 -6
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/{treeApiBeta.js → treeBeta.js} +5 -4
- package/lib/simple-tree/api/treeBeta.js.map +1 -0
- package/lib/simple-tree/api/treeChangeEvents.d.ts +83 -0
- package/lib/simple-tree/api/treeChangeEvents.d.ts.map +1 -0
- package/lib/simple-tree/api/treeChangeEvents.js +6 -0
- package/lib/simple-tree/api/treeChangeEvents.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts +2 -1
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +4 -9
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/arrayNode.d.ts +30 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +4 -3
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts +1 -1
- package/lib/simple-tree/core/getOrCreateNode.d.ts.map +1 -1
- package/lib/simple-tree/core/getOrCreateNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +94 -0
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -0
- package/lib/simple-tree/core/treeNode.js +118 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +2 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +3 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +0 -165
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js +0 -110
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +1 -1
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +4 -4
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +2 -2
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +2 -2
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +18 -5
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +5 -4
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/objectNodeTypes.d.ts +4 -4
- package/lib/simple-tree/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +164 -13
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +96 -8
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +8 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +26 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +2 -2
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/tableSchema.d.ts +455 -125
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +398 -101
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +1 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +30 -75
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/typeUtils.d.ts +1 -1
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +6 -1
- package/src/codec/index.ts +1 -0
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +3 -3
- package/src/core/schema-stored/schema.ts +3 -1
- package/src/core/schema-stored/storedSchemaRepository.ts +1 -1
- package/src/core/schema-view/index.ts +0 -1
- package/src/core/schema-view/view.ts +0 -31
- package/src/core/tree/persistedTreeTextFormat.ts +2 -2
- package/src/feature-libraries/forest-summary/format.ts +2 -2
- package/src/feature-libraries/index.ts +7 -1
- package/src/feature-libraries/mapTreeCursor.ts +3 -3
- package/src/feature-libraries/modular-schema/modularChangeFormat.ts +3 -3
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +38 -9
- package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +3 -4
- package/src/feature-libraries/schema-index/codec.ts +80 -12
- package/src/feature-libraries/schema-index/{format.ts → formatV1.ts} +4 -4
- package/src/feature-libraries/schema-index/index.ts +7 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +9 -9
- package/src/index.ts +18 -1
- package/src/internalTypes.ts +0 -2
- package/src/jsonDomainSchema.ts +2 -2
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +3 -3
- package/src/shared-tree/independentView.ts +4 -3
- package/src/shared-tree/index.ts +5 -6
- package/src/shared-tree/schematizeTree.ts +10 -40
- package/src/shared-tree/schematizingTreeView.ts +12 -17
- package/src/shared-tree/sharedTree.ts +67 -6
- package/src/shared-tree/{treeApi.ts → tree.ts} +75 -51
- package/src/shared-tree/{treeApiAlpha.ts → treeAlpha.ts} +28 -16
- package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
- package/src/shared-tree-core/transactionEnricher.ts +4 -1
- package/src/simple-tree/api/conciseTree.ts +1 -1
- package/src/simple-tree/api/configuration.ts +353 -0
- package/src/simple-tree/api/getJsonSchema.ts +1 -1
- package/src/simple-tree/api/index.ts +23 -15
- package/src/simple-tree/api/{view.ts → schemaCompatibilityTester.ts} +8 -15
- package/src/simple-tree/api/schemaFactory.ts +139 -19
- package/src/simple-tree/api/schemaFactoryAlpha.ts +7 -5
- package/src/simple-tree/api/schemaFactoryRecursive.ts +102 -38
- package/src/simple-tree/api/schemaFromSimple.ts +2 -2
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/storedSchema.ts +32 -17
- package/src/simple-tree/api/tree.ts +38 -354
- package/src/simple-tree/api/{treeApiBeta.ts → treeBeta.ts} +20 -6
- package/src/simple-tree/api/treeChangeEvents.ts +84 -0
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/api/typesUnsafe.ts +15 -11
- package/src/simple-tree/arrayNode.ts +38 -5
- package/src/simple-tree/arrayNodeTypes.ts +8 -7
- package/src/simple-tree/core/getOrCreateNode.ts +1 -1
- package/src/simple-tree/core/index.ts +5 -4
- package/src/simple-tree/core/treeNode.ts +163 -0
- package/src/simple-tree/core/treeNodeKernel.ts +2 -1
- package/src/simple-tree/core/treeNodeSchema.ts +3 -1
- package/src/simple-tree/core/types.ts +0 -234
- package/src/simple-tree/core/withType.ts +1 -1
- package/src/simple-tree/index.ts +19 -2
- package/src/simple-tree/mapNode.ts +11 -3
- package/src/simple-tree/mapNodeTypes.ts +10 -7
- package/src/simple-tree/objectNode.ts +39 -15
- package/src/simple-tree/objectNodeTypes.ts +9 -5
- package/src/simple-tree/schemaTypes.ts +354 -25
- package/src/simple-tree/toStoredSchema.ts +42 -41
- package/src/simple-tree/treeNodeValid.ts +2 -2
- package/src/tableSchema.ts +1206 -434
- package/src/treeFactory.ts +56 -173
- package/src/util/typeUtils.ts +1 -1
- package/dist/core/schema-stored/format.d.ts.map +0 -1
- package/dist/core/schema-stored/format.js.map +0 -1
- package/dist/feature-libraries/schema-index/format.d.ts.map +0 -1
- package/dist/feature-libraries/schema-index/format.js.map +0 -1
- package/dist/shared-tree/treeApi.d.ts.map +0 -1
- package/dist/shared-tree/treeApi.js.map +0 -1
- package/dist/shared-tree/treeApiAlpha.d.ts.map +0 -1
- package/dist/shared-tree/treeApiAlpha.js.map +0 -1
- package/dist/simple-tree/api/treeApiBeta.d.ts.map +0 -1
- package/dist/simple-tree/api/treeApiBeta.js.map +0 -1
- package/dist/simple-tree/api/view.d.ts.map +0 -1
- package/dist/simple-tree/api/view.js.map +0 -1
- package/lib/core/schema-stored/format.d.ts.map +0 -1
- package/lib/core/schema-stored/format.js.map +0 -1
- package/lib/feature-libraries/schema-index/format.d.ts.map +0 -1
- package/lib/feature-libraries/schema-index/format.js.map +0 -1
- package/lib/shared-tree/treeApi.d.ts.map +0 -1
- package/lib/shared-tree/treeApi.js.map +0 -1
- package/lib/shared-tree/treeApiAlpha.d.ts.map +0 -1
- package/lib/shared-tree/treeApiAlpha.js.map +0 -1
- package/lib/simple-tree/api/treeApiBeta.d.ts.map +0 -1
- package/lib/simple-tree/api/treeApiBeta.js.map +0 -1
- package/lib/simple-tree/api/view.d.ts.map +0 -1
- package/lib/simple-tree/api/view.js.map +0 -1
- /package/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
|
@@ -41,12 +41,15 @@ export class TransactionEnricher {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Commits the current transaction.
|
|
44
|
-
* @returns
|
|
44
|
+
* @returns A function which can be used to compute the composed change for that transaction's commits. Undefined if the transaction is still ongoing or contained no committed changes.
|
|
45
45
|
*/
|
|
46
46
|
commitTransaction() {
|
|
47
47
|
const commitsCommitted = __classPrivateFieldGet(this, _TransactionEnricher_transactionScopesStart, "f").pop();
|
|
48
48
|
assert(commitsCommitted !== undefined, 0x985 /* No transaction to commit */);
|
|
49
49
|
if (__classPrivateFieldGet(this, _TransactionEnricher_transactionScopesStart, "f").length === 0) {
|
|
50
|
+
if (__classPrivateFieldGet(this, _TransactionEnricher_transactionCommits, "f").length === 0) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
50
53
|
const transactionCommits = __classPrivateFieldGet(this, _TransactionEnricher_transactionCommits, "f");
|
|
51
54
|
__classPrivateFieldSet(this, _TransactionEnricher_transactionCommits, [], "f");
|
|
52
55
|
return (revision) => __classPrivateFieldGet(this, _TransactionEnricher_rebaser, "f").changeRevision(__classPrivateFieldGet(this, _TransactionEnricher_rebaser, "f").compose(transactionCommits), revision);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionEnricher.js","sourceRoot":"","sources":["../../src/shared-tree-core/transactionEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAY/B,YACC,OAA+B,EAC/B,QAAiD;QAbzC,+CAAiC;QACjC,gDAAmD;QAC5D,kDAA8C,EAAE,EAAC;QACjD;;;;;WAKG;QACM,sDAAoC,EAAE,EAAC;QAM/C,uBAAA,IAAI,gCAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,iCAAa,QAAQ,MAAA,CAAC;IAC3B,CAAC;IAEM,aAAa;QACnB,OAAO,uBAAA,IAAI,mDAAwB,CAAC,MAAM,KAAK,CAAC,CAAC;IAClD,CAAC;IAEM,gBAAgB;QACtB,uBAAA,IAAI,mDAAwB,CAAC,IAAI,CAAC,uBAAA,IAAI,+CAAoB,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACvB,MAAM,gBAAgB,GAAG,uBAAA,IAAI,mDAAwB,CAAC,GAAG,EAAE,CAAC;QAC5D,MAAM,CAAC,gBAAgB,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC7E,IAAI,uBAAA,IAAI,mDAAwB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,MAAM,kBAAkB,GAAG,uBAAA,IAAI,+CAAoB,CAAC;YACpD,uBAAA,IAAI,2CAAuB,EAAE,MAAA,CAAC;YAC9B,OAAO,CAAC,QAAqB,EAAE,EAAE,CAChC,uBAAA,IAAI,oCAAS,CAAC,cAAc,CAAC,uBAAA,IAAI,oCAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC;QACpF,CAAC;IACF,CAAC;IAEM,gBAAgB;QACtB,MAAM,UAAU,GAAG,uBAAA,IAAI,mDAAwB,CAAC,GAAG,EAAE,CAAC;QACtD,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACtE,uBAAA,IAAI,+CAAoB,CAAC,MAAM,GAAG,UAAU,CAAC;IAC9C,CAAC;IAEM,kBAAkB,CAAC,MAA4B;QACrD,MAAM,CACL,uBAAA,IAAI,mDAAwB,CAAC,MAAM,KAAK,CAAC,EACzC,KAAK,CAAC,qCAAqC,CAC3C,CAAC;QACF,MAAM,MAAM,GAAG,uBAAA,IAAI,qCAAU,CAAC,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtF,uBAAA,IAAI,+CAAoB,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { ChangeRebaser, GraphCommit, RevisionTag } from \"../core/index.js\";\nimport type { ChangeEnricherReadonlyCheckout } from \"./changeEnricher.js\";\n\n/**\n * Utility for producing an enriched commit out of multiple transaction steps\n */\nexport class TransactionEnricher<TChange> {\n\treadonly #rebaser: ChangeRebaser<TChange>;\n\treadonly #enricher: ChangeEnricherReadonlyCheckout<TChange>;\n\t#transactionCommits: GraphCommit<TChange>[] = [];\n\t/**\n\t * The number of commits before the start of each active transaction scope.\n\t * For a stack of `n` transaction scopes, the array will contain `n` integers,\n\t * where the integer at index `i` is the number of commits made before the start of the `i`th transaction scope\n\t * (therefore, the first element in the array, if present, is always 0)\n\t */\n\treadonly #transactionScopesStart: number[] = [];\n\n\tpublic constructor(\n\t\trebaser: ChangeRebaser<TChange>,\n\t\tenricher: ChangeEnricherReadonlyCheckout<TChange>,\n\t) {\n\t\tthis.#rebaser = rebaser;\n\t\tthis.#enricher = enricher;\n\t}\n\n\tpublic isTransacting(): boolean {\n\t\treturn this.#transactionScopesStart.length !== 0;\n\t}\n\n\tpublic startTransaction(): void {\n\t\tthis.#transactionScopesStart.push(this.#transactionCommits.length);\n\t}\n\n\t/**\n\t * Commits the current transaction.\n\t * @returns
|
|
1
|
+
{"version":3,"file":"transactionEnricher.js","sourceRoot":"","sources":["../../src/shared-tree-core/transactionEnricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAY/B,YACC,OAA+B,EAC/B,QAAiD;QAbzC,+CAAiC;QACjC,gDAAmD;QAC5D,kDAA8C,EAAE,EAAC;QACjD;;;;;WAKG;QACM,sDAAoC,EAAE,EAAC;QAM/C,uBAAA,IAAI,gCAAY,OAAO,MAAA,CAAC;QACxB,uBAAA,IAAI,iCAAa,QAAQ,MAAA,CAAC;IAC3B,CAAC;IAEM,aAAa;QACnB,OAAO,uBAAA,IAAI,mDAAwB,CAAC,MAAM,KAAK,CAAC,CAAC;IAClD,CAAC;IAEM,gBAAgB;QACtB,uBAAA,IAAI,mDAAwB,CAAC,IAAI,CAAC,uBAAA,IAAI,+CAAoB,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACvB,MAAM,gBAAgB,GAAG,uBAAA,IAAI,mDAAwB,CAAC,GAAG,EAAE,CAAC;QAC5D,MAAM,CAAC,gBAAgB,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAC7E,IAAI,uBAAA,IAAI,mDAAwB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,uBAAA,IAAI,+CAAoB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3C,OAAO,SAAS,CAAC;YAClB,CAAC;YACD,MAAM,kBAAkB,GAAG,uBAAA,IAAI,+CAAoB,CAAC;YACpD,uBAAA,IAAI,2CAAuB,EAAE,MAAA,CAAC;YAC9B,OAAO,CAAC,QAAqB,EAAE,EAAE,CAChC,uBAAA,IAAI,oCAAS,CAAC,cAAc,CAAC,uBAAA,IAAI,oCAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,CAAC;QACpF,CAAC;IACF,CAAC;IAEM,gBAAgB;QACtB,MAAM,UAAU,GAAG,uBAAA,IAAI,mDAAwB,CAAC,GAAG,EAAE,CAAC;QACtD,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACtE,uBAAA,IAAI,+CAAoB,CAAC,MAAM,GAAG,UAAU,CAAC;IAC9C,CAAC;IAEM,kBAAkB,CAAC,MAA4B;QACrD,MAAM,CACL,uBAAA,IAAI,mDAAwB,CAAC,MAAM,KAAK,CAAC,EACzC,KAAK,CAAC,qCAAqC,CAC3C,CAAC;QACF,MAAM,MAAM,GAAG,uBAAA,IAAI,qCAAU,CAAC,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtF,uBAAA,IAAI,+CAAoB,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { ChangeRebaser, GraphCommit, RevisionTag } from \"../core/index.js\";\nimport type { ChangeEnricherReadonlyCheckout } from \"./changeEnricher.js\";\n\n/**\n * Utility for producing an enriched commit out of multiple transaction steps\n */\nexport class TransactionEnricher<TChange> {\n\treadonly #rebaser: ChangeRebaser<TChange>;\n\treadonly #enricher: ChangeEnricherReadonlyCheckout<TChange>;\n\t#transactionCommits: GraphCommit<TChange>[] = [];\n\t/**\n\t * The number of commits before the start of each active transaction scope.\n\t * For a stack of `n` transaction scopes, the array will contain `n` integers,\n\t * where the integer at index `i` is the number of commits made before the start of the `i`th transaction scope\n\t * (therefore, the first element in the array, if present, is always 0)\n\t */\n\treadonly #transactionScopesStart: number[] = [];\n\n\tpublic constructor(\n\t\trebaser: ChangeRebaser<TChange>,\n\t\tenricher: ChangeEnricherReadonlyCheckout<TChange>,\n\t) {\n\t\tthis.#rebaser = rebaser;\n\t\tthis.#enricher = enricher;\n\t}\n\n\tpublic isTransacting(): boolean {\n\t\treturn this.#transactionScopesStart.length !== 0;\n\t}\n\n\tpublic startTransaction(): void {\n\t\tthis.#transactionScopesStart.push(this.#transactionCommits.length);\n\t}\n\n\t/**\n\t * Commits the current transaction.\n\t * @returns A function which can be used to compute the composed change for that transaction's commits. Undefined if the transaction is still ongoing or contained no committed changes.\n\t */\n\tpublic commitTransaction(): ((revision: RevisionTag) => TChange) | undefined {\n\t\tconst commitsCommitted = this.#transactionScopesStart.pop();\n\t\tassert(commitsCommitted !== undefined, 0x985 /* No transaction to commit */);\n\t\tif (this.#transactionScopesStart.length === 0) {\n\t\t\tif (this.#transactionCommits.length === 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst transactionCommits = this.#transactionCommits;\n\t\t\tthis.#transactionCommits = [];\n\t\t\treturn (revision: RevisionTag) =>\n\t\t\t\tthis.#rebaser.changeRevision(this.#rebaser.compose(transactionCommits), revision);\n\t\t}\n\t}\n\n\tpublic abortTransaction(): void {\n\t\tconst scopeStart = this.#transactionScopesStart.pop();\n\t\tassert(scopeStart !== undefined, 0x986 /* No transaction to abort */);\n\t\tthis.#transactionCommits.length = scopeStart;\n\t}\n\n\tpublic addTransactionStep(commit: GraphCommit<TChange>): void {\n\t\tassert(\n\t\t\tthis.#transactionScopesStart.length !== 0,\n\t\t\t0x987 /* No transaction to add a step to */,\n\t\t);\n\t\tconst change = this.#enricher.updateChangeEnrichments(commit.change, commit.revision);\n\t\tthis.#transactionCommits.push({ ...commit, change });\n\t}\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { type TreeEncodingOptions, type HandleConverter } from "./customTree.js"
|
|
|
11
11
|
* @remarks
|
|
12
12
|
* This is "concise" meaning that explicit type information is omitted.
|
|
13
13
|
* If the schema is compatible with {@link ITreeConfigurationOptions.preventAmbiguity},
|
|
14
|
-
* types will be lossless and compatible with {@link TreeAlpha.create} (unless the options are used to customize it).
|
|
14
|
+
* types will be lossless and compatible with {@link (TreeAlpha:interface).create} (unless the options are used to customize it).
|
|
15
15
|
*
|
|
16
16
|
* Every {@link TreeNode} is an array or object.
|
|
17
17
|
* Any IFluidHandle values have been replaced by `THandle`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conciseTree.js","sourceRoot":"","sources":["../../../src/simple-tree/api/conciseTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,gBAAgB,EAChB,cAAc,GAGd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAwB3D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAmB,EACnB,UAAgC,EAChC,OAA4B;IAE5B,MAAM,MAAM,GAAkC;QAC7C,aAAa,EAAE,KAAK;QACpB,GAAG,OAAO;KACV,CAAC;IAEF,MAAM,SAAS,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;IAC1D,OAAO,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,sBAAsB,CAC9B,MAAmB,EACnB,OAAsC,EACtC,MAA2C;IAE3C,OAAO,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACxC,IAAiB,EACjB,QAA4B;IAE5B,OAAO,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAmB,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport type { ITreeCursor } from \"../../core/index.js\";\nimport type { TreeLeafValue, ImplicitAllowedTypes } from \"../schemaTypes.js\";\nimport type { TreeNodeSchema } from \"../core/index.js\";\nimport {\n\tcustomFromCursor,\n\treplaceHandles,\n\ttype TreeEncodingOptions,\n\ttype HandleConverter,\n} from \"./customTree.js\";\nimport { getUnhydratedContext } from \"../createContext.js\";\n\n/**\n * Concise encoding of a {@link TreeNode} or {@link TreeLeafValue}.\n * @remarks\n * This is \"concise\" meaning that explicit type information is omitted.\n * If the schema is compatible with {@link ITreeConfigurationOptions.preventAmbiguity},\n * types will be lossless and compatible with {@link TreeAlpha.create} (unless the options are used to customize it).\n *\n * Every {@link TreeNode} is an array or object.\n * Any IFluidHandle values have been replaced by `THandle`.\n * @privateRemarks\n * This can store all possible simple trees,\n * but it can not store all possible trees representable by our internal representations like FlexTree and JsonableTree.\n * @alpha\n */\nexport type ConciseTree<THandle = IFluidHandle> =\n\t| Exclude<TreeLeafValue, IFluidHandle>\n\t| THandle\n\t| ConciseTree<THandle>[]\n\t| {\n\t\t\t[key: string]: ConciseTree<THandle>;\n\t };\n\n/**\n * Used to read a node cursor as a ConciseTree.\n */\nexport function conciseFromCursor(\n\treader: ITreeCursor,\n\trootSchema: ImplicitAllowedTypes,\n\toptions: TreeEncodingOptions,\n): ConciseTree {\n\tconst config: Required<TreeEncodingOptions> = {\n\t\tuseStoredKeys: false,\n\t\t...options,\n\t};\n\n\tconst schemaMap = getUnhydratedContext(rootSchema).schema;\n\treturn conciseFromCursorInner(reader, config, schemaMap);\n}\n\nfunction conciseFromCursorInner(\n\treader: ITreeCursor,\n\toptions: Required<TreeEncodingOptions>,\n\tschema: ReadonlyMap<string, TreeNodeSchema>,\n): ConciseTree {\n\treturn customFromCursor(reader, options, schema, conciseFromCursorInner);\n}\n\n/**\n * Clones tree, replacing any handles.\n * @remarks A strongly typed version of {@link replaceHandles}.\n * @alpha\n */\nexport function replaceConciseTreeHandles<T>(\n\ttree: ConciseTree,\n\treplacer: HandleConverter<T>,\n): ConciseTree<T> {\n\treturn replaceHandles(tree, replacer) as ConciseTree<T>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conciseTree.js","sourceRoot":"","sources":["../../../src/simple-tree/api/conciseTree.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,gBAAgB,EAChB,cAAc,GAGd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAwB3D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAChC,MAAmB,EACnB,UAAgC,EAChC,OAA4B;IAE5B,MAAM,MAAM,GAAkC;QAC7C,aAAa,EAAE,KAAK;QACpB,GAAG,OAAO;KACV,CAAC;IAEF,MAAM,SAAS,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;IAC1D,OAAO,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,sBAAsB,CAC9B,MAAmB,EACnB,OAAsC,EACtC,MAA2C;IAE3C,OAAO,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACxC,IAAiB,EACjB,QAA4B;IAE5B,OAAO,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAmB,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nimport type { ITreeCursor } from \"../../core/index.js\";\nimport type { TreeLeafValue, ImplicitAllowedTypes } from \"../schemaTypes.js\";\nimport type { TreeNodeSchema } from \"../core/index.js\";\nimport {\n\tcustomFromCursor,\n\treplaceHandles,\n\ttype TreeEncodingOptions,\n\ttype HandleConverter,\n} from \"./customTree.js\";\nimport { getUnhydratedContext } from \"../createContext.js\";\n\n/**\n * Concise encoding of a {@link TreeNode} or {@link TreeLeafValue}.\n * @remarks\n * This is \"concise\" meaning that explicit type information is omitted.\n * If the schema is compatible with {@link ITreeConfigurationOptions.preventAmbiguity},\n * types will be lossless and compatible with {@link (TreeAlpha:interface).create} (unless the options are used to customize it).\n *\n * Every {@link TreeNode} is an array or object.\n * Any IFluidHandle values have been replaced by `THandle`.\n * @privateRemarks\n * This can store all possible simple trees,\n * but it can not store all possible trees representable by our internal representations like FlexTree and JsonableTree.\n * @alpha\n */\nexport type ConciseTree<THandle = IFluidHandle> =\n\t| Exclude<TreeLeafValue, IFluidHandle>\n\t| THandle\n\t| ConciseTree<THandle>[]\n\t| {\n\t\t\t[key: string]: ConciseTree<THandle>;\n\t };\n\n/**\n * Used to read a node cursor as a ConciseTree.\n */\nexport function conciseFromCursor(\n\treader: ITreeCursor,\n\trootSchema: ImplicitAllowedTypes,\n\toptions: TreeEncodingOptions,\n): ConciseTree {\n\tconst config: Required<TreeEncodingOptions> = {\n\t\tuseStoredKeys: false,\n\t\t...options,\n\t};\n\n\tconst schemaMap = getUnhydratedContext(rootSchema).schema;\n\treturn conciseFromCursorInner(reader, config, schemaMap);\n}\n\nfunction conciseFromCursorInner(\n\treader: ITreeCursor,\n\toptions: Required<TreeEncodingOptions>,\n\tschema: ReadonlyMap<string, TreeNodeSchema>,\n): ConciseTree {\n\treturn customFromCursor(reader, options, schema, conciseFromCursorInner);\n}\n\n/**\n * Clones tree, replacing any handles.\n * @remarks A strongly typed version of {@link replaceHandles}.\n * @alpha\n */\nexport function replaceConciseTreeHandles<T>(\n\ttree: ConciseTree,\n\treplacer: HandleConverter<T>,\n): ConciseTree<T> {\n\treturn replaceHandles(tree, replacer) as ConciseTree<T>;\n}\n"]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { type FieldSchemaAlpha, type ImplicitFieldSchema } from "../schemaTypes.js";
|
|
6
|
+
import { type TreeNodeSchema } from "../core/index.js";
|
|
7
|
+
import type { MakeNominal } from "../../util/index.js";
|
|
8
|
+
import type { SimpleNodeSchema, SimpleTreeSchema } from "../simpleSchema.js";
|
|
9
|
+
/**
|
|
10
|
+
* Options when constructing a tree view.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface ITreeConfigurationOptions {
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, the tree will validate new content against its stored schema at insertion time
|
|
16
|
+
* and throw an error if the new content doesn't match the expected schema.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue `false`.
|
|
19
|
+
*
|
|
20
|
+
* @remarks Enabling schema validation has a performance penalty when inserting new content into the tree because
|
|
21
|
+
* additional checks are done. Enable this option only in scenarios where you are ok with that operation being a
|
|
22
|
+
* bit slower.
|
|
23
|
+
*/
|
|
24
|
+
enableSchemaValidation?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
* @defaultValue `false`.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* 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.
|
|
31
|
+
*
|
|
32
|
+
* This ensures that the canonical JSON-like representation of all unions in the tree are lossless and unambiguous.
|
|
33
|
+
* 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.
|
|
34
|
+
* 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).
|
|
35
|
+
* Currently these cases can cause ambiguity in a union:
|
|
36
|
+
*
|
|
37
|
+
* - More than one ArrayNode type: it's impossible to tell which array type is intended in the case of empty arrays (`[]`).
|
|
38
|
+
*
|
|
39
|
+
* - More than one MapNode type: it's impossible to tell which map type is intended in the case of an empty map (`{}`).
|
|
40
|
+
*
|
|
41
|
+
* - 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.
|
|
42
|
+
*
|
|
43
|
+
* - 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.
|
|
44
|
+
*
|
|
45
|
+
* - 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.
|
|
46
|
+
*
|
|
47
|
+
* This check is conservative: some complex cases may error if the current simple algorithm cannot show no ambiguity is possible.
|
|
48
|
+
* This check may become more permissive over time.
|
|
49
|
+
*
|
|
50
|
+
* @example Ambiguous schema (with `preventAmbiguity: false`), and how to disambiguate it using {@link Unhydrated} nodes:
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const schemaFactory = new SchemaFactory("com.example");
|
|
53
|
+
* class Feet extends schemaFactory.object("Feet", { length: schemaFactory.number }) {}
|
|
54
|
+
* class Meters extends schemaFactory.object("Meters", { length: schemaFactory.number }) {}
|
|
55
|
+
* const config = new TreeViewConfiguration({
|
|
56
|
+
* // This combination of schema can lead to ambiguous cases and will error if `preventAmbiguity` is true.
|
|
57
|
+
* schema: [Feet, Meters],
|
|
58
|
+
* preventAmbiguity: false,
|
|
59
|
+
* });
|
|
60
|
+
* const view = tree.viewWith(config);
|
|
61
|
+
* // This is invalid since it is ambiguous which type of node is being constructed:
|
|
62
|
+
* // view.initialize({ length: 5 });
|
|
63
|
+
* // To work, an explicit type can be provided by using an {@link Unhydrated} Node:
|
|
64
|
+
* view.initialize(new Meters({ length: 5 }));
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Schema disambiguated by adjusting field names, validated with `preventAmbiguity: true:`
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const schemaFactory = new SchemaFactory("com.example");
|
|
70
|
+
* class Feet extends schemaFactory.object("Feet", { length: schemaFactory.number }) {}
|
|
71
|
+
* class Meters extends schemaFactory.object("Meters", {
|
|
72
|
+
* // To avoid ambiguity when parsing unions of Feet and Meters, this renames the length field to "meters".
|
|
73
|
+
* // To preserve compatibility with existing data from the ambiguous case,
|
|
74
|
+
* // `{ key: "length" }` is set, so when persisted in the tree "length" is used as the field name.
|
|
75
|
+
* meters: schemaFactory.required(schemaFactory.number, { key: "length" }),
|
|
76
|
+
* }) {}
|
|
77
|
+
* const config = new TreeViewConfiguration({
|
|
78
|
+
* // This combination of schema is not ambiguous because `Feet` and `Meters` have different required keys.
|
|
79
|
+
* schema: [Feet, Meters],
|
|
80
|
+
* preventAmbiguity: true,
|
|
81
|
+
* });
|
|
82
|
+
* const view = tree.viewWith(config);
|
|
83
|
+
* // This now works, since the field is sufficient to determine this is a `Meters` node.
|
|
84
|
+
* view.initialize({ meters: 5 });
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @privateRemarks
|
|
88
|
+
* In the future, we can support lossless round tripping via the canonical JSON-like representation above when unambiguous.
|
|
89
|
+
* 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.
|
|
90
|
+
*
|
|
91
|
+
* To make this more permissive in the future we can:
|
|
92
|
+
*
|
|
93
|
+
* - Make toMapTree more permissive (ex: allow disambiguation based on leaf type)
|
|
94
|
+
* - Update this check to more tightly match toMapTree
|
|
95
|
+
* - Add options to help schema authors disambiguate their types, such as "constant fields" which are not persisted, and always have a constant value.
|
|
96
|
+
*
|
|
97
|
+
* The above examples exist in executable form in this files tests, and should be updated there then copied back here.
|
|
98
|
+
*/
|
|
99
|
+
readonly preventAmbiguity?: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Property-bag configuration for {@link TreeViewConfiguration} construction.
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
export interface ITreeViewConfiguration<TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends ITreeConfigurationOptions {
|
|
106
|
+
/**
|
|
107
|
+
* The schema which the application wants to view the tree with.
|
|
108
|
+
*/
|
|
109
|
+
readonly schema: TSchema;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Configuration for {@link ViewableTree.viewWith}.
|
|
113
|
+
* @sealed @public
|
|
114
|
+
*/
|
|
115
|
+
export declare class TreeViewConfiguration<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> implements Required<ITreeViewConfiguration<TSchema>> {
|
|
116
|
+
protected _typeCheck: MakeNominal;
|
|
117
|
+
/**
|
|
118
|
+
* {@inheritDoc ITreeViewConfiguration.schema}
|
|
119
|
+
*/
|
|
120
|
+
readonly schema: TSchema;
|
|
121
|
+
/**
|
|
122
|
+
* {@inheritDoc ITreeConfigurationOptions.enableSchemaValidation}
|
|
123
|
+
*/
|
|
124
|
+
readonly enableSchemaValidation: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* {@inheritDoc ITreeConfigurationOptions.preventAmbiguity}
|
|
127
|
+
*/
|
|
128
|
+
readonly preventAmbiguity: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Construct a new {@link TreeViewConfiguration}.
|
|
131
|
+
*
|
|
132
|
+
* @param props - Property bag of configuration options.
|
|
133
|
+
*
|
|
134
|
+
* @remarks
|
|
135
|
+
* Performing this construction deeply validates the provided schema.
|
|
136
|
+
* This means that when this constructor is called, all {@link LazyItem} {@link TreeNodeSchema} references will be evaluated (using {@link evaluateLazySchema}).
|
|
137
|
+
* This means that the declarations for all transitively reachable {@link TreeNodeSchema} must be available at this time.
|
|
138
|
+
*
|
|
139
|
+
* For example, a schema reachable from this configuration cannot reference this configuration during its declaration,
|
|
140
|
+
* since this would be a cyclic dependency that will cause an error when constructing this configuration.
|
|
141
|
+
*/
|
|
142
|
+
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* {@link TreeViewConfiguration} extended with some alpha APIs.
|
|
146
|
+
* @sealed @alpha
|
|
147
|
+
*/
|
|
148
|
+
export declare class TreeViewConfigurationAlpha<const TSchema extends ImplicitFieldSchema = ImplicitFieldSchema> extends TreeViewConfiguration<TSchema> implements TreeSchema {
|
|
149
|
+
/**
|
|
150
|
+
* {@inheritDoc TreeSchema.root}
|
|
151
|
+
*/
|
|
152
|
+
readonly root: FieldSchemaAlpha;
|
|
153
|
+
/**
|
|
154
|
+
* {@inheritDoc TreeSchema.definitions}
|
|
155
|
+
*/
|
|
156
|
+
readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
157
|
+
constructor(props: ITreeViewConfiguration<TSchema>);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* {@link TreeViewConfigurationAlpha}
|
|
161
|
+
* @sealed @alpha
|
|
162
|
+
*/
|
|
163
|
+
export interface TreeSchema extends SimpleTreeSchema {
|
|
164
|
+
/**
|
|
165
|
+
* {@inheritDoc SimpleTreeSchema.root}
|
|
166
|
+
*/
|
|
167
|
+
readonly root: FieldSchemaAlpha;
|
|
168
|
+
/**
|
|
169
|
+
* {@inheritDoc SimpleTreeSchema.definitions}
|
|
170
|
+
*/
|
|
171
|
+
readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Detect cases documented in {@link ITreeConfigurationOptions.preventAmbiguity}.
|
|
175
|
+
*/
|
|
176
|
+
export declare function checkUnion(union: Iterable<TreeNodeSchema>, errors: string[]): void;
|
|
177
|
+
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAIxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACzC;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyEG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACpC;AAOD;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CACtC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CACxD,SAAQ,yBAAyB;IAClC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,qBAAqB,CACjC,KAAK,CAAC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CAC9D,YAAW,QAAQ,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAErD,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAEnC;;OAEG;IACH,SAAgB,MAAM,EAAE,OAAO,CAAC;IAEhC;;OAEG;IACH,SAAgB,sBAAsB,EAAE,OAAO,CAAC;IAEhD;;OAEG;IACH,SAAgB,gBAAgB,EAAE,OAAO,CAAC;IAE1C;;;;;;;;;;;;OAYG;gBACgB,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC;CA+BzD;AAED;;;GAGG;AACH,qBAAa,0BAA0B,CACrC,KAAK,CAAC,OAAO,SAAS,mBAAmB,GAAG,mBAAmB,CAEhE,SAAQ,qBAAqB,CAAC,OAAO,CACrC,YAAW,UAAU;IAErB;;OAEG;IACH,SAAgB,IAAI,EAAE,gBAAgB,CAAC;IACvC;;OAEG;IACH,SAAgB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC;gBAEjE,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC;CAUzD;AAED;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,gBAAgB;IACnD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAAC,CAAC;CAC7E;AAWD;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAsFlF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
7
|
+
import { FieldKind, markSchemaMostDerived, normalizeFieldSchema, } from "../schemaTypes.js";
|
|
8
|
+
import { NodeKind } from "../core/index.js";
|
|
9
|
+
import { toStoredSchema } from "../toStoredSchema.js";
|
|
10
|
+
import { LeafNodeSchema } from "../leafNodeSchema.js";
|
|
11
|
+
import { isObjectNodeSchema } from "../objectNodeTypes.js";
|
|
12
|
+
import { getOrCreate } from "../../util/index.js";
|
|
13
|
+
import { walkFieldSchema } from "../walkFieldSchema.js";
|
|
14
|
+
const defaultTreeConfigurationOptions = {
|
|
15
|
+
enableSchemaValidation: false,
|
|
16
|
+
preventAmbiguity: false,
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for {@link ViewableTree.viewWith}.
|
|
20
|
+
* @sealed @public
|
|
21
|
+
*/
|
|
22
|
+
export class TreeViewConfiguration {
|
|
23
|
+
/**
|
|
24
|
+
* Construct a new {@link TreeViewConfiguration}.
|
|
25
|
+
*
|
|
26
|
+
* @param props - Property bag of configuration options.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Performing this construction deeply validates the provided schema.
|
|
30
|
+
* This means that when this constructor is called, all {@link LazyItem} {@link TreeNodeSchema} references will be evaluated (using {@link evaluateLazySchema}).
|
|
31
|
+
* This means that the declarations for all transitively reachable {@link TreeNodeSchema} must be available at this time.
|
|
32
|
+
*
|
|
33
|
+
* For example, a schema reachable from this configuration cannot reference this configuration during its declaration,
|
|
34
|
+
* since this would be a cyclic dependency that will cause an error when constructing this configuration.
|
|
35
|
+
*/
|
|
36
|
+
constructor(props) {
|
|
37
|
+
const config = { ...defaultTreeConfigurationOptions, ...props };
|
|
38
|
+
this.schema = config.schema;
|
|
39
|
+
this.enableSchemaValidation = config.enableSchemaValidation;
|
|
40
|
+
this.preventAmbiguity = config.preventAmbiguity;
|
|
41
|
+
// Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.
|
|
42
|
+
const ambiguityErrors = [];
|
|
43
|
+
walkFieldSchema(config.schema, {
|
|
44
|
+
// Ensure all reachable schema are marked as most derived.
|
|
45
|
+
// This ensures if multiple schema extending the same schema factory generated class are present (or have been constructed, or get constructed in the future),
|
|
46
|
+
// an error is reported.
|
|
47
|
+
node: (schema) => markSchemaMostDerived(schema, true),
|
|
48
|
+
allowedTypes(types) {
|
|
49
|
+
if (config.preventAmbiguity) {
|
|
50
|
+
checkUnion(types, ambiguityErrors);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
if (ambiguityErrors.length !== 0) {
|
|
55
|
+
// Duplicate errors are common since when two types conflict, both orders error:
|
|
56
|
+
const deduplicated = new Set(ambiguityErrors);
|
|
57
|
+
throw new UsageError(`Ambiguous schema found:\n${[...deduplicated].join("\n")}`);
|
|
58
|
+
}
|
|
59
|
+
// Eagerly perform this conversion to surface errors sooner.
|
|
60
|
+
toStoredSchema(config.schema);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* {@link TreeViewConfiguration} extended with some alpha APIs.
|
|
65
|
+
* @sealed @alpha
|
|
66
|
+
*/
|
|
67
|
+
export class TreeViewConfigurationAlpha extends TreeViewConfiguration {
|
|
68
|
+
constructor(props) {
|
|
69
|
+
super(props);
|
|
70
|
+
this.root = normalizeFieldSchema(props.schema);
|
|
71
|
+
const definitions = new Map();
|
|
72
|
+
walkFieldSchema(props.schema, {
|
|
73
|
+
node: (schema) => definitions.set(schema.identifier, schema),
|
|
74
|
+
});
|
|
75
|
+
this.definitions = definitions;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Pretty print a set of types for use in error messages.
|
|
80
|
+
*/
|
|
81
|
+
function formatTypes(allowed) {
|
|
82
|
+
// Use JSON.stringify to quote and escape identifiers.
|
|
83
|
+
// Don't just use a single array JSON.stringify since that omits spaces between items
|
|
84
|
+
return `[${Array.from(allowed, (s) => JSON.stringify(s.identifier)).join(", ")}]`;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Detect cases documented in {@link ITreeConfigurationOptions.preventAmbiguity}.
|
|
88
|
+
*/
|
|
89
|
+
export function checkUnion(union, errors) {
|
|
90
|
+
const checked = new Set();
|
|
91
|
+
const maps = [];
|
|
92
|
+
const arrays = [];
|
|
93
|
+
const objects = [];
|
|
94
|
+
// Map from key to schema using that key
|
|
95
|
+
const allObjectKeys = new Map();
|
|
96
|
+
for (const schema of union) {
|
|
97
|
+
if (checked.has(schema)) {
|
|
98
|
+
throw new UsageError(`Duplicate schema in allowed types: ${schema.identifier}`);
|
|
99
|
+
}
|
|
100
|
+
checked.add(schema);
|
|
101
|
+
if (schema instanceof LeafNodeSchema) {
|
|
102
|
+
// nothing to do
|
|
103
|
+
}
|
|
104
|
+
else if (isObjectNodeSchema(schema)) {
|
|
105
|
+
objects.push(schema);
|
|
106
|
+
for (const key of schema.fields.keys()) {
|
|
107
|
+
getOrCreate(allObjectKeys, key, () => new Set()).add(schema);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else if (schema.kind === NodeKind.Array) {
|
|
111
|
+
arrays.push(schema);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
assert(schema.kind === NodeKind.Map, 0x9e7 /* invalid schema */);
|
|
115
|
+
maps.push(schema);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (arrays.length > 1) {
|
|
119
|
+
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.`);
|
|
120
|
+
}
|
|
121
|
+
if (maps.length > 1) {
|
|
122
|
+
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.`);
|
|
123
|
+
}
|
|
124
|
+
if (maps.length > 0 && arrays.length > 0) {
|
|
125
|
+
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.`);
|
|
126
|
+
}
|
|
127
|
+
if (objects.length > 0 && maps.length > 0) {
|
|
128
|
+
errors.push(`Both a object and a map allowed within union (${formatTypes([...objects, ...maps])}). Both can be constructed from objects and can be ambiguous.`);
|
|
129
|
+
}
|
|
130
|
+
// Check for objects which fully overlap:
|
|
131
|
+
for (const schema of objects) {
|
|
132
|
+
// All objects which might be ambiguous relative to `schema`.
|
|
133
|
+
const possiblyAmbiguous = new Set(objects);
|
|
134
|
+
// A schema can't be ambiguous with itself
|
|
135
|
+
possiblyAmbiguous.delete(schema);
|
|
136
|
+
// For each field of schema, remove schema from possiblyAmbiguous that do not have that field
|
|
137
|
+
for (const [key, field] of schema.fields) {
|
|
138
|
+
if (field.kind === FieldKind.Required) {
|
|
139
|
+
const withKey = allObjectKeys.get(key) ?? fail(0xb35 /* missing schema */);
|
|
140
|
+
for (const candidate of possiblyAmbiguous) {
|
|
141
|
+
if (!withKey.has(candidate)) {
|
|
142
|
+
possiblyAmbiguous.delete(candidate);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (possiblyAmbiguous.size > 0) {
|
|
148
|
+
// TODO: make this check more permissive.
|
|
149
|
+
// Allow using the type of the field to disambiguate, at least for leaf types.
|
|
150
|
+
// Add "constant" fields which can be used to disambiguate even more cases without adding persisted data: maybe make them optional in constructor?
|
|
151
|
+
// Consider separating unambiguous implicit construction format from constructor arguments at type level, allowing constructor to superset the implicit construction options (ex: optional constant fields).
|
|
152
|
+
// The policy here however must remain at least as conservative as shallowCompatibilityTest in src/simple-tree/toMapTree.ts.
|
|
153
|
+
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.`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/simple-tree/api/configuration.ts"],"names":[],"mappings":"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","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"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { toJsonSchema } from "./simpleSchemaToJsonSchema.js";
|
|
6
|
-
import { TreeViewConfigurationAlpha } from "./
|
|
6
|
+
import { TreeViewConfigurationAlpha } from "./configuration.js";
|
|
7
7
|
/**
|
|
8
8
|
* Creates a {@link https://json-schema.org/ | JSON Schema} representation of the provided {@link TreeNodeSchema}.
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getJsonSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/getJsonSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAiBhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,UAAU,aAAa,CAC5B,MAA4B,EAC5B,OAA4C;IAE5C,MAAM,UAAU,GAAG,IAAI,0BAA0B,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { JsonTreeSchema } from \"./jsonSchema.js\";\nimport type { ImplicitAllowedTypes } from \"../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
|
|
6
|
-
export {
|
|
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";
|
|
9
|
+
export { SchemaFactory, type ScopedSchemaName, type SchemaFactoryObjectOptions, type SchemaStatics, 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,17 +17,18 @@ 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 {
|
|
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 "./
|
|
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";
|
|
26
29
|
export { type TransactionConstraint, type NodeInDocumentConstraint, type RunTransactionParams, type VoidTransactionCallbackStatus, type TransactionCallbackStatus, type TransactionResult, type TransactionResultExt, type TransactionResultSuccess, type TransactionResultFailed, rollback, } from "./transactionTypes.js";
|
|
27
30
|
export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
28
31
|
export { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
32
|
+
export type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
29
33
|
export { RecursiveObject as test_RecursiveObject, base as test_RecursiveObject_base, RecursiveObjectPojoMode as test_RecursiveObjectPojoMode, } from "./testRecursiveDomain.js";
|
|
30
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { TreeViewConfiguration, TreeViewConfigurationAlpha,
|
|
6
|
-
export {
|
|
5
|
+
export { TreeViewConfiguration, TreeViewConfigurationAlpha, } from "./configuration.js";
|
|
6
|
+
export { asTreeViewAlpha } from "./tree.js";
|
|
7
|
+
export { SchemaFactory, schemaStatics, } from "./schemaFactory.js";
|
|
7
8
|
export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
|
|
8
9
|
export { allowUnused } from "./schemaFactoryRecursive.js";
|
|
9
10
|
export { adaptEnum, enumFromStrings, singletonSchema, } from "./schemaCreationUtilities.js";
|
|
@@ -11,11 +12,11 @@ export { treeNodeApi, tryGetSchema } from "./treeNodeApi.js";
|
|
|
11
12
|
export { createFromInsertable, cursorFromInsertable, createFromCursor } from "./create.js";
|
|
12
13
|
export { getJsonSchema } from "./getJsonSchema.js";
|
|
13
14
|
export { getSimpleSchema } from "./getSimpleSchema.js";
|
|
14
|
-
export {
|
|
15
|
+
export { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
|
|
15
16
|
export { applySchemaToParserOptions, cursorFromVerbose, verboseFromCursor, replaceVerboseTreeHandles, } from "./verboseTree.js";
|
|
16
17
|
export { customFromCursorStored, tryStoredSchemaAsArray, replaceHandles, } from "./customTree.js";
|
|
17
18
|
export { conciseFromCursor, replaceConciseTreeHandles, } from "./conciseTree.js";
|
|
18
|
-
export { TreeBeta } from "./
|
|
19
|
+
export { TreeBeta } from "./treeBeta.js";
|
|
19
20
|
export { createSimpleTreeIndex } from "./simpleTreeIndex.js";
|
|
20
21
|
export { createIdentifierIndex, } from "./identifierIndex.js";
|
|
21
22
|
export { extractPersistedSchema, comparePersistedSchemaInternal, comparePersistedSchema, } from "./storedSchema.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/simple-tree/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EACN,qBAAqB,EACrB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAY5B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EACN,aAAa,EAIb,aAAa,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACN,SAAS,EACT,eAAe,EACf,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAoB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAiB3F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAS3E,OAAO,EAGN,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,sBAAsB,EAGtB,sBAAsB,EACtB,cAAc,GAEd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEN,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAmD,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAwB,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACN,qBAAqB,GAErB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAUN,QAAQ,GACR,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAGnE,6FAA6F;AAC7F,4IAA4I;AAC5I,OAAO,EACN,eAAe,IAAI,oBAAoB,EACvC,IAAI,IAAI,yBAAyB,EACjC,uBAAuB,IAAI,4BAA4B,GACvD,MAAM,0BAA0B,CAAC","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\tschemaStatics,\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\";\nexport type { TreeChangeEvents } from \"./treeChangeEvents.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"]}
|