@fluidframework/tree 2.40.0-336023 → 2.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/api-report/tree.alpha.api.md +4 -1
- package/dist/alpha.d.ts +1 -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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +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 +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +8 -9
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +9 -33
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +1 -4
- 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/tree.d.ts +24 -0
- package/dist/shared-tree/tree.d.ts.map +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +2 -0
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +3 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- 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/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +2 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +9 -0
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +7 -0
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +8 -7
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +13 -9
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +25 -0
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +4 -1
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- 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/arrayNode.d.ts +28 -0
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.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 +2 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +3 -2
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +1 -0
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- 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/tableSchema.d.ts +302 -83
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +299 -57
- 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/lib/alpha.d.ts +1 -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 +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +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 +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +8 -9
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +10 -34
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +2 -5
- 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/tree.d.ts +24 -0
- package/lib/shared-tree/tree.d.ts.map +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +2 -0
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +4 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- 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/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +9 -0
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +7 -0
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +8 -7
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +17 -11
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +25 -0
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +4 -1
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- 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/arrayNode.d.ts +28 -0
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.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 +2 -2
- 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/schemaTypes.d.ts +1 -0
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- 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/tableSchema.d.ts +302 -83
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +299 -57
- 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/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 +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +3 -2
- package/src/shared-tree/index.ts +2 -0
- package/src/shared-tree/schematizeTree.ts +5 -35
- package/src/shared-tree/schematizingTreeView.ts +2 -10
- package/src/shared-tree/sharedTree.ts +67 -6
- package/src/shared-tree/tree.ts +24 -0
- package/src/shared-tree/treeAlpha.ts +6 -3
- package/src/shared-tree-core/branchCommitEnricher.ts +0 -1
- package/src/shared-tree-core/transactionEnricher.ts +4 -1
- package/src/simple-tree/api/index.ts +2 -0
- package/src/simple-tree/api/schemaFactory.ts +9 -0
- package/src/simple-tree/api/storedSchema.ts +24 -13
- package/src/simple-tree/api/tree.ts +25 -0
- package/src/simple-tree/api/treeBeta.ts +3 -1
- package/src/simple-tree/api/treeChangeEvents.ts +84 -0
- package/src/simple-tree/api/treeNodeApi.ts +1 -1
- package/src/simple-tree/arrayNode.ts +28 -0
- 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 +2 -1
- package/src/simple-tree/schemaTypes.ts +1 -0
- package/src/simple-tree/toStoredSchema.ts +42 -41
- package/src/tableSchema.ts +665 -197
- package/src/treeFactory.ts +56 -173
- 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/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/src/core/schema-stored/{format.ts → formatV1.ts} +0 -0
|
@@ -13,6 +13,7 @@ import type { IChannelStorageService } from "@fluidframework/datastore-definitio
|
|
|
13
13
|
import type {
|
|
14
14
|
IChannelView,
|
|
15
15
|
IFluidSerializer,
|
|
16
|
+
SharedKernel,
|
|
16
17
|
} from "@fluidframework/shared-object-base/internal";
|
|
17
18
|
import {
|
|
18
19
|
UsageError,
|
|
@@ -46,6 +47,7 @@ import {
|
|
|
46
47
|
DetachedFieldIndexSummarizer,
|
|
47
48
|
FieldKinds,
|
|
48
49
|
ForestSummarizer,
|
|
50
|
+
SchemaCodecVersion,
|
|
49
51
|
SchemaSummarizer,
|
|
50
52
|
TreeCompressionStrategy,
|
|
51
53
|
buildChunkedForest,
|
|
@@ -54,6 +56,7 @@ import {
|
|
|
54
56
|
jsonableTreeFromFieldCursor,
|
|
55
57
|
makeFieldBatchCodec,
|
|
56
58
|
makeMitigatedChangeFamily,
|
|
59
|
+
makeSchemaCodec,
|
|
57
60
|
makeTreeChunker,
|
|
58
61
|
} from "../feature-libraries/index.js";
|
|
59
62
|
import {
|
|
@@ -90,7 +93,14 @@ import { SharedTreeChangeFamily } from "./sharedTreeChangeFamily.js";
|
|
|
90
93
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
91
94
|
import type { SharedTreeEditBuilder } from "./sharedTreeEditBuilder.js";
|
|
92
95
|
import { type TreeCheckout, type BranchableTree, createTreeCheckout } from "./treeCheckout.js";
|
|
93
|
-
import {
|
|
96
|
+
import {
|
|
97
|
+
type Breakable,
|
|
98
|
+
breakingClass,
|
|
99
|
+
type JsonCompatible,
|
|
100
|
+
throwIfBroken,
|
|
101
|
+
} from "../util/index.js";
|
|
102
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
103
|
+
import type { Format } from "../feature-libraries/schema-index/index.js";
|
|
94
104
|
|
|
95
105
|
/**
|
|
96
106
|
* Copy of data from an {@link ITreePrivate} at some point in time.
|
|
@@ -156,7 +166,7 @@ export interface ITreePrivate extends ITreeInternal {
|
|
|
156
166
|
*/
|
|
157
167
|
interface ExplicitCodecVersions extends ExplicitCoreCodecVersions {
|
|
158
168
|
forest: number;
|
|
159
|
-
schema:
|
|
169
|
+
schema: SchemaCodecVersion;
|
|
160
170
|
detachedFieldIndex: number;
|
|
161
171
|
fieldBatch: number;
|
|
162
172
|
}
|
|
@@ -186,18 +196,35 @@ function getCodecVersions(formatVersion: number): ExplicitCodecVersions {
|
|
|
186
196
|
return versions;
|
|
187
197
|
}
|
|
188
198
|
|
|
199
|
+
/**
|
|
200
|
+
* The type SharedTree's kernel's view must implement so what when its merged with the underling SharedObject's API it fully implements the required tree API surface ({@link ITreePrivate }).
|
|
201
|
+
*/
|
|
202
|
+
export type SharedTreeKernelView = Omit<ITreePrivate, keyof (IChannelView & IFluidLoadable)>;
|
|
203
|
+
|
|
189
204
|
/**
|
|
190
205
|
* SharedTreeCore, configured with a good set of indexes and field kinds which will maintain compatibility over time.
|
|
191
206
|
*
|
|
192
207
|
* TODO: detail compatibility requirements.
|
|
193
208
|
*/
|
|
194
209
|
@breakingClass
|
|
195
|
-
export class SharedTreeKernel
|
|
210
|
+
export class SharedTreeKernel
|
|
211
|
+
extends SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>
|
|
212
|
+
implements SharedKernel
|
|
213
|
+
{
|
|
196
214
|
public readonly checkout: TreeCheckout;
|
|
197
215
|
public get storedSchema(): TreeStoredSchemaRepository {
|
|
198
216
|
return this.checkout.storedSchema;
|
|
199
217
|
}
|
|
200
218
|
|
|
219
|
+
/**
|
|
220
|
+
* The app-facing API for SharedTree implemented by this Kernel.
|
|
221
|
+
* @remarks
|
|
222
|
+
* This is the API grafted onto the ISharedObject which apps can access.
|
|
223
|
+
* It includes both the APIs used for internal testing, and public facing APIs (both stable and unstable).
|
|
224
|
+
* Different users will have access to different subsets of this API, see {@link ITree}, {@link ITreeAlpha} and {@link ITreeInternal} which this {@link ITreePrivate} extends.
|
|
225
|
+
*/
|
|
226
|
+
public readonly view: SharedTreeKernelView;
|
|
227
|
+
|
|
201
228
|
public constructor(
|
|
202
229
|
breaker: Breakable,
|
|
203
230
|
sharedObject: IChannelView & IFluidLoadable,
|
|
@@ -219,9 +246,14 @@ export class SharedTreeKernel extends SharedTreeCore<SharedTreeEditBuilder, Shar
|
|
|
219
246
|
idCompressor,
|
|
220
247
|
options,
|
|
221
248
|
);
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
249
|
+
const schemaCodec = makeSchemaCodec(options, codecVersions.schema);
|
|
250
|
+
const schemaSummarizer = new SchemaSummarizer(
|
|
251
|
+
schema,
|
|
252
|
+
{
|
|
253
|
+
getCurrentSeq: lastSequenceNumber,
|
|
254
|
+
},
|
|
255
|
+
schemaCodec,
|
|
256
|
+
);
|
|
225
257
|
const fieldBatchCodec = makeFieldBatchCodec(options, codecVersions.fieldBatch);
|
|
226
258
|
|
|
227
259
|
const encoderContext = {
|
|
@@ -331,6 +363,14 @@ export class SharedTreeKernel extends SharedTreeCore<SharedTreeEditBuilder, Shar
|
|
|
331
363
|
}
|
|
332
364
|
}
|
|
333
365
|
});
|
|
366
|
+
|
|
367
|
+
this.view = {
|
|
368
|
+
contentSnapshot: () => this.contentSnapshot(),
|
|
369
|
+
exportSimpleSchema: () => this.exportSimpleSchema(),
|
|
370
|
+
exportVerbose: () => this.exportVerbose(),
|
|
371
|
+
viewWith: this.viewWith.bind(this),
|
|
372
|
+
kernel: this,
|
|
373
|
+
};
|
|
334
374
|
}
|
|
335
375
|
|
|
336
376
|
public exportVerbose(): VerboseTree | undefined {
|
|
@@ -450,6 +490,27 @@ export function exportSimpleSchema(storedSchema: TreeStoredSchema): SimpleTreeSc
|
|
|
450
490
|
};
|
|
451
491
|
}
|
|
452
492
|
|
|
493
|
+
/**
|
|
494
|
+
* A way to parse schema in the persisted format from {@link extractPersistedSchema}.
|
|
495
|
+
* @remarks
|
|
496
|
+
* This behaves identically to {@link ITreeAlpha.exportSimpleSchema},
|
|
497
|
+
* except that it gets the schema from the caller instead of from an existing tree.
|
|
498
|
+
*
|
|
499
|
+
* This can be useful for inspecting the contents of persisted schema,
|
|
500
|
+
* such as those generated by {@link extractPersistedSchema} for use in testing.
|
|
501
|
+
* Since that data format is otherwise unspecified,
|
|
502
|
+
* this provides a way to inspect its contents with documented semantics.
|
|
503
|
+
* @alpha
|
|
504
|
+
*/
|
|
505
|
+
export function persistedToSimpleSchema(
|
|
506
|
+
persisted: JsonCompatible,
|
|
507
|
+
options: ICodecOptions,
|
|
508
|
+
): SimpleTreeSchema {
|
|
509
|
+
const schemaCodec = makeSchemaCodec(options, SchemaCodecVersion.v1);
|
|
510
|
+
const stored = schemaCodec.decode(persisted as Format);
|
|
511
|
+
return exportSimpleSchema(stored);
|
|
512
|
+
}
|
|
513
|
+
|
|
453
514
|
/**
|
|
454
515
|
* Get a {@link BranchableTree} from a {@link ITree}.
|
|
455
516
|
* @remarks The branch can be used for "version control"-style coordination of edits on the tree.
|
package/src/shared-tree/tree.ts
CHANGED
|
@@ -96,7 +96,9 @@ export interface RunTransaction {
|
|
|
96
96
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
97
97
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
98
98
|
* However, using a transaction has the following additional consequences:
|
|
99
|
+
*
|
|
99
100
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
101
|
+
*
|
|
100
102
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
101
103
|
*
|
|
102
104
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -117,7 +119,9 @@ export interface RunTransaction {
|
|
|
117
119
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
118
120
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
119
121
|
* However, using a transaction has the following additional consequences:
|
|
122
|
+
*
|
|
120
123
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
124
|
+
*
|
|
121
125
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
122
126
|
*
|
|
123
127
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -143,7 +147,9 @@ export interface RunTransaction {
|
|
|
143
147
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
144
148
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
145
149
|
* However, using a transaction has the following additional consequences:
|
|
150
|
+
*
|
|
146
151
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
152
|
+
*
|
|
147
153
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
148
154
|
*
|
|
149
155
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -165,7 +171,9 @@ export interface RunTransaction {
|
|
|
165
171
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
166
172
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
167
173
|
* However, using a transaction has the following additional consequences:
|
|
174
|
+
*
|
|
168
175
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
176
|
+
*
|
|
169
177
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
170
178
|
*
|
|
171
179
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -188,7 +196,9 @@ export interface RunTransaction {
|
|
|
188
196
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
189
197
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
190
198
|
* However, using a transaction has the following additional consequences:
|
|
199
|
+
*
|
|
191
200
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
201
|
+
*
|
|
192
202
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
193
203
|
*
|
|
194
204
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -205,7 +215,9 @@ export interface RunTransaction {
|
|
|
205
215
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
206
216
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
207
217
|
* However, using a transaction has the following additional consequences:
|
|
218
|
+
*
|
|
208
219
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
220
|
+
*
|
|
209
221
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
210
222
|
*
|
|
211
223
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -229,7 +241,9 @@ export interface RunTransaction {
|
|
|
229
241
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
230
242
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
231
243
|
* However, using a transaction has the following additional consequences:
|
|
244
|
+
*
|
|
232
245
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
246
|
+
*
|
|
233
247
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
234
248
|
*
|
|
235
249
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -254,7 +268,9 @@ export interface RunTransaction {
|
|
|
254
268
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
255
269
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
256
270
|
* However, using a transaction has the following additional consequences:
|
|
271
|
+
*
|
|
257
272
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
273
|
+
*
|
|
258
274
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
259
275
|
*
|
|
260
276
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -283,7 +299,9 @@ export interface RunTransaction {
|
|
|
283
299
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
284
300
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
285
301
|
* However, using a transaction has the following additional consequences:
|
|
302
|
+
*
|
|
286
303
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
304
|
+
*
|
|
287
305
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
288
306
|
*
|
|
289
307
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -309,7 +327,9 @@ export interface RunTransaction {
|
|
|
309
327
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
310
328
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
311
329
|
* However, using a transaction has the following additional consequences:
|
|
330
|
+
*
|
|
312
331
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
332
|
+
*
|
|
313
333
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
314
334
|
*
|
|
315
335
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -336,7 +356,9 @@ export interface RunTransaction {
|
|
|
336
356
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
337
357
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
338
358
|
* However, using a transaction has the following additional consequences:
|
|
359
|
+
*
|
|
339
360
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
361
|
+
*
|
|
340
362
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
341
363
|
*
|
|
342
364
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -360,7 +382,9 @@ export interface RunTransaction {
|
|
|
360
382
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
361
383
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
362
384
|
* However, using a transaction has the following additional consequences:
|
|
385
|
+
*
|
|
363
386
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
387
|
+
*
|
|
364
388
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
365
389
|
*
|
|
366
390
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -34,8 +34,8 @@ import {
|
|
|
34
34
|
type VerboseTree,
|
|
35
35
|
toStoredSchema,
|
|
36
36
|
extractPersistedSchema,
|
|
37
|
-
TreeViewConfiguration,
|
|
38
37
|
type TreeBranch,
|
|
38
|
+
TreeViewConfigurationAlpha,
|
|
39
39
|
} from "../simple-tree/index.js";
|
|
40
40
|
import type { JsonCompatible } from "../util/index.js";
|
|
41
41
|
import { noopValidator, type FluidClientVersion, type ICodecOptions } from "../codec/index.js";
|
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
} from "../feature-libraries/index.js";
|
|
53
53
|
import { independentInitializedView, type ViewContent } from "./independentView.js";
|
|
54
54
|
import { SchematizingSimpleTreeView, ViewSlot } from "./schematizingTreeView.js";
|
|
55
|
+
import { currentVersion } from "../codec/index.js";
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
58
|
* Extensions to {@link (Tree:interface)} and {@link (TreeBeta:interface)} which are not yet stable.
|
|
@@ -197,7 +198,9 @@ export interface TreeAlpha {
|
|
|
197
198
|
* This API could be improved:
|
|
198
199
|
*
|
|
199
200
|
* 1. It could validate that the schema is compatible, and return or throw an error in the invalid case (maybe add a "try" version).
|
|
201
|
+
*
|
|
200
202
|
* 2. A "try" version of this could return an error if the data isn't in a supported format (as determined by version and/or JasonValidator).
|
|
203
|
+
*
|
|
201
204
|
* 3. Requiring the caller provide a JsonValidator isn't the most friendly API. It might be practical to provide a default.
|
|
202
205
|
*/
|
|
203
206
|
importCompressed<const TSchema extends ImplicitFieldSchema>(
|
|
@@ -311,12 +314,12 @@ export const TreeAlpha: TreeAlpha = {
|
|
|
311
314
|
idCompressor?: IIdCompressor;
|
|
312
315
|
} & ICodecOptions,
|
|
313
316
|
): Unhydrated<TreeFieldFromImplicitField<TSchema>> {
|
|
317
|
+
const config = new TreeViewConfigurationAlpha({ schema });
|
|
314
318
|
const content: ViewContent = {
|
|
315
|
-
schema: extractPersistedSchema(
|
|
319
|
+
schema: extractPersistedSchema(config, currentVersion),
|
|
316
320
|
tree: compressedData,
|
|
317
321
|
idCompressor: options.idCompressor ?? createIdCompressor(),
|
|
318
322
|
};
|
|
319
|
-
const config = new TreeViewConfiguration({ schema });
|
|
320
323
|
const view = independentInitializedView(config, options, content);
|
|
321
324
|
return TreeBeta.clone<TSchema>(view.root);
|
|
322
325
|
},
|
|
@@ -47,7 +47,6 @@ export class BranchCommitEnricher<TChange> {
|
|
|
47
47
|
/**
|
|
48
48
|
* Process the given change, preparing new commits for {@link BranchCommitEnricher.enrich | enrichment}.
|
|
49
49
|
* @param change - The change to process.
|
|
50
|
-
* @param isAttached - Whether or not the SharedTree is attached to the service.
|
|
51
50
|
*/
|
|
52
51
|
public processChange(change: SharedTreeBranchChange<TChange>): void {
|
|
53
52
|
if (change.type === "append") {
|
|
@@ -40,12 +40,15 @@ export class TransactionEnricher<TChange> {
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Commits the current transaction.
|
|
43
|
-
* @returns
|
|
43
|
+
* @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.
|
|
44
44
|
*/
|
|
45
45
|
public commitTransaction(): ((revision: RevisionTag) => TChange) | undefined {
|
|
46
46
|
const commitsCommitted = this.#transactionScopesStart.pop();
|
|
47
47
|
assert(commitsCommitted !== undefined, 0x985 /* No transaction to commit */);
|
|
48
48
|
if (this.#transactionScopesStart.length === 0) {
|
|
49
|
+
if (this.#transactionCommits.length === 0) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
49
52
|
const transactionCommits = this.#transactionCommits;
|
|
50
53
|
this.#transactionCommits = [];
|
|
51
54
|
return (revision: RevisionTag) =>
|
|
@@ -29,6 +29,7 @@ export {
|
|
|
29
29
|
type ScopedSchemaName,
|
|
30
30
|
type SchemaFactoryObjectOptions,
|
|
31
31
|
type SchemaStatics,
|
|
32
|
+
schemaStatics,
|
|
32
33
|
} from "./schemaFactory.js";
|
|
33
34
|
export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
|
|
34
35
|
export type {
|
|
@@ -125,6 +126,7 @@ export {
|
|
|
125
126
|
|
|
126
127
|
export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
127
128
|
export { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
129
|
+
export type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
128
130
|
|
|
129
131
|
// Exporting the schema (RecursiveObject) to test that recursive types are working correctly.
|
|
130
132
|
// These are `@internal` so they can't be included in the `InternalClassTreeTypes` due to https://github.com/microsoft/rushstack/issues/3639
|
|
@@ -182,7 +182,9 @@ export interface SchemaStatics {
|
|
|
182
182
|
*
|
|
183
183
|
* @remarks
|
|
184
184
|
* The number is a {@link https://en.wikipedia.org/wiki/Double-precision_floating-point_format | double-precision 64-bit binary format IEEE 754} value, however there are some exceptions:
|
|
185
|
+
*
|
|
185
186
|
* - `NaN`, and the infinities are converted to `null` (and may therefore only be used where `null` is allowed by the schema).
|
|
187
|
+
*
|
|
186
188
|
* - `-0` may be converted to `0` in some cases.
|
|
187
189
|
*
|
|
188
190
|
* These limitations match the limitations of JSON.
|
|
@@ -429,9 +431,13 @@ const schemaStaticsPublic: SchemaStatics = schemaStatics;
|
|
|
429
431
|
* It is legal to subclass the returned class, and even subclass that class,
|
|
430
432
|
* but only a single class from that class hierarchy can ever be instantiated or passed to any API as a {@link TreeNodeSchema|schema}.
|
|
431
433
|
* These base classes can be used with `instanceof`, but not with schema based APIs like `Tree.is`.
|
|
434
|
+
*
|
|
432
435
|
* 2. If overriding the constructor, the constructor must accept the same argument as the base constructor `super` and forward it to `super` unchanged.
|
|
436
|
+
*
|
|
433
437
|
* 3. Properties for fields defined in the schema should not be overridden.
|
|
438
|
+
*
|
|
434
439
|
* 4. Additional static members added to schema should pick relatively unique keys to reduce the risk of colliding with implementation details what are not exposed in the API.
|
|
440
|
+
*
|
|
435
441
|
* 5. If exporting the schema from a package which uses API-Extractor, export the base class and derived class separately to work around [a known limitation](https://github.com/microsoft/rushstack/issues/4429).
|
|
436
442
|
*
|
|
437
443
|
* Note:
|
|
@@ -1064,8 +1070,11 @@ export class SchemaFactory<
|
|
|
1064
1070
|
* The identifier generated by the SharedTree has the following properties:
|
|
1065
1071
|
*
|
|
1066
1072
|
* - It is a UUID which will not collide with other generated UUIDs.
|
|
1073
|
+
*
|
|
1067
1074
|
* - It is compressed to a space-efficient representation when stored in the document.
|
|
1075
|
+
*
|
|
1068
1076
|
* - A compressed form of the identifier can be accessed at runtime via the {@link TreeNodeApi.shortId|Tree.shortId()} API.
|
|
1077
|
+
*
|
|
1069
1078
|
* - It will error if read (and will not be present in the object's iterable properties) before the node has been inserted into a tree.
|
|
1070
1079
|
*
|
|
1071
1080
|
* However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).
|
|
@@ -3,29 +3,34 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { ICodecOptions } from "../../codec/index.js";
|
|
6
|
+
import type { FluidClientVersion, ICodecOptions } from "../../codec/index.js";
|
|
7
7
|
import type { TreeStoredSchema } from "../../core/index.js";
|
|
8
8
|
import {
|
|
9
9
|
defaultSchemaPolicy,
|
|
10
10
|
encodeTreeSchema,
|
|
11
11
|
makeSchemaCodec,
|
|
12
|
+
SchemaCodecVersion,
|
|
12
13
|
} from "../../feature-libraries/index.js";
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
import {
|
|
15
|
+
clientVersionToSchemaVersion,
|
|
16
|
+
type Format,
|
|
17
|
+
// eslint-disable-next-line import/no-internal-modules
|
|
18
|
+
} from "../../feature-libraries/schema-index/index.js";
|
|
15
19
|
import type { JsonCompatible } from "../../util/index.js";
|
|
16
20
|
import { normalizeFieldSchema, type ImplicitFieldSchema } from "../schemaTypes.js";
|
|
17
|
-
import {
|
|
21
|
+
import { simpleToStoredSchema } from "../toStoredSchema.js";
|
|
18
22
|
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
19
23
|
import { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
|
|
24
|
+
import type { SimpleTreeSchema } from "../simpleSchema.js";
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
|
-
* Dumps the "persisted" schema subset of the provided `schema` into a deterministic JSON-compatible, semi-human-readable
|
|
27
|
+
* Dumps the "persisted" schema subset of the provided `schema` into a deterministic JSON-compatible, semi-human-readable format.
|
|
28
|
+
*
|
|
29
|
+
* @param schema - The schema to dump.
|
|
23
30
|
*
|
|
24
31
|
* @remarks
|
|
25
32
|
* This can be used to help inspect schema for debugging, and to save a snapshot of schema to help detect and review changes to an applications schema.
|
|
26
|
-
*
|
|
27
|
-
* This format may change across major versions of this package: such changes are considered breaking.
|
|
28
|
-
* Beyond that, no compatibility guarantee is provided for this format: it should never be relied upon to load data, it should only be used for comparing outputs from this function.
|
|
33
|
+
* This format is also compatible with {@link ViewContent.schema}, {@link comparePersistedSchema} and {@link persistedToSimpleSchema}.
|
|
29
34
|
*
|
|
30
35
|
* This only includes the "persisted" subset of schema information, which means the portion which gets included in documents.
|
|
31
36
|
* It thus uses "persisted" keys, see {@link FieldProps.key}.
|
|
@@ -38,7 +43,7 @@ import { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
|
|
|
38
43
|
* An application could use this API to generate a `schema.json` file when it first releases,
|
|
39
44
|
* then test that the schema is sill compatible with documents from that version with a test like :
|
|
40
45
|
* ```typescript
|
|
41
|
-
* assert.deepEqual(extractPersistedSchema(MySchema), require("./schema.json"));
|
|
46
|
+
* assert.deepEqual(extractPersistedSchema(MySchema, FluidClientVersion.v2_0), require("./schema.json"));
|
|
42
47
|
* ```
|
|
43
48
|
*
|
|
44
49
|
* @privateRemarks
|
|
@@ -48,9 +53,13 @@ import { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
|
|
|
48
53
|
* Public API surface uses "persisted" terminology while internally we use "stored".
|
|
49
54
|
* @alpha
|
|
50
55
|
*/
|
|
51
|
-
export function extractPersistedSchema(
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
export function extractPersistedSchema(
|
|
57
|
+
schema: SimpleTreeSchema,
|
|
58
|
+
oldestCompatibleClient: FluidClientVersion,
|
|
59
|
+
): JsonCompatible {
|
|
60
|
+
const stored = simpleToStoredSchema(schema);
|
|
61
|
+
const writeVersion = clientVersionToSchemaVersion(oldestCompatibleClient);
|
|
62
|
+
return encodeTreeSchema(stored, writeVersion);
|
|
54
63
|
}
|
|
55
64
|
|
|
56
65
|
/**
|
|
@@ -89,7 +98,9 @@ export function comparePersistedSchema(
|
|
|
89
98
|
options: ICodecOptions,
|
|
90
99
|
canInitialize: boolean,
|
|
91
100
|
): SchemaCompatibilityStatus {
|
|
92
|
-
|
|
101
|
+
// Any version can be passed down to makeSchemaCodec here.
|
|
102
|
+
// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.
|
|
103
|
+
const schemaCodec = makeSchemaCodec(options, SchemaCodecVersion.v1);
|
|
93
104
|
const stored = schemaCodec.decode(persisted as Format);
|
|
94
105
|
const viewSchema = new SchemaCompatibilityTester(
|
|
95
106
|
defaultSchemaPolicy,
|
|
@@ -290,14 +290,18 @@ export interface TreeViewAlpha<
|
|
|
290
290
|
* "rollback" can be set to false or left undefined to indicate that the body of the transaction has successfully run.
|
|
291
291
|
* @param params - The optional parameters for the transaction. It includes the constraints that will be checked before the transaction begins.
|
|
292
292
|
* @returns A result object of {@link TransactionResultExt | TransactionResultExt} type. It includes the following:
|
|
293
|
+
*
|
|
293
294
|
* - A "success" flag indicating whether the transaction was successful or not.
|
|
295
|
+
*
|
|
294
296
|
* - The success of failure value as returned by the transaction function.
|
|
295
297
|
* @remarks
|
|
296
298
|
* This API will throw an error if the constraints are not met or something unexpected happens.
|
|
297
299
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
298
300
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
299
301
|
* However, using a transaction has the following additional consequences:
|
|
302
|
+
*
|
|
300
303
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
304
|
+
*
|
|
301
305
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
302
306
|
*
|
|
303
307
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -305,9 +309,12 @@ export interface TreeViewAlpha<
|
|
|
305
309
|
*
|
|
306
310
|
* Nested transactions:
|
|
307
311
|
* This API can be called from within the transaction callback of another runTransaction call. That will have slightly different behavior:
|
|
312
|
+
*
|
|
308
313
|
* - If the inner transaction fails, only the inner transaction will be rolled back and the outer transaction will continue.
|
|
314
|
+
*
|
|
309
315
|
* - Constraints will apply to the outermost transaction. Constraints are applied per commit and there will be one commit generated
|
|
310
316
|
* for the outermost transaction which includes all inner transactions.
|
|
317
|
+
*
|
|
311
318
|
* - Undo will undo the outermost transaction and all inner transactions.
|
|
312
319
|
*/
|
|
313
320
|
runTransaction<TSuccessValue, TFailureValue>(
|
|
@@ -317,10 +324,13 @@ export interface TreeViewAlpha<
|
|
|
317
324
|
/**
|
|
318
325
|
* Run a transaction which applies one or more edits to the tree as a single atomic unit.
|
|
319
326
|
* @param transaction - The function to run as the body of the transaction. It may return the following:
|
|
327
|
+
*
|
|
320
328
|
* - Nothing to indicate that the body of the transaction has successfully run.
|
|
329
|
+
*
|
|
321
330
|
* - A status object of {@link VoidTransactionCallbackStatus | VoidTransactionCallbackStatus } type. It includes a "rollback" property which
|
|
322
331
|
* may be returned as true at any point during the transaction. This will abort the transaction and discard any changes it made so
|
|
323
332
|
* far. "rollback" can be set to false or left undefined to indicate that the body of the transaction has successfully run.
|
|
333
|
+
*
|
|
324
334
|
* @param params - The optional parameters for the transaction. It includes the constraints that will be checked before the transaction begins.
|
|
325
335
|
* @returns A result object of {@link TransactionResult | TransactionResult} type. It includes a "success" flag indicating whether the
|
|
326
336
|
* transaction was successful or not.
|
|
@@ -329,7 +339,9 @@ export interface TreeViewAlpha<
|
|
|
329
339
|
* All of the changes in the transaction are applied synchronously and therefore no other changes (either from this client or from a remote client) can be interleaved with those changes.
|
|
330
340
|
* Note that this is guaranteed by Fluid for any sequence of changes that are submitted synchronously, whether in a transaction or not.
|
|
331
341
|
* However, using a transaction has the following additional consequences:
|
|
342
|
+
*
|
|
332
343
|
* - If reverted (e.g. via an "undo" operation), all the changes in the transaction are reverted together.
|
|
344
|
+
*
|
|
333
345
|
* - The internal data representation of a transaction with many changes is generally smaller and more efficient than that of the changes when separate.
|
|
334
346
|
*
|
|
335
347
|
* Local change events will be emitted for each change as the transaction is being applied.
|
|
@@ -337,9 +349,12 @@ export interface TreeViewAlpha<
|
|
|
337
349
|
*
|
|
338
350
|
* Nested transactions:
|
|
339
351
|
* This API can be called from within the transaction callback of another runTransaction call. That will have slightly different behavior:
|
|
352
|
+
*
|
|
340
353
|
* - If the inner transaction fails, only the inner transaction will be rolled back and the outer transaction will continue.
|
|
354
|
+
*
|
|
341
355
|
* - Constraints will apply to the outermost transaction. Constraints are applied per commit and there will be one commit generated
|
|
342
356
|
* for the outermost transaction which includes all inner transactions.
|
|
357
|
+
*
|
|
343
358
|
* - Undo will undo the outermost transaction and all inner transactions.
|
|
344
359
|
*/
|
|
345
360
|
runTransaction(
|
|
@@ -363,7 +378,9 @@ export interface SchemaCompatibilityStatus {
|
|
|
363
378
|
* exact matches in a strict (schema-based) sense but still allow the same documents, and the document notion is more useful to applications.
|
|
364
379
|
*
|
|
365
380
|
* Examples which are expressible where this may occur include:
|
|
381
|
+
*
|
|
366
382
|
* - schema repository `A` has extra schema which schema `B` doesn't have, but they are unused (i.e. not reachable from the root schema)
|
|
383
|
+
*
|
|
367
384
|
* - field in schema `A` has allowed field members which the corresponding field in schema `B` does not have, but those types are not constructible (ex: an object node type containing a required field with no allowed types)
|
|
368
385
|
*
|
|
369
386
|
* These cases are typically not interesting to applications.
|
|
@@ -441,11 +458,15 @@ export interface TreeBranchEvents extends Omit<TreeViewEvents, "commitApplied">
|
|
|
441
458
|
|
|
442
459
|
/**
|
|
443
460
|
* Fired when:
|
|
461
|
+
*
|
|
444
462
|
* - a local commit is applied outside of a transaction
|
|
463
|
+
*
|
|
445
464
|
* - a local transaction is committed
|
|
446
465
|
*
|
|
447
466
|
* The event is not fired when:
|
|
467
|
+
*
|
|
448
468
|
* - a local commit is applied within a transaction
|
|
469
|
+
*
|
|
449
470
|
* - a remote commit is applied
|
|
450
471
|
*
|
|
451
472
|
* @param data - information about the commit that was applied
|
|
@@ -481,11 +502,15 @@ export interface TreeViewEvents {
|
|
|
481
502
|
|
|
482
503
|
/**
|
|
483
504
|
* Fired when:
|
|
505
|
+
*
|
|
484
506
|
* - a local commit is applied outside of a transaction
|
|
507
|
+
*
|
|
485
508
|
* - a local transaction is committed
|
|
486
509
|
*
|
|
487
510
|
* The event is not fired when:
|
|
511
|
+
*
|
|
488
512
|
* - a local commit is applied within a transaction
|
|
513
|
+
*
|
|
489
514
|
* - a remote commit is applied
|
|
490
515
|
*
|
|
491
516
|
* @param data - information about the commit that was applied
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
getKernel,
|
|
8
8
|
isTreeNode,
|
|
9
9
|
type NodeKind,
|
|
10
|
-
type TreeChangeEvents,
|
|
11
10
|
type TreeNode,
|
|
12
11
|
type Unhydrated,
|
|
13
12
|
type WithType,
|
|
@@ -15,6 +14,7 @@ import {
|
|
|
15
14
|
import { treeNodeApi } from "./treeNodeApi.js";
|
|
16
15
|
import { createFromCursor } from "./create.js";
|
|
17
16
|
import type { ImplicitFieldSchema, TreeFieldFromImplicitField } from "../schemaTypes.js";
|
|
17
|
+
import type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
18
18
|
|
|
19
19
|
// Tests for this file are grouped with those for treeNodeApi.ts as that is where this functionality will eventually land,
|
|
20
20
|
// and where most of the actual implementation is for much of it.
|
|
@@ -122,7 +122,9 @@ export interface TreeBeta {
|
|
|
122
122
|
*
|
|
123
123
|
* - Local state, such as properties added to customized schema classes, will not be cloned. However, they will be
|
|
124
124
|
* initialized to their default state just as if the node had been created via its constructor.
|
|
125
|
+
*
|
|
125
126
|
* - Value node types (i.e., numbers, strings, booleans, nulls and Fluid handles) will be returned as is.
|
|
127
|
+
*
|
|
126
128
|
* - The identifiers in the node's subtree will be preserved, i.e., they are not replaced with new values.
|
|
127
129
|
*/
|
|
128
130
|
clone<const TSchema extends ImplicitFieldSchema>(
|