@fluidframework/tree 2.71.0 → 2.72.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 +26 -40
- package/api-report/tree.alpha.api.md +27 -18
- package/api-report/tree.beta.api.md +42 -0
- package/api-report/tree.legacy.beta.api.md +42 -0
- package/dist/alpha.d.ts +9 -7
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/beta.d.ts +7 -0
- package/dist/codec/codec.d.ts +16 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +16 -3
- package/dist/codec/codec.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 +6 -6
- 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 +29 -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/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 +12 -8
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +9 -4
- package/dist/feature-libraries/chunked-forest/codec/format.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 +1 -2
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
- 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 +1 -2
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +3 -21
- package/dist/feature-libraries/default-schema/defaultFieldKinds.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 +8 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +8 -3
- 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 +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -2
- package/dist/feature-libraries/index.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 +22 -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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- 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/sharedTree.d.ts +12 -16
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +87 -127
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +12 -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 +35 -17
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +43 -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 +11 -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 +38 -21
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +50 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/messageFormat.js +51 -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/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 +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +4 -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.js +6 -3
- 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 +292 -0
- package/dist/simple-tree/api/simpleSchemaCodec.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 +2 -2
- 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 +1 -1
- package/dist/simple-tree/core/allowedTypes.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/index.d.ts +2 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -0
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +11 -3
- 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/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +1 -1
- 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/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 +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +3 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +9 -7
- package/lib/api.js +2 -2
- package/lib/api.js.map +1 -1
- package/lib/beta.d.ts +7 -0
- package/lib/codec/codec.d.ts +16 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +16 -3
- package/lib/codec/codec.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 +6 -6
- 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 +29 -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/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 +13 -8
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.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/uncompressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -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 +1 -9
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -20
- package/lib/feature-libraries/default-schema/defaultFieldKinds.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 +8 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +7 -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 +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -2
- package/lib/feature-libraries/index.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 +24 -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/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- 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/sharedTree.d.ts +12 -16
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +90 -130
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +7 -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 +32 -16
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +42 -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 +35 -20
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +50 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/messageFormat.js +48 -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/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 +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +1 -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.js +6 -3
- 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 +264 -0
- package/lib/simple-tree/api/simpleSchemaCodec.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 +2 -2
- 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 +1 -1
- package/lib/simple-tree/core/allowedTypes.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/index.d.ts +2 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -0
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +2 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +11 -3
- 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/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +1 -1
- 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/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 +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/package.json +24 -24
- package/src/api.ts +2 -2
- package/src/codec/codec.ts +17 -3
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +1 -2
- package/src/core/schema-stored/schema.ts +10 -7
- 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 +33 -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/chunked-forest/codec/codecs.ts +18 -13
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +15 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +4 -2
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/index.ts +0 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +2 -29
- 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 +12 -2
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/index.ts +1 -2
- 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 +34 -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/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +16 -5
- package/src/shared-tree/sharedTree.ts +112 -172
- package/src/shared-tree/sharedTreeChangeCodecs.ts +15 -9
- 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 +56 -19
- package/src/shared-tree-core/editManagerFormatCommons.ts +47 -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 +11 -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 +60 -26
- package/src/shared-tree-core/messageFormat.ts +56 -0
- package/src/shared-tree-core/sharedTreeCore.ts +11 -13
- 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 +6 -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 +6 -3
- package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
- package/src/simple-tree/api/storedSchema.ts +8 -5
- package/src/simple-tree/api/tree.ts +2 -2
- 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 +3 -3
- package/src/simple-tree/core/treeNode.ts +2 -2
- package/src/simple-tree/index.ts +5 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +2 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +2 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
- package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +12 -3
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/tableSchema.ts +5 -2
- package/src/treeFactory.ts +33 -1
- package/src/util/brand.ts +40 -2
- package/src/util/brandedMap.ts +3 -1
- package/src/util/index.ts +1 -0
|
@@ -8,7 +8,9 @@ import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
type CodecTree,
|
|
11
|
+
type CodecWriteOptions,
|
|
11
12
|
type DependentFormatVersion,
|
|
13
|
+
FluidClientVersion,
|
|
12
14
|
type FormatVersion,
|
|
13
15
|
type ICodecFamily,
|
|
14
16
|
type ICodecOptions,
|
|
@@ -22,17 +24,61 @@ import type {
|
|
|
22
24
|
RevisionTag,
|
|
23
25
|
SchemaAndPolicy,
|
|
24
26
|
} from "../core/index.js";
|
|
25
|
-
import { brand, type
|
|
27
|
+
import { brand, type JsonCompatibleReadOnly } from "../util/index.js";
|
|
26
28
|
|
|
27
29
|
import type { SummaryData } from "./editManager.js";
|
|
28
30
|
import { makeV1CodecWithVersion } from "./editManagerCodecsV1toV4.js";
|
|
29
31
|
import { makeV5CodecWithVersion } from "./editManagerCodecsV5.js";
|
|
32
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
33
|
+
import {
|
|
34
|
+
EditManagerFormatVersion,
|
|
35
|
+
editManagerFormatVersions,
|
|
36
|
+
} from "./editManagerFormatCommons.js";
|
|
30
37
|
|
|
31
38
|
export interface EditManagerEncodingContext {
|
|
32
39
|
idCompressor: IIdCompressor;
|
|
33
40
|
readonly schema?: SchemaAndPolicy;
|
|
34
41
|
}
|
|
35
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Convert a MinimumVersionForCollab to an EditManagerFormatVersion.
|
|
45
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
46
|
+
* @returns The EditManagerFormatVersion that corresponds to the provided MinimumVersionForCollab.
|
|
47
|
+
*/
|
|
48
|
+
export function clientVersionToEditManagerFormatVersion(
|
|
49
|
+
clientVersion: MinimumVersionForCollab,
|
|
50
|
+
writeVersionOverride?: EditManagerFormatVersion,
|
|
51
|
+
): EditManagerFormatVersion {
|
|
52
|
+
const compatibleVersion: EditManagerFormatVersion =
|
|
53
|
+
clientVersion < FluidClientVersion.v2_43
|
|
54
|
+
? brand(EditManagerFormatVersion.v3)
|
|
55
|
+
: brand(EditManagerFormatVersion.v4);
|
|
56
|
+
return writeVersionOverride ?? compatibleVersion;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns the version that should be used for testing shared branches.
|
|
61
|
+
*/
|
|
62
|
+
export function editManagerFormatVersionSelectorForSharedBranches(
|
|
63
|
+
clientVersion: MinimumVersionForCollab,
|
|
64
|
+
): EditManagerFormatVersion {
|
|
65
|
+
return brand(EditManagerFormatVersion.v5);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface EditManagerCodecOptions {
|
|
69
|
+
readonly editManagerFormatSelector?: (
|
|
70
|
+
minVersionForCollab: MinimumVersionForCollab,
|
|
71
|
+
) => EditManagerFormatVersion;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function editManagerFormatVersionFromOptions(
|
|
75
|
+
options: EditManagerCodecOptions & CodecWriteOptions,
|
|
76
|
+
): EditManagerFormatVersion {
|
|
77
|
+
const selector =
|
|
78
|
+
options.editManagerFormatSelector ?? clientVersionToEditManagerFormatVersion;
|
|
79
|
+
return selector(options.minVersionForCollab);
|
|
80
|
+
}
|
|
81
|
+
|
|
36
82
|
export function makeEditManagerCodec<TChangeset>(
|
|
37
83
|
changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,
|
|
38
84
|
dependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>,
|
|
@@ -42,8 +88,7 @@ export function makeEditManagerCodec<TChangeset>(
|
|
|
42
88
|
EncodedRevisionTag,
|
|
43
89
|
ChangeEncodingContext
|
|
44
90
|
>,
|
|
45
|
-
options:
|
|
46
|
-
writeVersion: number,
|
|
91
|
+
options: EditManagerCodecOptions & CodecWriteOptions,
|
|
47
92
|
): IJsonCodec<
|
|
48
93
|
SummaryData<TChangeset>,
|
|
49
94
|
JsonCompatibleReadOnly,
|
|
@@ -56,6 +101,7 @@ export function makeEditManagerCodec<TChangeset>(
|
|
|
56
101
|
revisionTagCodec,
|
|
57
102
|
options,
|
|
58
103
|
);
|
|
104
|
+
const writeVersion = editManagerFormatVersionFromOptions(options);
|
|
59
105
|
return makeVersionDispatchingCodec(family, { ...options, writeVersion });
|
|
60
106
|
}
|
|
61
107
|
|
|
@@ -81,15 +127,15 @@ export function makeEditManagerCodecs<TChangeset>(
|
|
|
81
127
|
][] = Array.from(editManagerFormatVersions, (version) => {
|
|
82
128
|
const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
|
|
83
129
|
switch (version) {
|
|
84
|
-
case
|
|
85
|
-
case
|
|
86
|
-
case
|
|
87
|
-
case
|
|
130
|
+
case EditManagerFormatVersion.v1:
|
|
131
|
+
case EditManagerFormatVersion.v2:
|
|
132
|
+
case EditManagerFormatVersion.v3:
|
|
133
|
+
case EditManagerFormatVersion.v4:
|
|
88
134
|
return [
|
|
89
135
|
version,
|
|
90
136
|
makeV1CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
91
137
|
];
|
|
92
|
-
case
|
|
138
|
+
case EditManagerFormatVersion.v5:
|
|
93
139
|
return [
|
|
94
140
|
version,
|
|
95
141
|
makeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
@@ -101,22 +147,13 @@ export function makeEditManagerCodecs<TChangeset>(
|
|
|
101
147
|
return makeCodecFamily(registry);
|
|
102
148
|
}
|
|
103
149
|
|
|
104
|
-
export type EditManagerFormatVersion = Brand<1 | 2 | 3 | 4 | 5, "EditManagerFormatVersion">;
|
|
105
|
-
export const editManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> = new Set([
|
|
106
|
-
brand(1),
|
|
107
|
-
brand(2),
|
|
108
|
-
brand(3),
|
|
109
|
-
brand(4),
|
|
110
|
-
brand(5),
|
|
111
|
-
]);
|
|
112
|
-
|
|
113
150
|
export function getCodecTreeForEditManagerFormatWithChange(
|
|
114
|
-
|
|
151
|
+
clientVersion: MinimumVersionForCollab,
|
|
115
152
|
changeFormat: CodecTree,
|
|
116
153
|
): CodecTree {
|
|
117
154
|
return {
|
|
118
155
|
name: "EditManager",
|
|
119
|
-
version,
|
|
156
|
+
version: clientVersionToEditManagerFormatVersion(clientVersion),
|
|
120
157
|
children: [changeFormat],
|
|
121
158
|
};
|
|
122
159
|
}
|
|
@@ -120,4 +120,51 @@ export const EncodedSharedBranch = <ChangeSchema extends TSchema>(tChange: Chang
|
|
|
120
120
|
noAdditionalProps,
|
|
121
121
|
);
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* The format version for the EditManager.
|
|
125
|
+
*/
|
|
126
|
+
export const EditManagerFormatVersion = {
|
|
127
|
+
/**
|
|
128
|
+
* Introduced and retired prior to 2.0.
|
|
129
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
130
|
+
* Writing capability need not be maintained.
|
|
131
|
+
*/
|
|
132
|
+
v1: 1,
|
|
133
|
+
/**
|
|
134
|
+
* Introduced and retired prior to 2.0.
|
|
135
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
136
|
+
* Writing capability need not be maintained.
|
|
137
|
+
*/
|
|
138
|
+
v2: 2,
|
|
139
|
+
/**
|
|
140
|
+
* Introduced prior to 2.0 and used beyond.
|
|
141
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
142
|
+
* Writing capability needs to be maintained.
|
|
143
|
+
*/
|
|
144
|
+
v3: 3,
|
|
145
|
+
/**
|
|
146
|
+
* Was inadvertently released in 2.43.0 (through usages of configuredSharedTree) and remains available.
|
|
147
|
+
* Reading capability must be maintained for backwards compatibility.
|
|
148
|
+
* Writing capability needs to be maintained.
|
|
149
|
+
* @privateRemarks TODO: stop writing this version.
|
|
150
|
+
*/
|
|
151
|
+
v4: 4,
|
|
152
|
+
/**
|
|
153
|
+
* Not yet released.
|
|
154
|
+
* Only used for testing shared branches.
|
|
155
|
+
*/
|
|
156
|
+
v5: 5,
|
|
157
|
+
} as const;
|
|
158
|
+
export type EditManagerFormatVersion = Brand<
|
|
159
|
+
(typeof EditManagerFormatVersion)[keyof typeof EditManagerFormatVersion],
|
|
160
|
+
"EditManagerFormatVersion"
|
|
161
|
+
>;
|
|
162
|
+
export const editManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> = new Set([
|
|
163
|
+
EditManagerFormatVersion.v1,
|
|
164
|
+
EditManagerFormatVersion.v2,
|
|
165
|
+
EditManagerFormatVersion.v3,
|
|
166
|
+
EditManagerFormatVersion.v4,
|
|
167
|
+
EditManagerFormatVersion.v5,
|
|
168
|
+
] as EditManagerFormatVersion[]);
|
|
169
|
+
|
|
123
170
|
/* eslint-enable @typescript-eslint/explicit-function-return-type */
|
|
@@ -8,6 +8,7 @@ import { type ObjectOptions, type TSchema, Type } from "@sinclair/typebox";
|
|
|
8
8
|
|
|
9
9
|
import { SessionIdSchema } from "../core/index.js";
|
|
10
10
|
import {
|
|
11
|
+
EditManagerFormatVersion,
|
|
11
12
|
type EncodedSummarySessionBranch,
|
|
12
13
|
SequencedCommit,
|
|
13
14
|
SummarySessionBranch,
|
|
@@ -21,17 +22,21 @@ const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
|
21
22
|
export interface EncodedEditManager<TChangeset> {
|
|
22
23
|
readonly trunk: readonly Readonly<SequencedCommit<TChangeset>>[];
|
|
23
24
|
readonly branches: readonly [SessionId, Readonly<EncodedSummarySessionBranch<TChangeset>>][];
|
|
24
|
-
readonly version:
|
|
25
|
+
readonly version:
|
|
26
|
+
| typeof EditManagerFormatVersion.v1
|
|
27
|
+
| typeof EditManagerFormatVersion.v2
|
|
28
|
+
| typeof EditManagerFormatVersion.v3
|
|
29
|
+
| typeof EditManagerFormatVersion.v4;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
export const EncodedEditManager = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>
|
|
28
33
|
Type.Object(
|
|
29
34
|
{
|
|
30
35
|
version: Type.Union([
|
|
31
|
-
Type.Literal(
|
|
32
|
-
Type.Literal(
|
|
33
|
-
Type.Literal(
|
|
34
|
-
Type.Literal(
|
|
36
|
+
Type.Literal(EditManagerFormatVersion.v1),
|
|
37
|
+
Type.Literal(EditManagerFormatVersion.v2),
|
|
38
|
+
Type.Literal(EditManagerFormatVersion.v3),
|
|
39
|
+
Type.Literal(EditManagerFormatVersion.v4),
|
|
35
40
|
]),
|
|
36
41
|
trunk: Type.Array(SequencedCommit(tChange)),
|
|
37
42
|
branches: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange)])),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { type ObjectOptions, type TSchema, Type } from "@sinclair/typebox";
|
|
7
7
|
import type { SessionId } from "@fluidframework/id-compressor";
|
|
8
8
|
|
|
9
|
-
import { EncodedSharedBranch } from "./editManagerFormatCommons.js";
|
|
9
|
+
import { EncodedSharedBranch, EditManagerFormatVersion } from "./editManagerFormatCommons.js";
|
|
10
10
|
import { SessionIdSchema } from "../core/index.js";
|
|
11
11
|
|
|
12
12
|
const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
@@ -15,7 +15,7 @@ const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
|
15
15
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
16
16
|
|
|
17
17
|
export interface EncodedEditManager<TChangeset> {
|
|
18
|
-
readonly version:
|
|
18
|
+
readonly version: typeof EditManagerFormatVersion.v5;
|
|
19
19
|
readonly originator: SessionId;
|
|
20
20
|
readonly main: EncodedSharedBranch<TChangeset>;
|
|
21
21
|
readonly branches?: readonly EncodedSharedBranch<TChangeset>[];
|
|
@@ -24,7 +24,7 @@ export interface EncodedEditManager<TChangeset> {
|
|
|
24
24
|
export const EncodedEditManager = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>
|
|
25
25
|
Type.Object(
|
|
26
26
|
{
|
|
27
|
-
version: Type.Union([Type.Literal(
|
|
27
|
+
version: Type.Union([Type.Literal(EditManagerFormatVersion.v5)]),
|
|
28
28
|
originator: SessionIdSchema,
|
|
29
29
|
main: EncodedSharedBranch(tChange),
|
|
30
30
|
branches: Type.Optional(Type.Array(EncodedSharedBranch(tChange))),
|
|
@@ -22,12 +22,12 @@ export {
|
|
|
22
22
|
} from "./transaction.js";
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
|
-
type ExplicitCoreCodecVersions,
|
|
26
25
|
SharedTreeCore,
|
|
27
26
|
type Summarizable,
|
|
28
27
|
type SummaryElementParser,
|
|
29
28
|
type SummaryElementStringifier,
|
|
30
29
|
type ClonableSchemaAndPolicy,
|
|
30
|
+
type SharedTreeCoreOptionsInternal as SharedTreCoreOptionsInternal,
|
|
31
31
|
} from "./sharedTreeCore.js";
|
|
32
32
|
|
|
33
33
|
export type { ResubmitMachine } from "./resubmitMachine.js";
|
|
@@ -42,9 +42,14 @@ export {
|
|
|
42
42
|
export {
|
|
43
43
|
makeEditManagerCodec,
|
|
44
44
|
getCodecTreeForEditManagerFormatWithChange,
|
|
45
|
-
type
|
|
46
|
-
|
|
45
|
+
type EditManagerCodecOptions,
|
|
46
|
+
clientVersionToEditManagerFormatVersion,
|
|
47
|
+
editManagerFormatVersionSelectorForSharedBranches,
|
|
47
48
|
} from "./editManagerCodecs.js";
|
|
49
|
+
export {
|
|
50
|
+
EditManagerFormatVersion,
|
|
51
|
+
editManagerFormatVersions,
|
|
52
|
+
} from "./editManagerFormatCommons.js";
|
|
48
53
|
export { EditManagerSummarizer } from "./editManagerSummarizer.js";
|
|
49
54
|
export {
|
|
50
55
|
EditManager,
|
|
@@ -61,7 +66,8 @@ export type {
|
|
|
61
66
|
} from "./editManagerFormatCommons.js";
|
|
62
67
|
|
|
63
68
|
export {
|
|
64
|
-
type MessageFormatVersion,
|
|
65
|
-
messageFormatVersions,
|
|
66
69
|
getCodecTreeForMessageFormatWithChange,
|
|
70
|
+
clientVersionToMessageFormatVersion,
|
|
71
|
+
messageFormatVersionSelectorForSharedBranches,
|
|
67
72
|
} from "./messageCodecs.js";
|
|
73
|
+
export { MessageFormatVersion, messageFormatVersions } from "./messageFormat.js";
|
|
@@ -18,6 +18,7 @@ import type { JsonCompatibleReadOnly } from "../util/index.js";
|
|
|
18
18
|
import { Message } from "./messageFormatV1ToV4.js";
|
|
19
19
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
20
20
|
import type { MessageEncodingContext } from "./messageCodecs.js";
|
|
21
|
+
import type { MessageFormatVersion } from "./messageFormat.js";
|
|
21
22
|
|
|
22
23
|
export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
23
24
|
changeCodec: ChangeFamilyCodec<TChangeset>,
|
|
@@ -28,7 +29,11 @@ export function makeV1ToV4CodecWithVersion<TChangeset>(
|
|
|
28
29
|
ChangeEncodingContext
|
|
29
30
|
>,
|
|
30
31
|
options: ICodecOptions,
|
|
31
|
-
version:
|
|
32
|
+
version:
|
|
33
|
+
| typeof MessageFormatVersion.v1
|
|
34
|
+
| typeof MessageFormatVersion.v2
|
|
35
|
+
| typeof MessageFormatVersion.v3
|
|
36
|
+
| typeof MessageFormatVersion.v4,
|
|
32
37
|
): IJsonCodec<
|
|
33
38
|
DecodedMessage<TChangeset>,
|
|
34
39
|
JsonCompatibleReadOnly,
|
|
@@ -19,6 +19,7 @@ import type { DecodedMessage } from "./messageTypes.js";
|
|
|
19
19
|
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
20
20
|
import type { MessageEncodingContext } from "./messageCodecs.js";
|
|
21
21
|
import { decodeBranchId, encodeBranchId } from "./branchIdCodec.js";
|
|
22
|
+
import type { MessageFormatVersion } from "./messageFormat.js";
|
|
22
23
|
|
|
23
24
|
export function makeV5CodecWithVersion<TChangeset>(
|
|
24
25
|
changeCodec: ChangeFamilyCodec<TChangeset>,
|
|
@@ -29,7 +30,7 @@ export function makeV5CodecWithVersion<TChangeset>(
|
|
|
29
30
|
ChangeEncodingContext
|
|
30
31
|
>,
|
|
31
32
|
options: ICodecOptions,
|
|
32
|
-
version:
|
|
33
|
+
version: typeof MessageFormatVersion.v5,
|
|
33
34
|
): IJsonCodec<
|
|
34
35
|
DecodedMessage<TChangeset>,
|
|
35
36
|
JsonCompatibleReadOnly,
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
7
8
|
import {
|
|
8
9
|
type CodecTree,
|
|
10
|
+
type CodecWriteOptions,
|
|
9
11
|
type DependentFormatVersion,
|
|
12
|
+
FluidClientVersion,
|
|
10
13
|
type FormatVersion,
|
|
11
14
|
type ICodecFamily,
|
|
12
15
|
type ICodecOptions,
|
|
@@ -20,18 +23,57 @@ import type {
|
|
|
20
23
|
RevisionTag,
|
|
21
24
|
SchemaAndPolicy,
|
|
22
25
|
} from "../core/index.js";
|
|
23
|
-
import { brand, type
|
|
26
|
+
import { brand, type JsonCompatibleReadOnly } from "../util/index.js";
|
|
24
27
|
|
|
25
28
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
26
29
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
27
30
|
import { makeV1ToV4CodecWithVersion } from "./messageCodecV1ToV4.js";
|
|
28
31
|
import { makeV5CodecWithVersion } from "./messageCodecV5.js";
|
|
32
|
+
import { MessageFormatVersion, messageFormatVersions } from "./messageFormat.js";
|
|
29
33
|
|
|
30
34
|
export interface MessageEncodingContext {
|
|
31
35
|
idCompressor: IIdCompressor;
|
|
32
36
|
schema?: SchemaAndPolicy;
|
|
33
37
|
}
|
|
34
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Convert a MinimumVersionForCollab to a MessageFormatVersion.
|
|
41
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
42
|
+
* @returns The MessageFormatVersion that corresponds to the provided MinimumVersionForCollab.
|
|
43
|
+
*/
|
|
44
|
+
export function clientVersionToMessageFormatVersion(
|
|
45
|
+
clientVersion: MinimumVersionForCollab,
|
|
46
|
+
writeVersionOverride?: MessageFormatVersion,
|
|
47
|
+
): MessageFormatVersion {
|
|
48
|
+
const compatibleVersion: MessageFormatVersion =
|
|
49
|
+
clientVersion < FluidClientVersion.v2_43
|
|
50
|
+
? brand(MessageFormatVersion.v3)
|
|
51
|
+
: brand(MessageFormatVersion.v4);
|
|
52
|
+
return writeVersionOverride ?? compatibleVersion;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface MessageCodecOptions {
|
|
56
|
+
readonly messageFormatSelector?: (
|
|
57
|
+
minVersionForCollab: MinimumVersionForCollab,
|
|
58
|
+
) => MessageFormatVersion;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function messageFormatVersionFromOptions(
|
|
62
|
+
options: MessageCodecOptions & CodecWriteOptions,
|
|
63
|
+
): MessageFormatVersion {
|
|
64
|
+
const selector = options.messageFormatSelector ?? clientVersionToMessageFormatVersion;
|
|
65
|
+
return selector(options.minVersionForCollab);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns the version that should be used for testing shared branches.
|
|
70
|
+
*/
|
|
71
|
+
export function messageFormatVersionSelectorForSharedBranches(
|
|
72
|
+
clientVersion: MinimumVersionForCollab,
|
|
73
|
+
): MessageFormatVersion {
|
|
74
|
+
return brand(MessageFormatVersion.v5);
|
|
75
|
+
}
|
|
76
|
+
|
|
35
77
|
export function makeMessageCodec<TChangeset>(
|
|
36
78
|
changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,
|
|
37
79
|
dependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>,
|
|
@@ -41,8 +83,7 @@ export function makeMessageCodec<TChangeset>(
|
|
|
41
83
|
EncodedRevisionTag,
|
|
42
84
|
ChangeEncodingContext
|
|
43
85
|
>,
|
|
44
|
-
options:
|
|
45
|
-
writeVersion: MessageFormatVersion = brand(1),
|
|
86
|
+
options: MessageCodecOptions & CodecWriteOptions,
|
|
46
87
|
): IJsonCodec<
|
|
47
88
|
DecodedMessage<TChangeset>,
|
|
48
89
|
JsonCompatibleReadOnly,
|
|
@@ -55,6 +96,7 @@ export function makeMessageCodec<TChangeset>(
|
|
|
55
96
|
revisionTagCodec,
|
|
56
97
|
options,
|
|
57
98
|
);
|
|
99
|
+
const writeVersion = messageFormatVersionFromOptions(options);
|
|
58
100
|
return makeVersionDispatchingCodec(family, { ...options, writeVersion });
|
|
59
101
|
}
|
|
60
102
|
|
|
@@ -85,16 +127,21 @@ export function makeMessageCodecs<TChangeset>(
|
|
|
85
127
|
dependentChangeFormatVersion.lookup(version),
|
|
86
128
|
).json;
|
|
87
129
|
switch (version) {
|
|
88
|
-
case undefined:
|
|
89
|
-
case
|
|
90
|
-
case
|
|
91
|
-
case
|
|
92
|
-
case
|
|
130
|
+
case MessageFormatVersion.undefined:
|
|
131
|
+
case MessageFormatVersion.v1:
|
|
132
|
+
case MessageFormatVersion.v2:
|
|
133
|
+
case MessageFormatVersion.v3:
|
|
134
|
+
case MessageFormatVersion.v4:
|
|
93
135
|
return [
|
|
94
|
-
version,
|
|
95
|
-
makeV1ToV4CodecWithVersion(
|
|
136
|
+
version === MessageFormatVersion.undefined ? undefined : version,
|
|
137
|
+
makeV1ToV4CodecWithVersion(
|
|
138
|
+
changeCodec,
|
|
139
|
+
revisionTagCodec,
|
|
140
|
+
options,
|
|
141
|
+
version === MessageFormatVersion.undefined ? MessageFormatVersion.v1 : version,
|
|
142
|
+
),
|
|
96
143
|
];
|
|
97
|
-
case
|
|
144
|
+
case MessageFormatVersion.v5:
|
|
98
145
|
return [
|
|
99
146
|
version,
|
|
100
147
|
makeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
@@ -106,26 +153,13 @@ export function makeMessageCodecs<TChangeset>(
|
|
|
106
153
|
return makeCodecFamily(registry);
|
|
107
154
|
}
|
|
108
155
|
|
|
109
|
-
export type MessageFormatVersion = Brand<
|
|
110
|
-
undefined | 1 | 2 | 3 | 4 | 5,
|
|
111
|
-
"MessageFormatVersion"
|
|
112
|
-
>;
|
|
113
|
-
export const messageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([
|
|
114
|
-
brand(undefined),
|
|
115
|
-
brand(1),
|
|
116
|
-
brand(2),
|
|
117
|
-
brand(3),
|
|
118
|
-
brand(4),
|
|
119
|
-
brand(5),
|
|
120
|
-
]);
|
|
121
|
-
|
|
122
156
|
export function getCodecTreeForMessageFormatWithChange(
|
|
123
|
-
|
|
157
|
+
clientVersion: MinimumVersionForCollab,
|
|
124
158
|
changeFormat: CodecTree,
|
|
125
159
|
): CodecTree {
|
|
126
160
|
return {
|
|
127
161
|
name: "Message",
|
|
128
|
-
version,
|
|
162
|
+
version: clientVersionToMessageFormatVersion(clientVersion),
|
|
129
163
|
children: [changeFormat],
|
|
130
164
|
};
|
|
131
165
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Brand } from "../util/index.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The format version for the message.
|
|
10
|
+
*/
|
|
11
|
+
export const MessageFormatVersion = {
|
|
12
|
+
/**
|
|
13
|
+
* NOTE: this is written as `undefined` rather than `0` in the wire format.
|
|
14
|
+
* Introduced and retired prior to 2.0.
|
|
15
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
16
|
+
* Writing capability need not be maintained.
|
|
17
|
+
*/
|
|
18
|
+
undefined: 0,
|
|
19
|
+
/**
|
|
20
|
+
* Introduced and retired prior to 2.0.
|
|
21
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
22
|
+
* Writing capability need not be maintained.
|
|
23
|
+
*/
|
|
24
|
+
v1: 1,
|
|
25
|
+
/**
|
|
26
|
+
* Introduced and retired prior to 2.0.
|
|
27
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
28
|
+
* Writing capability need not be maintained.
|
|
29
|
+
*/
|
|
30
|
+
v2: 2,
|
|
31
|
+
/**
|
|
32
|
+
* Introduced prior to 2.0 and used beyond.
|
|
33
|
+
* Reading capability is currently maintained for backwards compatibility, but it could be removed in the future.
|
|
34
|
+
* Writing capability needs to be maintained.
|
|
35
|
+
*/
|
|
36
|
+
v3: 3,
|
|
37
|
+
/**
|
|
38
|
+
* Was inadvertently released in 2.43.0 (through usages of configuredSharedTree) and remains available.
|
|
39
|
+
* Reading capability must be maintained for backwards compatibility.
|
|
40
|
+
* Writing capability needs to be maintained.
|
|
41
|
+
* @privateRemarks TODO: stop writing this version.
|
|
42
|
+
*/
|
|
43
|
+
v4: 4,
|
|
44
|
+
/**
|
|
45
|
+
* Not yet released.
|
|
46
|
+
* Only used for testing shared branches.
|
|
47
|
+
*/
|
|
48
|
+
v5: 5,
|
|
49
|
+
} as const;
|
|
50
|
+
export type MessageFormatVersion = Brand<
|
|
51
|
+
(typeof MessageFormatVersion)[keyof typeof MessageFormatVersion],
|
|
52
|
+
"MessageFormatVersion"
|
|
53
|
+
>;
|
|
54
|
+
export const messageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set(
|
|
55
|
+
Object.values(MessageFormatVersion) as MessageFormatVersion[],
|
|
56
|
+
);
|
|
@@ -25,7 +25,7 @@ import type {
|
|
|
25
25
|
} from "@fluidframework/shared-object-base/internal";
|
|
26
26
|
import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
|
|
27
27
|
|
|
28
|
-
import type {
|
|
28
|
+
import type { CodecWriteOptions, DependentFormatVersion, IJsonCodec } from "../codec/index.js";
|
|
29
29
|
import {
|
|
30
30
|
type ChangeFamily,
|
|
31
31
|
type ChangeFamilyEditor,
|
|
@@ -51,29 +51,30 @@ import { BranchCommitEnricher } from "./branchCommitEnricher.js";
|
|
|
51
51
|
import { type ChangeEnricherReadonlyCheckout, NoOpChangeEnricher } from "./changeEnricher.js";
|
|
52
52
|
import { DefaultResubmitMachine } from "./defaultResubmitMachine.js";
|
|
53
53
|
import { EditManager, minimumPossibleSequenceNumber } from "./editManager.js";
|
|
54
|
-
import { makeEditManagerCodec, type
|
|
55
|
-
import type { SeqNumber } from "./editManagerFormatCommons.js";
|
|
54
|
+
import { makeEditManagerCodec, type EditManagerCodecOptions } from "./editManagerCodecs.js";
|
|
55
|
+
import type { EditManagerFormatVersion, SeqNumber } from "./editManagerFormatCommons.js";
|
|
56
56
|
import { EditManagerSummarizer } from "./editManagerSummarizer.js";
|
|
57
57
|
import {
|
|
58
|
+
type MessageCodecOptions,
|
|
58
59
|
type MessageEncodingContext,
|
|
59
|
-
type MessageFormatVersion,
|
|
60
60
|
makeMessageCodec,
|
|
61
61
|
} from "./messageCodecs.js";
|
|
62
62
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
63
63
|
import type { ResubmitMachine } from "./resubmitMachine.js";
|
|
64
|
+
import type { MessageFormatVersion } from "./messageFormat.js";
|
|
64
65
|
|
|
65
66
|
// TODO: Organize this to be adjacent to persisted types.
|
|
66
67
|
const summarizablesTreeKey = "indexes";
|
|
67
68
|
|
|
68
|
-
export interface ExplicitCoreCodecVersions {
|
|
69
|
-
editManager: EditManagerFormatVersion;
|
|
70
|
-
message: MessageFormatVersion;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
69
|
export interface ClonableSchemaAndPolicy extends SchemaAndPolicy {
|
|
74
70
|
schema: TreeStoredSchemaRepository;
|
|
75
71
|
}
|
|
76
72
|
|
|
73
|
+
export interface SharedTreeCoreOptionsInternal
|
|
74
|
+
extends CodecWriteOptions,
|
|
75
|
+
EditManagerCodecOptions,
|
|
76
|
+
MessageCodecOptions {}
|
|
77
|
+
|
|
77
78
|
/**
|
|
78
79
|
* Generic shared tree, which needs to be configured with indexes, field kinds and other configuration.
|
|
79
80
|
*/
|
|
@@ -128,8 +129,7 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
128
129
|
logger: ITelemetryBaseLogger | undefined,
|
|
129
130
|
summarizables: readonly Summarizable[],
|
|
130
131
|
protected readonly changeFamily: ChangeFamily<TEditor, TChange>,
|
|
131
|
-
options:
|
|
132
|
-
formatOptions: ExplicitCoreCodecVersions,
|
|
132
|
+
options: SharedTreeCoreOptionsInternal,
|
|
133
133
|
changeFormatVersionForEditManager: DependentFormatVersion<EditManagerFormatVersion>,
|
|
134
134
|
changeFormatVersionForMessage: DependentFormatVersion<MessageFormatVersion>,
|
|
135
135
|
protected readonly idCompressor: IIdCompressor,
|
|
@@ -172,7 +172,6 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
172
172
|
changeFormatVersionForEditManager,
|
|
173
173
|
revisionTagCodec,
|
|
174
174
|
options,
|
|
175
|
-
formatOptions.editManager,
|
|
176
175
|
);
|
|
177
176
|
this.summarizables = [
|
|
178
177
|
new EditManagerSummarizer(
|
|
@@ -193,7 +192,6 @@ export class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
193
192
|
changeFormatVersionForMessage,
|
|
194
193
|
new RevisionTagCodec(idCompressor),
|
|
195
194
|
options,
|
|
196
|
-
formatOptions.message,
|
|
197
195
|
);
|
|
198
196
|
|
|
199
197
|
this.registerSharedBranchForEditing(
|
|
@@ -90,12 +90,12 @@ export interface AllowedTypeDiscrepancy extends FieldDiscrepancyLocation {
|
|
|
90
90
|
readonly mismatch: "allowedTypes";
|
|
91
91
|
/**
|
|
92
92
|
* Annotated allowed types in viewed schema
|
|
93
|
-
* (excluding {@link
|
|
93
|
+
* (excluding {@link SchemaStaticsBeta.staged | staged} schema) which are not allowed in stored schema.
|
|
94
94
|
*/
|
|
95
95
|
readonly view: readonly AnnotatedAllowedType<TreeNodeSchema>[];
|
|
96
96
|
/**
|
|
97
97
|
* Allowed type identifiers in stored schema which are not allowed in view schema
|
|
98
|
-
* (including the view schema's {@link
|
|
98
|
+
* (including the view schema's {@link SchemaStaticsBeta.staged | staged} schema).
|
|
99
99
|
*/
|
|
100
100
|
readonly stored: readonly TreeNodeSchemaIdentifier[];
|
|
101
101
|
}
|
|
@@ -19,7 +19,7 @@ import { assert } from "@fluidframework/core-utils/internal";
|
|
|
19
19
|
* @remarks
|
|
20
20
|
* See {@link getShouldIncrementallySummarizeAllowedTypes} for more details.
|
|
21
21
|
*
|
|
22
|
-
* Use {@link
|
|
22
|
+
* Use {@link SchemaStaticsBeta.types} to add this metadata to allowed types in a schema.
|
|
23
23
|
* @example
|
|
24
24
|
* ```typescript
|
|
25
25
|
* const sf = new SchemaFactoryAlpha("IncrementalSummarization");
|
|
@@ -36,8 +36,8 @@ export {
|
|
|
36
36
|
type NodeSchemaOptionsAlpha,
|
|
37
37
|
type SchemaFactory_base,
|
|
38
38
|
} from "./schemaFactory.js";
|
|
39
|
-
export { SchemaFactoryBeta } from "./schemaFactoryBeta.js";
|
|
40
|
-
export { SchemaFactoryAlpha
|
|
39
|
+
export { SchemaFactoryBeta, type SchemaStaticsBeta } from "./schemaFactoryBeta.js";
|
|
40
|
+
export { SchemaFactoryAlpha } from "./schemaFactoryAlpha.js";
|
|
41
41
|
export type {
|
|
42
42
|
ValidateRecursiveSchema,
|
|
43
43
|
FixRecursiveArraySchema,
|
|
@@ -167,3 +167,7 @@ export {
|
|
|
167
167
|
getShouldIncrementallySummarizeAllowedTypes,
|
|
168
168
|
incrementalSummaryHint,
|
|
169
169
|
} from "./incrementalAllowedTypes.js";
|
|
170
|
+
export {
|
|
171
|
+
encodeSimpleSchema,
|
|
172
|
+
decodeSimpleSchema,
|
|
173
|
+
} from "./simpleSchemaCodec.js";
|