@fluidframework/tree 2.71.0 → 2.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -40
- package/api-report/tree.alpha.api.md +44 -48
- package/api-report/tree.beta.api.md +42 -0
- package/api-report/tree.legacy.beta.api.md +42 -0
- package/dist/alpha.d.ts +12 -8
- 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/beta.d.ts +7 -0
- package/dist/codec/codec.d.ts +23 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +23 -3
- 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/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +2 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +18 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +6 -7
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +31 -8
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.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 +4 -10
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +39 -21
- 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 +163 -6
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +13 -4
- 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/index.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +2 -2
- 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 -2
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +35 -25
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +54 -74
- 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/codec.d.ts +4 -5
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +15 -4
- package/dist/feature-libraries/forest-summary/codec.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 +9 -2
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +11 -4
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -1
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +6 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +9 -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/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-edits/index.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +24 -18
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.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/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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +7 -0
- package/dist/packageVersion.d.ts +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 +22 -15
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +1 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +1 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +12 -60
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +68 -159
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +10 -11
- 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/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +42 -18
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +40 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +12 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +49 -21
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +48 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/messageFormat.js +53 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -3
- package/dist/shared-tree-core/sharedTreeCore.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/discrepancies.d.ts +2 -2
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +13 -4
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js +290 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- 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/storedSchema.d.ts +2 -2
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +3 -3
- package/dist/simple-tree/api/tree.js +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
- package/dist/simple-tree/core/allowedTypes.js +2 -2
- 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/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.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 -2
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +12 -2
- 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 -50
- 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 +2 -6
- 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 +4 -12
- 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 +3 -7
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +25 -5
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- 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 +3 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +26 -2
- 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/brand.d.ts +31 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +28 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +3 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.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 +8 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +12 -8
- 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/beta.d.ts +7 -0
- package/lib/codec/codec.d.ts +23 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +23 -3
- 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/index.d.ts +1 -1
- 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/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +18 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -7
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +31 -8
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.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 +4 -10
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +42 -23
- 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 +5 -3
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +163 -6
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +12 -3
- 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/index.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
- 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 -25
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +56 -76
- 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/codec.d.ts +4 -5
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +16 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +9 -2
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +9 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -0
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +6 -5
- 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/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-edits/index.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +26 -20
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +2 -2
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +2 -2
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.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/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/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +7 -0
- package/lib/packageVersion.d.ts +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 +11 -4
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +1 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +12 -60
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +70 -161
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +8 -7
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +5 -6
- 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/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +5 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +39 -17
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +36 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +39 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +46 -20
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +48 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/messageFormat.js +50 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +3 -3
- package/lib/shared-tree-core/sharedTreeCore.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/discrepancies.d.ts +2 -2
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +14 -5
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js +262 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- 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/storedSchema.d.ts +2 -2
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -3
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +3 -3
- package/lib/simple-tree/api/tree.js +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
- package/lib/simple-tree/core/allowedTypes.js +2 -2
- 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/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.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 -2
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +2 -1
- 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 +17 -53
- 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 +5 -9
- 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 +6 -14
- 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 +6 -10
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +25 -5
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- 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 +3 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +23 -1
- 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/brand.d.ts +31 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +26 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +3 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.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/package.json +24 -24
- package/src/api.ts +22 -11
- package/src/codec/codec.ts +25 -3
- 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/index.ts +1 -2
- package/src/core/schema-stored/index.ts +1 -2
- package/src/core/schema-stored/schema.ts +22 -8
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
- package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +40 -11
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
- package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
- package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
- package/src/core/tree/index.ts +2 -4
- package/src/external-utilities/typeboxValidator.ts +1 -1
- 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 +65 -27
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +9 -4
- package/src/feature-libraries/chunked-forest/codec/format.ts +26 -5
- package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/index.ts +1 -2
- 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 -2
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +88 -103
- package/src/feature-libraries/default-schema/index.ts +1 -9
- package/src/feature-libraries/forest-summary/codec.ts +24 -9
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/forest-summary/format.ts +25 -9
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/index.ts +8 -7
- 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/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-edits/index.ts +0 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
- package/src/feature-libraries/schema-index/codec.ts +41 -22
- package/src/feature-libraries/schema-index/formatV1.ts +2 -2
- package/src/feature-libraries/schema-index/formatV2.ts +2 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
- package/src/feature-libraries/{default-schema/schemaChecker.ts → schemaChecker.ts} +4 -4
- package/src/feature-libraries/sequence-field/sequenceFieldCodecs.ts +0 -2
- package/src/index.ts +6 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +16 -5
- package/src/shared-tree/index.ts +0 -1
- package/src/shared-tree/sharedTree.ts +92 -222
- package/src/shared-tree/sharedTreeChangeCodecs.ts +14 -13
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeAlpha.ts +6 -5
- package/src/shared-tree/treeCheckout.ts +1 -3
- package/src/shared-tree-core/editManagerCodecs.ts +69 -20
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
- package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
- package/src/shared-tree-core/index.ts +15 -5
- package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
- package/src/shared-tree-core/messageCodecV5.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +77 -28
- package/src/shared-tree-core/messageFormat.ts +58 -0
- package/src/shared-tree-core/sharedTreeCore.ts +11 -13
- package/src/simple-tree/api/configuration.ts +17 -4
- package/src/simple-tree/api/discrepancies.ts +2 -2
- package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
- package/src/simple-tree/api/index.ts +11 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
- package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
- package/src/simple-tree/api/schemaFromSimple.ts +20 -9
- package/src/simple-tree/api/simpleSchemaCodec.ts +361 -0
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +135 -0
- package/src/simple-tree/api/storedSchema.ts +8 -5
- package/src/simple-tree/api/tree.ts +3 -3
- package/src/simple-tree/api/typesUnsafe.ts +6 -6
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
- package/src/simple-tree/core/allowedTypes.ts +4 -4
- package/src/simple-tree/core/index.ts +3 -1
- package/src/simple-tree/core/toStored.ts +42 -18
- package/src/simple-tree/core/treeNode.ts +2 -2
- 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 +11 -2
- package/src/simple-tree/leafNodeSchema.ts +1 -2
- package/src/simple-tree/node-kinds/array/arrayNode.ts +28 -77
- package/src/simple-tree/node-kinds/map/mapNode.ts +3 -17
- package/src/simple-tree/node-kinds/object/objectNode.ts +5 -20
- package/src/simple-tree/node-kinds/record/recordNode.ts +4 -18
- package/src/simple-tree/simpleSchema.ts +27 -5
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/simple-tree/toStoredSchema.ts +54 -38
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +22 -17
- package/src/tableSchema.ts +110 -331
- package/src/treeFactory.ts +33 -1
- package/src/util/arrayUtilities.ts +88 -0
- package/src/util/brand.ts +40 -2
- package/src/util/brandedMap.ts +3 -1
- package/src/util/index.ts +7 -0
- 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
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type Brand,
|
|
11
11
|
type JsonCompatibleReadOnlyObject,
|
|
12
12
|
type MakeNominal,
|
|
13
|
-
|
|
13
|
+
brandConst,
|
|
14
14
|
invertMap,
|
|
15
15
|
} from "../../util/index.js";
|
|
16
16
|
|
|
@@ -33,14 +33,17 @@ import type { Multiplicity } from "./multiplicity.js";
|
|
|
33
33
|
/**
|
|
34
34
|
* The format version for the schema.
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
37
|
-
v1
|
|
36
|
+
export const SchemaFormatVersion = {
|
|
37
|
+
v1: 1,
|
|
38
38
|
/**
|
|
39
39
|
* Adds persisted metadata to the node schema and field schema.
|
|
40
40
|
*/
|
|
41
|
-
v2
|
|
42
|
-
}
|
|
43
|
-
export type SchemaFormatVersion = Brand<
|
|
41
|
+
v2: 2,
|
|
42
|
+
} as const;
|
|
43
|
+
export type SchemaFormatVersion = Brand<
|
|
44
|
+
(typeof SchemaFormatVersion)[keyof typeof SchemaFormatVersion],
|
|
45
|
+
"SchemaFormatVersion"
|
|
46
|
+
>;
|
|
44
47
|
|
|
45
48
|
type FieldSchemaFormat = FieldSchemaFormatV1 | FieldSchemaFormatV2;
|
|
46
49
|
|
|
@@ -88,13 +91,24 @@ export enum ValueSchema {
|
|
|
88
91
|
export type TreeTypeSet = ReadonlySet<TreeNodeSchemaIdentifier>;
|
|
89
92
|
|
|
90
93
|
/**
|
|
91
|
-
* Declarative portion of a
|
|
94
|
+
* Declarative portion of a {@link FlexFieldKind}.
|
|
92
95
|
*
|
|
93
96
|
* @remarks
|
|
94
97
|
* Enough info about a field kind to know if a given tree is is schema.
|
|
98
|
+
*
|
|
99
|
+
* Note that compatibility between trees and schema is not sufficient to evaluate if a schema upgrade should be allowed.
|
|
100
|
+
* Currently schema upgrades are restricted to field kind changes which can not be cyclic (like version upgrades but not down grades).
|
|
101
|
+
* See {@link FlexFieldKind.allowsFieldSuperset} for more details.
|
|
95
102
|
*/
|
|
96
103
|
export interface FieldKindData {
|
|
104
|
+
/**
|
|
105
|
+
* Globally scoped identifier.
|
|
106
|
+
*/
|
|
97
107
|
readonly identifier: FieldKindIdentifier;
|
|
108
|
+
/**
|
|
109
|
+
* Bound on the number of children that fields of this kind may have.
|
|
110
|
+
* TODO: consider replacing this with numeric upper and lower bounds.
|
|
111
|
+
*/
|
|
98
112
|
readonly multiplicity: Multiplicity;
|
|
99
113
|
}
|
|
100
114
|
|
|
@@ -157,7 +171,7 @@ export interface TreeFieldStoredSchema {
|
|
|
157
171
|
*
|
|
158
172
|
* 2. The schema used for out of schema fields (which thus must be empty/not exist) on object and leaf nodes.
|
|
159
173
|
*/
|
|
160
|
-
export const forbiddenFieldKindIdentifier
|
|
174
|
+
export const forbiddenFieldKindIdentifier = brandConst("Forbidden")<FieldKindIdentifier>();
|
|
161
175
|
|
|
162
176
|
/**
|
|
163
177
|
* A schema for empty fields (fields which must always be empty).
|
|
@@ -12,6 +12,7 @@ import { hasSingle } from "../../util/index.js";
|
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
Format,
|
|
15
|
+
type DetachedFieldIndexFormatVersion,
|
|
15
16
|
type EncodedRootsForRevision,
|
|
16
17
|
type RootRanges,
|
|
17
18
|
} from "./detachedFieldIndexFormatCommon.js";
|
|
@@ -27,7 +28,7 @@ import type { Static, TSchema } from "@sinclair/typebox";
|
|
|
27
28
|
export function makeDetachedFieldIndexCodecFromMajorCodec<
|
|
28
29
|
TEncodedRevisionTag,
|
|
29
30
|
TEncodedRevisionTagSchema extends TSchema,
|
|
30
|
-
TVersion extends
|
|
31
|
+
TVersion extends DetachedFieldIndexFormatVersion,
|
|
31
32
|
>(
|
|
32
33
|
options: ICodecOptions,
|
|
33
34
|
majorCodec: IJsonCodec<Major, TEncodedRevisionTag>,
|
|
@@ -14,9 +14,11 @@ import {
|
|
|
14
14
|
RevisionTagSchema,
|
|
15
15
|
} from "../rebase/index.js";
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import type { FormatV1 } from "./detachedFieldIndexFormatV1.js";
|
|
18
18
|
import type { DetachedFieldSummaryData, Major } from "./detachedFieldIndexTypes.js";
|
|
19
19
|
import { makeDetachedFieldIndexCodecFromMajorCodec } from "./detachedFieldIndexCodecCommon.js";
|
|
20
|
+
import { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
21
|
+
import { brand } from "../../util/index.js";
|
|
20
22
|
|
|
21
23
|
class MajorCodec implements IJsonCodec<Major, EncodedRevisionTag> {
|
|
22
24
|
public constructor(
|
|
@@ -74,7 +76,7 @@ export function makeDetachedNodeToFieldCodecV1(
|
|
|
74
76
|
return makeDetachedFieldIndexCodecFromMajorCodec(
|
|
75
77
|
options,
|
|
76
78
|
majorCodec,
|
|
77
|
-
|
|
79
|
+
brand(DetachedFieldIndexFormatVersion.v1),
|
|
78
80
|
RevisionTagSchema,
|
|
79
81
|
);
|
|
80
82
|
}
|
|
@@ -9,14 +9,12 @@ import type { IIdCompressor, StableId } from "@fluidframework/id-compressor";
|
|
|
9
9
|
import type { ICodecOptions, IJsonCodec } from "../../codec/index.js";
|
|
10
10
|
import type { EncodedRevisionTag, RevisionTagCodec, RevisionTag } from "../rebase/index.js";
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
type FormatV2,
|
|
14
|
-
StableOrFinalRevisionTag,
|
|
15
|
-
version2,
|
|
16
|
-
} from "./detachedFieldIndexFormatV2.js";
|
|
12
|
+
import { type FormatV2, StableOrFinalRevisionTag } from "./detachedFieldIndexFormatV2.js";
|
|
17
13
|
import type { DetachedFieldSummaryData, Major } from "./detachedFieldIndexTypes.js";
|
|
18
14
|
import { makeDetachedFieldIndexCodecFromMajorCodec } from "./detachedFieldIndexCodecCommon.js";
|
|
19
15
|
import { isStableId } from "@fluidframework/id-compressor/internal";
|
|
16
|
+
import { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
17
|
+
import { brand } from "../../util/index.js";
|
|
20
18
|
|
|
21
19
|
class MajorCodec implements IJsonCodec<Major> {
|
|
22
20
|
public constructor(
|
|
@@ -66,7 +64,7 @@ export function makeDetachedNodeToFieldCodecV2(
|
|
|
66
64
|
return makeDetachedFieldIndexCodecFromMajorCodec(
|
|
67
65
|
options,
|
|
68
66
|
majorCodec,
|
|
69
|
-
|
|
67
|
+
brand(DetachedFieldIndexFormatVersion.v2),
|
|
70
68
|
StableOrFinalRevisionTag,
|
|
71
69
|
);
|
|
72
70
|
}
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
+
import {
|
|
9
|
+
getConfigForMinVersionForCollab,
|
|
10
|
+
lowestMinVersionForCollab,
|
|
11
|
+
} from "@fluidframework/runtime-utils/internal";
|
|
7
12
|
|
|
8
13
|
import {
|
|
9
14
|
type CodecTree,
|
|
@@ -16,12 +21,27 @@ import {
|
|
|
16
21
|
} from "../../codec/index.js";
|
|
17
22
|
import type { RevisionTagCodec } from "../rebase/index.js";
|
|
18
23
|
|
|
19
|
-
import { version1 } from "./detachedFieldIndexFormatV1.js";
|
|
20
|
-
import { version2 } from "./detachedFieldIndexFormatV2.js";
|
|
21
24
|
import { makeDetachedNodeToFieldCodecV1 } from "./detachedFieldIndexCodecV1.js";
|
|
22
25
|
import { makeDetachedNodeToFieldCodecV2 } from "./detachedFieldIndexCodecV2.js";
|
|
23
26
|
import type { DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
|
|
24
|
-
import
|
|
27
|
+
import { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
28
|
+
import { brand } from "../../util/index.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Convert a MinimumVersionForCollab to a version for detached field codecs.
|
|
32
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
33
|
+
* @returns The detached field codec version that corresponds to the provided MinimumVersionForCollab.
|
|
34
|
+
*/
|
|
35
|
+
function clientVersionToDetachedFieldVersion(
|
|
36
|
+
clientVersion: MinimumVersionForCollab,
|
|
37
|
+
): DetachedFieldIndexFormatVersion {
|
|
38
|
+
return brand(
|
|
39
|
+
getConfigForMinVersionForCollab(clientVersion, {
|
|
40
|
+
[lowestMinVersionForCollab]: DetachedFieldIndexFormatVersion.v1,
|
|
41
|
+
[FluidClientVersion.v2_52]: DetachedFieldIndexFormatVersion.v2,
|
|
42
|
+
}),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
25
45
|
|
|
26
46
|
export function makeDetachedFieldIndexCodec(
|
|
27
47
|
revisionTagCodec: RevisionTagCodec,
|
|
@@ -29,9 +49,10 @@ export function makeDetachedFieldIndexCodec(
|
|
|
29
49
|
idCompressor: IIdCompressor,
|
|
30
50
|
): IJsonCodec<DetachedFieldSummaryData> {
|
|
31
51
|
const family = makeDetachedFieldIndexCodecFamily(revisionTagCodec, options, idCompressor);
|
|
32
|
-
|
|
33
|
-
options
|
|
34
|
-
|
|
52
|
+
return makeVersionDispatchingCodec(family, {
|
|
53
|
+
...options,
|
|
54
|
+
writeVersion: clientVersionToDetachedFieldVersion(options.minVersionForCollab),
|
|
55
|
+
});
|
|
35
56
|
}
|
|
36
57
|
|
|
37
58
|
export function makeDetachedFieldIndexCodecFamily(
|
|
@@ -40,14 +61,22 @@ export function makeDetachedFieldIndexCodecFamily(
|
|
|
40
61
|
idCompressor: IIdCompressor,
|
|
41
62
|
): ICodecFamily<DetachedFieldSummaryData> {
|
|
42
63
|
return makeCodecFamily([
|
|
43
|
-
[
|
|
44
|
-
|
|
64
|
+
[
|
|
65
|
+
DetachedFieldIndexFormatVersion.v1,
|
|
66
|
+
makeDetachedNodeToFieldCodecV1(revisionTagCodec, options, idCompressor),
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
DetachedFieldIndexFormatVersion.v2,
|
|
70
|
+
makeDetachedNodeToFieldCodecV2(revisionTagCodec, options, idCompressor),
|
|
71
|
+
],
|
|
45
72
|
]);
|
|
46
73
|
}
|
|
47
74
|
|
|
48
|
-
export type DetachedFieldIndexFormatVersion = Brand<1 | 2, "DetachedFieldIndexFormatVersion">;
|
|
49
75
|
export function getCodecTreeForDetachedFieldIndexFormat(
|
|
50
|
-
|
|
76
|
+
clientVersion: MinimumVersionForCollab,
|
|
51
77
|
): CodecTree {
|
|
52
|
-
return {
|
|
78
|
+
return {
|
|
79
|
+
name: "DetachedFieldIndex",
|
|
80
|
+
version: clientVersionToDetachedFieldVersion(clientVersion),
|
|
81
|
+
};
|
|
53
82
|
}
|
|
@@ -5,10 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
import { type Static, type TSchema, Type } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import { brandedNumberType } from "../../util/index.js";
|
|
8
|
+
import { brandedNumberType, type Brand } from "../../util/index.js";
|
|
9
9
|
|
|
10
10
|
import type { ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The format version for the detached field index.
|
|
14
|
+
*/
|
|
15
|
+
export const DetachedFieldIndexFormatVersion = {
|
|
16
|
+
v1: 1,
|
|
17
|
+
v2: 2,
|
|
18
|
+
} as const;
|
|
19
|
+
export type DetachedFieldIndexFormatVersion = Brand<
|
|
20
|
+
(typeof DetachedFieldIndexFormatVersion)[keyof typeof DetachedFieldIndexFormatVersion],
|
|
21
|
+
"DetachedFieldIndexFormatVersion"
|
|
22
|
+
>;
|
|
23
|
+
|
|
12
24
|
/**
|
|
13
25
|
* The ID of a detached node. Is not globally unique on.
|
|
14
26
|
* A `RevisionTag` + `DetachId` pair is globally unique and eventually consistent across clients.
|
|
@@ -54,7 +66,10 @@ export const EncodedRootsForRevision = <Schema extends TSchema>(tRevisionTag: Sc
|
|
|
54
66
|
]);
|
|
55
67
|
export type EncodedRootsForRevision = Static<ReturnType<typeof EncodedRootsForRevision>>;
|
|
56
68
|
|
|
57
|
-
export const Format = <
|
|
69
|
+
export const Format = <
|
|
70
|
+
TVersion extends DetachedFieldIndexFormatVersion,
|
|
71
|
+
TRevisionTagSchema extends TSchema,
|
|
72
|
+
>(
|
|
58
73
|
tVersion: TVersion,
|
|
59
74
|
tRevisionTag: TRevisionTagSchema,
|
|
60
75
|
// Return type is intentionally derived.
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import type { Static } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import { Format } from "./detachedFieldIndexFormatCommon.js";
|
|
8
|
+
import { DetachedFieldIndexFormatVersion, Format } from "./detachedFieldIndexFormatCommon.js";
|
|
9
9
|
import { RevisionTagSchema } from "../rebase/index.js";
|
|
10
|
+
import { brand } from "../../util/index.js";
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
export const FormatV1 = Format(
|
|
13
|
+
brand<DetachedFieldIndexFormatVersion>(DetachedFieldIndexFormatVersion.v1),
|
|
14
|
+
RevisionTagSchema,
|
|
15
|
+
);
|
|
14
16
|
|
|
15
17
|
export type FormatV1 = Static<typeof FormatV1>;
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
import { Type, type Static } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import { Format } from "./detachedFieldIndexFormatCommon.js";
|
|
8
|
+
import { DetachedFieldIndexFormatVersion, Format } from "./detachedFieldIndexFormatCommon.js";
|
|
9
9
|
import { RevisionTagSchema, StableIdSchema } from "../rebase/index.js";
|
|
10
|
-
|
|
11
|
-
export const version2 = 2.0;
|
|
10
|
+
import { brand } from "../../util/index.js";
|
|
12
11
|
|
|
13
12
|
export const StableOrFinalRevisionTag = Type.Union([RevisionTagSchema, StableIdSchema]);
|
|
14
13
|
|
|
15
|
-
export const FormatV2 = Format(
|
|
14
|
+
export const FormatV2 = Format(
|
|
15
|
+
brand<DetachedFieldIndexFormatVersion>(DetachedFieldIndexFormatVersion.v2),
|
|
16
|
+
StableOrFinalRevisionTag,
|
|
17
|
+
);
|
|
16
18
|
|
|
17
19
|
export type FormatV2 = Static<typeof FormatV2>;
|
package/src/core/tree/index.ts
CHANGED
|
@@ -119,9 +119,7 @@ export {
|
|
|
119
119
|
|
|
120
120
|
export { DetachedFieldIndex } from "./detachedFieldIndex.js";
|
|
121
121
|
|
|
122
|
-
export {
|
|
123
|
-
|
|
124
|
-
getCodecTreeForDetachedFieldIndexFormat,
|
|
125
|
-
} from "./detachedFieldIndexCodecs.js";
|
|
122
|
+
export { getCodecTreeForDetachedFieldIndexFormat } from "./detachedFieldIndexCodecs.js";
|
|
123
|
+
export { type DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
126
124
|
|
|
127
125
|
export { type ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { Static, TSchema } from "@sinclair/typebox";
|
|
7
7
|
// This export is documented as supported in typebox's documentation.
|
|
8
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
8
|
+
// eslint-disable-next-line import-x/no-internal-modules
|
|
9
9
|
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
|
10
10
|
|
|
11
11
|
import { toFormatValidator, type JsonValidator } from "../codec/index.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Libraries which plug into the [Core Libraries](../core/README.md) to provide specializations, either for performance, or compatibility with specific tools or use-cases.
|
|
4
4
|
|
|
5
|
-
This includes concrete implementations of abstractions used to parameterize `SharedTreeCore` (Like `Index` and `ChangeFamily`), or any other entry points to the `core` libraries
|
|
5
|
+
This includes concrete implementations of abstractions used to parameterize `SharedTreeCore` (Like `Index` and `ChangeFamily`), or any other entry points to the `core` libraries package (like `Forest`).
|
|
6
6
|
|
|
7
7
|
`SharedTreeCore` should be usable with alternative versions of anything within this library.
|
|
8
8
|
|
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
type TreeChunk,
|
|
24
24
|
tryGetChunk,
|
|
25
25
|
type SchemaAndPolicy,
|
|
26
|
+
type SchemaPolicy,
|
|
26
27
|
} from "../../core/index.js";
|
|
27
28
|
import { getOrCreate } from "../../util/index.js";
|
|
28
|
-
import type { FullSchemaPolicy } from "../modular-schema/index.js";
|
|
29
29
|
import { isStableNodeIdentifier } from "../node-identifier/index.js";
|
|
30
30
|
|
|
31
31
|
import { BasicChunk } from "./basicChunk.js";
|
|
@@ -44,7 +44,7 @@ export interface Disposable {
|
|
|
44
44
|
*/
|
|
45
45
|
export function makeTreeChunker(
|
|
46
46
|
schema: TreeStoredSchemaSubscription,
|
|
47
|
-
policy:
|
|
47
|
+
policy: SchemaPolicy,
|
|
48
48
|
shouldEncodeIncrementally: IncrementalEncodingPolicy,
|
|
49
49
|
): IChunker {
|
|
50
50
|
return new Chunker(
|
|
@@ -113,7 +113,7 @@ export class Chunker implements IChunker {
|
|
|
113
113
|
|
|
114
114
|
public constructor(
|
|
115
115
|
public readonly schema: TreeStoredSchemaSubscription,
|
|
116
|
-
public readonly policy:
|
|
116
|
+
public readonly policy: SchemaPolicy,
|
|
117
117
|
public readonly sequenceChunkSplitThreshold: number,
|
|
118
118
|
public readonly sequenceChunkInlineThreshold: number,
|
|
119
119
|
public readonly uniformChunkNodeCount: number,
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
type EncodedNestedArrayShape,
|
|
47
47
|
type EncodedNodeShape,
|
|
48
48
|
type EncodedValueShape,
|
|
49
|
+
FieldBatchFormatVersion,
|
|
49
50
|
SpecialField,
|
|
50
51
|
} from "./format.js";
|
|
51
52
|
import type { IncrementalDecoder } from "./codecs.js";
|
|
@@ -246,6 +247,10 @@ export class IncrementalChunkDecoder implements ChunkDecoder {
|
|
|
246
247
|
);
|
|
247
248
|
|
|
248
249
|
const chunkDecoder = (batch: EncodedFieldBatch): TreeChunk => {
|
|
250
|
+
assert(
|
|
251
|
+
batch.version >= FieldBatchFormatVersion.v2,
|
|
252
|
+
0xc9f /* Unsupported FieldBatchFormatVersion for incremental chunks; must be v2 or higher */,
|
|
253
|
+
);
|
|
249
254
|
const context = new DecoderContext(
|
|
250
255
|
batch.identifiers,
|
|
251
256
|
batch.shapes,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
jsonMinimizingFilter,
|
|
16
16
|
} from "./chunkCodecUtilities.js";
|
|
17
17
|
import type { EncodedFieldBatchGeneric } from "./formatGeneric.js";
|
|
18
|
+
import type { FieldBatchFormatVersion } from "./format.js";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* An identifier which can be compressed using {@link Counter}.
|
|
@@ -51,7 +52,7 @@ export type BufferFormat<TEncodedShape> = (
|
|
|
51
52
|
* Note that this modifies `buffer` to avoid having to copy it.
|
|
52
53
|
*/
|
|
53
54
|
export function updateShapesAndIdentifiersEncoding<TEncodedShape>(
|
|
54
|
-
version:
|
|
55
|
+
version: FieldBatchFormatVersion,
|
|
55
56
|
buffer: BufferFormat<TEncodedShape>[],
|
|
56
57
|
identifierFilter: CounterFilter<string> = jsonMinimizingFilter,
|
|
57
58
|
): EncodedFieldBatchGeneric<TEncodedShape> {
|
|
@@ -5,10 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
8
|
+
import {
|
|
9
|
+
getConfigForMinVersionForCollab,
|
|
10
|
+
lowestMinVersionForCollab,
|
|
11
|
+
} from "@fluidframework/runtime-utils/internal";
|
|
8
12
|
|
|
9
13
|
import {
|
|
10
14
|
type CodecTree,
|
|
11
|
-
type
|
|
15
|
+
type CodecWriteOptions,
|
|
16
|
+
FluidClientVersion,
|
|
12
17
|
type IJsonCodec,
|
|
13
18
|
makeVersionedValidatedCodec,
|
|
14
19
|
} from "../../../codec/index.js";
|
|
@@ -19,6 +24,7 @@ import {
|
|
|
19
24
|
type TreeChunk,
|
|
20
25
|
} from "../../../core/index.js";
|
|
21
26
|
import {
|
|
27
|
+
brand,
|
|
22
28
|
brandedNumberType,
|
|
23
29
|
type Brand,
|
|
24
30
|
type JsonCompatibleReadOnly,
|
|
@@ -31,11 +37,17 @@ import {
|
|
|
31
37
|
|
|
32
38
|
import { decode } from "./chunkDecoding.js";
|
|
33
39
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
import {
|
|
41
|
+
type EncodedFieldBatch,
|
|
42
|
+
validVersions,
|
|
43
|
+
FieldBatchFormatVersion,
|
|
44
|
+
EncodedFieldBatchV1,
|
|
45
|
+
EncodedFieldBatchV2,
|
|
46
|
+
} from "./format.js";
|
|
37
47
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
38
48
|
import type { IncrementalEncodingPolicy } from "./incrementalEncodingPolicy.js";
|
|
49
|
+
import { uncompressedEncodeV1, uncompressedEncodeV2 } from "./uncompressedEncode.js";
|
|
50
|
+
import { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from "./schemaBasedEncode.js";
|
|
39
51
|
|
|
40
52
|
/**
|
|
41
53
|
* Reference ID for a chunk that is incrementally encoded.
|
|
@@ -119,21 +131,22 @@ export type FieldBatchCodec = IJsonCodec<
|
|
|
119
131
|
>;
|
|
120
132
|
|
|
121
133
|
/**
|
|
122
|
-
*
|
|
123
|
-
* @
|
|
124
|
-
* TODO: makeFieldBatchCodec (and makeVersionDispatchingCodec transitively) should bake in this versionToFormat logic and the resulting codec can then support use with FluidClientVersion directly.
|
|
134
|
+
* Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.
|
|
135
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
125
136
|
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
):
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
function clientVersionToFieldBatchVersion(
|
|
138
|
+
clientVersion: MinimumVersionForCollab,
|
|
139
|
+
): FieldBatchFormatVersion {
|
|
140
|
+
return brand(
|
|
141
|
+
getConfigForMinVersionForCollab(clientVersion, {
|
|
142
|
+
[lowestMinVersionForCollab]: FieldBatchFormatVersion.v1,
|
|
143
|
+
[FluidClientVersion.v2_73]: FieldBatchFormatVersion.v2,
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
131
146
|
}
|
|
132
147
|
|
|
133
|
-
export function makeFieldBatchCodec(
|
|
134
|
-
options
|
|
135
|
-
writeVersion: number,
|
|
136
|
-
): FieldBatchCodec {
|
|
148
|
+
export function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec {
|
|
149
|
+
const writeVersion = clientVersionToFieldBatchVersion(options.minVersionForCollab);
|
|
137
150
|
// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since
|
|
138
151
|
// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if
|
|
139
152
|
// decode is being run on a client that just submitted a schema change, but the op is from another client who has
|
|
@@ -143,8 +156,27 @@ export function makeFieldBatchCodec(
|
|
|
143
156
|
0x935 /* Invalid write version for FieldBatch codec */,
|
|
144
157
|
);
|
|
145
158
|
|
|
146
|
-
|
|
147
|
-
|
|
159
|
+
let uncompressedEncodeFn: typeof uncompressedEncodeV1 | typeof uncompressedEncodeV2;
|
|
160
|
+
let schemaCompressedEncodeFn:
|
|
161
|
+
| typeof schemaCompressedEncodeV1
|
|
162
|
+
| typeof schemaCompressedEncodeV2;
|
|
163
|
+
let encodedFieldBatchType: typeof EncodedFieldBatchV1 | typeof EncodedFieldBatchV2;
|
|
164
|
+
switch (writeVersion) {
|
|
165
|
+
case FieldBatchFormatVersion.v1:
|
|
166
|
+
uncompressedEncodeFn = uncompressedEncodeV1;
|
|
167
|
+
schemaCompressedEncodeFn = schemaCompressedEncodeV1;
|
|
168
|
+
encodedFieldBatchType = EncodedFieldBatchV1;
|
|
169
|
+
break;
|
|
170
|
+
case FieldBatchFormatVersion.v2:
|
|
171
|
+
uncompressedEncodeFn = uncompressedEncodeV2;
|
|
172
|
+
schemaCompressedEncodeFn = schemaCompressedEncodeV2;
|
|
173
|
+
encodedFieldBatchType = EncodedFieldBatchV2;
|
|
174
|
+
break;
|
|
175
|
+
default:
|
|
176
|
+
unreachableCase(writeVersion);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return makeVersionedValidatedCodec(options, validVersions, encodedFieldBatchType, {
|
|
148
180
|
encode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {
|
|
149
181
|
for (const cursor of data) {
|
|
150
182
|
assert(
|
|
@@ -153,27 +185,31 @@ export function makeFieldBatchCodec(
|
|
|
153
185
|
);
|
|
154
186
|
}
|
|
155
187
|
let encoded: EncodedFieldBatch;
|
|
188
|
+
let incrementalEncoder: IncrementalEncoder | undefined;
|
|
156
189
|
switch (context.encodeType) {
|
|
157
190
|
case TreeCompressionStrategy.Uncompressed:
|
|
158
|
-
encoded =
|
|
191
|
+
encoded = uncompressedEncodeFn(data);
|
|
159
192
|
break;
|
|
160
193
|
case TreeCompressionStrategyExtended.CompressedIncremental:
|
|
194
|
+
assert(
|
|
195
|
+
writeVersion >= FieldBatchFormatVersion.v2,
|
|
196
|
+
0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,
|
|
197
|
+
);
|
|
198
|
+
// Incremental encoding is only supported for CompressedIncremental.
|
|
199
|
+
incrementalEncoder = context.incrementalEncoderDecoder;
|
|
161
200
|
case TreeCompressionStrategy.Compressed:
|
|
162
201
|
// eslint-disable-next-line unicorn/prefer-ternary
|
|
163
202
|
if (context.schema !== undefined) {
|
|
164
|
-
encoded =
|
|
203
|
+
encoded = schemaCompressedEncodeFn(
|
|
165
204
|
context.schema.schema,
|
|
166
205
|
context.schema.policy,
|
|
167
206
|
data,
|
|
168
207
|
context.idCompressor,
|
|
169
|
-
|
|
170
|
-
context.encodeType === TreeCompressionStrategyExtended.CompressedIncremental
|
|
171
|
-
? context.incrementalEncoderDecoder
|
|
172
|
-
: undefined,
|
|
208
|
+
incrementalEncoder,
|
|
173
209
|
);
|
|
174
210
|
} else {
|
|
175
211
|
// TODO: consider enabling a somewhat compressed but not schema accelerated encode.
|
|
176
|
-
encoded =
|
|
212
|
+
encoded = uncompressedEncodeFn(data);
|
|
177
213
|
}
|
|
178
214
|
|
|
179
215
|
break;
|
|
@@ -198,6 +234,8 @@ export function makeFieldBatchCodec(
|
|
|
198
234
|
});
|
|
199
235
|
}
|
|
200
236
|
|
|
201
|
-
export function getCodecTreeForFieldBatchFormat(
|
|
202
|
-
|
|
237
|
+
export function getCodecTreeForFieldBatchFormat(
|
|
238
|
+
clientVersion: MinimumVersionForCollab,
|
|
239
|
+
): CodecTree {
|
|
240
|
+
return { name: "FieldBatch", version: clientVersionToFieldBatchVersion(clientVersion) };
|
|
203
241
|
}
|
|
@@ -9,6 +9,7 @@ import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
|
9
9
|
import {
|
|
10
10
|
CursorLocationType,
|
|
11
11
|
type FieldKey,
|
|
12
|
+
type FieldKindData,
|
|
12
13
|
type FieldKindIdentifier,
|
|
13
14
|
type ITreeCursorSynchronous,
|
|
14
15
|
type TreeChunk,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
forEachNode,
|
|
19
20
|
} from "../../../core/index.js";
|
|
20
21
|
import { getOrCreate } from "../../../util/index.js";
|
|
21
|
-
import type { FlexFieldKind } from "../../modular-schema/index.js";
|
|
22
22
|
|
|
23
23
|
import type { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";
|
|
24
24
|
import {
|
|
@@ -33,8 +33,8 @@ import {
|
|
|
33
33
|
type EncodedFieldBatch,
|
|
34
34
|
type EncodedNestedArrayShape,
|
|
35
35
|
type EncodedValueShape,
|
|
36
|
+
FieldBatchFormatVersion,
|
|
36
37
|
SpecialField,
|
|
37
|
-
version,
|
|
38
38
|
} from "./format.js";
|
|
39
39
|
import type { IncrementalEncoder } from "./codecs.js";
|
|
40
40
|
|
|
@@ -57,7 +57,7 @@ export function compressedEncode(
|
|
|
57
57
|
anyFieldEncoder.encodeField(cursor, context, buffer);
|
|
58
58
|
batchBuffer.push(buffer);
|
|
59
59
|
}
|
|
60
|
-
return updateShapesAndIdentifiersEncoding(version, batchBuffer);
|
|
60
|
+
return updateShapesAndIdentifiersEncoding(context.version, batchBuffer);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export type BufferFormat = BufferFormatGeneric<EncodedChunkShape>;
|
|
@@ -458,6 +458,10 @@ export const incrementalFieldEncoder: FieldEncoder = {
|
|
|
458
458
|
context.incrementalEncoder !== undefined,
|
|
459
459
|
0xc88 /* incremental encoder must be defined to use incrementalFieldEncoder */,
|
|
460
460
|
);
|
|
461
|
+
assert(
|
|
462
|
+
context.version >= FieldBatchFormatVersion.v2,
|
|
463
|
+
0xca1 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,
|
|
464
|
+
);
|
|
461
465
|
|
|
462
466
|
const chunkReferenceIds = context.incrementalEncoder.encodeIncrementalField(
|
|
463
467
|
cursor,
|
|
@@ -519,7 +523,7 @@ export class EncoderContext implements NodeEncodeBuilder, FieldEncodeBuilder {
|
|
|
519
523
|
public constructor(
|
|
520
524
|
private readonly nodeEncoderFromPolicy: NodeEncoderPolicy,
|
|
521
525
|
private readonly fieldEncoderFromPolicy: FieldEncoderPolicy,
|
|
522
|
-
public readonly fieldShapes: ReadonlyMap<FieldKindIdentifier,
|
|
526
|
+
public readonly fieldShapes: ReadonlyMap<FieldKindIdentifier, FieldKindData>,
|
|
523
527
|
public readonly idCompressor: IIdCompressor,
|
|
524
528
|
/**
|
|
525
529
|
* To be used to encode incremental chunks, if any.
|
|
@@ -527,6 +531,7 @@ export class EncoderContext implements NodeEncodeBuilder, FieldEncodeBuilder {
|
|
|
527
531
|
* See {@link IncrementalEncoder} for more information.
|
|
528
532
|
*/
|
|
529
533
|
public readonly incrementalEncoder: IncrementalEncoder | undefined,
|
|
534
|
+
public readonly version: FieldBatchFormatVersion,
|
|
530
535
|
) {}
|
|
531
536
|
|
|
532
537
|
public nodeEncoderFromSchema(schemaName: TreeNodeSchemaIdentifier): NodeEncoder {
|
|
@@ -13,14 +13,23 @@ import {
|
|
|
13
13
|
IdentifierOrIndex,
|
|
14
14
|
ShapeIndex,
|
|
15
15
|
} from "./formatGeneric.js";
|
|
16
|
-
import type
|
|
16
|
+
import { brand, type Brand } from "../../../util/index.js";
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The format version for the field batch.
|
|
20
|
+
*/
|
|
21
|
+
export const FieldBatchFormatVersion = {
|
|
22
|
+
v1: 1,
|
|
23
|
+
v2: 2,
|
|
24
|
+
} as const;
|
|
25
|
+
export type FieldBatchFormatVersion = Brand<
|
|
26
|
+
(typeof FieldBatchFormatVersion)[keyof typeof FieldBatchFormatVersion],
|
|
27
|
+
"FieldBatchFormatVersion"
|
|
28
|
+
>;
|
|
20
29
|
|
|
21
30
|
// Compatible versions used for format/version validation.
|
|
22
31
|
// TODO: A proper version update policy will need to be documented.
|
|
23
|
-
export const validVersions = new Set([
|
|
32
|
+
export const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);
|
|
24
33
|
|
|
25
34
|
/**
|
|
26
35
|
* Top level length is implied from length of data array.
|
|
@@ -209,5 +218,17 @@ export type EncodedNodeShape = Static<typeof EncodedNodeShape>;
|
|
|
209
218
|
export type EncodedAnyShape = Static<typeof EncodedAnyShape>;
|
|
210
219
|
export type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;
|
|
211
220
|
|
|
212
|
-
export const
|
|
221
|
+
export const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(
|
|
222
|
+
brand<FieldBatchFormatVersion>(FieldBatchFormatVersion.v1),
|
|
223
|
+
EncodedChunkShape,
|
|
224
|
+
);
|
|
225
|
+
export type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;
|
|
226
|
+
|
|
227
|
+
export const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(
|
|
228
|
+
brand<FieldBatchFormatVersion>(FieldBatchFormatVersion.v2),
|
|
229
|
+
EncodedChunkShape,
|
|
230
|
+
);
|
|
231
|
+
export type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;
|
|
232
|
+
|
|
233
|
+
export const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);
|
|
213
234
|
export type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;
|