@fluidframework/tree 2.72.0 → 2.74.0-365691
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +99 -0
- package/api-report/tree.alpha.api.md +32 -31
- package/dist/alpha.d.ts +7 -1
- package/dist/api.d.ts +6 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -11
- package/dist/api.js.map +1 -1
- package/dist/codec/codec.d.ts +9 -2
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +9 -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/codec/versioned/codec.d.ts +7 -2
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js +24 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/index.d.ts +1 -1
- package/dist/codec/versioned/index.d.ts.map +1 -1
- package/dist/codec/versioned/index.js +2 -1
- package/dist/codec/versioned/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +12 -1
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +5 -3
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +1 -0
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -3
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +32 -18
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +7 -3
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +2 -2
- 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/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +23 -6
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +20 -4
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +53 -55
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -3
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -8
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.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 +4 -2
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +5 -4
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +8 -8
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +1 -2
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +0 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +1 -3
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/dist/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +3 -2
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts +1 -1
- package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/index.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +5 -3
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/dist/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/dist/feature-libraries/schemaChecker.js.map +1 -0
- package/dist/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/formatV2.js +1 -0
- package/dist/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.d.ts +2 -12
- package/dist/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/dist/feature-libraries/treeCompressionUtils.js +4 -14
- package/dist/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -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/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +7 -54
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -52
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -2
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- 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 +12 -6
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +5 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +3 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +3 -2
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +20 -9
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +4 -6
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +9 -7
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +2 -0
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -0
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +15 -12
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +17 -14
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +2 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +6 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +7 -1
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +4 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +128 -0
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +2 -2
- package/dist/simple-tree/api/tree.js +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +3 -3
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +3 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +12 -5
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +26 -10
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +1 -0
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -6
- 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/treeNodeValid.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +1 -2
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +1 -8
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -3
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +10 -4
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +0 -1
- package/dist/simple-tree/leafNodeSchema.js.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 +14 -49
- package/dist/simple-tree/node-kinds/array/arrayNode.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 +1 -5
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +3 -10
- package/dist/simple-tree/node-kinds/object/objectNode.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 +1 -5
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +15 -3
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +20 -8
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +27 -22
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +18 -15
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/tableSchema.d.ts +22 -52
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +141 -277
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +5 -0
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +12 -5
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/arrayUtilities.d.ts +45 -0
- package/dist/util/arrayUtilities.d.ts.map +1 -0
- package/dist/util/arrayUtilities.js +76 -0
- package/dist/util/arrayUtilities.js.map +1 -0
- package/dist/util/breakable.js +3 -3
- package/dist/util/breakable.js.map +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +7 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/typeCheckTests.d.ts.map +1 -1
- package/dist/util/typeCheckTests.js.map +1 -1
- package/lib/alpha.d.ts +7 -1
- package/lib/api.d.ts +6 -2
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +2 -13
- package/lib/api.js.map +1 -1
- package/lib/codec/codec.d.ts +9 -2
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +9 -2
- 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/codec/versioned/codec.d.ts +7 -2
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js +22 -0
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/index.d.ts +1 -1
- package/lib/codec/versioned/index.d.ts.map +1 -1
- package/lib/codec/versioned/index.js +1 -1
- package/lib/codec/versioned/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +12 -1
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +5 -3
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +4 -5
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +2 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +36 -22
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +6 -6
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +4 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +156 -4
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +6 -2
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js +4 -1
- package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +2 -2
- 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/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +13 -13
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -6
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts +9 -8
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +17 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -17
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +55 -57
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -3
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -3
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +2 -2
- package/lib/feature-libraries/forest-summary/forestSummarizer.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 +4 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +5 -4
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -4
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +1 -2
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +38 -12
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +29 -11
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +3 -2
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +0 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +0 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts +5 -6
- package/lib/feature-libraries/modular-schema/isNeverTree.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/isNeverTree.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts +2 -2
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +8 -8
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -2
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +66 -9
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +2 -1
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts +1 -1
- package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/index.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
- package/lib/feature-libraries/optional-field/optionalFieldCodecs.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 -3
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/{default-schema/schemaChecker.d.ts → schemaChecker.d.ts} +2 -2
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -0
- package/lib/feature-libraries/{default-schema/schemaChecker.js → schemaChecker.js} +3 -3
- package/lib/feature-libraries/schemaChecker.js.map +1 -0
- package/lib/feature-libraries/sequence-field/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/formatV2.js +1 -0
- package/lib/feature-libraries/sequence-field/formatV2.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js +0 -2
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecs.js.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.d.ts +2 -12
- package/lib/feature-libraries/treeCompressionUtils.d.ts.map +1 -1
- package/lib/feature-libraries/treeCompressionUtils.js +3 -13
- package/lib/feature-libraries/treeCompressionUtils.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- 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/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +7 -54
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +1 -51
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -2
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- 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 +13 -7
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +3 -4
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +4 -7
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +3 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +21 -10
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +4 -6
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +8 -6
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +2 -0
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +10 -0
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +15 -12
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +15 -12
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +2 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +8 -2
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +5 -7
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +103 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +122 -0
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +2 -2
- package/lib/simple-tree/api/tree.js +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +3 -3
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +12 -5
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +25 -9
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -0
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -6
- 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/treeNodeValid.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +1 -2
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +2 -9
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -3
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +3 -3
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +1 -2
- package/lib/simple-tree/leafNodeSchema.js.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 +16 -51
- package/lib/simple-tree/node-kinds/array/arrayNode.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 +3 -7
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +4 -11
- package/lib/simple-tree/node-kinds/object/objectNode.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 +3 -7
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +15 -3
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +20 -8
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +28 -24
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +20 -17
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/tableSchema.d.ts +22 -52
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +143 -279
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +5 -0
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +10 -4
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/arrayUtilities.d.ts +45 -0
- package/lib/util/arrayUtilities.d.ts.map +1 -0
- package/lib/util/arrayUtilities.js +69 -0
- package/lib/util/arrayUtilities.js.map +1 -0
- package/lib/util/breakable.js +3 -3
- package/lib/util/breakable.js.map +1 -1
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/lib/util/typeCheckTests.d.ts.map +1 -1
- package/lib/util/typeCheckTests.js.map +1 -1
- package/package.json +22 -22
- package/src/api.ts +22 -11
- package/src/codec/codec.ts +10 -2
- package/src/codec/index.ts +1 -0
- package/src/codec/versioned/codec.ts +40 -2
- package/src/codec/versioned/index.ts +1 -0
- package/src/core/schema-stored/schema.ts +12 -1
- package/src/core/tree/detachedFieldIndexCodecs.ts +10 -3
- package/src/feature-libraries/README.md +1 -1
- package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -3
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +5 -0
- package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +2 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +55 -26
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +8 -3
- package/src/feature-libraries/chunked-forest/codec/format.ts +14 -4
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +5 -6
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -4
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +62 -9
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +24 -2
- package/src/feature-libraries/chunked-forest/index.ts +1 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +86 -74
- package/src/feature-libraries/default-schema/index.ts +1 -9
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +2 -2
- package/src/feature-libraries/forest-summary/format.ts +15 -9
- package/src/feature-libraries/index.ts +8 -10
- package/src/feature-libraries/modular-schema/comparison.ts +2 -3
- package/src/feature-libraries/modular-schema/fieldKind.ts +90 -13
- package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +2 -3
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +6 -6
- package/src/feature-libraries/modular-schema/index.ts +0 -1
- package/src/feature-libraries/modular-schema/isNeverTree.ts +7 -8
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -6
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +13 -13
- package/src/feature-libraries/object-forest/objectForest.ts +2 -6
- package/src/feature-libraries/optional-field/index.ts +1 -0
- package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
- package/src/feature-libraries/schema-index/codec.ts +10 -3
- package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
- package/src/feature-libraries/sequence-field/formatV2.ts +1 -0
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
- package/src/feature-libraries/treeCompressionUtils.ts +1 -15
- package/src/index.ts +7 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/sharedTree.ts +12 -88
- package/src/shared-tree/sharedTreeChangeCodecs.ts +1 -6
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeCheckout.ts +2 -2
- package/src/shared-tree-core/editManagerCodecs.ts +19 -7
- package/src/shared-tree-core/editManagerFormatCommons.ts +11 -12
- package/src/shared-tree-core/index.ts +7 -3
- package/src/shared-tree-core/messageCodecs.ts +32 -17
- package/src/shared-tree-core/messageFormat.ts +8 -6
- package/src/simple-tree/api/configuration.ts +17 -4
- package/src/simple-tree/api/incrementalAllowedTypes.ts +20 -18
- package/src/simple-tree/api/index.ts +6 -1
- package/src/simple-tree/api/schemaFromSimple.ts +14 -6
- package/src/simple-tree/api/simpleSchemaCodec.ts +10 -9
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
- package/src/simple-tree/api/tree.ts +2 -2
- package/src/simple-tree/core/allowedTypes.ts +1 -1
- package/src/simple-tree/core/index.ts +3 -1
- package/src/simple-tree/core/toStored.ts +42 -18
- package/src/simple-tree/core/treeNodeKernel.ts +1 -0
- package/src/simple-tree/core/treeNodeSchema.ts +1 -7
- package/src/simple-tree/core/treeNodeValid.ts +0 -2
- package/src/simple-tree/fieldSchema.ts +2 -11
- package/src/simple-tree/index.ts +7 -2
- package/src/simple-tree/leafNodeSchema.ts +1 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -75
- package/src/simple-tree/node-kinds/map/mapNode.ts +1 -15
- package/src/simple-tree/node-kinds/object/objectNode.ts +4 -18
- package/src/simple-tree/node-kinds/record/recordNode.ts +1 -15
- package/src/simple-tree/simpleSchema.ts +16 -3
- package/src/simple-tree/toStoredSchema.ts +54 -38
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
- package/src/tableSchema.ts +110 -334
- package/src/treeFactory.ts +13 -4
- package/src/util/arrayUtilities.ts +88 -0
- package/src/util/breakable.ts +4 -4
- package/src/util/index.ts +6 -0
- package/src/util/typeCheckTests.ts +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -15
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -76
- package/dist/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -158
- package/dist/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -245
- package/dist/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts +0 -10
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -12
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +0 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts +0 -50
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.d.ts.map +0 -1
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js +0 -71
- package/lib/feature-libraries/modular-schema/fieldKindWithEditor.js.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts +0 -12
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js +0 -154
- package/lib/feature-libraries/optional-field/optionalFieldCodecV1.js.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts +0 -11
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.d.ts.map +0 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js +0 -241
- package/lib/feature-libraries/sequence-field/sequenceFieldCodecV1.js.map +0 -1
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -15
- package/src/feature-libraries/modular-schema/fieldKindWithEditor.ts +0 -108
- package/src/feature-libraries/optional-field/optionalFieldCodecV1.ts +0 -208
- package/src/feature-libraries/sequence-field/sequenceFieldCodecV1.ts +0 -344
|
@@ -27,7 +27,7 @@ export {
|
|
|
27
27
|
type SummaryElementParser,
|
|
28
28
|
type SummaryElementStringifier,
|
|
29
29
|
type ClonableSchemaAndPolicy,
|
|
30
|
-
type SharedTreeCoreOptionsInternal
|
|
30
|
+
type SharedTreeCoreOptionsInternal,
|
|
31
31
|
} from "./sharedTreeCore.js";
|
|
32
32
|
|
|
33
33
|
export type { ResubmitMachine } from "./resubmitMachine.js";
|
|
@@ -48,7 +48,7 @@ export {
|
|
|
48
48
|
} from "./editManagerCodecs.js";
|
|
49
49
|
export {
|
|
50
50
|
EditManagerFormatVersion,
|
|
51
|
-
|
|
51
|
+
supportedEditManagerFormatVersions,
|
|
52
52
|
} from "./editManagerFormatCommons.js";
|
|
53
53
|
export { EditManagerSummarizer } from "./editManagerSummarizer.js";
|
|
54
54
|
export {
|
|
@@ -70,4 +70,8 @@ export {
|
|
|
70
70
|
clientVersionToMessageFormatVersion,
|
|
71
71
|
messageFormatVersionSelectorForSharedBranches,
|
|
72
72
|
} from "./messageCodecs.js";
|
|
73
|
-
export {
|
|
73
|
+
export {
|
|
74
|
+
MessageFormatVersion,
|
|
75
|
+
messageFormatVersions,
|
|
76
|
+
supportedMessageFormatVersions,
|
|
77
|
+
} from "./messageFormat.js";
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
+
import {
|
|
9
|
+
getConfigForMinVersionForCollab,
|
|
10
|
+
lowestMinVersionForCollab,
|
|
11
|
+
} from "@fluidframework/runtime-utils/internal";
|
|
12
|
+
|
|
8
13
|
import {
|
|
9
14
|
type CodecTree,
|
|
10
15
|
type CodecWriteOptions,
|
|
@@ -15,6 +20,7 @@ import {
|
|
|
15
20
|
type ICodecOptions,
|
|
16
21
|
type IJsonCodec,
|
|
17
22
|
makeCodecFamily,
|
|
23
|
+
makeDiscontinuedCodecVersion,
|
|
18
24
|
makeVersionDispatchingCodec,
|
|
19
25
|
} from "../codec/index.js";
|
|
20
26
|
import type {
|
|
@@ -45,10 +51,12 @@ export function clientVersionToMessageFormatVersion(
|
|
|
45
51
|
clientVersion: MinimumVersionForCollab,
|
|
46
52
|
writeVersionOverride?: MessageFormatVersion,
|
|
47
53
|
): MessageFormatVersion {
|
|
48
|
-
const compatibleVersion: MessageFormatVersion =
|
|
49
|
-
clientVersion
|
|
50
|
-
|
|
51
|
-
:
|
|
54
|
+
const compatibleVersion: MessageFormatVersion = brand(
|
|
55
|
+
getConfigForMinVersionForCollab(clientVersion, {
|
|
56
|
+
[lowestMinVersionForCollab]: MessageFormatVersion.v3,
|
|
57
|
+
[FluidClientVersion.v2_43]: MessageFormatVersion.v4,
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
52
60
|
return writeVersionOverride ?? compatibleVersion;
|
|
53
61
|
}
|
|
54
62
|
|
|
@@ -123,29 +131,36 @@ export function makeMessageCodecs<TChangeset>(
|
|
|
123
131
|
MessageEncodingContext
|
|
124
132
|
>,
|
|
125
133
|
][] = Array.from(messageFormatVersions).map((version) => {
|
|
126
|
-
const changeCodec = changeCodecs.resolve(
|
|
127
|
-
dependentChangeFormatVersion.lookup(version),
|
|
128
|
-
).json;
|
|
129
134
|
switch (version) {
|
|
130
135
|
case MessageFormatVersion.undefined:
|
|
131
136
|
case MessageFormatVersion.v1:
|
|
132
|
-
case MessageFormatVersion.v2:
|
|
137
|
+
case MessageFormatVersion.v2: {
|
|
138
|
+
const versionOrUndefined =
|
|
139
|
+
version === MessageFormatVersion.undefined ? undefined : version;
|
|
140
|
+
return [
|
|
141
|
+
versionOrUndefined,
|
|
142
|
+
makeDiscontinuedCodecVersion(options, versionOrUndefined, "2.73.0"),
|
|
143
|
+
];
|
|
144
|
+
}
|
|
133
145
|
case MessageFormatVersion.v3:
|
|
134
|
-
case MessageFormatVersion.v4:
|
|
146
|
+
case MessageFormatVersion.v4: {
|
|
147
|
+
const changeCodec = changeCodecs.resolve(
|
|
148
|
+
dependentChangeFormatVersion.lookup(version),
|
|
149
|
+
).json;
|
|
135
150
|
return [
|
|
136
|
-
version
|
|
137
|
-
makeV1ToV4CodecWithVersion(
|
|
138
|
-
changeCodec,
|
|
139
|
-
revisionTagCodec,
|
|
140
|
-
options,
|
|
141
|
-
version === MessageFormatVersion.undefined ? MessageFormatVersion.v1 : version,
|
|
142
|
-
),
|
|
151
|
+
version,
|
|
152
|
+
makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
143
153
|
];
|
|
144
|
-
|
|
154
|
+
}
|
|
155
|
+
case MessageFormatVersion.v5: {
|
|
156
|
+
const changeCodec = changeCodecs.resolve(
|
|
157
|
+
dependentChangeFormatVersion.lookup(version),
|
|
158
|
+
).json;
|
|
145
159
|
return [
|
|
146
160
|
version,
|
|
147
161
|
makeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
148
162
|
];
|
|
163
|
+
}
|
|
149
164
|
default:
|
|
150
165
|
unreachableCase(version);
|
|
151
166
|
}
|
|
@@ -12,20 +12,17 @@ export const MessageFormatVersion = {
|
|
|
12
12
|
/**
|
|
13
13
|
* NOTE: this is written as `undefined` rather than `0` in the wire format.
|
|
14
14
|
* Introduced and retired prior to 2.0.
|
|
15
|
-
* Reading
|
|
16
|
-
* Writing capability need not be maintained.
|
|
15
|
+
* Reading and writing capability removed in 2.73.0.
|
|
17
16
|
*/
|
|
18
17
|
undefined: 0,
|
|
19
18
|
/**
|
|
20
19
|
* Introduced and retired prior to 2.0.
|
|
21
|
-
* Reading
|
|
22
|
-
* Writing capability need not be maintained.
|
|
20
|
+
* Reading and writing capability removed in 2.73.0.
|
|
23
21
|
*/
|
|
24
22
|
v1: 1,
|
|
25
23
|
/**
|
|
26
24
|
* Introduced and retired prior to 2.0.
|
|
27
|
-
* Reading
|
|
28
|
-
* Writing capability need not be maintained.
|
|
25
|
+
* Reading and writing capability removed in 2.73.0.
|
|
29
26
|
*/
|
|
30
27
|
v2: 2,
|
|
31
28
|
/**
|
|
@@ -51,6 +48,11 @@ export type MessageFormatVersion = Brand<
|
|
|
51
48
|
(typeof MessageFormatVersion)[keyof typeof MessageFormatVersion],
|
|
52
49
|
"MessageFormatVersion"
|
|
53
50
|
>;
|
|
51
|
+
export const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([
|
|
52
|
+
MessageFormatVersion.v3,
|
|
53
|
+
MessageFormatVersion.v4,
|
|
54
|
+
MessageFormatVersion.v5,
|
|
55
|
+
] as MessageFormatVersion[]);
|
|
54
56
|
export const messageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set(
|
|
55
57
|
Object.values(MessageFormatVersion) as MessageFormatVersion[],
|
|
56
58
|
);
|
|
@@ -175,22 +175,22 @@ export class TreeViewConfiguration<
|
|
|
175
175
|
/**
|
|
176
176
|
* {@inheritDoc ITreeViewConfiguration.schema}
|
|
177
177
|
*/
|
|
178
|
-
public readonly schema
|
|
178
|
+
public readonly schema!: TSchema;
|
|
179
179
|
|
|
180
180
|
/**
|
|
181
181
|
* {@inheritDoc ITreeConfigurationOptions.enableSchemaValidation}
|
|
182
182
|
*/
|
|
183
|
-
public readonly enableSchemaValidation
|
|
183
|
+
public readonly enableSchemaValidation!: boolean;
|
|
184
184
|
|
|
185
185
|
/**
|
|
186
186
|
* {@inheritDoc ITreeConfigurationOptions.preventAmbiguity}
|
|
187
187
|
*/
|
|
188
|
-
public readonly preventAmbiguity
|
|
188
|
+
public readonly preventAmbiguity!: boolean;
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* {@link TreeSchema.definitions} but with public types.
|
|
192
192
|
*/
|
|
193
|
-
protected readonly definitionsInternal
|
|
193
|
+
protected readonly definitionsInternal!: ReadonlyMap<string, TreeNodeSchema>;
|
|
194
194
|
|
|
195
195
|
/**
|
|
196
196
|
* Construct a new {@link TreeViewConfiguration}.
|
|
@@ -206,6 +206,17 @@ export class TreeViewConfiguration<
|
|
|
206
206
|
* since this would be a cyclic dependency that will cause an error when constructing this configuration.
|
|
207
207
|
*/
|
|
208
208
|
public constructor(props: ITreeViewConfiguration<TSchema>) {
|
|
209
|
+
if (this.constructor === TreeViewConfiguration) {
|
|
210
|
+
// Ensure all TreeViewConfiguration instances are actually TreeViewConfigurationAlpha, allowing `asAlpha` to work correctly.
|
|
211
|
+
// If everything in TreeViewConfigurationAlpha is stabilized and this is removed, the `!` on the properties above should be removed to restore better type safety.
|
|
212
|
+
return new TreeViewConfigurationAlpha(props);
|
|
213
|
+
}
|
|
214
|
+
assert(
|
|
215
|
+
// The type cast here is needed to avoid this assert narrowing "this" to never, breaking the code below.
|
|
216
|
+
(this.constructor as unknown) === TreeViewConfigurationAlpha,
|
|
217
|
+
0xc9e /* Invalid configuration class constructed. */,
|
|
218
|
+
);
|
|
219
|
+
|
|
209
220
|
const config = { ...defaultTreeConfigurationOptions, ...props };
|
|
210
221
|
this.schema = config.schema;
|
|
211
222
|
this.enableSchemaValidation = config.enableSchemaValidation;
|
|
@@ -252,6 +263,8 @@ export class TreeViewConfiguration<
|
|
|
252
263
|
|
|
253
264
|
/**
|
|
254
265
|
* {@link TreeViewConfiguration} extended with some alpha APIs.
|
|
266
|
+
* @remarks
|
|
267
|
+
* See {@link (asAlpha:2)} for an API to downcast from {@link TreeViewConfiguration} to this type.
|
|
255
268
|
* @sealed @alpha
|
|
256
269
|
*/
|
|
257
270
|
export class TreeViewConfigurationAlpha<
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { FieldKey, TreeNodeSchemaIdentifier } from "../../core/index.js";
|
|
7
6
|
import { getTreeNodeSchemaPrivateData, type AllowedTypesFull } from "../core/index.js";
|
|
8
7
|
import { isObjectNodeSchema } from "../node-kinds/index.js";
|
|
9
8
|
import type { TreeSchema } from "./configuration.js";
|
|
10
9
|
import type { IncrementalEncodingPolicy } from "../../feature-libraries/index.js";
|
|
11
10
|
import { oneFromIterable } from "../../util/index.js";
|
|
12
11
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
12
|
+
import type { FieldKey } from "../../core/index.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* A symbol when present in the {@link AnnotatedAllowedTypes.metadata
|
|
15
|
+
* A symbol when present in the {@link AnnotatedAllowedTypes.metadata}'s `custom` property as true, opts in the allowed
|
|
16
16
|
* types to incremental summary optimization.
|
|
17
17
|
* These allowed types will be optimized during summary such that if they don't change across summaries,
|
|
18
18
|
* they will not be encoded and their content will not be included in the summary that is uploaded to the service.
|
|
19
19
|
* @remarks
|
|
20
|
-
* See {@link
|
|
20
|
+
* See {@link incrementalEncodingPolicyForAllowedTypes} for more details.
|
|
21
21
|
*
|
|
22
22
|
* Use {@link SchemaStaticsBeta.types} to add this metadata to allowed types in a schema.
|
|
23
23
|
* @example
|
|
@@ -29,6 +29,7 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
29
29
|
* }),
|
|
30
30
|
* }) {}
|
|
31
31
|
* ```
|
|
32
|
+
* @alpha
|
|
32
33
|
*/
|
|
33
34
|
export const incrementalSummaryHint: unique symbol = Symbol("IncrementalSummaryHint");
|
|
34
35
|
|
|
@@ -44,31 +45,30 @@ function isIncrementalSummaryHintInAllowedTypes(allowedTypes: AllowedTypesFull):
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
|
-
* This helper function {@link
|
|
48
|
-
* of type {@link IncrementalEncodingPolicy}.
|
|
49
|
-
*
|
|
48
|
+
* This helper function {@link incrementalEncodingPolicyForAllowedTypes} can be used to generate a callback function
|
|
49
|
+
* of type {@link IncrementalEncodingPolicy}. It determines if each {@link AllowedTypes} in a schema should be
|
|
50
|
+
* incrementally summarized.
|
|
51
|
+
* This callback can be passed as the value for {@link SharedTreeOptions.shouldEncodeIncrementally} parameter
|
|
50
52
|
* when creating the tree.
|
|
51
|
-
* It will be called for each {@link AllowedTypes} in the schema to determine if it should be incrementally summarized.
|
|
52
53
|
*
|
|
53
54
|
* @param rootSchema - The schema for the root of the tree.
|
|
54
|
-
* @returns A callback function of type {@link IncrementalEncodingPolicy} which
|
|
55
|
-
*
|
|
56
|
-
* {@link incrementalAllowedTypesMetadata} metadata.
|
|
55
|
+
* @returns A callback function of type {@link IncrementalEncodingPolicy} which determines if allowed types should
|
|
56
|
+
* be incrementally summarized based on whether they have opted in via the {@link incrementalSummaryHint} metadata.
|
|
57
57
|
*
|
|
58
58
|
* @remarks
|
|
59
59
|
* This only works for forest type {@link ForestTypeOptimized} and compression strategy
|
|
60
|
-
* {@link
|
|
60
|
+
* {@link TreeCompressionStrategy.CompressedIncremental}.
|
|
61
61
|
*
|
|
62
|
-
*
|
|
62
|
+
* @privateRemarks
|
|
63
|
+
* The {@link incrementalSummaryHint} will be replaced with a specialized metadata property once the
|
|
63
64
|
* incremental summary feature and APIs are stabilized.
|
|
65
|
+
*
|
|
66
|
+
* @alpha
|
|
64
67
|
*/
|
|
65
|
-
export function
|
|
68
|
+
export function incrementalEncodingPolicyForAllowedTypes(
|
|
66
69
|
rootSchema: TreeSchema,
|
|
67
70
|
): IncrementalEncodingPolicy {
|
|
68
|
-
return (
|
|
69
|
-
targetNodeIdentifier: TreeNodeSchemaIdentifier | undefined,
|
|
70
|
-
targetFieldKey: FieldKey,
|
|
71
|
-
) => {
|
|
71
|
+
return (targetNodeIdentifier: string | undefined, targetFieldKey: string) => {
|
|
72
72
|
if (targetNodeIdentifier === undefined) {
|
|
73
73
|
// Root fields cannot be allowed types, so we don't incrementally summarize them.
|
|
74
74
|
return false;
|
|
@@ -85,7 +85,9 @@ export function getShouldIncrementallySummarizeAllowedTypes(
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
if (isObjectNodeSchema(targetNode)) {
|
|
88
|
-
const targetPropertyKey = targetNode.storedKeyToPropertyKey.get(
|
|
88
|
+
const targetPropertyKey = targetNode.storedKeyToPropertyKey.get(
|
|
89
|
+
targetFieldKey as FieldKey,
|
|
90
|
+
);
|
|
89
91
|
if (targetPropertyKey !== undefined) {
|
|
90
92
|
const fieldSchema = targetNode.fields.get(targetPropertyKey);
|
|
91
93
|
if (fieldSchema !== undefined) {
|
|
@@ -164,10 +164,15 @@ export { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
|
164
164
|
export { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
165
165
|
export type { TreeChangeEvents } from "./treeChangeEvents.js";
|
|
166
166
|
export {
|
|
167
|
-
|
|
167
|
+
incrementalEncodingPolicyForAllowedTypes,
|
|
168
168
|
incrementalSummaryHint,
|
|
169
169
|
} from "./incrementalAllowedTypes.js";
|
|
170
170
|
export {
|
|
171
171
|
encodeSimpleSchema,
|
|
172
172
|
decodeSimpleSchema,
|
|
173
173
|
} from "./simpleSchemaCodec.js";
|
|
174
|
+
export {
|
|
175
|
+
exportCompatibilitySchemaSnapshot,
|
|
176
|
+
importCompatibilitySchemaSnapshot,
|
|
177
|
+
checkCompatibility,
|
|
178
|
+
} from "./snapshotCompatibilityChecker.js";
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
import { unreachableCase, fail } from "@fluidframework/core-utils/internal";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
NodeKind,
|
|
10
|
+
type TreeNodeSchema,
|
|
11
|
+
type AllowedTypesFull,
|
|
12
|
+
SchemaUpgrade,
|
|
13
|
+
} from "../core/index.js";
|
|
9
14
|
import {
|
|
10
15
|
type FieldSchema,
|
|
11
16
|
type FieldSchemaAlpha,
|
|
@@ -88,11 +93,14 @@ function generateFieldSchema(
|
|
|
88
93
|
function generateAllowedTypes(
|
|
89
94
|
allowed: ReadonlyMap<string, SimpleAllowedTypeAttributes>,
|
|
90
95
|
context: Context,
|
|
91
|
-
):
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
);
|
|
96
|
+
): AllowedTypesFull {
|
|
97
|
+
const types = Array.from(allowed.entries(), ([id, attributes]) => {
|
|
98
|
+
const schema = context.get(id) ?? fail(0xb5a /* Missing schema */);
|
|
99
|
+
return attributes.isStaged instanceof SchemaUpgrade ? factory.staged(schema) : schema;
|
|
100
|
+
});
|
|
101
|
+
// TODO: AB#53315: `AllowedTypesFullFromMixed` does not correctly handle the `(AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]` case.
|
|
102
|
+
// We have to cast here in order to produce an allowed types list that can be used in tree node factory methods (e.g., `SchemaFactoryAlpha.objectAlpha`).
|
|
103
|
+
return SchemaFactoryAlpha.types(types) as AllowedTypesFull;
|
|
96
104
|
}
|
|
97
105
|
|
|
98
106
|
function generateNode(
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
SimpleRecordNodeSchema,
|
|
18
18
|
SimpleTreeSchema,
|
|
19
19
|
} from "../simpleSchema.js";
|
|
20
|
-
import { NodeKind } from "../core/index.js";
|
|
20
|
+
import { createSchemaUpgrade, NodeKind, SchemaUpgrade } from "../core/index.js";
|
|
21
21
|
import type { FieldKind } from "../fieldSchema.js";
|
|
22
22
|
import type { ValueSchema } from "../../core/index.js";
|
|
23
23
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
@@ -153,9 +153,8 @@ function encodeSimpleAllowedTypes(
|
|
|
153
153
|
): Format.SimpleAllowedTypesFormat {
|
|
154
154
|
const encodedAllowedTypes: Format.SimpleAllowedTypesFormat = {};
|
|
155
155
|
for (const [identifier, attributes] of simpleAllowedTypes) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
};
|
|
156
|
+
const isStaged = attributes.isStaged instanceof SchemaUpgrade ? true : attributes.isStaged;
|
|
157
|
+
encodedAllowedTypes[identifier] = { isStaged };
|
|
159
158
|
}
|
|
160
159
|
return encodedAllowedTypes;
|
|
161
160
|
}
|
|
@@ -350,11 +349,13 @@ function decodeSimpleAllowedTypes(
|
|
|
350
349
|
): ReadonlyMap<string, SimpleAllowedTypeAttributes> {
|
|
351
350
|
const untypedMap = objectToMap(encodedAllowedTypes);
|
|
352
351
|
|
|
353
|
-
const simpleAllowedTypes = transformMapValues(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
352
|
+
const simpleAllowedTypes = transformMapValues(
|
|
353
|
+
untypedMap,
|
|
354
|
+
(value): SimpleAllowedTypeAttributes => {
|
|
355
|
+
const isStaged = value.isStaged === true ? createSchemaUpgrade() : value.isStaged;
|
|
356
|
+
return { isStaged };
|
|
357
|
+
},
|
|
358
|
+
);
|
|
358
359
|
|
|
359
360
|
return simpleAllowedTypes;
|
|
360
361
|
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { JsonCompatibleReadOnly } from "../../util/index.js";
|
|
7
|
+
import { toStoredSchema } from "../toStoredSchema.js";
|
|
8
|
+
import { TreeViewConfigurationAlpha, TreeViewConfiguration } from "./configuration.js";
|
|
9
|
+
import { SchemaCompatibilityTester } from "./schemaCompatibilityTester.js";
|
|
10
|
+
import { generateSchemaFromSimpleSchema } from "./schemaFromSimple.js";
|
|
11
|
+
import { decodeSimpleSchema, encodeSimpleSchema } from "./simpleSchemaCodec.js";
|
|
12
|
+
import type { SchemaCompatibilityStatus } from "./tree.js";
|
|
13
|
+
import { toSimpleTreeSchema } from "./viewSchemaToSimpleSchema.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 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}.
|
|
17
|
+
*
|
|
18
|
+
* @remarks See {@link SchemaCompatibilityStatus} for details on the compatibility results.
|
|
19
|
+
*
|
|
20
|
+
* @example This example demonstrates checking the compatibility of a historical schema against a current schema.
|
|
21
|
+
* In this case, the historical schema is a Point2D object with x and y fields, while the current schema is a Point3D object
|
|
22
|
+
* that adds an optional z field.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* // This snapshot is assumed to be the same as Point3D, except missing `z`.
|
|
26
|
+
* const encodedSchema = JSON.parse(fs.readFileSync("PointSchema.json", "utf8"));
|
|
27
|
+
* const oldViewSchema = importCompatibilitySchemaSnapshot(encodedSchema);
|
|
28
|
+
*
|
|
29
|
+
* // Build the current view schema
|
|
30
|
+
* class Point3D extends factory.object("Point", {
|
|
31
|
+
* x: factory.number,
|
|
32
|
+
* y: factory.number,
|
|
33
|
+
*
|
|
34
|
+
* // The current schema has a new optional field that was not present on Point2D
|
|
35
|
+
* z: factory.optional(factory.number),
|
|
36
|
+
* }) {}
|
|
37
|
+
* const currentViewSchema = new TreeViewConfiguration({ schema: Point3D });
|
|
38
|
+
*
|
|
39
|
+
* // Check to see if the document created by the historical view schema can be opened with the current view schema
|
|
40
|
+
* const backwardsCompatibilityStatus = checkCompatibility(oldViewSchema, currentViewSchema);
|
|
41
|
+
*
|
|
42
|
+
* // z is not present in Point2D, so the schema must be upgraded
|
|
43
|
+
* assert.equal(backwardsCompatibilityStatus.canView, false);
|
|
44
|
+
*
|
|
45
|
+
* // The schema can be upgraded to add the new optional field
|
|
46
|
+
* assert.equal(backwardsCompatibilityStatus.canUpgrade, true);
|
|
47
|
+
*
|
|
48
|
+
* // Test what the old version of the application would do with a tree using the new schema:
|
|
49
|
+
* const forwardsCompatibilityStatus = checkCompatibility(currentViewSchema, oldViewSchema);
|
|
50
|
+
*
|
|
51
|
+
* // If the old schema set allowUnknownOptionalFields, this would be true, but since it did not,
|
|
52
|
+
* // this assert will fail, detecting the forwards compatibility break:
|
|
53
|
+
* // this means these two versions of the application cannot collaborate on content using these schema.
|
|
54
|
+
* assert.equal(forwardsCompatibilityStatus.canView, true);
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @param viewWhichCreatedStoredSchema - From which to derive the stored schema, as if it initialized or upgraded a tree via {@link TreeView}.
|
|
58
|
+
* @param view - The view being tested to see if it could view tree created or initialized using `viewWhichCreatedStoredSchema`.
|
|
59
|
+
* @returns The compatibility status.
|
|
60
|
+
*
|
|
61
|
+
* @alpha
|
|
62
|
+
*/
|
|
63
|
+
export function checkCompatibility(
|
|
64
|
+
viewWhichCreatedStoredSchema: TreeViewConfiguration,
|
|
65
|
+
view: TreeViewConfiguration,
|
|
66
|
+
): Omit<SchemaCompatibilityStatus, "canInitialize"> {
|
|
67
|
+
const viewAsAlpha = new TreeViewConfigurationAlpha({ schema: view.schema });
|
|
68
|
+
const stored = toStoredSchema(viewWhichCreatedStoredSchema.schema, {
|
|
69
|
+
includeStaged: () => true,
|
|
70
|
+
});
|
|
71
|
+
const tester = new SchemaCompatibilityTester(viewAsAlpha);
|
|
72
|
+
return tester.checkCompatibility(stored);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Returns a JSON compatible representation of the tree schema for snapshot compatibility checking.
|
|
77
|
+
*
|
|
78
|
+
* Snapshots can be loaded by the same or newer package versions, but not necessarily older versions.
|
|
79
|
+
*
|
|
80
|
+
* @see {@link importCompatibilitySchemaSnapshot} which loads these snapshots.
|
|
81
|
+
*
|
|
82
|
+
* @param config - The schema to snapshot. Only the schema field of the `TreeViewConfiguration` is used.
|
|
83
|
+
* @returns The JSON representation of the schema.
|
|
84
|
+
*
|
|
85
|
+
* @example This example creates and persists a snapshot of a Point2D schema.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* const schemaFactory = new SchemaFactory("test");
|
|
89
|
+
* class Point2D extends schemaFactory.object("Point", {
|
|
90
|
+
* x: factory.number,
|
|
91
|
+
* y: factory.number,
|
|
92
|
+
* }) {}
|
|
93
|
+
* const viewSchema = new TreeViewConfiguration({ schema: Point2D });
|
|
94
|
+
* const encodedSchema = JSON.stringify(exportCompatibilitySchemaSnapshot(viewSchema));
|
|
95
|
+
* fs.writeFileSync("PointSchema.json", encodedSchema);
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @alpha
|
|
99
|
+
*/
|
|
100
|
+
export function exportCompatibilitySchemaSnapshot(
|
|
101
|
+
config: Pick<TreeViewConfiguration, "schema">,
|
|
102
|
+
): JsonCompatibleReadOnly {
|
|
103
|
+
const simpleSchema = toSimpleTreeSchema(config.schema, true);
|
|
104
|
+
return encodeSimpleSchema(simpleSchema);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Parse the format exported by {@link exportCompatibilitySchemaSnapshot} into a schema.
|
|
109
|
+
*
|
|
110
|
+
* Can load snapshots created by the same or older package versions, but not necessarily newer versions.
|
|
111
|
+
*
|
|
112
|
+
* @see {@link exportCompatibilitySchemaSnapshot} which creates these snapshots.
|
|
113
|
+
*
|
|
114
|
+
* @param config - The JSON representation of the schema.
|
|
115
|
+
* @returns The schema. Only the schema field of the {@link TreeViewConfiguration} is populated.
|
|
116
|
+
* @throws Will throw a usage error if the encoded schema is not in the expected format.
|
|
117
|
+
*
|
|
118
|
+
* @example This example loads and parses a snapshot of a Point2D schema.
|
|
119
|
+
*
|
|
120
|
+
* ```ts;
|
|
121
|
+
* const oldViewSchema = importCompatibilitySchemaSnapshot(fs.readFileSync("PointSchema.json", "utf8"));
|
|
122
|
+
* ```
|
|
123
|
+
*
|
|
124
|
+
* @alpha
|
|
125
|
+
*/
|
|
126
|
+
export function importCompatibilitySchemaSnapshot(
|
|
127
|
+
config: JsonCompatibleReadOnly,
|
|
128
|
+
): TreeViewConfiguration {
|
|
129
|
+
const simpleSchema = decodeSimpleSchema(config);
|
|
130
|
+
const viewSchema = generateSchemaFromSimpleSchema(simpleSchema);
|
|
131
|
+
|
|
132
|
+
// We construct a TreeViewConfiguration here with the default parameters. The default set of validation parameters are fine for
|
|
133
|
+
// a schema produced by `generateSchemaFromSimpleSchema`.
|
|
134
|
+
return new TreeViewConfiguration({ schema: viewSchema.root });
|
|
135
|
+
}
|
|
@@ -449,7 +449,7 @@ export interface SchemaCompatibilityStatus {
|
|
|
449
449
|
*
|
|
450
450
|
* In these cases `canUpgrade` and `isEquivalent` will be false.
|
|
451
451
|
*
|
|
452
|
-
* When the documents allowed by the view schema is a strict superset of those by the stored schema,
|
|
452
|
+
* When the set of documents allowed by the view schema is a strict superset of those allowed by the stored schema,
|
|
453
453
|
* `canView` is false because writes to the document using the view schema could make the document violate its stored schema.
|
|
454
454
|
* In this case, the stored schema could be updated to match the provided view schema, allowing read-write access to the tree.
|
|
455
455
|
* See {@link SchemaCompatibilityStatus.canUpgrade}.
|
|
@@ -577,7 +577,7 @@ export interface TreeViewEvents {
|
|
|
577
577
|
/**
|
|
578
578
|
* Retrieve the {@link TreeViewAlpha | alpha API} for a {@link TreeView}.
|
|
579
579
|
* @alpha
|
|
580
|
-
* @deprecated Use {@link asAlpha} instead.
|
|
580
|
+
* @deprecated Use {@link (asAlpha:1)} instead.
|
|
581
581
|
* @privateRemarks Despite being deprecated, this function should be used within the tree package (outside of tests) rather than `asAlpha` in order to avoid circular import dependencies.
|
|
582
582
|
*/
|
|
583
583
|
export function asTreeViewAlpha<TSchema extends ImplicitFieldSchema>(
|
|
@@ -262,7 +262,7 @@ export class AnnotatedAllowedTypesInternal<
|
|
|
262
262
|
const simpleAllowedTypes = new Map<string, SimpleAllowedTypeAttributes>();
|
|
263
263
|
for (const type of annotatedAllowedTypes.evaluate().types) {
|
|
264
264
|
simpleAllowedTypes.set(type.type.identifier, {
|
|
265
|
-
isStaged: type.metadata.stagedSchemaUpgrade
|
|
265
|
+
isStaged: type.metadata.stagedSchemaUpgrade ?? false,
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
return simpleAllowedTypes;
|
|
@@ -65,6 +65,7 @@ export {
|
|
|
65
65
|
createSchemaUpgrade,
|
|
66
66
|
AnnotatedAllowedTypesInternal,
|
|
67
67
|
normalizeAllowedTypesInternal,
|
|
68
|
+
SchemaUpgrade,
|
|
68
69
|
} from "./allowedTypes.js";
|
|
69
70
|
export type {
|
|
70
71
|
AnnotatedAllowedType,
|
|
@@ -80,7 +81,6 @@ export type {
|
|
|
80
81
|
AllowedTypeMetadata,
|
|
81
82
|
AnnotatedAllowedTypes,
|
|
82
83
|
AnnotateAllowedTypesList,
|
|
83
|
-
SchemaUpgrade,
|
|
84
84
|
AllowedTypesFullInternal,
|
|
85
85
|
AllowedTypesFull,
|
|
86
86
|
AllowedTypesFullFromMixed,
|
|
@@ -117,4 +117,6 @@ export {
|
|
|
117
117
|
type StoredSchemaGenerationOptions,
|
|
118
118
|
convertAllowedTypes,
|
|
119
119
|
allowedTypeFilter,
|
|
120
|
+
type StoredFromViewSchemaGenerationOptions,
|
|
121
|
+
ExpectStored,
|
|
120
122
|
} from "./toStored.js";
|