@fluidframework/tree 2.74.0-365691 → 2.74.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 +4 -2
- package/CHANGELOG.md +11 -0
- package/api-report/tree.alpha.api.md +125 -87
- package/api-report/tree.beta.api.md +0 -1
- package/api-report/tree.legacy.beta.api.md +0 -1
- package/api-report/tree.legacy.public.api.md +0 -1
- package/api-report/tree.public.api.md +0 -1
- package/assertTagging.config.mjs +1 -1
- package/dist/alpha.d.ts +6 -2
- package/dist/codec/codec.d.ts +41 -13
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +46 -19
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +4 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -1
- package/dist/codec/versioned/format.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 +4 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +20 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +2 -2
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +34 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +12 -12
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/index.d.ts +3 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -0
- package/dist/core/tree/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -26
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +7 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +13 -11
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +35 -31
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatCommon.js +27 -0
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +21 -43
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -4
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js +35 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- 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 +3 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +54 -3
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +4 -4
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- 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 +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/schematizingTreeView.d.ts +2 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +3 -0
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +2 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +10 -5
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +72 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +10 -8
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -9
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
- package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +7 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +12 -10
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +9 -36
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +19 -9
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/{lib/shared-tree-core/messageFormatV5.d.ts → dist/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +13 -47
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +29 -17
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
- package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/dist/shared-tree-core/summaryTypes.js +47 -0
- package/dist/shared-tree-core/summaryTypes.js.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts +72 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.js +64 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/dist/simple-tree/api/configuration.d.ts +3 -26
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -21
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +7 -0
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +9 -3
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -5
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +5 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
- package/dist/simple-tree/api/simpleSchemaCodec.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/snapshotCompatibilityChecker.d.ts +8 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +1 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +15 -2
- 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/typesUnsafe.d.ts +3 -3
- 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/core/allowedTypes.d.ts +2 -2
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +17 -15
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +5 -40
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +20 -5
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +3 -3
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +6 -5
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +16 -11
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +55 -23
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js +17 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +58 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +205 -30
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.d.ts +23 -0
- package/dist/simple-tree/treeSchema.d.ts.map +1 -0
- package/dist/simple-tree/treeSchema.js +25 -0
- package/dist/simple-tree/treeSchema.js.map +1 -0
- package/dist/tableSchema.d.ts +107 -64
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +161 -60
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/brand.d.ts +49 -0
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +47 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +6 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +13 -0
- package/dist/util/readSnapshotBlob.d.ts.map +1 -0
- package/dist/util/readSnapshotBlob.js +18 -0
- package/dist/util/readSnapshotBlob.js.map +1 -0
- package/eslint.config.mts +98 -0
- package/lib/alpha.d.ts +6 -2
- package/lib/codec/codec.d.ts +41 -13
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +40 -13
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +4 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +4 -1
- package/lib/codec/versioned/format.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 +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +20 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +34 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +12 -12
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/index.d.ts +3 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +23 -27
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +7 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +12 -11
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +33 -29
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatCommon.js +23 -0
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +20 -42
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +2 -2
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js +30 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- 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/modular-schema/comparison.d.ts +18 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +55 -5
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +5 -5
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- 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 +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/schematizingTreeView.d.ts +2 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +3 -0
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +2 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +4 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +2 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +10 -5
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +73 -18
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +11 -9
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +19 -10
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
- package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +3 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +13 -11
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +9 -36
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +19 -9
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/{dist/shared-tree-core/messageFormatV5.d.ts → lib/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +13 -47
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +27 -15
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
- package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/lib/shared-tree-core/summaryTypes.js +43 -0
- package/lib/shared-tree-core/summaryTypes.js.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts +72 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.js +60 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +3 -26
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +14 -25
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.js +7 -0
- package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +9 -3
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +5 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.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/snapshotCompatibilityChecker.d.ts +8 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +1 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +15 -2
- 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/typesUnsafe.d.ts +3 -3
- 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/core/allowedTypes.d.ts +2 -2
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -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/toStored.d.ts +17 -15
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +4 -37
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +5 -1
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +20 -5
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +3 -3
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +6 -5
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +55 -23
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js +16 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +58 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +204 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeSchema.d.ts +23 -0
- package/lib/simple-tree/treeSchema.d.ts.map +1 -0
- package/lib/simple-tree/treeSchema.js +21 -0
- package/lib/simple-tree/treeSchema.js.map +1 -0
- package/lib/tableSchema.d.ts +107 -64
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +162 -61
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/brand.d.ts +49 -0
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +44 -0
- package/lib/util/brand.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts +13 -0
- package/lib/util/readSnapshotBlob.d.ts.map +1 -0
- package/lib/util/readSnapshotBlob.js +14 -0
- package/lib/util/readSnapshotBlob.js.map +1 -0
- package/package.json +24 -23
- package/src/codec/codec.ts +44 -14
- package/src/codec/versioned/codec.ts +1 -1
- package/src/codec/versioned/format.ts +4 -1
- package/src/core/index.ts +4 -1
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +25 -0
- package/src/core/schema-stored/schema.ts +5 -7
- package/src/core/tree/detachedFieldIndex.ts +54 -13
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
- package/src/core/tree/index.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -33
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
- package/src/feature-libraries/forest-summary/codec.ts +22 -10
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +77 -44
- package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +12 -13
- package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
- package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +37 -56
- package/src/feature-libraries/forest-summary/index.ts +2 -2
- package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
- package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
- package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
- package/src/feature-libraries/forest-summary/summaryTypes.ts +41 -0
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/modular-schema/comparison.ts +64 -5
- package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -1
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
- package/src/feature-libraries/schema-index/codec.ts +7 -9
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
- package/src/index.ts +6 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +2 -3
- package/src/shared-tree/schematizingTreeView.ts +5 -0
- package/src/shared-tree/sharedTree.ts +20 -9
- package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
- package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +103 -20
- package/src/shared-tree-core/editManagerCodecs.ts +11 -9
- package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/editManagerFormatCommons.ts +22 -16
- package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
- package/src/shared-tree-core/index.ts +12 -3
- package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/messageCodecs.ts +13 -11
- package/src/shared-tree-core/messageFormat.ts +23 -16
- package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
- package/src/shared-tree-core/sharedTreeCore.ts +63 -75
- package/src/shared-tree-core/summaryTypes.ts +122 -0
- package/src/shared-tree-core/versionedSummarizer.ts +114 -0
- package/src/simple-tree/api/configuration.ts +21 -68
- package/src/simple-tree/api/dirtyIndex.ts +11 -0
- package/src/simple-tree/api/discrepancies.ts +1 -1
- package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
- package/src/simple-tree/api/getSimpleSchema.ts +13 -6
- package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
- package/src/simple-tree/api/index.ts +7 -4
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
- package/src/simple-tree/api/schemaFromSimple.ts +11 -5
- package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
- package/src/simple-tree/api/storedSchema.ts +2 -2
- package/src/simple-tree/api/tree.ts +16 -1
- package/src/simple-tree/api/typesUnsafe.ts +7 -3
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/index.ts +2 -2
- package/src/simple-tree/core/toStored.ts +22 -55
- package/src/simple-tree/core/treeNode.ts +1 -0
- package/src/simple-tree/core/walkSchema.ts +6 -0
- package/src/simple-tree/createContext.ts +29 -11
- package/src/simple-tree/fieldSchema.ts +10 -3
- package/src/simple-tree/index.ts +12 -10
- package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -2
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/map/mapNode.ts +5 -2
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
- package/src/simple-tree/node-kinds/record/recordNode.ts +5 -2
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +79 -32
- package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
- package/src/simple-tree/toStoredSchema.ts +319 -61
- package/src/simple-tree/treeSchema.ts +54 -0
- package/src/tableSchema.ts +487 -173
- package/src/util/brand.ts +61 -0
- package/src/util/index.ts +5 -0
- package/src/util/readSnapshotBlob.ts +23 -0
- package/dist/feature-libraries/forest-summary/format.d.ts +0 -23
- package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/format.js +0 -24
- package/dist/feature-libraries/forest-summary/format.js.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +0 -23
- package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/format.js +0 -21
- package/lib/feature-libraries/forest-summary/format.js.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
|
@@ -3,31 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
assert,
|
|
8
|
-
debugAssert,
|
|
9
|
-
fail,
|
|
10
|
-
oob,
|
|
11
|
-
unreachableCase,
|
|
12
|
-
} from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { assert, fail, oob, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
13
7
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
14
8
|
|
|
15
|
-
import {
|
|
16
|
-
type FieldSchemaAlpha,
|
|
17
|
-
type ImplicitFieldSchema,
|
|
18
|
-
FieldKind,
|
|
19
|
-
normalizeFieldSchema,
|
|
20
|
-
} from "../fieldSchema.js";
|
|
9
|
+
import { type FieldSchemaAlpha, type ImplicitFieldSchema, FieldKind } from "../fieldSchema.js";
|
|
21
10
|
import {
|
|
22
11
|
type AllowedTypesFullEvaluated,
|
|
23
12
|
NodeKind,
|
|
24
13
|
type TreeNodeSchema,
|
|
25
|
-
markSchemaMostDerived,
|
|
26
14
|
} from "../core/index.js";
|
|
27
15
|
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
toInitialSchema,
|
|
17
|
+
toUnhydratedSchema,
|
|
18
|
+
transformSimpleSchema,
|
|
31
19
|
} from "../toStoredSchema.js";
|
|
32
20
|
import {
|
|
33
21
|
isArrayNodeSchema,
|
|
@@ -42,7 +30,8 @@ import {
|
|
|
42
30
|
import { getOrCreate } from "../../util/index.js";
|
|
43
31
|
import type { MakeNominal } from "../../util/index.js";
|
|
44
32
|
import { walkFieldSchema } from "../walkFieldSchema.js";
|
|
45
|
-
import type {
|
|
33
|
+
import type { SchemaType, SimpleNodeSchema } from "../simpleSchema.js";
|
|
34
|
+
import { createTreeSchema, type TreeSchema } from "../treeSchema.js";
|
|
46
35
|
|
|
47
36
|
/**
|
|
48
37
|
* Options when constructing a tree view.
|
|
@@ -187,11 +176,6 @@ export class TreeViewConfiguration<
|
|
|
187
176
|
*/
|
|
188
177
|
public readonly preventAmbiguity!: boolean;
|
|
189
178
|
|
|
190
|
-
/**
|
|
191
|
-
* {@link TreeSchema.definitions} but with public types.
|
|
192
|
-
*/
|
|
193
|
-
protected readonly definitionsInternal!: ReadonlyMap<string, TreeNodeSchema>;
|
|
194
|
-
|
|
195
179
|
/**
|
|
196
180
|
* Construct a new {@link TreeViewConfiguration}.
|
|
197
181
|
*
|
|
@@ -225,23 +209,10 @@ export class TreeViewConfiguration<
|
|
|
225
209
|
// Ambiguity errors are lower priority to report than invalid schema errors, so collect these in an array and report them all at once.
|
|
226
210
|
const ambiguityErrors: string[] = [];
|
|
227
211
|
|
|
228
|
-
//
|
|
229
|
-
//
|
|
230
|
-
|
|
231
|
-
toStoredSchema(config.schema, permissiveStoredSchemaGenerationOptions);
|
|
232
|
-
|
|
233
|
-
const definitions = new Map<string, SimpleNodeSchema & TreeNodeSchema>();
|
|
234
|
-
|
|
212
|
+
// Validate the schema and collect ambiguity errors.
|
|
213
|
+
// This does a lot of validation (throwing usage errors as a side effect) in addition to just collecting ambiguity errors.
|
|
214
|
+
// ambiguityErrors are considered a lower priority, so only thrown if no other errors are found.
|
|
235
215
|
walkFieldSchema(config.schema, {
|
|
236
|
-
node: (schema) => {
|
|
237
|
-
// Ensure all reachable schema are marked as most derived.
|
|
238
|
-
// This ensures if multiple schema extending the same schema factory generated class are present (or have had instances of them constructed, or get instances of them constructed in the future),
|
|
239
|
-
// an error is reported.
|
|
240
|
-
markSchemaMostDerived(schema, true);
|
|
241
|
-
|
|
242
|
-
debugAssert(() => !definitions.has(schema.identifier));
|
|
243
|
-
definitions.set(schema.identifier, schema as SimpleNodeSchema & TreeNodeSchema);
|
|
244
|
-
},
|
|
245
216
|
allowedTypes({ types }: AllowedTypesFullEvaluated): void {
|
|
246
217
|
checkUnion(
|
|
247
218
|
types.map((t) => t.type),
|
|
@@ -251,8 +222,6 @@ export class TreeViewConfiguration<
|
|
|
251
222
|
},
|
|
252
223
|
});
|
|
253
224
|
|
|
254
|
-
this.definitionsInternal = definitions;
|
|
255
|
-
|
|
256
225
|
if (ambiguityErrors.length !== 0) {
|
|
257
226
|
// Duplicate errors are common since when two types conflict, both orders error:
|
|
258
227
|
const deduplicated = new Set(ambiguityErrors);
|
|
@@ -273,38 +242,22 @@ export class TreeViewConfigurationAlpha<
|
|
|
273
242
|
extends TreeViewConfiguration<TSchema>
|
|
274
243
|
implements TreeSchema
|
|
275
244
|
{
|
|
276
|
-
/**
|
|
277
|
-
* {@inheritDoc TreeSchema.root}
|
|
278
|
-
*/
|
|
279
245
|
public readonly root: FieldSchemaAlpha;
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
public get definitions(): ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema> {
|
|
285
|
-
return this.definitionsInternal as ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
286
|
-
}
|
|
246
|
+
public readonly definitions: ReadonlyMap<
|
|
247
|
+
string,
|
|
248
|
+
SimpleNodeSchema<SchemaType.View> & TreeNodeSchema
|
|
249
|
+
>;
|
|
287
250
|
|
|
288
251
|
public constructor(props: ITreeViewConfiguration<TSchema>) {
|
|
289
252
|
super(props);
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
253
|
+
const treeSchema = createTreeSchema(this.schema);
|
|
254
|
+
this.root = treeSchema.root;
|
|
255
|
+
this.definitions = treeSchema.definitions;
|
|
293
256
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
export interface TreeSchema extends SimpleTreeSchema {
|
|
299
|
-
/**
|
|
300
|
-
* {@inheritDoc SimpleTreeSchema.root}
|
|
301
|
-
*/
|
|
302
|
-
readonly root: FieldSchemaAlpha;
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* {@inheritDoc SimpleTreeSchema.definitions}
|
|
306
|
-
*/
|
|
307
|
-
readonly definitions: ReadonlyMap<string, SimpleNodeSchema & TreeNodeSchema>;
|
|
257
|
+
// Eagerly perform these conversions to surface errors sooner.
|
|
258
|
+
toInitialSchema(this.root);
|
|
259
|
+
transformSimpleSchema(treeSchema, toUnhydratedSchema);
|
|
260
|
+
}
|
|
308
261
|
}
|
|
309
262
|
|
|
310
263
|
/**
|
|
@@ -23,6 +23,10 @@ import type { ImplicitFieldSchema } from "../fieldSchema.js";
|
|
|
23
23
|
* * "new": The node was added.
|
|
24
24
|
* * "changed": A direct child was updated, added, removed, or moved (and the node is not "new").
|
|
25
25
|
* * "moved": The node was moved between/within arrays (and the node is not "new" or "changed").
|
|
26
|
+
* @privateRemarks
|
|
27
|
+
* It is unclear how this will handle forward compatibility with other kinds of edits, like moves that are not limited to arrays (attach, detach, swap):
|
|
28
|
+
* this needs to be sorted out before this is stabilized.
|
|
29
|
+
* It is also unclear how this is supposed to handle schema changes (which can result in new TreeNode instance, but I think won't trigger "new" here).
|
|
26
30
|
* @alpha
|
|
27
31
|
*/
|
|
28
32
|
export type DirtyTreeStatus = "new" | "changed" | "moved";
|
|
@@ -51,6 +55,13 @@ export interface DirtyTreeMap {
|
|
|
51
55
|
* console.log(`The root of the tree is ${dirty.get(view.root) ?? "unchanged"}`);
|
|
52
56
|
* stopTracking();
|
|
53
57
|
* ```
|
|
58
|
+
* @privateRemarks
|
|
59
|
+
* This provides an opportunity for user code ("set" on dirty) to run during forest changes, in the middle of processing an edit.
|
|
60
|
+
* We have generally avoided exposing such times to users and instead flush events after the edit has finished and user facing invariants are known to be restored.
|
|
61
|
+
* Before stabilizing, how this event relates to other events time/ordering wise should be clarified, and if any APIs have been provided to defer events, that mentioned as well.
|
|
62
|
+
* Maybe updates should be deferred?
|
|
63
|
+
*
|
|
64
|
+
* This is also documented in terms of "forest" which is not a concept in the public API, and thus needs to be redefined in terms of public concepts.
|
|
54
65
|
* @alpha
|
|
55
66
|
*/
|
|
56
67
|
export function trackDirtyNodes(
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
type FieldSchema,
|
|
44
44
|
} from "../fieldSchema.js";
|
|
45
45
|
import { LeafNodeSchema } from "../leafNodeSchema.js";
|
|
46
|
-
import type { TreeSchema } from "
|
|
46
|
+
import type { TreeSchema } from "../treeSchema.js";
|
|
47
47
|
import { tryStoredSchemaAsArray } from "./customTree.js";
|
|
48
48
|
import { FieldKinds } from "../../feature-libraries/index.js";
|
|
49
49
|
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type {
|
|
7
|
+
TreeNode,
|
|
8
|
+
TreeNodeSchema,
|
|
9
|
+
NodeKind,
|
|
10
|
+
TreeNodeSchemaClass,
|
|
11
|
+
WithType,
|
|
12
|
+
} from "../core/index.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type-erase details of a schema.
|
|
16
|
+
*
|
|
17
|
+
* @typeParam TNode - The type to narrow the node to.
|
|
18
|
+
* Typically {@link TreeNode} intersected with the public interface for the component.
|
|
19
|
+
* @typeParam ExtraSchemaProperties - Properties of the schema (statics on the schema class) to retain in addition to the basic {@link TreeNodeSchema}.
|
|
20
|
+
* Typically includes at least one static factory method for creating nodes.
|
|
21
|
+
* @remarks
|
|
22
|
+
* This can be used to type erase the details of a schema including the node's type (such as its fields and APIs for modifying those fields).
|
|
23
|
+
* This is intended for use on component boundaries to support encapsulation of implementation details, including the exact schema.
|
|
24
|
+
*
|
|
25
|
+
* This is best applied to a top level "component node" which wraps the actual component content (in a single required object node field) allowing more cases of schema evolution to be carried out as implementation details of the component.
|
|
26
|
+
*
|
|
27
|
+
* Since this type-erases the schema details, the remaining API will need to provide ways to construct instances of the node and access its contents.
|
|
28
|
+
* Typically construction is done via static functions on the schema which can be included in `ExtraSchemaProperties`,
|
|
29
|
+
* and access to contents is done via properties of TNode (usually methods).
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const schema = new SchemaFactory("com.example");
|
|
34
|
+
*
|
|
35
|
+
* interface SquareNode {
|
|
36
|
+
* readonly area: number;
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* interface SquareSchema {
|
|
40
|
+
* create(sideLength: number): Square;
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* class SquareInternal
|
|
44
|
+
* extends schema.object("Demo", { hidden: schema.number })
|
|
45
|
+
* implements SquareNode
|
|
46
|
+
* {
|
|
47
|
+
* public get area(): number {
|
|
48
|
+
* return this.hidden * this.hidden;
|
|
49
|
+
* }
|
|
50
|
+
*
|
|
51
|
+
* public static create(sideLength: number): SquareInternal {
|
|
52
|
+
* return new SquareInternal({ hidden: sideLength });
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* const Square = eraseSchemaDetails<Square, SquareSchema>()(SquareInternal);
|
|
57
|
+
* type Square = SquareNode & TreeNode & WithType<"com.example.Demo">;
|
|
58
|
+
* ```
|
|
59
|
+
* @privateRemarks
|
|
60
|
+
* See "example" test for an executable version of this example.
|
|
61
|
+
* @alpha
|
|
62
|
+
*/
|
|
63
|
+
export function eraseSchemaDetails<TNode, ExtraSchemaProperties = unknown>(): <
|
|
64
|
+
T extends ExtraSchemaProperties & TreeNodeSchema<string, NodeKind, TNode & TreeNode>,
|
|
65
|
+
>(
|
|
66
|
+
schema: T,
|
|
67
|
+
) => ExtraSchemaProperties &
|
|
68
|
+
TreeNodeSchema<
|
|
69
|
+
T["identifier"],
|
|
70
|
+
NodeKind,
|
|
71
|
+
TNode & TreeNode & WithType<T["identifier"]>,
|
|
72
|
+
never,
|
|
73
|
+
false
|
|
74
|
+
> {
|
|
75
|
+
return (schema) => schema as never;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Like {@link eraseSchemaDetails} but allows the returned schema to be subclassed.
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const schema = new SchemaFactory("com.example");
|
|
83
|
+
*
|
|
84
|
+
* interface SquareInterface {
|
|
85
|
+
* readonly area: number;
|
|
86
|
+
* }
|
|
87
|
+
*
|
|
88
|
+
* class SquareInternal
|
|
89
|
+
* extends schema.object("Demo", { size: schema.number })
|
|
90
|
+
* implements SquareInterface
|
|
91
|
+
* {
|
|
92
|
+
* public get area(): number {
|
|
93
|
+
* return this.size * this.size;
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* class Square extends eraseSchemaDetailsSubclassable<SquareInterface>()(SquareInternal) {
|
|
98
|
+
* public static create(sideLength: number): Square {
|
|
99
|
+
* return new (this as TreeNodeSchema as typeof SquareInternal)({ size: sideLength });
|
|
100
|
+
* }
|
|
101
|
+
* }
|
|
102
|
+
*
|
|
103
|
+
* const square = Square.create(10);
|
|
104
|
+
* assert.equal(square.area, 100);
|
|
105
|
+
* ```
|
|
106
|
+
* @privateRemarks
|
|
107
|
+
* See "example" test for an executable version of this example.
|
|
108
|
+
* @alpha
|
|
109
|
+
*/
|
|
110
|
+
export function eraseSchemaDetailsSubclassable<TNode, ExtraSchemaProperties = unknown>(): <
|
|
111
|
+
T extends ExtraSchemaProperties & TreeNodeSchemaClass<string, NodeKind, TNode & TreeNode>,
|
|
112
|
+
>(
|
|
113
|
+
schema: T,
|
|
114
|
+
) => ExtraSchemaProperties &
|
|
115
|
+
TreeNodeSchemaClass<
|
|
116
|
+
T["identifier"],
|
|
117
|
+
NodeKind,
|
|
118
|
+
TNode & TreeNode & WithType<T["identifier"]>,
|
|
119
|
+
never,
|
|
120
|
+
false
|
|
121
|
+
> {
|
|
122
|
+
return (schema) => schema as never;
|
|
123
|
+
}
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { Unchanged } from "../core/index.js";
|
|
6
7
|
import type { ImplicitFieldSchema } from "../fieldSchema.js";
|
|
7
|
-
import type { SimpleTreeSchema } from "../simpleSchema.js";
|
|
8
|
-
|
|
9
|
-
import {
|
|
8
|
+
import type { SchemaType, SimpleTreeSchema } from "../simpleSchema.js";
|
|
9
|
+
import { transformSimpleSchema } from "../toStoredSchema.js";
|
|
10
|
+
import { createTreeSchema } from "../treeSchema.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
|
-
* Copies data from {@link ImplicitFieldSchema} to create
|
|
13
|
+
* Copies data from {@link ImplicitFieldSchema} to create a {@link SimpleTreeSchema} out of new plain JavaScript objects, Sets and Maps.
|
|
13
14
|
*
|
|
14
15
|
* @remarks
|
|
15
16
|
* See also {@link TreeViewConfigurationAlpha} which implements {@link SimpleTreeSchema} as a way to get a `SimpleTreeSchema` without copying the node and field schema and without losing as much type information.
|
|
@@ -23,6 +24,12 @@ import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
|
23
24
|
*
|
|
24
25
|
* @alpha
|
|
25
26
|
*/
|
|
26
|
-
export function getSimpleSchema(
|
|
27
|
-
|
|
27
|
+
export function getSimpleSchema(
|
|
28
|
+
schema: ImplicitFieldSchema,
|
|
29
|
+
): SimpleTreeSchema<SchemaType.View> {
|
|
30
|
+
// Convert the input into a TreeSchema: This API should probably be updated to take in a TreeSchema directly
|
|
31
|
+
// (and maybe a clean way to make TreeSchema from ImplicitFieldSchema other than TreeViewConfigurationAlpha should be provided).
|
|
32
|
+
const treeSchema = createTreeSchema(schema);
|
|
33
|
+
// Do the actual copy into clean simple schema objects.
|
|
34
|
+
return transformSimpleSchema(treeSchema, Unchanged);
|
|
28
35
|
}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { getTreeNodeSchemaPrivateData, type AllowedTypesFull } from "../core/index.js";
|
|
7
|
-
import { isObjectNodeSchema } from "../node-kinds/index.js";
|
|
8
|
-
import type { TreeSchema } from "
|
|
7
|
+
import { isArrayNodeSchema, isObjectNodeSchema } from "../node-kinds/index.js";
|
|
8
|
+
import type { TreeSchema } from "../treeSchema.js";
|
|
9
9
|
import type { IncrementalEncodingPolicy } from "../../feature-libraries/index.js";
|
|
10
10
|
import { oneFromIterable } from "../../util/index.js";
|
|
11
11
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
12
12
|
import type { FieldKey } from "../../core/index.js";
|
|
13
|
+
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed
|
|
@@ -68,7 +69,7 @@ function isIncrementalSummaryHintInAllowedTypes(allowedTypes: AllowedTypesFull):
|
|
|
68
69
|
export function incrementalEncodingPolicyForAllowedTypes(
|
|
69
70
|
rootSchema: TreeSchema,
|
|
70
71
|
): IncrementalEncodingPolicy {
|
|
71
|
-
return (targetNodeIdentifier: string | undefined, targetFieldKey
|
|
72
|
+
return (targetNodeIdentifier: string | undefined, targetFieldKey?: string) => {
|
|
72
73
|
if (targetNodeIdentifier === undefined) {
|
|
73
74
|
// Root fields cannot be allowed types, so we don't incrementally summarize them.
|
|
74
75
|
return false;
|
|
@@ -85,6 +86,11 @@ export function incrementalEncodingPolicyForAllowedTypes(
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
if (isObjectNodeSchema(targetNode)) {
|
|
89
|
+
if (targetFieldKey === undefined) {
|
|
90
|
+
throw new UsageError(
|
|
91
|
+
`Field key must be provided for object or array node '${targetNodeIdentifier}'`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
88
94
|
const targetPropertyKey = targetNode.storedKeyToPropertyKey.get(
|
|
89
95
|
targetFieldKey as FieldKey,
|
|
90
96
|
);
|
|
@@ -97,6 +103,12 @@ export function incrementalEncodingPolicyForAllowedTypes(
|
|
|
97
103
|
return false;
|
|
98
104
|
}
|
|
99
105
|
|
|
106
|
+
if (targetFieldKey !== undefined && !isArrayNodeSchema(targetNode)) {
|
|
107
|
+
throw new UsageError(
|
|
108
|
+
`Field key must not be provided for leaf, map or record node '${targetNodeIdentifier}'`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
const allowedTypes = oneFromIterable(
|
|
101
113
|
getTreeNodeSchemaPrivateData(targetNode).childAllowedTypes,
|
|
102
114
|
);
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export type {
|
|
7
|
-
TreeSchema,
|
|
8
7
|
ITreeViewConfiguration,
|
|
9
8
|
ITreeConfigurationOptions,
|
|
10
9
|
} from "./configuration.js";
|
|
@@ -29,6 +28,7 @@ export { asTreeViewAlpha } from "./tree.js";
|
|
|
29
28
|
export { type SchemaStatics, schemaStatics } from "./schemaStatics.js";
|
|
30
29
|
export {
|
|
31
30
|
SchemaFactory,
|
|
31
|
+
scoped,
|
|
32
32
|
type ScopedSchemaName,
|
|
33
33
|
type ObjectSchemaOptionsAlpha,
|
|
34
34
|
type ObjectSchemaOptions,
|
|
@@ -38,6 +38,10 @@ export {
|
|
|
38
38
|
} from "./schemaFactory.js";
|
|
39
39
|
export { SchemaFactoryBeta, type SchemaStaticsBeta } from "./schemaFactoryBeta.js";
|
|
40
40
|
export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
|
|
41
|
+
export {
|
|
42
|
+
eraseSchemaDetails,
|
|
43
|
+
eraseSchemaDetailsSubclassable,
|
|
44
|
+
} from "./eraseSchemaDetails.js";
|
|
41
45
|
export type {
|
|
42
46
|
ValidateRecursiveSchema,
|
|
43
47
|
FixRecursiveArraySchema,
|
|
@@ -161,15 +165,14 @@ export {
|
|
|
161
165
|
} from "./transactionTypes.js";
|
|
162
166
|
|
|
163
167
|
export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
164
|
-
export { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
165
168
|
export type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
166
169
|
export {
|
|
167
170
|
incrementalEncodingPolicyForAllowedTypes,
|
|
168
171
|
incrementalSummaryHint,
|
|
169
172
|
} from "./incrementalAllowedTypes.js";
|
|
170
173
|
export {
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
encodeSchemaCompatibilitySnapshot,
|
|
175
|
+
decodeSchemaCompatibilitySnapshot,
|
|
173
176
|
} from "./simpleSchemaCodec.js";
|
|
174
177
|
export {
|
|
175
178
|
exportCompatibilitySchemaSnapshot,
|
|
@@ -9,7 +9,7 @@ import { allowsRepoSuperset, defaultSchemaPolicy } from "../../feature-libraries
|
|
|
9
9
|
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
10
10
|
import { getDiscrepanciesInAllowedContent } from "./discrepancies.js";
|
|
11
11
|
import { toUpgradeSchema } from "../toStoredSchema.js";
|
|
12
|
-
import type { TreeSchema } from "
|
|
12
|
+
import type { TreeSchema } from "../treeSchema.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* A collection of View information for schema
|
|
@@ -35,7 +35,7 @@ import type {
|
|
|
35
35
|
System_Unsafe,
|
|
36
36
|
TreeRecordNodeUnsafe,
|
|
37
37
|
} from "./typesUnsafe.js";
|
|
38
|
-
import type { SimpleObjectNodeSchema } from "../simpleSchema.js";
|
|
38
|
+
import type { SchemaType, SimpleObjectNodeSchema } from "../simpleSchema.js";
|
|
39
39
|
import { SchemaFactoryBeta } from "./schemaFactoryBeta.js";
|
|
40
40
|
|
|
41
41
|
// These imports prevent a large number of type references in the API reports from showing up as *_2.
|
|
@@ -119,7 +119,7 @@ export class SchemaFactoryAlpha<
|
|
|
119
119
|
never,
|
|
120
120
|
TCustomMetadata
|
|
121
121
|
> &
|
|
122
|
-
SimpleObjectNodeSchema<TCustomMetadata> &
|
|
122
|
+
SimpleObjectNodeSchema<SchemaType.View, TCustomMetadata> &
|
|
123
123
|
// We can't just use non generic `ObjectNodeSchema` here since "Base constructors must all have the same return type".
|
|
124
124
|
// We also can't just use generic `ObjectNodeSchema` here and not `TreeNodeSchemaClass` since that doesn't work with unsafe recursive types.
|
|
125
125
|
// ObjectNodeSchema<
|
|
@@ -182,7 +182,6 @@ export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchemaClass> =
|
|
|
182
182
|
}[T["kind"]]
|
|
183
183
|
>;
|
|
184
184
|
|
|
185
|
-
/* eslint-disable @fluid-internal/fluid/no-hyphen-after-jsdoc-tag -- false positive AB#50920 */
|
|
186
185
|
/**
|
|
187
186
|
* Workaround for "Type instantiation is excessively deep and possibly infinite.ts" errors.
|
|
188
187
|
* @remarks
|
|
@@ -240,7 +239,6 @@ export type ValidateRecursiveSchemaTemplate<T extends TreeNodeSchemaClass> =
|
|
|
240
239
|
*/
|
|
241
240
|
export type FixRecursiveRecursionLimit<T extends TreeNodeSchemaClass> =
|
|
242
241
|
T extends ValidateRecursiveSchemaTemplate<T> ? undefined : undefined;
|
|
243
|
-
/* eslint-enable @fluid-internal/fluid/no-hyphen-after-jsdoc-tag */
|
|
244
242
|
|
|
245
243
|
/**
|
|
246
244
|
* Does nothing with the provided value, but appears to use it to make unused locals warnings and errors go away.
|
|
@@ -18,13 +18,14 @@ import {
|
|
|
18
18
|
type FieldProps,
|
|
19
19
|
} from "../fieldSchema.js";
|
|
20
20
|
import type {
|
|
21
|
+
SchemaType,
|
|
21
22
|
SimpleAllowedTypeAttributes,
|
|
22
23
|
SimpleFieldSchema,
|
|
23
24
|
SimpleNodeSchema,
|
|
24
25
|
SimpleTreeSchema,
|
|
25
26
|
} from "../simpleSchema.js";
|
|
26
27
|
|
|
27
|
-
import type { TreeSchema } from "
|
|
28
|
+
import type { TreeSchema } from "../treeSchema.js";
|
|
28
29
|
import { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
|
|
29
30
|
|
|
30
31
|
const factory = new SchemaFactoryAlpha(undefined);
|
|
@@ -41,12 +42,17 @@ const factory = new SchemaFactoryAlpha(undefined);
|
|
|
41
42
|
*
|
|
42
43
|
* This API bakes in some arbitrary policy choices for how to handle data that is not included in the SimpleTreeSchema API, for example the value of `allowUnknownOptionalFields`.
|
|
43
44
|
* If any particular choice is required for such cases, this API should not be used.
|
|
45
|
+
*
|
|
46
|
+
* @privateRemarks
|
|
47
|
+
* TODO: Add the ability for consumers to inject custom policy.
|
|
48
|
+
* For example, allow nodes with table schema identifiers to dispatch to `TableSchema` factory APIs.
|
|
49
|
+
*
|
|
44
50
|
* @alpha
|
|
45
51
|
*/
|
|
46
52
|
export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSchema {
|
|
47
53
|
const context: Context = new Map(
|
|
48
54
|
[...simple.definitions].map(
|
|
49
|
-
([id, schema]): [string, () => TreeNodeSchema & SimpleNodeSchema] => [
|
|
55
|
+
([id, schema]): [string, () => TreeNodeSchema & SimpleNodeSchema<SchemaType.View>] => [
|
|
50
56
|
id,
|
|
51
57
|
// This relies on the caching in evaluateLazySchema so that it only runs once.
|
|
52
58
|
() => generateNode(id, schema, context),
|
|
@@ -54,7 +60,7 @@ export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSc
|
|
|
54
60
|
),
|
|
55
61
|
);
|
|
56
62
|
const root = generateFieldSchema(simple.root, context, undefined);
|
|
57
|
-
const definitions = new Map<string, TreeNodeSchema & SimpleNodeSchema
|
|
63
|
+
const definitions = new Map<string, TreeNodeSchema & SimpleNodeSchema<SchemaType.View>>();
|
|
58
64
|
for (const [id, lazy] of context) {
|
|
59
65
|
definitions.set(id, lazy());
|
|
60
66
|
}
|
|
@@ -64,7 +70,7 @@ export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSc
|
|
|
64
70
|
};
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
type Context = ReadonlyMap<string, () => TreeNodeSchema & SimpleNodeSchema
|
|
73
|
+
type Context = ReadonlyMap<string, () => TreeNodeSchema & SimpleNodeSchema<SchemaType.View>>;
|
|
68
74
|
|
|
69
75
|
function generateFieldSchema(
|
|
70
76
|
simple: SimpleFieldSchema,
|
|
@@ -107,7 +113,7 @@ function generateNode(
|
|
|
107
113
|
id: string,
|
|
108
114
|
schema: SimpleNodeSchema,
|
|
109
115
|
context: Context,
|
|
110
|
-
): TreeNodeSchema & SimpleNodeSchema {
|
|
116
|
+
): TreeNodeSchema & SimpleNodeSchema<SchemaType.View> {
|
|
111
117
|
switch (schema.kind) {
|
|
112
118
|
case NodeKind.Object: {
|
|
113
119
|
const fields: Record<string, FieldSchema> = {};
|
|
@@ -30,15 +30,23 @@ import {
|
|
|
30
30
|
} from "../../codec/index.js";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* Encodes
|
|
33
|
+
* Encodes the compatibility impacting subset of simple schema (view or stored) into a serializable format.
|
|
34
|
+
*
|
|
34
35
|
* @remarks The JSON-compatible schema returned from this method is only intended for use in snapshots/comparisons of schemas.
|
|
35
36
|
* It is not possible to reconstruct a full schema (including metadata and persistedMetadata) from the encoded format.
|
|
36
37
|
* @param treeSchema - The tree schema to convert.
|
|
37
38
|
* @returns A serializable representation of the schema.
|
|
38
39
|
*
|
|
40
|
+
* @privateRemarks
|
|
41
|
+
* Encodes to {@link Format.SimpleTreeSchemaFormat}.
|
|
42
|
+
*
|
|
43
|
+
* TODO: a simple high level API for snapshot based schema compatibility checking should replace the need to export this.
|
|
44
|
+
*
|
|
39
45
|
* @alpha
|
|
40
46
|
*/
|
|
41
|
-
export function
|
|
47
|
+
export function encodeSchemaCompatibilitySnapshot(
|
|
48
|
+
simpleSchema: SimpleTreeSchema,
|
|
49
|
+
): JsonCompatibleReadOnly {
|
|
42
50
|
// Convert types to serializable forms
|
|
43
51
|
const encodedDefinitions: Format.SimpleSchemaDefinitionsFormat = {};
|
|
44
52
|
|
|
@@ -63,9 +71,15 @@ export function encodeSimpleSchema(simpleSchema: SimpleTreeSchema): JsonCompatib
|
|
|
63
71
|
* @returns A decoded simple schema.
|
|
64
72
|
* @throws Will throw a usage error if the encoded schema is not in the expected format.
|
|
65
73
|
*
|
|
74
|
+
* @privateRemarks
|
|
75
|
+
* If a validator is not provided, this implicitly performs an unsafe type conversion:
|
|
76
|
+
* this is something our user facing APIs generally avoid doing, and should be reconsidered before stabilizing.
|
|
77
|
+
*
|
|
78
|
+
* TODO: a simple high level API for snapshot based schema compatibility checking should replace the need to export this.
|
|
79
|
+
*
|
|
66
80
|
* @alpha
|
|
67
81
|
*/
|
|
68
|
-
export function
|
|
82
|
+
export function decodeSchemaCompatibilitySnapshot(
|
|
69
83
|
encodedSchema: JsonCompatibleReadOnly,
|
|
70
84
|
validator?: FormatValidator,
|
|
71
85
|
): SimpleTreeSchema {
|
|
@@ -28,7 +28,7 @@ import type {
|
|
|
28
28
|
SimpleRecordNodeSchema,
|
|
29
29
|
} from "../simpleSchema.js";
|
|
30
30
|
import { NodeKind, type TreeNodeSchema } from "../core/index.js";
|
|
31
|
-
import type { TreeSchema } from "
|
|
31
|
+
import type { TreeSchema } from "../treeSchema.js";
|
|
32
32
|
import type { TreeSchemaEncodingOptions } from "./getJsonSchema.js";
|
|
33
33
|
import {
|
|
34
34
|
ArrayNodeSchema,
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { toInitialSchema } from "../toStoredSchema.js";
|
|
8
8
|
import { TreeViewConfigurationAlpha, TreeViewConfiguration } from "./configuration.js";
|
|
9
|
+
import { createTreeSchema } from "../treeSchema.js";
|
|
9
10
|
import { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
|
|
10
11
|
import { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
11
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
decodeSchemaCompatibilitySnapshot,
|
|
14
|
+
encodeSchemaCompatibilitySnapshot,
|
|
15
|
+
} from "./simpleSchemaCodec.js";
|
|
12
16
|
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
13
|
-
import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Compute the compatibility of using `view` to {@link ViewableTree.viewWith | view a tree} who's {@link ITreeAlpha.exportSimpleSchema | stored schema} could be derived from `viewWhichCreatedStoredSchema` via either {@link TreeView.initialize} or {@link TreeView.upgradeSchema}.
|
|
@@ -58,6 +61,9 @@ import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
|
58
61
|
* @param view - The view being tested to see if it could view tree created or initialized using `viewWhichCreatedStoredSchema`.
|
|
59
62
|
* @returns The compatibility status.
|
|
60
63
|
*
|
|
64
|
+
* @privateRemarks
|
|
65
|
+
* TODO: a simple high level API for snapshot based schema compatibility checking should replace the need to export this.
|
|
66
|
+
*
|
|
61
67
|
* @alpha
|
|
62
68
|
*/
|
|
63
69
|
export function checkCompatibility(
|
|
@@ -65,9 +71,7 @@ export function checkCompatibility(
|
|
|
65
71
|
view: TreeViewConfiguration,
|
|
66
72
|
): Omit<SchemaCompatibilityStatus, "canInitialize"> {
|
|
67
73
|
const viewAsAlpha = new TreeViewConfigurationAlpha({ schema: view.schema });
|
|
68
|
-
const stored =
|
|
69
|
-
includeStaged: () => true,
|
|
70
|
-
});
|
|
74
|
+
const stored = toInitialSchema(viewWhichCreatedStoredSchema.schema);
|
|
71
75
|
const tester = new SchemaCompatibilityTester(viewAsAlpha);
|
|
72
76
|
return tester.checkCompatibility(stored);
|
|
73
77
|
}
|
|
@@ -95,13 +99,16 @@ export function checkCompatibility(
|
|
|
95
99
|
* fs.writeFileSync("PointSchema.json", encodedSchema);
|
|
96
100
|
* ```
|
|
97
101
|
*
|
|
102
|
+
* @privateRemarks
|
|
103
|
+
* TODO: a simple high level API for snapshot based schema compatibility checking should replace the need to export this.
|
|
104
|
+
*
|
|
98
105
|
* @alpha
|
|
99
106
|
*/
|
|
100
107
|
export function exportCompatibilitySchemaSnapshot(
|
|
101
108
|
config: Pick<TreeViewConfiguration, "schema">,
|
|
102
109
|
): JsonCompatibleReadOnly {
|
|
103
|
-
const
|
|
104
|
-
return
|
|
110
|
+
const treeSchema = createTreeSchema(config.schema);
|
|
111
|
+
return encodeSchemaCompatibilitySnapshot(treeSchema);
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
/**
|
|
@@ -120,13 +127,14 @@ export function exportCompatibilitySchemaSnapshot(
|
|
|
120
127
|
* ```ts;
|
|
121
128
|
* const oldViewSchema = importCompatibilitySchemaSnapshot(fs.readFileSync("PointSchema.json", "utf8"));
|
|
122
129
|
* ```
|
|
123
|
-
*
|
|
130
|
+
* @privateRemarks
|
|
131
|
+
* TODO: a simple high level API for snapshot based schema compatibility checking should replace the need to export this.
|
|
124
132
|
* @alpha
|
|
125
133
|
*/
|
|
126
134
|
export function importCompatibilitySchemaSnapshot(
|
|
127
135
|
config: JsonCompatibleReadOnly,
|
|
128
136
|
): TreeViewConfiguration {
|
|
129
|
-
const simpleSchema =
|
|
137
|
+
const simpleSchema = decodeSchemaCompatibilitySnapshot(config);
|
|
130
138
|
const viewSchema = generateSchemaFromSimpleSchema(simpleSchema);
|
|
131
139
|
|
|
132
140
|
// We construct a TreeViewConfiguration here with the default parameters. The default set of validation parameters are fine for
|