@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
|
@@ -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,uDAG4B;AAF3B,yHAAA,qBAAqB,OAAA;AACrB,8HAAA,0BAA0B,OAAA;AAa3B,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,uDAM4B;AAL3B,iHAAA,aAAa,OAAA;AAIb,iHAAA,aAAa,OAAA;AAEd,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAO3B,yEAA0D;AAAjD,wHAAA,WAAW,OAAA;AACpB,2EAIsC;AAHrC,uHAAA,SAAS,OAAA;AACT,6HAAA,eAAe,OAAA;AACf,6HAAA,eAAe,OAAA;AAEhB,mDAA+E;AAAtE,6GAAA,WAAW,OAAA;AAAoB,8GAAA,YAAY,OAAA;AACpD,yCAA2F;AAAlF,iHAAA,oBAAoB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAiBrE,uDAAmD;AAA1C,iHAAA,aAAa,OAAA;AACtB,2DAAuD;AAA9C,qHAAA,eAAe,OAAA;AACxB,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AASlC,mDAO0B;AAJzB,4HAAA,0BAA0B,OAAA;AAC1B,mHAAA,iBAAiB,OAAA;AACjB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,iDAQyB;AANxB,uHAAA,sBAAsB,OAAA;AAGtB,uHAAA,sBAAsB,OAAA;AACtB,+GAAA,cAAc,OAAA;AAIf,mDAI0B;AAFzB,mHAAA,iBAAiB,OAAA;AACjB,2HAAA,yBAAyB,OAAA;AAG1B,6CAA0F;AAAjF,uGAAA,QAAQ,OAAA;AACjB,2DAAmF;AAA1E,2HAAA,qBAAqB,OAAA;AAC9B,2DAG8B;AAF7B,2HAAA,qBAAqB,OAAA;AAItB,qDAI2B;AAH1B,yHAAA,sBAAsB,OAAA;AACtB,iIAAA,8BAA8B,OAAA;AAC9B,yHAAA,sBAAsB,OAAA;AAGvB,6DAW+B;AAD9B,+GAAA,QAAQ,OAAA;AAGT,6DAAuE;AAA9D,qIAAA,8BAA8B,OAAA;AACvC,6EAAmE;AAA1D,iIAAA,kBAAkB,OAAA;AAG3B,6FAA6F;AAC7F,4IAA4I;AAC5I,mEAIkC;AAHjC,8HAAA,eAAe,OAAwB;AACvC,mIAAA,IAAI,OAA6B;AACjC,sIAAA,uBAAuB,OAAgC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tTreeSchema,\n\tITreeViewConfiguration,\n\tITreeConfigurationOptions,\n} from \"./configuration.js\";\nexport {\n\tTreeViewConfiguration,\n\tTreeViewConfigurationAlpha,\n} from \"./configuration.js\";\nexport type {\n\tITree,\n\tTreeView,\n\tViewableTree,\n\tTreeViewEvents,\n\tSchemaCompatibilityStatus,\n\tTreeViewAlpha,\n\tTreeBranch,\n\tTreeBranchEvents,\n\tITreeAlpha,\n} from \"./tree.js\";\nexport { asTreeViewAlpha } from \"./tree.js\";\nexport {\n\tSchemaFactory,\n\ttype ScopedSchemaName,\n\ttype SchemaFactoryObjectOptions,\n\ttype SchemaStatics,\n\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"]}
|
|
@@ -4,26 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { AdaptedViewSchema, type Adapters, type TreeStoredSchema } from "../../core/index.js";
|
|
6
6
|
import { type FullSchemaPolicy } from "../../feature-libraries/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import type { FieldSchema } from "../schemaTypes.js";
|
|
8
8
|
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
9
9
|
/**
|
|
10
10
|
* A collection of View information for schema, including policy.
|
|
11
|
+
* @remarks
|
|
12
|
+
* This contains everything needed to determine compatibility with a given stored schema.
|
|
11
13
|
*/
|
|
12
|
-
export declare class
|
|
14
|
+
export declare class SchemaCompatibilityTester {
|
|
13
15
|
readonly policy: FullSchemaPolicy;
|
|
14
16
|
readonly adapters: Adapters;
|
|
15
17
|
/**
|
|
16
18
|
* Cached conversion of the view schema in the stored schema format.
|
|
17
19
|
*/
|
|
18
|
-
|
|
20
|
+
readonly viewSchemaAsStored: TreeStoredSchema;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* @param viewSchemaRoot - Schema for the root field.
|
|
21
23
|
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @param viewSchema - Schema for the root field of this view.
|
|
25
|
-
*/
|
|
26
|
-
constructor(policy: FullSchemaPolicy, adapters: Adapters, viewSchema: ImplicitFieldSchema);
|
|
24
|
+
constructor(policy: FullSchemaPolicy, adapters: Adapters, viewSchemaRoot: FieldSchema);
|
|
27
25
|
/**
|
|
28
26
|
* Determines the compatibility of a stored document
|
|
29
27
|
* (based on its stored schema) with a viewer (based on its view schema).
|
|
@@ -47,4 +45,4 @@ export declare class ViewSchema {
|
|
|
47
45
|
private adaptField;
|
|
48
46
|
private adaptTree;
|
|
49
47
|
}
|
|
50
|
-
//# sourceMappingURL=
|
|
48
|
+
//# sourceMappingURL=schemaCompatibilityTester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaCompatibilityTester.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,iBAAiB,EAEjB,KAAK,QAAQ,EAGb,KAAK,gBAAgB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,gBAAgB,EAOrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,yBAAyB;aAUpB,MAAM,EAAE,gBAAgB;aACxB,QAAQ,EAAE,QAAQ;IAVnC;;OAEG;IACH,SAAgB,kBAAkB,EAAE,gBAAgB,CAAC;IAErD;;OAEG;gBAEc,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,QAAQ,EAClC,cAAc,EAAE,WAAW;IAK5B;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAM,EAAE,gBAAgB,GACtB,IAAI,CAAC,yBAAyB,EAAE,eAAe,CAAC;IAkKnD;;;;OAIG;IACI,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB;IAiC7D;;OAEG;IACH,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,SAAS;CAIjB"}
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.SchemaCompatibilityTester = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../../core/index.js");
|
|
10
10
|
const index_js_2 = require("../../feature-libraries/index.js");
|
|
11
|
-
const schemaTypes_js_1 = require("../schemaTypes.js");
|
|
12
11
|
const toStoredSchema_js_1 = require("../toStoredSchema.js");
|
|
13
12
|
/**
|
|
14
13
|
* A collection of View information for schema, including policy.
|
|
14
|
+
* @remarks
|
|
15
|
+
* This contains everything needed to determine compatibility with a given stored schema.
|
|
15
16
|
*/
|
|
16
|
-
class
|
|
17
|
+
class SchemaCompatibilityTester {
|
|
17
18
|
/**
|
|
18
|
-
* @param
|
|
19
|
+
* @param viewSchemaRoot - Schema for the root field.
|
|
19
20
|
*/
|
|
20
|
-
constructor(policy, adapters,
|
|
21
|
+
constructor(policy, adapters, viewSchemaRoot) {
|
|
21
22
|
this.policy = policy;
|
|
22
23
|
this.adapters = adapters;
|
|
23
|
-
this.
|
|
24
|
-
this.viewSchemaAsStored = (0, toStoredSchema_js_1.toStoredSchema)(this.schema);
|
|
24
|
+
this.viewSchemaAsStored = (0, toStoredSchema_js_1.toStoredSchema)(viewSchemaRoot);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Determines the compatibility of a stored document
|
|
@@ -206,5 +206,5 @@ class ViewSchema {
|
|
|
206
206
|
return original;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
exports.
|
|
210
|
-
//# sourceMappingURL=
|
|
209
|
+
exports.SchemaCompatibilityTester = SchemaCompatibilityTester;
|
|
210
|
+
//# sourceMappingURL=schemaCompatibilityTester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4E;AAC5E,kDAO6B;AAC7B,+DAS0C;AAE1C,4DAAsD;AAGtD;;;;GAIG;AACH,MAAa,yBAAyB;IAMrC;;OAEG;IACH,YACiB,MAAwB,EACxB,QAAkB,EAClC,cAA2B;QAFX,WAAM,GAAN,MAAM,CAAkB;QACxB,aAAQ,GAAR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,MAAM,CAAC,UAAU,EAAE,CAAC;YAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAC5C,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QAC3C,CAAC;QAED,iEAAiE;QACjE,OAAO,IAAI,4BAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACK,UAAU,CAAC,QAA+B;QACjD,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAClC,MAAM,KAAK,GAAkC,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACrE,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;gBACrD,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;oBAClC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;oBAChC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;gBAC/B,CAAC;YACF,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAEO,SAAS,CAAC,QAA8B;QAC/C,sDAAsD;QACtD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AA3PD,8DA2PC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAdaptedViewSchema,\n\ttype TreeNodeStoredSchema,\n\ttype Adapters,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n} from \"../../core/index.js\";\nimport {\n\tFieldKinds,\n\ttype FullSchemaPolicy,\n\ttype FieldDiscrepancy,\n\tgetAllowedContentDiscrepancies,\n\tisNeverTree,\n\tPosetComparisonResult,\n\tfieldRealizer,\n\tcomparePosetElements,\n} from \"../../feature-libraries/index.js\";\nimport type { FieldSchema } from \"../schemaTypes.js\";\nimport { toStoredSchema } from \"../toStoredSchema.js\";\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\n\n/**\n * A collection of View information for schema, including policy.\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\t/**\n\t * Cached conversion of the view schema in the stored schema format.\n\t */\n\tpublic readonly viewSchemaAsStored: TreeStoredSchema;\n\n\t/**\n\t * @param viewSchemaRoot - Schema for the root field.\n\t */\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly adapters: Adapters,\n\t\tviewSchemaRoot: FieldSchema,\n\t) {\n\t\tthis.viewSchemaAsStored = toStoredSchema(viewSchemaRoot);\n\t}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// TODO: support adapters\n\t\t// const adapted = this.adaptRepo(stored);\n\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\t\t// View schema allows a superset of documents that stored schema does, hence the document could be upgraded to use a persisted version\n\t\t// of this view schema as its stored schema.\n\t\tlet canUpgrade = true;\n\n\t\tconst updateCompatibilityFromFieldDiscrepancy = (discrepancy: FieldDiscrepancy): void => {\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"allowedTypes\": {\n\t\t\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t\t\t// stored schema.\n\t\t\t\t\tif (\n\t\t\t\t\t\tdiscrepancy.stored.some(\n\t\t\t\t\t\t\t(identifier) =>\n\t\t\t\t\t\t\t\t!isNeverTree(this.policy, stored, stored.nodeSchema.get(identifier)),\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Stored schema has extra allowed types that the view schema does not.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tdiscrepancy.view.some(\n\t\t\t\t\t\t\t(identifier) =>\n\t\t\t\t\t\t\t\t!isNeverTree(\n\t\t\t\t\t\t\t\t\tthis.policy,\n\t\t\t\t\t\t\t\t\tthis.viewSchemaAsStored,\n\t\t\t\t\t\t\t\t\tthis.viewSchemaAsStored.nodeSchema.get(identifier),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// View schema has extra allowed types that the stored schema does not.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tconst result = comparePosetElements(\n\t\t\t\t\t\tdiscrepancy.stored,\n\t\t\t\t\t\tdiscrepancy.view,\n\t\t\t\t\t\tfieldRealizer,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (result === PosetComparisonResult.Greater) {\n\t\t\t\t\t\t// Stored schema is more relaxed than view schema.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdiscrepancy.view === FieldKinds.forbidden.identifier &&\n\t\t\t\t\t\t\tdiscrepancy.identifier !== undefined &&\n\t\t\t\t\t\t\tthis.policy.allowUnknownOptionalFields(discrepancy.identifier)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t\t\t\t\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Less) {\n\t\t\t\t\t\t// View schema is more relaxed than stored schema.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Incomparable) {\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\": {\n\t\t\t\t\tcanView = false;\n\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(discrepancy);\n\t\t\t}\n\t\t};\n\n\t\tfor (const discrepancy of getAllowedContentDiscrepancies(\n\t\t\tthis.viewSchemaAsStored,\n\t\t\tstored,\n\t\t)) {\n\t\t\tif (!canView && !canUpgrade) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"nodeKind\": {\n\t\t\t\t\tconst viewNodeSchema = this.viewSchemaAsStored.nodeSchema.get(\n\t\t\t\t\t\tdiscrepancy.identifier,\n\t\t\t\t\t);\n\t\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(discrepancy.identifier);\n\t\t\t\t\t// We conservatively do not allow node types to change.\n\t\t\t\t\t// The only time this might be valid in the sense that the data canonically converts is converting an object node\n\t\t\t\t\t// to a map node over the union of all the object fields' types.\n\t\t\t\t\tif (discrepancy.stored === undefined) {\n\t\t\t\t\t\tconst viewIsNever =\n\t\t\t\t\t\t\tviewNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, this.viewSchemaAsStored, viewNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!viewIsNever) {\n\t\t\t\t\t\t\t// View schema has added a node type that the stored schema doesn't know about.\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (discrepancy.view === undefined) {\n\t\t\t\t\t\tconst storedIsNever =\n\t\t\t\t\t\t\tstoredNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, stored, storedNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!storedIsNever) {\n\t\t\t\t\t\t\t// Stored schema has a node type that the view schema doesn't know about.\n\t\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Node type exists in both schemas but has changed. We conservatively never allow this.\n\t\t\t\t\t\tconst storedIsNever =\n\t\t\t\t\t\t\tstoredNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, stored, storedNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tconst viewIsNever =\n\t\t\t\t\t\t\tviewNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, this.viewSchemaAsStored, viewNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!storedIsNever || !viewIsNever) {\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\":\n\t\t\t\tcase \"allowedTypes\":\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tupdateCompatibilityFromFieldDiscrepancy(discrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fields\": {\n\t\t\t\t\tdiscrepancy.differences.forEach(updateCompatibilityFromFieldDiscrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// No default\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent: canView && canUpgrade,\n\t\t};\n\t}\n\n\t/**\n\t * Compute a schema that `original` could be viewed as using adapters as needed.\n\t *\n\t * TODO: have a way for callers to get invalidated on schema updates.\n\t */\n\tpublic adaptRepo(stored: TreeStoredSchema): AdaptedViewSchema {\n\t\t// Sanity check on adapters:\n\t\t// it's probably a bug if they use the never types,\n\t\t// since there never is a reason to have a never type as an adapter input,\n\t\t// and its impossible for an adapter to be correctly implemented if its output type is never\n\t\t// (unless its input is also never).\n\n\t\tfor (const adapter of this.adapters?.tree ?? []) {\n\t\t\tif (\n\t\t\t\tisNeverTree(\n\t\t\t\t\tthis.policy,\n\t\t\t\t\tthis.viewSchemaAsStored,\n\t\t\t\t\tthis.viewSchemaAsStored.nodeSchema.get(adapter.output),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfail(0xb3d /* tree adapter for stored adapter.output should not be never */);\n\t\t\t}\n\t\t}\n\n\t\tconst adapted = {\n\t\t\trootFieldSchema: this.adaptField(stored.rootFieldSchema),\n\t\t\tnodeSchema: new Map<TreeNodeSchemaIdentifier, TreeNodeStoredSchema>(),\n\t\t};\n\n\t\tfor (const [key, schema] of stored.nodeSchema) {\n\t\t\tconst adapatedTree = this.adaptTree(schema);\n\t\t\tadapted.nodeSchema.set(key, adapatedTree);\n\t\t}\n\n\t\t// TODO: subset these adapters to the ones that were needed/used.\n\t\treturn new AdaptedViewSchema(this.adapters, adapted);\n\t}\n\n\t/**\n\t * Adapt original such that it allows member types which can be adapted to its specified types.\n\t */\n\tprivate adaptField(original: TreeFieldStoredSchema): TreeFieldStoredSchema {\n\t\tif (original.types !== undefined) {\n\t\t\tconst types: Set<TreeNodeSchemaIdentifier> = new Set(original.types);\n\t\t\tfor (const treeAdapter of this.adapters?.tree ?? []) {\n\t\t\t\tif (types.has(treeAdapter.input)) {\n\t\t\t\t\ttypes.delete(treeAdapter.input);\n\t\t\t\t\ttypes.add(treeAdapter.output);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { kind: original.kind, types };\n\t\t}\n\t\treturn original;\n\t}\n\n\tprivate adaptTree(original: TreeNodeStoredSchema): TreeNodeStoredSchema {\n\t\t// TODO: support adapters like missing field adapters.\n\t\treturn original;\n\t}\n}\n"]}
|
|
@@ -6,7 +6,7 @@ import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
|
6
6
|
import type { TreeValue } from "../../core/index.js";
|
|
7
7
|
import { type RestrictiveStringRecord } from "../../util/index.js";
|
|
8
8
|
import { stringSchema, type LeafSchema } from "../leafNodeSchema.js";
|
|
9
|
-
import { FieldKind, type FieldSchema, type ImplicitAllowedTypes, type ImplicitFieldSchema, type InsertableTreeNodeFromImplicitAllowedTypes, type FieldProps, type NodeSchemaOptions, type FieldSchemaAlpha } from "../schemaTypes.js";
|
|
9
|
+
import { FieldKind, type FieldSchema, type ImplicitAllowedTypes, type ImplicitFieldSchema, type InsertableTreeNodeFromImplicitAllowedTypes, type FieldProps, type NodeSchemaOptions, type FieldSchemaAlpha, type ImplicitAnnotatedAllowedTypes, type UnannotateImplicitAllowedTypes } from "../schemaTypes.js";
|
|
10
10
|
import type { NodeKind, WithType, TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaNonClass } from "../core/index.js";
|
|
11
11
|
import { type TreeArrayNode } from "../arrayNode.js";
|
|
12
12
|
import { type InsertableObjectFromSchemaRecord, type TreeObjectNode } from "../objectNode.js";
|
|
@@ -58,7 +58,7 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends N
|
|
|
58
58
|
* ```
|
|
59
59
|
*
|
|
60
60
|
* If an application wants to be particularly careful to preserve all data on a node when editing it, it can use
|
|
61
|
-
* {@link TreeAlpha.importVerbose|import}/{@link TreeAlpha.exportVerbose|export} APIs with persistent keys.
|
|
61
|
+
* {@link (TreeAlpha:interface).importVerbose|import}/{@link (TreeAlpha:interface).exportVerbose|export} APIs with persistent keys.
|
|
62
62
|
*
|
|
63
63
|
* Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter
|
|
64
64
|
* this problem as SharedTree's implementation stores the entire node in its lower layers. It's only when application code
|
|
@@ -100,7 +100,9 @@ export interface SchemaStatics {
|
|
|
100
100
|
*
|
|
101
101
|
* @remarks
|
|
102
102
|
* 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:
|
|
103
|
+
*
|
|
103
104
|
* - `NaN`, and the infinities are converted to `null` (and may therefore only be used where `null` is allowed by the schema).
|
|
105
|
+
*
|
|
104
106
|
* - `-0` may be converted to `0` in some cases.
|
|
105
107
|
*
|
|
106
108
|
* These limitations match the limitations of JSON.
|
|
@@ -178,6 +180,10 @@ export interface SchemaStatics {
|
|
|
178
180
|
*/
|
|
179
181
|
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
180
182
|
}
|
|
183
|
+
declare function optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
|
|
184
|
+
declare function optional<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
185
|
+
declare function required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
|
|
186
|
+
declare function required<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
181
187
|
/**
|
|
182
188
|
* Implementation of {@link SchemaStatics}.
|
|
183
189
|
* @remarks
|
|
@@ -191,10 +197,10 @@ export declare const schemaStaticsBase: {
|
|
|
191
197
|
readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
192
198
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
193
199
|
readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
|
|
194
|
-
readonly optional:
|
|
195
|
-
readonly required:
|
|
196
|
-
readonly optionalRecursive: <const
|
|
197
|
-
readonly requiredRecursive: <const
|
|
200
|
+
readonly optional: typeof optional;
|
|
201
|
+
readonly required: typeof required;
|
|
202
|
+
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
|
|
203
|
+
readonly requiredRecursive: <const T_1 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_1, TCustomMetadata_1>;
|
|
198
204
|
};
|
|
199
205
|
/**
|
|
200
206
|
* Unstable extensions to {@link schemaStaticsBase}.
|
|
@@ -207,10 +213,10 @@ export declare const schemaStatics: {
|
|
|
207
213
|
readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
208
214
|
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
209
215
|
readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
|
|
210
|
-
readonly optional:
|
|
211
|
-
readonly required:
|
|
212
|
-
readonly optionalRecursive: <const
|
|
213
|
-
readonly requiredRecursive: <const
|
|
216
|
+
readonly optional: typeof optional;
|
|
217
|
+
readonly required: typeof required;
|
|
218
|
+
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_1 = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata_1>;
|
|
219
|
+
readonly requiredRecursive: <const T_1 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_2 = unknown>(t: T_1, props?: Omit<FieldProps<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_1, TCustomMetadata_2>;
|
|
214
220
|
};
|
|
215
221
|
/**
|
|
216
222
|
* Creates various types of {@link TreeNodeSchema|schema} for {@link TreeNode}s.
|
|
@@ -237,9 +243,13 @@ export declare const schemaStatics: {
|
|
|
237
243
|
* It is legal to subclass the returned class, and even subclass that class,
|
|
238
244
|
* but only a single class from that class hierarchy can ever be instantiated or passed to any API as a {@link TreeNodeSchema|schema}.
|
|
239
245
|
* These base classes can be used with `instanceof`, but not with schema based APIs like `Tree.is`.
|
|
246
|
+
*
|
|
240
247
|
* 2. If overriding the constructor, the constructor must accept the same argument as the base constructor `super` and forward it to `super` unchanged.
|
|
248
|
+
*
|
|
241
249
|
* 3. Properties for fields defined in the schema should not be overridden.
|
|
250
|
+
*
|
|
242
251
|
* 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.
|
|
252
|
+
*
|
|
243
253
|
* 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).
|
|
244
254
|
*
|
|
245
255
|
* Note:
|
|
@@ -598,8 +608,11 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
598
608
|
* The identifier generated by the SharedTree has the following properties:
|
|
599
609
|
*
|
|
600
610
|
* - It is a UUID which will not collide with other generated UUIDs.
|
|
611
|
+
*
|
|
601
612
|
* - It is compressed to a space-efficient representation when stored in the document.
|
|
613
|
+
*
|
|
602
614
|
* - A compressed form of the identifier can be accessed at runtime via the {@link TreeNodeApi.shortId|Tree.shortId()} API.
|
|
615
|
+
*
|
|
603
616
|
* - 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.
|
|
604
617
|
*
|
|
605
618
|
* However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).
|
|
@@ -627,6 +640,7 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
627
640
|
* @remarks
|
|
628
641
|
* This version of `SchemaFactory.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
|
|
629
642
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
643
|
+
* See also {@link FixRecursiveArraySchema} for additional information specific to recursive arrays schema exports.
|
|
630
644
|
*/
|
|
631
645
|
arrayRecursive<const Name extends TName, const T extends System_Unsafe.ImplicitAllowedTypesUnsafe>(name: Name, allowedTypes: T): TreeNodeSchemaClass<ScopedSchemaName<TScope, Name>, NodeKind.Array, System_Unsafe.TreeArrayNodeUnsafe<T> & WithType<ScopedSchemaName<TScope, Name>, NodeKind.Array, unknown>, {
|
|
632
646
|
/**
|
|
@@ -670,4 +684,5 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
670
684
|
}, false, T, undefined>;
|
|
671
685
|
}
|
|
672
686
|
export declare function structuralName<const T extends string>(collectionName: T, allowedTypes: TreeNodeSchema | readonly TreeNodeSchema[]): `${T}<${string}>`;
|
|
687
|
+
export {};
|
|
673
688
|
//# sourceMappingURL=schemaFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACN,KAAK,uBAAuB,EAG5B,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAKN,YAAY,EACZ,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0CAA0C,EAC/C,KAAK,UAAU,EAIf,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACX,QAAQ,EACR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GACtD,GAAG,CAAC,IAAI,MAAM,GAAG,CAmBnB"}
|
|
@@ -44,6 +44,15 @@ exports.defaultSchemaFactoryObjectOptions = {
|
|
|
44
44
|
const defaultOptionalProvider = (0, schemaTypes_js_1.getDefaultProvider)(() => {
|
|
45
45
|
return undefined;
|
|
46
46
|
});
|
|
47
|
+
function optional(t, props) {
|
|
48
|
+
return (0, schemaTypes_js_1.createFieldSchema)(schemaTypes_js_1.FieldKind.Optional, t, {
|
|
49
|
+
defaultProvider: defaultOptionalProvider,
|
|
50
|
+
...props,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function required(t, props) {
|
|
54
|
+
return (0, schemaTypes_js_1.createFieldSchema)(schemaTypes_js_1.FieldKind.Required, t, props);
|
|
55
|
+
}
|
|
47
56
|
/**
|
|
48
57
|
* Implementation of {@link SchemaStatics}.
|
|
49
58
|
* @remarks
|
|
@@ -57,15 +66,8 @@ exports.schemaStaticsBase = {
|
|
|
57
66
|
null: leafNodeSchema_js_1.nullSchema,
|
|
58
67
|
handle: leafNodeSchema_js_1.handleSchema,
|
|
59
68
|
leaves: [leafNodeSchema_js_1.stringSchema, leafNodeSchema_js_1.numberSchema, leafNodeSchema_js_1.booleanSchema, leafNodeSchema_js_1.nullSchema, leafNodeSchema_js_1.handleSchema],
|
|
60
|
-
optional
|
|
61
|
-
|
|
62
|
-
defaultProvider: defaultOptionalProvider,
|
|
63
|
-
...props,
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
required: (t, props) => {
|
|
67
|
-
return (0, schemaTypes_js_1.createFieldSchema)(schemaTypes_js_1.FieldKind.Required, t, props);
|
|
68
|
-
},
|
|
69
|
+
optional,
|
|
70
|
+
required,
|
|
69
71
|
optionalRecursive: (t, props) => {
|
|
70
72
|
return (0, schemaFactoryRecursive_js_1.createFieldSchemaUnsafe)(schemaTypes_js_1.FieldKind.Optional, t, {
|
|
71
73
|
defaultProvider: defaultOptionalProvider,
|
|
@@ -115,9 +117,13 @@ const schemaStaticsPublic = exports.schemaStatics;
|
|
|
115
117
|
* It is legal to subclass the returned class, and even subclass that class,
|
|
116
118
|
* but only a single class from that class hierarchy can ever be instantiated or passed to any API as a {@link TreeNodeSchema|schema}.
|
|
117
119
|
* These base classes can be used with `instanceof`, but not with schema based APIs like `Tree.is`.
|
|
120
|
+
*
|
|
118
121
|
* 2. If overriding the constructor, the constructor must accept the same argument as the base constructor `super` and forward it to `super` unchanged.
|
|
122
|
+
*
|
|
119
123
|
* 3. Properties for fields defined in the schema should not be overridden.
|
|
124
|
+
*
|
|
120
125
|
* 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.
|
|
126
|
+
*
|
|
121
127
|
* 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).
|
|
122
128
|
*
|
|
123
129
|
* Note:
|
|
@@ -294,7 +300,9 @@ class SchemaFactory {
|
|
|
294
300
|
* @param fields - Schema for fields of the object node's schema. Defines what children can be placed under each key.
|
|
295
301
|
*/
|
|
296
302
|
object(name, fields) {
|
|
297
|
-
|
|
303
|
+
// The compiler can't infer that UnannotateSchemaRecord<T> is equal to T so we have to do a bunch of typing to make the error go away.
|
|
304
|
+
const object = (0, objectNode_js_1.objectSchema)(this.scoped(name), fields, true, exports.defaultSchemaFactoryObjectOptions.allowUnknownOptionalFields);
|
|
305
|
+
return object;
|
|
298
306
|
}
|
|
299
307
|
/**
|
|
300
308
|
* {@link SchemaFactory.map} implementation.
|
|
@@ -320,9 +328,11 @@ class SchemaFactory {
|
|
|
320
328
|
* @param name - Unique identifier for this schema within this factory's scope.
|
|
321
329
|
*/
|
|
322
330
|
namedMap(name, allowedTypes, customizable, implicitlyConstructable) {
|
|
323
|
-
|
|
331
|
+
// The compiler can't infer that UnannotateImplicitAllowedTypes<T> is equal to T so we have to do a bunch of typing to make the error go away.
|
|
332
|
+
const map = (0, mapNode_js_1.mapSchema)(this.scoped(name), allowedTypes, implicitlyConstructable,
|
|
324
333
|
// The current policy is customizable nodes don't get fake prototypes.
|
|
325
334
|
!customizable, undefined);
|
|
335
|
+
return map;
|
|
326
336
|
}
|
|
327
337
|
/**
|
|
328
338
|
* {@link SchemaFactory.array} implementation.
|
|
@@ -349,7 +359,8 @@ class SchemaFactory {
|
|
|
349
359
|
* This is only public to work around a compiler limitation.
|
|
350
360
|
*/
|
|
351
361
|
namedArray(name, allowedTypes, customizable, implicitlyConstructable) {
|
|
352
|
-
|
|
362
|
+
const array = (0, arrayNode_js_1.arraySchema)(this.scoped(name), allowedTypes, implicitlyConstructable, customizable);
|
|
363
|
+
return array;
|
|
353
364
|
}
|
|
354
365
|
/**
|
|
355
366
|
* A special readonly field which holds an identifier string for an object node.
|
|
@@ -361,8 +372,11 @@ class SchemaFactory {
|
|
|
361
372
|
* The identifier generated by the SharedTree has the following properties:
|
|
362
373
|
*
|
|
363
374
|
* - It is a UUID which will not collide with other generated UUIDs.
|
|
375
|
+
*
|
|
364
376
|
* - It is compressed to a space-efficient representation when stored in the document.
|
|
377
|
+
*
|
|
365
378
|
* - A compressed form of the identifier can be accessed at runtime via the {@link TreeNodeApi.shortId|Tree.shortId()} API.
|
|
379
|
+
*
|
|
366
380
|
* - 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.
|
|
367
381
|
*
|
|
368
382
|
* However, a user may alternatively supply their own string as the identifier if desired (for example, if importing identifiers from another system).
|
|
@@ -399,6 +413,7 @@ class SchemaFactory {
|
|
|
399
413
|
* @remarks
|
|
400
414
|
* This version of `SchemaFactory.array` uses the same workarounds as {@link SchemaFactory.objectRecursive}.
|
|
401
415
|
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
416
|
+
* See also {@link FixRecursiveArraySchema} for additional information specific to recursive arrays schema exports.
|
|
402
417
|
*/
|
|
403
418
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
404
419
|
arrayRecursive(name, allowedTypes) {
|