@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
|
@@ -56,79 +56,6 @@ const sharedTreeChangeFamily_js_1 = require("./sharedTreeChangeFamily.js");
|
|
|
56
56
|
const treeCheckout_js_1 = require("./treeCheckout.js");
|
|
57
57
|
const index_js_6 = require("../util/index.js");
|
|
58
58
|
const sharedTreeChangeCodecs_js_1 = require("./sharedTreeChangeCodecs.js");
|
|
59
|
-
const formatVersionToTopLevelCodecVersions = new Map([
|
|
60
|
-
[
|
|
61
|
-
1,
|
|
62
|
-
{
|
|
63
|
-
forest: (0, index_js_6.brand)(1),
|
|
64
|
-
schema: (0, index_js_6.brand)(1),
|
|
65
|
-
detachedFieldIndex: (0, index_js_6.brand)(1),
|
|
66
|
-
editManager: (0, index_js_6.brand)(1),
|
|
67
|
-
message: (0, index_js_6.brand)(1),
|
|
68
|
-
fieldBatch: (0, index_js_6.brand)(1),
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
[
|
|
72
|
-
2,
|
|
73
|
-
{
|
|
74
|
-
forest: (0, index_js_6.brand)(1),
|
|
75
|
-
schema: (0, index_js_6.brand)(1),
|
|
76
|
-
detachedFieldIndex: (0, index_js_6.brand)(1),
|
|
77
|
-
editManager: (0, index_js_6.brand)(2),
|
|
78
|
-
message: (0, index_js_6.brand)(2),
|
|
79
|
-
fieldBatch: (0, index_js_6.brand)(1),
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
[
|
|
83
|
-
3,
|
|
84
|
-
{
|
|
85
|
-
forest: (0, index_js_6.brand)(1),
|
|
86
|
-
schema: (0, index_js_6.brand)(1),
|
|
87
|
-
detachedFieldIndex: (0, index_js_6.brand)(1),
|
|
88
|
-
editManager: (0, index_js_6.brand)(3),
|
|
89
|
-
message: (0, index_js_6.brand)(3),
|
|
90
|
-
fieldBatch: (0, index_js_6.brand)(1),
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
[
|
|
94
|
-
4,
|
|
95
|
-
{
|
|
96
|
-
forest: (0, index_js_6.brand)(1),
|
|
97
|
-
schema: (0, index_js_6.brand)(1),
|
|
98
|
-
detachedFieldIndex: (0, index_js_6.brand)(1),
|
|
99
|
-
editManager: (0, index_js_6.brand)(4),
|
|
100
|
-
message: (0, index_js_6.brand)(4),
|
|
101
|
-
fieldBatch: (0, index_js_6.brand)(1),
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
[
|
|
105
|
-
5,
|
|
106
|
-
{
|
|
107
|
-
forest: (0, index_js_6.brand)(1),
|
|
108
|
-
schema: (0, index_js_6.brand)(2),
|
|
109
|
-
detachedFieldIndex: (0, index_js_6.brand)(1),
|
|
110
|
-
editManager: (0, index_js_6.brand)(4),
|
|
111
|
-
message: (0, index_js_6.brand)(4),
|
|
112
|
-
fieldBatch: (0, index_js_6.brand)(1),
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
[
|
|
116
|
-
100, // SharedTreeFormatVersion.vSharedBranches
|
|
117
|
-
{
|
|
118
|
-
forest: (0, index_js_6.brand)(1),
|
|
119
|
-
schema: (0, index_js_6.brand)(2),
|
|
120
|
-
detachedFieldIndex: (0, index_js_6.brand)(1),
|
|
121
|
-
editManager: (0, index_js_6.brand)(5),
|
|
122
|
-
message: (0, index_js_6.brand)(5),
|
|
123
|
-
fieldBatch: (0, index_js_6.brand)(1),
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
]);
|
|
127
|
-
function getCodecVersions(formatVersion) {
|
|
128
|
-
const versions = formatVersionToTopLevelCodecVersions.get(formatVersion);
|
|
129
|
-
(0, internal_1.assert)(versions !== undefined, 0x90e /* Unknown format version */);
|
|
130
|
-
return versions;
|
|
131
|
-
}
|
|
132
59
|
/**
|
|
133
60
|
* SharedTreeCore, configured with a good set of indexes and field kinds which will maintain compatibility over time.
|
|
134
61
|
*
|
|
@@ -147,17 +74,22 @@ let SharedTreeKernel = (() => {
|
|
|
147
74
|
return this.checkout.storedSchema;
|
|
148
75
|
}
|
|
149
76
|
constructor(breaker, sharedObject, serializer, submitLocalMessage, lastSequenceNumber, initialSequenceNumber, logger, idCompressor, optionsParam) {
|
|
150
|
-
const options = {
|
|
151
|
-
|
|
77
|
+
const options = {
|
|
78
|
+
...exports.defaultSharedTreeOptions,
|
|
79
|
+
...optionsParam,
|
|
80
|
+
};
|
|
81
|
+
if (options.minVersionForCollab < index_js_1.FluidClientVersion.v2_0) {
|
|
82
|
+
throw new internal_2.UsageError("SharedTree requires minVersionForCollab of at least 2.0.0");
|
|
83
|
+
}
|
|
152
84
|
const schema = new index_js_2.TreeStoredSchemaRepository();
|
|
153
85
|
const forest = buildConfiguredForest(breaker, options.forest, schema, idCompressor, options.shouldEncodeIncrementally);
|
|
154
86
|
const revisionTagCodec = new index_js_2.RevisionTagCodec(idCompressor);
|
|
155
87
|
const removedRoots = (0, index_js_2.makeDetachedFieldIndex)("repair", revisionTagCodec, idCompressor, options);
|
|
156
|
-
const schemaCodec = (0, index_js_3.makeSchemaCodec)(options
|
|
88
|
+
const schemaCodec = (0, index_js_3.makeSchemaCodec)(options);
|
|
157
89
|
const schemaSummarizer = new index_js_3.SchemaSummarizer(schema, {
|
|
158
90
|
getCurrentSeq: lastSequenceNumber,
|
|
159
91
|
}, schemaCodec);
|
|
160
|
-
const fieldBatchCodec = (0, index_js_3.makeFieldBatchCodec)(options
|
|
92
|
+
const fieldBatchCodec = (0, index_js_3.makeFieldBatchCodec)(options);
|
|
161
93
|
const encoderContext = {
|
|
162
94
|
schema: {
|
|
163
95
|
schema,
|
|
@@ -189,7 +121,7 @@ let SharedTreeKernel = (() => {
|
|
|
189
121
|
throw error;
|
|
190
122
|
});
|
|
191
123
|
const changeEnricher = new sharedTreeChangeEnricher_js_1.SharedTreeReadonlyChangeEnricher(forest, schema, removedRoots);
|
|
192
|
-
super(breaker, sharedObject, serializer, submitLocalMessage, logger, [schemaSummarizer, forestSummarizer, removedRootsSummarizer], changeFamily, options,
|
|
124
|
+
super(breaker, sharedObject, serializer, submitLocalMessage, logger, [schemaSummarizer, forestSummarizer, removedRootsSummarizer], changeFamily, options, exports.changeFormatVersionForEditManager, exports.changeFormatVersionForMessage, idCompressor, schema, index_js_3.defaultSchemaPolicy, undefined, changeEnricher);
|
|
193
125
|
this.logger = (__runInitializers(this, _instanceExtraInitializers), logger);
|
|
194
126
|
this.checkouts = new Map();
|
|
195
127
|
this.checkout = (0, treeCheckout_js_1.createTreeCheckout)(idCompressor, this.mintRevisionTag, revisionTagCodec, {
|
|
@@ -354,7 +286,12 @@ exports.exportSimpleSchema = exportSimpleSchema;
|
|
|
354
286
|
* @alpha
|
|
355
287
|
*/
|
|
356
288
|
function persistedToSimpleSchema(persisted, options) {
|
|
357
|
-
|
|
289
|
+
// Any version can be passed down to makeSchemaCodec here.
|
|
290
|
+
// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.
|
|
291
|
+
const schemaCodec = (0, index_js_3.makeSchemaCodec)({
|
|
292
|
+
...options,
|
|
293
|
+
minVersionForCollab: index_js_1.FluidClientVersion.v2_0,
|
|
294
|
+
});
|
|
358
295
|
const stored = schemaCodec.decode(persisted);
|
|
359
296
|
return exportSimpleSchema(stored);
|
|
360
297
|
}
|
|
@@ -407,11 +344,26 @@ exports.SharedTreeFormatVersion = {
|
|
|
407
344
|
* This is because the format for SharedTree changes are not explicitly versioned.
|
|
408
345
|
*/
|
|
409
346
|
exports.changeFormatVersionForEditManager = index_js_1.DependentFormatVersion.fromPairs([
|
|
410
|
-
[
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
[
|
|
347
|
+
[
|
|
348
|
+
(0, index_js_6.brand)(index_js_4.EditManagerFormatVersion.v1),
|
|
349
|
+
(0, index_js_6.brand)(1),
|
|
350
|
+
],
|
|
351
|
+
[
|
|
352
|
+
(0, index_js_6.brand)(index_js_4.EditManagerFormatVersion.v2),
|
|
353
|
+
(0, index_js_6.brand)(2),
|
|
354
|
+
],
|
|
355
|
+
[
|
|
356
|
+
(0, index_js_6.brand)(index_js_4.EditManagerFormatVersion.v3),
|
|
357
|
+
(0, index_js_6.brand)(3),
|
|
358
|
+
],
|
|
359
|
+
[
|
|
360
|
+
(0, index_js_6.brand)(index_js_4.EditManagerFormatVersion.v4),
|
|
361
|
+
(0, index_js_6.brand)(4),
|
|
362
|
+
],
|
|
363
|
+
[
|
|
364
|
+
(0, index_js_6.brand)(index_js_4.EditManagerFormatVersion.v5),
|
|
365
|
+
(0, index_js_6.brand)(4),
|
|
366
|
+
],
|
|
415
367
|
]);
|
|
416
368
|
/**
|
|
417
369
|
* Defines for each MessageFormatVersion the SharedTreeChangeFormatVersion to use.
|
|
@@ -420,53 +372,52 @@ exports.changeFormatVersionForEditManager = index_js_1.DependentFormatVersion.fr
|
|
|
420
372
|
* This is because the format for SharedTree changes are not explicitly versioned.
|
|
421
373
|
*/
|
|
422
374
|
exports.changeFormatVersionForMessage = index_js_1.DependentFormatVersion.fromPairs([
|
|
423
|
-
[
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
[
|
|
428
|
-
|
|
375
|
+
[
|
|
376
|
+
(0, index_js_6.brand)(index_js_4.MessageFormatVersion.undefined),
|
|
377
|
+
(0, index_js_6.brand)(1),
|
|
378
|
+
],
|
|
379
|
+
[
|
|
380
|
+
(0, index_js_6.brand)(index_js_4.MessageFormatVersion.v1),
|
|
381
|
+
(0, index_js_6.brand)(1),
|
|
382
|
+
],
|
|
383
|
+
[
|
|
384
|
+
(0, index_js_6.brand)(index_js_4.MessageFormatVersion.v2),
|
|
385
|
+
(0, index_js_6.brand)(2),
|
|
386
|
+
],
|
|
387
|
+
[
|
|
388
|
+
(0, index_js_6.brand)(index_js_4.MessageFormatVersion.v3),
|
|
389
|
+
(0, index_js_6.brand)(3),
|
|
390
|
+
],
|
|
391
|
+
[
|
|
392
|
+
(0, index_js_6.brand)(index_js_4.MessageFormatVersion.v4),
|
|
393
|
+
(0, index_js_6.brand)(4),
|
|
394
|
+
],
|
|
395
|
+
[
|
|
396
|
+
(0, index_js_6.brand)(index_js_4.MessageFormatVersion.v5),
|
|
397
|
+
(0, index_js_6.brand)(4),
|
|
398
|
+
],
|
|
429
399
|
]);
|
|
430
|
-
function getCodecTreeForEditManagerFormat(
|
|
431
|
-
const change = exports.changeFormatVersionForEditManager.lookup(
|
|
432
|
-
const changeCodecTree = (0, sharedTreeChangeCodecs_js_1.getCodecTreeForChangeFormat)(change);
|
|
433
|
-
return (0, index_js_4.getCodecTreeForEditManagerFormatWithChange)(
|
|
400
|
+
function getCodecTreeForEditManagerFormat(clientVersion) {
|
|
401
|
+
const change = exports.changeFormatVersionForEditManager.lookup((0, index_js_4.clientVersionToEditManagerFormatVersion)(clientVersion));
|
|
402
|
+
const changeCodecTree = (0, sharedTreeChangeCodecs_js_1.getCodecTreeForChangeFormat)(change, clientVersion);
|
|
403
|
+
return (0, index_js_4.getCodecTreeForEditManagerFormatWithChange)(clientVersion, changeCodecTree);
|
|
434
404
|
}
|
|
435
|
-
function getCodecTreeForMessageFormat(
|
|
436
|
-
const change = exports.changeFormatVersionForMessage.lookup(
|
|
437
|
-
const changeCodecTree = (0, sharedTreeChangeCodecs_js_1.getCodecTreeForChangeFormat)(change);
|
|
438
|
-
return (0, index_js_4.getCodecTreeForMessageFormatWithChange)(
|
|
405
|
+
function getCodecTreeForMessageFormat(clientVersion) {
|
|
406
|
+
const change = exports.changeFormatVersionForMessage.lookup((0, index_js_4.clientVersionToMessageFormatVersion)(clientVersion));
|
|
407
|
+
const changeCodecTree = (0, sharedTreeChangeCodecs_js_1.getCodecTreeForChangeFormat)(change, clientVersion);
|
|
408
|
+
return (0, index_js_4.getCodecTreeForMessageFormatWithChange)(clientVersion, changeCodecTree);
|
|
439
409
|
}
|
|
440
|
-
function getCodecTreeForSharedTreeFormat(
|
|
410
|
+
function getCodecTreeForSharedTreeFormat(clientVersion) {
|
|
441
411
|
const children = [];
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
case "message":
|
|
449
|
-
children.push(getCodecTreeForMessageFormat(childCodecs.message));
|
|
450
|
-
break;
|
|
451
|
-
case "forest":
|
|
452
|
-
children.push((0, index_js_3.getCodecTreeForForestFormat)(childCodecs.forest));
|
|
453
|
-
break;
|
|
454
|
-
case "schema":
|
|
455
|
-
children.push((0, index_js_3.getCodecTreeForSchemaFormat)(childCodecs.schema));
|
|
456
|
-
break;
|
|
457
|
-
case "detachedFieldIndex":
|
|
458
|
-
children.push((0, index_js_2.getCodecTreeForDetachedFieldIndexFormat)(childCodecs.detachedFieldIndex));
|
|
459
|
-
break;
|
|
460
|
-
case "fieldBatch":
|
|
461
|
-
children.push((0, index_js_3.getCodecTreeForFieldBatchFormat)(childCodecs.fieldBatch));
|
|
462
|
-
break;
|
|
463
|
-
default:
|
|
464
|
-
(0, internal_1.unreachableCase)(name);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
412
|
+
children.push((0, index_js_3.getCodecTreeForForestFormat)(clientVersion));
|
|
413
|
+
children.push((0, index_js_3.getCodecTreeForSchemaFormat)(clientVersion));
|
|
414
|
+
children.push((0, index_js_2.getCodecTreeForDetachedFieldIndexFormat)(clientVersion));
|
|
415
|
+
children.push(getCodecTreeForEditManagerFormat(clientVersion));
|
|
416
|
+
children.push(getCodecTreeForMessageFormat(clientVersion));
|
|
417
|
+
children.push((0, index_js_3.getCodecTreeForFieldBatchFormat)(clientVersion));
|
|
467
418
|
return {
|
|
468
419
|
name: "SharedTree",
|
|
469
|
-
version,
|
|
420
|
+
version: undefined, // SharedTree does not have a version of its own.
|
|
470
421
|
children,
|
|
471
422
|
};
|
|
472
423
|
}
|
|
@@ -515,9 +466,10 @@ exports.defaultSharedTreeOptions = {
|
|
|
515
466
|
minVersionForCollab: index_js_1.FluidClientVersion.v2_0,
|
|
516
467
|
forest: exports.ForestTypeReference,
|
|
517
468
|
treeEncodeType: index_js_3.TreeCompressionStrategy.Compressed,
|
|
518
|
-
formatVersion: exports.SharedTreeFormatVersion.v3,
|
|
519
469
|
disposeForksAfterTransaction: true,
|
|
520
470
|
shouldEncodeIncrementally: index_js_3.defaultIncrementalEncodingPolicy,
|
|
471
|
+
editManagerFormatSelector: index_js_4.clientVersionToEditManagerFormatVersion,
|
|
472
|
+
messageFormatSelector: index_js_4.clientVersionToMessageFormatVersion,
|
|
521
473
|
};
|
|
522
474
|
/**
|
|
523
475
|
* Build the allowed types for a Stored Schema.
|
|
@@ -564,6 +516,8 @@ function exportSimpleFieldSchemaStored(schema) {
|
|
|
564
516
|
* Export a {@link SimpleNodeSchema} from a {@link TreeNodeStoredSchema}.
|
|
565
517
|
* @privateRemarks
|
|
566
518
|
* TODO: Persist node metadata once schema FormatV2 is supported.
|
|
519
|
+
* Note on SimpleNodeSchema construction: In the persisted format `persistedMetadata` is just called `metadata` whereas the `metadata`
|
|
520
|
+
* field on SimpleNodeSchema is not persisted.
|
|
567
521
|
*/
|
|
568
522
|
function exportSimpleNodeSchemaStored(schema) {
|
|
569
523
|
const arrayTypes = (0, index_js_5.tryStoredSchemaAsArray)(schema);
|
|
@@ -580,7 +534,13 @@ function exportSimpleNodeSchemaStored(schema) {
|
|
|
580
534
|
for (const [storedKey, field] of schema.objectNodeFields) {
|
|
581
535
|
fields.set(storedKey, { ...exportSimpleFieldSchemaStored(field), storedKey });
|
|
582
536
|
}
|
|
583
|
-
return {
|
|
537
|
+
return {
|
|
538
|
+
kind: index_js_5.NodeKind.Object,
|
|
539
|
+
fields,
|
|
540
|
+
allowUnknownOptionalFields: undefined,
|
|
541
|
+
metadata: {},
|
|
542
|
+
persistedMetadata: schema.metadata,
|
|
543
|
+
};
|
|
584
544
|
}
|
|
585
545
|
if (schema instanceof index_js_2.MapNodeStoredSchema) {
|
|
586
546
|
(0, internal_1.assert)(schema.mapFields.kind === index_js_3.FieldKinds.optional.identifier, 0xa95 /* Invalid map schema */);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTree.js","sourceRoot":"","sources":["../../src/shared-tree/sharedTree.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,kEAAoF;AAQpF,uEAGkD;AAElD,gDAO2B;AAC3B,+CAqB0B;AAC1B,4DAsBuC;AAGvC,2DASsC;AACtC,sDAkBiC;AAEjC,uEAAuE;AACvE,+EA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AAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC5F,CAAC;IACD,IAAI,MAAM,YAAY,8BAAmB,EAAE,CAAC;QAC3C,IAAA,iBAAM,EACL,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,EACxD,KAAK,CAAC,wBAAwB,CAC9B,CAAC;QACF,OAAO;YACN,IAAI,EAAE,mBAAQ,CAAC,GAAG;YAClB,kBAAkB,EAAE,+CAA+C,CAClE,MAAM,CAAC,SAAS,CAAC,KAAK,CACtB;YACD,QAAQ,EAAE,EAAE;YACZ,iBAAiB,EAAE,MAAM,CAAC,QAAQ;SAClC,CAAC;IACH,CAAC;IACD,IAAI,MAAM,YAAY,+BAAoB,EAAE,CAAC;QAC5C,OAAO;YACN,IAAI,EAAE,mBAAQ,CAAC,IAAI;YACnB,QAAQ,EAAE,MAAM,CAAC,SAAS;YAC1B,QAAQ,EAAE,EAAE;YACZ,iBAAiB,EAAE,MAAM,CAAC,QAAQ;SAClC,CAAC;IACH,CAAC;IACD,IAAA,eAAI,EAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType, IFluidLoadable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor, StableId } from \"@fluidframework/id-compressor\";\nimport type {\n\tIChannelView,\n\tIFluidSerializer,\n\tSharedKernel,\n} from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tUsageError,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tDependentFormatVersion,\n\tFluidClientVersion,\n\tFormatValidatorNoOp,\n\ttype ICodecOptions,\n} from \"../codec/index.js\";\nimport {\n\ttype DetachedFieldIndexFormatVersion,\n\ttype FieldKey,\n\ttype GraphCommit,\n\ttype IEditableForest,\n\ttype JsonableTree,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tRevisionTagCodec,\n\ttype SchemaFormatVersion,\n\tSchemaVersion,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\ttype TreeStoredSchemaSubscription,\n\ttype TreeTypeSet,\n\tgetCodecTreeForDetachedFieldIndexFormat,\n\tmakeDetachedFieldIndex,\n\tmoveToDetachedField,\n} from \"../core/index.js\";\nimport {\n\tDetachedFieldIndexSummarizer,\n\tFieldKinds,\n\tForestSummarizer,\n\tSchemaSummarizer,\n\tTreeCompressionStrategy,\n\tbuildChunkedForest,\n\tbuildForest,\n\tdefaultIncrementalEncodingPolicy,\n\tdefaultSchemaPolicy,\n\tgetCodecTreeForFieldBatchFormat,\n\tgetCodecTreeForForestFormat,\n\tgetCodecTreeForSchemaFormat,\n\tjsonableTreeFromFieldCursor,\n\tmakeFieldBatchCodec,\n\tmakeMitigatedChangeFamily,\n\tmakeSchemaCodec,\n\tmakeTreeChunker,\n\ttype IncrementalEncodingPolicy,\n\ttype FieldBatchFormatVersion,\n\ttype ForestFormatVersion,\n\ttype TreeCompressionStrategyPrivate,\n} from \"../feature-libraries/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport type { FormatV1 } from \"../feature-libraries/schema-index/index.js\";\nimport {\n\ttype BranchId,\n\ttype ClonableSchemaAndPolicy,\n\ttype EditManagerFormatVersion,\n\ttype ExplicitCoreCodecVersions,\n\tgetCodecTreeForEditManagerFormatWithChange,\n\tgetCodecTreeForMessageFormatWithChange,\n\ttype MessageFormatVersion,\n\tSharedTreeCore,\n} from \"../shared-tree-core/index.js\";\nimport {\n\ttype ITree,\n\ttype ImplicitFieldSchema,\n\tNodeKind,\n\ttype ReadSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleTreeSchema,\n\ttype TreeView,\n\ttype TreeViewAlpha,\n\ttype TreeViewConfiguration,\n\ttype UnsafeUnknownSchema,\n\ttype VerboseTree,\n\ttryStoredSchemaAsArray,\n\ttype SimpleNodeSchema,\n\tFieldKind,\n\ttype ITreeAlpha,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleAllowedTypeAttributes,\n} from \"../simple-tree/index.js\";\n\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport { SharedTreeReadonlyChangeEnricher } from \"./sharedTreeChangeEnricher.js\";\nimport { SharedTreeChangeFamily } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type { SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\nimport { type TreeCheckout, type BranchableTree, createTreeCheckout } from \"./treeCheckout.js\";\nimport {\n\tbrand,\n\ttype Breakable,\n\tbreakingClass,\n\ttype JsonCompatible,\n\tthrowIfBroken,\n} from \"../util/index.js\";\nimport {\n\tgetCodecTreeForChangeFormat,\n\ttype SharedTreeChangeFormatVersion,\n} from \"./sharedTreeChangeCodecs.js\";\n\n/**\n * Copy of data from an {@link ITreePrivate} at some point in time.\n * @remarks\n * This is unrelated to Fluids concept of \"snapshots\".\n */\nexport interface SharedTreeContentSnapshot {\n\t/**\n\t * The schema stored in the document.\n\t *\n\t * @remarks\n\t * Edits to the schema can mutate the schema stored of the tree which took this snapshot (but this snapshot will remain the same)\n\t * This is mainly useful for debugging cases where schematize reports an incompatible view schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\t/**\n\t * All {@link TreeStatus.InDocument} content.\n\t */\n\treadonly tree: JsonableTree[];\n\t/**\n\t * All {@link TreeStatus.Removed} content.\n\t */\n\treadonly removed: [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * {@link ITree} extended with some non-public APIs.\n * @internal\n */\nexport interface ITreeInternal extends IChannelView, ITreeAlpha {}\n\n/**\n * {@link ITreeInternal} extended with some non-exported APIs.\n * @remarks\n * This allows access to the tree content using the internal data model used at the storage and \"flex\" layers,\n * and should only be needed for testing and debugging this package's internals.\n */\nexport interface ITreePrivate extends ITreeInternal {\n\t/**\n\t * Provides a copy of the current content of the tree.\n\t * This can be useful for inspecting the tree when no suitable view schema is available.\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t *\n\t * This does not include everything that is included in a tree summary, since information about how to merge future edits is omitted.\n\t */\n\tcontentSnapshot(): SharedTreeContentSnapshot;\n\n\t/**\n\t * Access to internals for testing.\n\t */\n\treadonly kernel: SharedTreeKernel;\n}\n\n/**\n * Has an entry for each codec which writes an explicit version into its data.\n *\n * This is used to map the single API entrypoint controlling the format {@link SharedTreeOptions.formatVersion}\n * to a list of write versions that for each codec that should be used for that format.\n *\n * Note that all explicitly versioned codecs should be using the format version from the data to read encoded data.\n *\n * TODO: Plumb these write versions into forest, schema, detached field index codec creation.\n */\ninterface ExplicitCodecVersions extends ExplicitCoreCodecVersions {\n\tforest: ForestFormatVersion;\n\tschema: SchemaFormatVersion;\n\tdetachedFieldIndex: DetachedFieldIndexFormatVersion;\n\tfieldBatch: FieldBatchFormatVersion;\n}\n\nconst formatVersionToTopLevelCodecVersions = new Map<number, ExplicitCodecVersions>([\n\t[\n\t\t1,\n\t\t{\n\t\t\tforest: brand(1),\n\t\t\tschema: brand(1),\n\t\t\tdetachedFieldIndex: brand(1),\n\t\t\teditManager: brand(1),\n\t\t\tmessage: brand(1),\n\t\t\tfieldBatch: brand(1),\n\t\t},\n\t],\n\t[\n\t\t2,\n\t\t{\n\t\t\tforest: brand(1),\n\t\t\tschema: brand(1),\n\t\t\tdetachedFieldIndex: brand(1),\n\t\t\teditManager: brand(2),\n\t\t\tmessage: brand(2),\n\t\t\tfieldBatch: brand(1),\n\t\t},\n\t],\n\t[\n\t\t3,\n\t\t{\n\t\t\tforest: brand(1),\n\t\t\tschema: brand(1),\n\t\t\tdetachedFieldIndex: brand(1),\n\t\t\teditManager: brand(3),\n\t\t\tmessage: brand(3),\n\t\t\tfieldBatch: brand(1),\n\t\t},\n\t],\n\t[\n\t\t4,\n\t\t{\n\t\t\tforest: brand(1),\n\t\t\tschema: brand(1),\n\t\t\tdetachedFieldIndex: brand(1),\n\t\t\teditManager: brand(4),\n\t\t\tmessage: brand(4),\n\t\t\tfieldBatch: brand(1),\n\t\t},\n\t],\n\t[\n\t\t5,\n\t\t{\n\t\t\tforest: brand(1),\n\t\t\tschema: brand(2),\n\t\t\tdetachedFieldIndex: brand(1),\n\t\t\teditManager: brand(4),\n\t\t\tmessage: brand(4),\n\t\t\tfieldBatch: brand(1),\n\t\t},\n\t],\n\t[\n\t\t100, // SharedTreeFormatVersion.vSharedBranches\n\t\t{\n\t\t\tforest: brand(1),\n\t\t\tschema: brand(2),\n\t\t\tdetachedFieldIndex: brand(1),\n\t\t\teditManager: brand(5),\n\t\t\tmessage: brand(5),\n\t\t\tfieldBatch: brand(1),\n\t\t},\n\t],\n]);\n\nfunction getCodecVersions(formatVersion: number): ExplicitCodecVersions {\n\tconst versions = formatVersionToTopLevelCodecVersions.get(formatVersion);\n\tassert(versions !== undefined, 0x90e /* Unknown format version */);\n\treturn versions;\n}\n\n/**\n * The type SharedTree's kernel's view must implement so what when its merged with the underling SharedObject's API it fully implements the required tree API surface ({@link ITreePrivate }).\n */\nexport type SharedTreeKernelView = Omit<ITreePrivate, keyof (IChannelView & IFluidLoadable)>;\n\n/**\n * SharedTreeCore, configured with a good set of indexes and field kinds which will maintain compatibility over time.\n *\n * TODO: detail compatibility requirements.\n */\n@breakingClass\nexport class SharedTreeKernel\n\textends SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>\n\timplements SharedKernel\n{\n\tpublic readonly checkout: TreeCheckout;\n\tpublic get storedSchema(): TreeStoredSchemaRepository {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\tprivate readonly checkouts: Map<BranchId, TreeCheckout> = new Map();\n\n\t/**\n\t * The app-facing API for SharedTree implemented by this Kernel.\n\t * @remarks\n\t * This is the API grafted onto the ISharedObject which apps can access.\n\t * It includes both the APIs used for internal testing, and public facing APIs (both stable and unstable).\n\t * Different users will have access to different subsets of this API, see {@link ITree}, {@link ITreeAlpha} and {@link ITreeInternal} which this {@link ITreePrivate} extends.\n\t */\n\tpublic readonly view: SharedTreeKernelView;\n\n\tpublic constructor(\n\t\tbreaker: Breakable,\n\t\tsharedObject: IChannelView & IFluidLoadable,\n\t\tserializer: IFluidSerializer,\n\t\tsubmitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void,\n\t\tlastSequenceNumber: () => number | undefined,\n\t\tinitialSequenceNumber: number,\n\t\tprivate readonly logger: ITelemetryLoggerExt | undefined,\n\t\tidCompressor: IIdCompressor,\n\t\toptionsParam: SharedTreeOptionsInternal,\n\t) {\n\t\tconst options = { ...defaultSharedTreeOptions, ...optionsParam };\n\t\tconst codecVersions = getCodecVersions(options.formatVersion);\n\t\tconst schema = new TreeStoredSchemaRepository();\n\t\tconst forest = buildConfiguredForest(\n\t\t\tbreaker,\n\t\t\toptions.forest,\n\t\t\tschema,\n\t\t\tidCompressor,\n\t\t\toptions.shouldEncodeIncrementally,\n\t\t);\n\t\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\t\tconst removedRoots = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\trevisionTagCodec,\n\t\t\tidCompressor,\n\t\t\toptions,\n\t\t);\n\t\tconst schemaCodec = makeSchemaCodec(options, codecVersions.schema);\n\t\tconst schemaSummarizer = new SchemaSummarizer(\n\t\t\tschema,\n\t\t\t{\n\t\t\t\tgetCurrentSeq: lastSequenceNumber,\n\t\t\t},\n\t\t\tschemaCodec,\n\t\t);\n\t\tconst fieldBatchCodec = makeFieldBatchCodec(options, codecVersions.fieldBatch);\n\n\t\tconst encoderContext = {\n\t\t\tschema: {\n\t\t\t\tschema,\n\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t},\n\t\t\tencodeType: options.treeEncodeType,\n\t\t\toriginatorId: idCompressor.localSessionId,\n\t\t\tidCompressor,\n\t\t};\n\t\tconst forestSummarizer = new ForestSummarizer(\n\t\t\tforest,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tencoderContext,\n\t\t\toptions,\n\t\t\tidCompressor,\n\t\t\tinitialSequenceNumber,\n\t\t\toptions.shouldEncodeIncrementally,\n\t\t);\n\t\tconst removedRootsSummarizer = new DetachedFieldIndexSummarizer(removedRoots);\n\t\tconst innerChangeFamily = new SharedTreeChangeFamily(\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\toptions,\n\t\t\toptions.treeEncodeType,\n\t\t\tidCompressor,\n\t\t);\n\t\tconst changeFamily = makeMitigatedChangeFamily(\n\t\t\tinnerChangeFamily,\n\t\t\tSharedTreeChangeFamily.emptyChange,\n\t\t\t(error: unknown) => {\n\t\t\t\t// TODO:6344 Add telemetry for these errors.\n\t\t\t\t// Rethrowing the error has a different effect depending on the context in which the\n\t\t\t\t// ChangeFamily was invoked:\n\t\t\t\t// - If the ChangeFamily was invoked as part of incoming op processing, rethrowing the error\n\t\t\t\t// will cause the runtime to disconnect the client, log a severe error, and not reconnect.\n\t\t\t\t// This will not cause the host application to crash because it is not on the stack at that time.\n\t\t\t\t// TODO: let the host application know that the client is now disconnected.\n\t\t\t\t// - If the ChangeFamily was invoked as part of dealing with a local change, rethrowing the\n\t\t\t\t// error will cause the host application to crash. This is not ideal, but is better than\n\t\t\t\t// letting the application either send an invalid change to the server or allowing the\n\t\t\t\t// application to continue working when its local branches contain edits that cannot be\n\t\t\t\t// reflected in its views.\n\t\t\t\t// The best course of action for a host application in such a state is to restart.\n\t\t\t\t// TODO: let the host application know about this situation and provide a way to\n\t\t\t\t// programmatically reload the SharedTree container.\n\t\t\t\tthrow error;\n\t\t\t},\n\t\t);\n\t\tconst changeEnricher = new SharedTreeReadonlyChangeEnricher(forest, schema, removedRoots);\n\t\tsuper(\n\t\t\tbreaker,\n\t\t\tsharedObject,\n\t\t\tserializer,\n\t\t\tsubmitLocalMessage,\n\t\t\tlogger,\n\t\t\t[schemaSummarizer, forestSummarizer, removedRootsSummarizer],\n\t\t\tchangeFamily,\n\t\t\toptions,\n\t\t\tcodecVersions,\n\t\t\tchangeFormatVersionForEditManager,\n\t\t\tchangeFormatVersionForMessage,\n\t\t\tidCompressor,\n\t\t\tschema,\n\t\t\tdefaultSchemaPolicy,\n\t\t\tundefined,\n\t\t\tchangeEnricher,\n\t\t);\n\n\t\tthis.checkout = createTreeCheckout(idCompressor, this.mintRevisionTag, revisionTagCodec, {\n\t\t\tbranch: this.getLocalBranch(),\n\t\t\tchangeFamily,\n\t\t\tschema,\n\t\t\tforest,\n\t\t\tfieldBatchCodec,\n\t\t\tremovedRoots,\n\t\t\tchunkCompressionStrategy: options.treeEncodeType,\n\t\t\tlogger,\n\t\t\tbreaker: this.breaker,\n\t\t\tdisposeForksAfterTransaction: options.disposeForksAfterTransaction,\n\t\t});\n\n\t\tthis.registerCheckout(\"main\", this.checkout);\n\n\t\tthis.view = {\n\t\t\tcontentSnapshot: () => this.contentSnapshot(),\n\t\t\texportSimpleSchema: () => this.exportSimpleSchema(),\n\t\t\texportVerbose: () => this.exportVerbose(),\n\t\t\tviewWith: this.viewWith.bind(this),\n\t\t\tviewSharedBranchWith: this.viewBranchWith.bind(this),\n\t\t\tcreateSharedBranch: this.createSharedBranch.bind(this),\n\t\t\tgetSharedBranchIds: this.getSharedBranchIds.bind(this),\n\t\t\tkernel: this,\n\t\t};\n\t}\n\n\tprivate registerCheckout(branchId: BranchId, checkout: TreeCheckout): void {\n\t\tthis.checkouts.set(branchId, checkout);\n\t\tconst enricher = this.getCommitEnricher(branchId);\n\t\tcheckout.transaction.events.on(\"started\", () => {\n\t\t\tif (this.sharedObject.isAttached()) {\n\t\t\t\t// It is currently forbidden to attach during a transaction, so transaction state changes can be ignored until after attaching.\n\t\t\t\tenricher.startTransaction();\n\t\t\t}\n\t\t});\n\n\t\tcheckout.transaction.events.on(\"aborting\", () => {\n\t\t\tif (this.sharedObject.isAttached()) {\n\t\t\t\t// It is currently forbidden to attach during a transaction, so transaction state changes can be ignored until after attaching.\n\t\t\t\tenricher.abortTransaction();\n\t\t\t}\n\t\t});\n\t\tcheckout.transaction.events.on(\"committing\", () => {\n\t\t\tif (this.sharedObject.isAttached()) {\n\t\t\t\t// It is currently forbidden to attach during a transaction, so transaction state changes can be ignored until after attaching.\n\t\t\t\tenricher.commitTransaction();\n\t\t\t}\n\t\t});\n\t\tcheckout.events.on(\"beforeBatch\", (event) => {\n\t\t\tif (event.type === \"append\" && this.sharedObject.isAttached()) {\n\t\t\t\tif (checkout.transaction.isInProgress()) {\n\t\t\t\t\tenricher.addTransactionCommits(event.newCommits);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic exportVerbose(): VerboseTree | undefined {\n\t\treturn this.checkout.exportVerbose();\n\t}\n\n\tpublic exportSimpleSchema(): SimpleTreeSchema {\n\t\treturn exportSimpleSchema(this.storedSchema);\n\t}\n\n\t@throwIfBroken\n\tpublic contentSnapshot(): SharedTreeContentSnapshot {\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"contentSnapshot\");\n\t\ttry {\n\t\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\t\treturn {\n\t\t\t\tschema: this.storedSchema.clone(),\n\t\t\t\ttree: jsonableTreeFromFieldCursor(cursor),\n\t\t\t\tremoved: this.checkout.getRemovedRoots(),\n\t\t\t};\n\t\t} finally {\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t// For the new TreeViewAlpha API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;\n\n\t// For the old TreeView API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<TRoot>;\n\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>> {\n\t\treturn this.checkout.viewWith(config) as SchematizingSimpleTreeView<TRoot> &\n\t\t\tTreeView<ReadSchema<TRoot>>;\n\t}\n\n\tpublic viewBranchWith<TRoot extends ImplicitFieldSchema>(\n\t\tbranchId: string,\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): TreeView<TRoot>;\n\n\tpublic viewBranchWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tbranchId: string,\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>> {\n\t\tconst compressedId = this.idCompressor.tryRecompress(branchId as StableId);\n\t\tif (compressedId === undefined) {\n\t\t\tthrow new UsageError(`No branch found with id: ${branchId}`);\n\t\t}\n\t\treturn this.getCheckout(compressedId).viewWith(\n\t\t\tconfig,\n\t\t) as SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;\n\t}\n\n\tprivate getCheckout(branchId: BranchId): TreeCheckout {\n\t\treturn this.checkouts.get(branchId) ?? this.checkoutBranch(branchId);\n\t}\n\n\tprivate checkoutBranch(branchId: BranchId): TreeCheckout {\n\t\tconst checkout = this.checkout.branch();\n\t\tcheckout.switchBranch(this.getSharedBranch(branchId));\n\t\tconst enricher = new SharedTreeReadonlyChangeEnricher(\n\t\t\tcheckout.forest,\n\t\t\tcheckout.storedSchema,\n\t\t\tcheckout.removedRoots,\n\t\t);\n\n\t\tthis.registerSharedBranchForEditing(branchId, enricher);\n\t\tthis.registerCheckout(branchId, checkout);\n\t\treturn checkout;\n\t}\n\n\tpublic override async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tawait super.loadCore(services);\n\t\tthis.checkout.load();\n\t}\n\n\tpublic override didAttach(): void {\n\t\tfor (const checkout of this.checkouts.values()) {\n\t\t\tif (checkout.transaction.isInProgress()) {\n\t\t\t\t// Attaching during a transaction is not currently supported.\n\t\t\t\t// At least part of of the system is known to not handle this case correctly - commit enrichment - and there may be others.\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot attach while a transaction is in progress. Commit or abort the transaction before attaching.\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tsuper.didAttach();\n\t}\n\n\tpublic override applyStashedOp(\n\t\t...args: Parameters<\n\t\t\tSharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>[\"applyStashedOp\"]\n\t\t>\n\t): void {\n\t\tfor (const checkout of this.checkouts.values()) {\n\t\t\tassert(\n\t\t\t\t!checkout.transaction.isInProgress(),\n\t\t\t\t0x674 /* Unexpected transaction is open while applying stashed ops */,\n\t\t\t);\n\t\t}\n\t\tsuper.applyStashedOp(...args);\n\t}\n\n\tprotected override submitCommit(\n\t\tbranchId: BranchId,\n\t\tcommit: GraphCommit<SharedTreeChange>,\n\t\tschemaAndPolicy: ClonableSchemaAndPolicy,\n\t\tisResubmit: boolean,\n\t): void {\n\t\tconst checkout = this.getCheckout(branchId);\n\t\tassert(\n\t\t\t!checkout.transaction.isInProgress(),\n\t\t\t0xaa6 /* Cannot submit a commit while a transaction is in progress */,\n\t\t);\n\t\tif (isResubmit) {\n\t\t\treturn super.submitCommit(branchId, commit, schemaAndPolicy, isResubmit);\n\t\t}\n\n\t\t// Refrain from submitting new commits until they are validated by the checkout.\n\t\t// This is not a strict requirement for correctness in our system, but in the event that there is a bug when applying commits to the checkout\n\t\t// that causes a crash (e.g. in the forest), this will at least prevent this client from sending the problematic commit to any other clients.\n\t\tcheckout.onCommitValid(commit, () =>\n\t\t\tsuper.submitCommit(branchId, commit, schemaAndPolicy, isResubmit),\n\t\t);\n\t}\n\n\tpublic onDisconnect(): void {}\n}\n\nexport function exportSimpleSchema(storedSchema: TreeStoredSchema): SimpleTreeSchema {\n\treturn {\n\t\troot: exportSimpleFieldSchemaStored(storedSchema.rootFieldSchema),\n\t\tdefinitions: new Map(\n\t\t\t[...storedSchema.nodeSchema].map(([key, schema]) => {\n\t\t\t\treturn [key, exportSimpleNodeSchemaStored(schema)];\n\t\t\t}),\n\t\t),\n\t};\n}\n\n/**\n * A way to parse schema in the persisted format from {@link extractPersistedSchema}.\n * @remarks\n * This behaves identically to {@link ITreeAlpha.exportSimpleSchema},\n * except that it gets the schema from the caller instead of from an existing tree.\n *\n * This can be useful for inspecting the contents of persisted schema,\n * such as those generated by {@link extractPersistedSchema} for use in testing.\n * Since that data format is otherwise unspecified,\n * this provides a way to inspect its contents with documented semantics.\n * @alpha\n */\nexport function persistedToSimpleSchema(\n\tpersisted: JsonCompatible,\n\toptions: ICodecOptions,\n): SimpleTreeSchema {\n\tconst schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);\n\tconst stored = schemaCodec.decode(persisted as FormatV1);\n\treturn exportSimpleSchema(stored);\n}\n\n/**\n * Get a {@link BranchableTree} from a {@link ITree}.\n * @remarks The branch can be used for \"version control\"-style coordination of edits on the tree.\n * @privateRemarks This function will be removed if/when the branching API becomes public,\n * but it (or something like it) is necessary in the meantime to prevent the alpha types from being exposed as public.\n * @alpha\n * @deprecated This API is superseded by {@link TreeBranch}, which should be used instead.\n */\nexport function getBranch(tree: ITree): BranchableTree;\n/**\n * Get a {@link BranchableTree} from a {@link TreeView}.\n * @remarks The branch can be used for \"version control\"-style coordination of edits on the tree.\n * Branches are currently an unstable \"alpha\" API and are subject to change in the future.\n * @privateRemarks This function will be removed if/when the branching API becomes public,\n * but it (or something like it) is necessary in the meantime to prevent the alpha types from being exposed as public.\n * @alpha\n * @deprecated This API is superseded by {@link TreeBranch}, which should be used instead.\n */\nexport function getBranch<T extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\tview: TreeViewAlpha<T>,\n): BranchableTree;\nexport function getBranch<T extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\ttreeOrView: ITree | TreeViewAlpha<T>,\n): BranchableTree {\n\tif (treeOrView instanceof SchematizingSimpleTreeView) {\n\t\treturn treeOrView.checkout as unknown as BranchableTree;\n\t}\n\tconst kernel = (treeOrView as ITree as ITreePrivate).kernel;\n\tassert(kernel instanceof SharedTreeKernel, 0xb56 /* Invalid ITree */);\n\t// This cast is safe so long as TreeCheckout supports all the operations on the branch interface.\n\treturn kernel.checkout as unknown as BranchableTree;\n}\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @alpha\n */\nexport const SharedTreeFormatVersion = {\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t *\n\t * @deprecated FF does not currently plan on supporting this format long-term.\n\t * Do not write production documents using this format, as they may not be loadable in the future.\n\t */\n\tv1: 1,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv2: 2,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv3: 3,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv5: 5,\n\n\t/**\n\t * For testing purposes only.\n\t */\n\tvSharedBranches: 100,\n} as const;\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @alpha\n * @privateRemarks\n * See packages/dds/tree/docs/main/compatibility.md for information on how to add support for a new format.\n *\n * TODO: Before this gets promoted past Alpha,\n * a separate abstraction more suited for use in the public API should be adopted rather than reusing the same types used internally.\n * Such an abstraction should probably be in the form of a Fluid-Framework wide compatibility enum.\n */\nexport type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;\n\n/**\n * Defines for each EditManagerFormatVersion the SharedTreeChangeFormatVersion to use.\n * This is an arbitrary mapping that is injected in the EditManger codec.\n * Once an entry is defined and used in production, it cannot be changed.\n * This is because the format for SharedTree changes are not explicitly versioned.\n */\nexport const changeFormatVersionForEditManager = DependentFormatVersion.fromPairs([\n\t[brand<EditManagerFormatVersion>(1), brand<SharedTreeChangeFormatVersion>(1)],\n\t[brand<EditManagerFormatVersion>(2), brand<SharedTreeChangeFormatVersion>(2)],\n\t[brand<EditManagerFormatVersion>(3), brand<SharedTreeChangeFormatVersion>(3)],\n\t[brand<EditManagerFormatVersion>(4), brand<SharedTreeChangeFormatVersion>(4)],\n\t[brand<EditManagerFormatVersion>(5), brand<SharedTreeChangeFormatVersion>(4)],\n]);\n\n/**\n * Defines for each MessageFormatVersion the SharedTreeChangeFormatVersion to use.\n * This is an arbitrary mapping that is injected in the message codec.\n * Once an entry is defined and used in production, it cannot be changed.\n * This is because the format for SharedTree changes are not explicitly versioned.\n */\nexport const changeFormatVersionForMessage = DependentFormatVersion.fromPairs([\n\t[brand<MessageFormatVersion>(undefined), brand<SharedTreeChangeFormatVersion>(1)],\n\t[brand<MessageFormatVersion>(1), brand<SharedTreeChangeFormatVersion>(1)],\n\t[brand<MessageFormatVersion>(2), brand<SharedTreeChangeFormatVersion>(2)],\n\t[brand<MessageFormatVersion>(3), brand<SharedTreeChangeFormatVersion>(3)],\n\t[brand<MessageFormatVersion>(4), brand<SharedTreeChangeFormatVersion>(4)],\n\t[brand<MessageFormatVersion>(5), brand<SharedTreeChangeFormatVersion>(4)],\n]);\n\nfunction getCodecTreeForEditManagerFormat(version: EditManagerFormatVersion): CodecTree {\n\tconst change = changeFormatVersionForEditManager.lookup(version);\n\tconst changeCodecTree = getCodecTreeForChangeFormat(change);\n\treturn getCodecTreeForEditManagerFormatWithChange(version, changeCodecTree);\n}\n\nfunction getCodecTreeForMessageFormat(version: MessageFormatVersion): CodecTree {\n\tconst change = changeFormatVersionForMessage.lookup(version);\n\tconst changeCodecTree = getCodecTreeForChangeFormat(change);\n\treturn getCodecTreeForMessageFormatWithChange(version, changeCodecTree);\n}\n\nexport function getCodecTreeForSharedTreeFormat(\n\tversion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion],\n): CodecTree {\n\tconst children: CodecTree[] = [];\n\tconst childCodecs = getCodecVersions(version);\n\tfor (const name of Object.keys(childCodecs) as (keyof ExplicitCodecVersions)[]) {\n\t\tswitch (name) {\n\t\t\tcase \"editManager\":\n\t\t\t\tchildren.push(getCodecTreeForEditManagerFormat(childCodecs.editManager));\n\t\t\t\tbreak;\n\t\t\tcase \"message\":\n\t\t\t\tchildren.push(getCodecTreeForMessageFormat(childCodecs.message));\n\t\t\t\tbreak;\n\t\t\tcase \"forest\":\n\t\t\t\tchildren.push(getCodecTreeForForestFormat(childCodecs.forest));\n\t\t\t\tbreak;\n\t\t\tcase \"schema\":\n\t\t\t\tchildren.push(getCodecTreeForSchemaFormat(childCodecs.schema));\n\t\t\t\tbreak;\n\t\t\tcase \"detachedFieldIndex\":\n\t\t\t\tchildren.push(getCodecTreeForDetachedFieldIndexFormat(childCodecs.detachedFieldIndex));\n\t\t\t\tbreak;\n\t\t\tcase \"fieldBatch\":\n\t\t\t\tchildren.push(getCodecTreeForFieldBatchFormat(childCodecs.fieldBatch));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tunreachableCase(name);\n\t\t}\n\t}\n\treturn {\n\t\tname: \"SharedTree\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * Configuration options for SharedTree.\n * @beta @input\n */\nexport type SharedTreeOptionsBeta = ForestOptions;\n\n/**\n * Configuration options for SharedTree.\n * @alpha @input\n */\nexport type SharedTreeOptions = Partial<CodecWriteOptions> &\n\tPartial<SharedTreeFormatOptions> &\n\tSharedTreeOptionsBeta;\n\nexport interface SharedTreeOptionsInternal\n\textends Omit<SharedTreeOptions, \"treeEncodeType\">,\n\t\tPartial<SharedTreeFormatOptionsInternal> {\n\tdisposeForksAfterTransaction?: boolean;\n\t/**\n\t * Returns whether a node / field should be incrementally encoded.\n\t * @remarks\n\t * See {@link IncrementalEncodingPolicy}.\n\t */\n\tshouldEncodeIncrementally?: IncrementalEncodingPolicy;\n}\n/**\n * Configuration options for SharedTree's internal tree storage.\n * @beta @input\n */\nexport interface ForestOptions {\n\t/**\n\t * The {@link ForestType} indicating which forest type should be created for the SharedTree.\n\t */\n\treadonly forest?: ForestType;\n}\n\n/**\n * Options for configuring the persisted format SharedTree uses.\n * @alpha @input\n */\nexport interface SharedTreeFormatOptions {\n\t/**\n\t * See {@link TreeCompressionStrategy}.\n\t * default: TreeCompressionStrategy.Compressed\n\t */\n\ttreeEncodeType: TreeCompressionStrategy;\n\t/**\n\t * The format version SharedTree should use to persist documents.\n\t *\n\t * This option has compatibility implications for applications using SharedTree.\n\t * Each version documents a required minimum version of \\@fluidframework/tree.\n\t * If this minimum version fails to be met, the SharedTree may fail to load.\n\t * To be safe, application authors should verify that they have saturated this version\n\t * of \\@fluidframework/tree in their ecosystem before changing the format version.\n\t *\n\t * This option defaults to SharedTreeFormatVersion.v2.\n\t */\n\tformatVersion: SharedTreeFormatVersion[keyof SharedTreeFormatVersion];\n}\n\nexport interface SharedTreeFormatOptionsInternal\n\textends Omit<SharedTreeFormatOptions, \"treeEncodeType\"> {\n\ttreeEncodeType: TreeCompressionStrategyPrivate;\n}\n\n/**\n * Used to distinguish between different forest types.\n * @remarks\n * The \"Forest\" is the internal data structure used to store all the trees (the main tree and any removed ones) for a given view or branch.\n * ForestTypes should all have the same behavior, but may differ in performance and debuggability.\n *\n * Current options are {@link ForestTypeReference}, {@link ForestTypeOptimized} and {@link ForestTypeExpensiveDebug}.\n * @privateRemarks\n * Implement using {@link toForestType}.\n * Consume using {@link buildConfiguredForest}.\n * @sealed @beta\n */\nexport interface ForestType extends ErasedType<\"ForestType\"> {}\n\n/**\n * Reference implementation of forest.\n * @remarks\n * A simple implementation with minimal complexity and moderate debuggability, validation and performance.\n * @privateRemarks\n * The \"ObjectForest\" forest type.\n * @beta\n */\nexport const ForestTypeReference = toForestType(\n\t(breaker: Breakable, schema: TreeStoredSchemaSubscription, idCompressor: IIdCompressor) =>\n\t\tbuildForest(breaker, schema),\n);\n\n/**\n * Optimized implementation of forest.\n * @remarks\n * A complex optimized forest implementation, which has minimal validation and debuggability to optimize for performance.\n * Uses an internal representation optimized for size designed to scale to larger datasets with reduced overhead.\n * @privateRemarks\n * The \"ChunkedForest\" forest type.\n * @beta\n */\nexport const ForestTypeOptimized = toForestType(\n\t(\n\t\tbreaker: Breakable,\n\t\tschema: TreeStoredSchemaSubscription,\n\t\tidCompressor: IIdCompressor,\n\t\tshouldEncodeIncrementally: IncrementalEncodingPolicy,\n\t) =>\n\t\tbuildChunkedForest(\n\t\t\tmakeTreeChunker(schema, defaultSchemaPolicy, shouldEncodeIncrementally),\n\t\t\tundefined,\n\t\t\tidCompressor,\n\t\t),\n);\n\n/**\n * Slow implementation of forest intended only for debugging.\n * @remarks\n * Includes validation with scales poorly.\n * May be asymptotically slower than {@link ForestTypeReference}, and may perform very badly with larger data sizes.\n * @privateRemarks\n * The \"ObjectForest\" forest type with expensive asserts for debugging.\n * @beta\n */\nexport const ForestTypeExpensiveDebug = toForestType(\n\t(breaker: Breakable, schema: TreeStoredSchemaSubscription) =>\n\t\tbuildForest(breaker, schema, undefined, true),\n);\n\ntype ForestFactory = (\n\tbreaker: Breakable,\n\tschema: TreeStoredSchemaSubscription,\n\tidCompressor: IIdCompressor,\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy,\n) => IEditableForest;\n\nfunction toForestType(factory: ForestFactory): ForestType {\n\treturn factory as unknown as ForestType;\n}\n\n/**\n * Build and return a forest of the requested type.\n */\nexport function buildConfiguredForest(\n\tbreaker: Breakable,\n\tfactory: ForestType,\n\tschema: TreeStoredSchemaSubscription,\n\tidCompressor: IIdCompressor,\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy,\n): IEditableForest {\n\treturn (factory as unknown as ForestFactory)(\n\t\tbreaker,\n\t\tschema,\n\t\tidCompressor,\n\t\tshouldEncodeIncrementally,\n\t);\n}\n\nexport const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal> = {\n\tjsonValidator: FormatValidatorNoOp,\n\tminVersionForCollab: FluidClientVersion.v2_0,\n\tforest: ForestTypeReference,\n\ttreeEncodeType: TreeCompressionStrategy.Compressed,\n\tformatVersion: SharedTreeFormatVersion.v3,\n\tdisposeForksAfterTransaction: true,\n\tshouldEncodeIncrementally: defaultIncrementalEncodingPolicy,\n};\n\n/**\n * Build the allowed types for a Stored Schema.\n *\n * @remarks Staged upgrades do not apply to stored schemas, so we omit the {@link SimpleAllowedTypeAttributes.isStaged | staging flag } when building {@link SimpleAllowedTypeAttributes}.\n * @param types - The types to create allowed types for.\n * @returns The allowed types.\n */\nfunction buildSimpleAllowedTypeAttributesForStoredSchema(\n\ttypes: TreeTypeSet,\n): ReadonlyMap<string, SimpleAllowedTypeAttributes> {\n\tconst allowedTypesInfo = new Map<string, SimpleAllowedTypeAttributes>();\n\tfor (const type of types) {\n\t\t// Stored schemas do not have staged upgrades\n\t\tallowedTypesInfo.set(type, { isStaged: undefined });\n\t}\n\treturn allowedTypesInfo;\n}\n\nfunction exportSimpleFieldSchemaStored(schema: TreeFieldStoredSchema): SimpleFieldSchema {\n\tlet kind: FieldKind;\n\tswitch (schema.kind) {\n\t\tcase FieldKinds.identifier.identifier:\n\t\t\tkind = FieldKind.Identifier;\n\t\t\tbreak;\n\t\tcase FieldKinds.optional.identifier:\n\t\t\tkind = FieldKind.Optional;\n\t\t\tbreak;\n\t\tcase FieldKinds.required.identifier:\n\t\t\tkind = FieldKind.Required;\n\t\t\tbreak;\n\t\tcase FieldKinds.forbidden.identifier:\n\t\t\tkind = FieldKind.Optional;\n\t\t\tassert(schema.types.size === 0, 0xa94 /* invalid forbidden field */);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfail(0xaca /* invalid field kind */);\n\t}\n\treturn {\n\t\tkind,\n\t\tsimpleAllowedTypes: buildSimpleAllowedTypeAttributesForStoredSchema(schema.types),\n\t\tmetadata: {},\n\t\tpersistedMetadata: schema.persistedMetadata,\n\t};\n}\n\n/**\n * Export a {@link SimpleNodeSchema} from a {@link TreeNodeStoredSchema}.\n * @privateRemarks\n * TODO: Persist node metadata once schema FormatV2 is supported.\n */\nfunction exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeSchema {\n\tconst arrayTypes = tryStoredSchemaAsArray(schema);\n\tif (arrayTypes !== undefined) {\n\t\treturn {\n\t\t\tkind: NodeKind.Array,\n\t\t\tsimpleAllowedTypes: buildSimpleAllowedTypeAttributesForStoredSchema(arrayTypes),\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\tconst fields = new Map<FieldKey, SimpleObjectFieldSchema>();\n\t\tfor (const [storedKey, field] of schema.objectNodeFields) {\n\t\t\tfields.set(storedKey, { ...exportSimpleFieldSchemaStored(field), storedKey });\n\t\t}\n\t\treturn { kind: NodeKind.Object, fields, metadata: {}, persistedMetadata: schema.metadata };\n\t}\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tassert(\n\t\t\tschema.mapFields.kind === FieldKinds.optional.identifier,\n\t\t\t0xa95 /* Invalid map schema */,\n\t\t);\n\t\treturn {\n\t\t\tkind: NodeKind.Map,\n\t\t\tsimpleAllowedTypes: buildSimpleAllowedTypeAttributesForStoredSchema(\n\t\t\t\tschema.mapFields.types,\n\t\t\t),\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\treturn {\n\t\t\tkind: NodeKind.Leaf,\n\t\t\tleafKind: schema.leafValue,\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tfail(0xacb /* invalid schema kind */);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sharedTree.js","sourceRo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K,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC1D,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,GAAG,6BAA6B,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO;YACN,IAAI,EAAE,mBAAQ,CAAC,MAAM;YACrB,MAAM;YACN,0BAA0B,EAAE,SAAS;YACrC,QAAQ,EAAE,EAAE;YACZ,iBAAiB,EAAE,MAAM,CAAC,QAAQ;SAClC,CAAC;IACH,CAAC;IACD,IAAI,MAAM,YAAY,8BAAmB,EAAE,CAAC;QAC3C,IAAA,iBAAM,EACL,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK,qBAAU,CAAC,QAAQ,CAAC,UAAU,EACxD,KAAK,CAAC,wBAAwB,CAC9B,CAAC;QACF,OAAO;YACN,IAAI,EAAE,mBAAQ,CAAC,GAAG;YAClB,kBAAkB,EAAE,+CAA+C,CAClE,MAAM,CAAC,SAAS,CAAC,KAAK,CACtB;YACD,QAAQ,EAAE,EAAE;YACZ,iBAAiB,EAAE,MAAM,CAAC,QAAQ;SAClC,CAAC;IACH,CAAC;IACD,IAAI,MAAM,YAAY,+BAAoB,EAAE,CAAC;QAC5C,OAAO;YACN,IAAI,EAAE,mBAAQ,CAAC,IAAI;YACnB,QAAQ,EAAE,MAAM,CAAC,SAAS;YAC1B,QAAQ,EAAE,EAAE;YACZ,iBAAiB,EAAE,MAAM,CAAC,QAAQ;SAClC,CAAC;IACH,CAAC;IACD,IAAA,eAAI,EAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ErasedType, IFluidLoadable } from \"@fluidframework/core-interfaces/internal\";\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IIdCompressor, StableId } from \"@fluidframework/id-compressor\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport type {\n\tIChannelView,\n\tIFluidSerializer,\n\tSharedKernel,\n} from \"@fluidframework/shared-object-base/internal\";\nimport {\n\tUsageError,\n\ttype ITelemetryLoggerExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tDependentFormatVersion,\n\tFluidClientVersion,\n\tFormatValidatorNoOp,\n\ttype ICodecOptions,\n} from \"../codec/index.js\";\nimport {\n\ttype FieldKey,\n\ttype GraphCommit,\n\ttype IEditableForest,\n\ttype JsonableTree,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\tRevisionTagCodec,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\tTreeStoredSchemaRepository,\n\ttype TreeStoredSchemaSubscription,\n\ttype TreeTypeSet,\n\tgetCodecTreeForDetachedFieldIndexFormat,\n\tmakeDetachedFieldIndex,\n\tmoveToDetachedField,\n} from \"../core/index.js\";\nimport {\n\tDetachedFieldIndexSummarizer,\n\tFieldKinds,\n\tForestSummarizer,\n\tSchemaSummarizer,\n\tTreeCompressionStrategy,\n\tbuildChunkedForest,\n\tbuildForest,\n\tdefaultIncrementalEncodingPolicy,\n\tdefaultSchemaPolicy,\n\tgetCodecTreeForFieldBatchFormat,\n\tgetCodecTreeForForestFormat,\n\tgetCodecTreeForSchemaFormat,\n\tjsonableTreeFromFieldCursor,\n\tmakeFieldBatchCodec,\n\tmakeMitigatedChangeFamily,\n\tmakeSchemaCodec,\n\tmakeTreeChunker,\n\ttype IncrementalEncodingPolicy,\n\ttype TreeCompressionStrategyPrivate,\n} from \"../feature-libraries/index.js\";\n// eslint-disable-next-line import-x/no-internal-modules\nimport type { FormatV1 } from \"../feature-libraries/schema-index/index.js\";\nimport {\n\ttype BranchId,\n\tclientVersionToEditManagerFormatVersion,\n\tclientVersionToMessageFormatVersion,\n\ttype ClonableSchemaAndPolicy,\n\tgetCodecTreeForEditManagerFormatWithChange,\n\tgetCodecTreeForMessageFormatWithChange,\n\ttype SharedTreCoreOptionsInternal,\n\tMessageFormatVersion,\n\tSharedTreeCore,\n\tEditManagerFormatVersion,\n} from \"../shared-tree-core/index.js\";\nimport {\n\ttype ITree,\n\ttype ImplicitFieldSchema,\n\tNodeKind,\n\ttype ReadSchema,\n\ttype SimpleFieldSchema,\n\ttype SimpleTreeSchema,\n\ttype TreeView,\n\ttype TreeViewAlpha,\n\ttype TreeViewConfiguration,\n\ttype UnsafeUnknownSchema,\n\ttype VerboseTree,\n\ttryStoredSchemaAsArray,\n\ttype SimpleNodeSchema,\n\tFieldKind,\n\ttype ITreeAlpha,\n\ttype SimpleObjectFieldSchema,\n\ttype SimpleAllowedTypeAttributes,\n} from \"../simple-tree/index.js\";\n\nimport { SchematizingSimpleTreeView } from \"./schematizingTreeView.js\";\nimport { SharedTreeReadonlyChangeEnricher } from \"./sharedTreeChangeEnricher.js\";\nimport { SharedTreeChangeFamily } from \"./sharedTreeChangeFamily.js\";\nimport type { SharedTreeChange } from \"./sharedTreeChangeTypes.js\";\nimport type { SharedTreeEditBuilder } from \"./sharedTreeEditBuilder.js\";\nimport { type TreeCheckout, type BranchableTree, createTreeCheckout } from \"./treeCheckout.js\";\nimport {\n\tbrand,\n\ttype Breakable,\n\tbreakingClass,\n\ttype JsonCompatible,\n\tthrowIfBroken,\n} from \"../util/index.js\";\nimport {\n\tgetCodecTreeForChangeFormat,\n\ttype SharedTreeChangeFormatVersion,\n} from \"./sharedTreeChangeCodecs.js\";\n\n/**\n * Copy of data from an {@link ITreePrivate} at some point in time.\n * @remarks\n * This is unrelated to Fluids concept of \"snapshots\".\n */\nexport interface SharedTreeContentSnapshot {\n\t/**\n\t * The schema stored in the document.\n\t *\n\t * @remarks\n\t * Edits to the schema can mutate the schema stored of the tree which took this snapshot (but this snapshot will remain the same)\n\t * This is mainly useful for debugging cases where schematize reports an incompatible view schema.\n\t */\n\treadonly schema: TreeStoredSchema;\n\t/**\n\t * All {@link TreeStatus.InDocument} content.\n\t */\n\treadonly tree: JsonableTree[];\n\t/**\n\t * All {@link TreeStatus.Removed} content.\n\t */\n\treadonly removed: [string | number | undefined, number, JsonableTree][];\n}\n\n/**\n * {@link ITree} extended with some non-public APIs.\n * @internal\n */\nexport interface ITreeInternal extends IChannelView, ITreeAlpha {}\n\n/**\n * {@link ITreeInternal} extended with some non-exported APIs.\n * @remarks\n * This allows access to the tree content using the internal data model used at the storage and \"flex\" layers,\n * and should only be needed for testing and debugging this package's internals.\n */\nexport interface ITreePrivate extends ITreeInternal {\n\t/**\n\t * Provides a copy of the current content of the tree.\n\t * This can be useful for inspecting the tree when no suitable view schema is available.\n\t * This is only intended for use in testing and exceptional code paths: it is not performant.\n\t *\n\t * This does not include everything that is included in a tree summary, since information about how to merge future edits is omitted.\n\t */\n\tcontentSnapshot(): SharedTreeContentSnapshot;\n\n\t/**\n\t * Access to internals for testing.\n\t */\n\treadonly kernel: SharedTreeKernel;\n}\n\n/**\n * The type SharedTree's kernel's view must implement so what when its merged with the underling SharedObject's API it fully implements the required tree API surface ({@link ITreePrivate }).\n */\nexport type SharedTreeKernelView = Omit<ITreePrivate, keyof (IChannelView & IFluidLoadable)>;\n\n/**\n * SharedTreeCore, configured with a good set of indexes and field kinds which will maintain compatibility over time.\n *\n * TODO: detail compatibility requirements.\n */\n@breakingClass\nexport class SharedTreeKernel\n\textends SharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>\n\timplements SharedKernel\n{\n\tpublic readonly checkout: TreeCheckout;\n\tpublic get storedSchema(): TreeStoredSchemaRepository {\n\t\treturn this.checkout.storedSchema;\n\t}\n\n\tprivate readonly checkouts: Map<BranchId, TreeCheckout> = new Map();\n\n\t/**\n\t * The app-facing API for SharedTree implemented by this Kernel.\n\t * @remarks\n\t * This is the API grafted onto the ISharedObject which apps can access.\n\t * It includes both the APIs used for internal testing, and public facing APIs (both stable and unstable).\n\t * Different users will have access to different subsets of this API, see {@link ITree}, {@link ITreeAlpha} and {@link ITreeInternal} which this {@link ITreePrivate} extends.\n\t */\n\tpublic readonly view: SharedTreeKernelView;\n\n\tpublic constructor(\n\t\tbreaker: Breakable,\n\t\tsharedObject: IChannelView & IFluidLoadable,\n\t\tserializer: IFluidSerializer,\n\t\tsubmitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void,\n\t\tlastSequenceNumber: () => number | undefined,\n\t\tinitialSequenceNumber: number,\n\t\tprivate readonly logger: ITelemetryLoggerExt | undefined,\n\t\tidCompressor: IIdCompressor,\n\t\toptionsParam: SharedTreeOptionsInternal,\n\t) {\n\t\tconst options: Required<SharedTreeOptionsInternal> = {\n\t\t\t...defaultSharedTreeOptions,\n\t\t\t...optionsParam,\n\t\t};\n\t\tif (options.minVersionForCollab < FluidClientVersion.v2_0) {\n\t\t\tthrow new UsageError(\"SharedTree requires minVersionForCollab of at least 2.0.0\");\n\t\t}\n\t\tconst schema = new TreeStoredSchemaRepository();\n\t\tconst forest = buildConfiguredForest(\n\t\t\tbreaker,\n\t\t\toptions.forest,\n\t\t\tschema,\n\t\t\tidCompressor,\n\t\t\toptions.shouldEncodeIncrementally,\n\t\t);\n\t\tconst revisionTagCodec = new RevisionTagCodec(idCompressor);\n\t\tconst removedRoots = makeDetachedFieldIndex(\n\t\t\t\"repair\",\n\t\t\trevisionTagCodec,\n\t\t\tidCompressor,\n\t\t\toptions,\n\t\t);\n\t\tconst schemaCodec = makeSchemaCodec(options);\n\t\tconst schemaSummarizer = new SchemaSummarizer(\n\t\t\tschema,\n\t\t\t{\n\t\t\t\tgetCurrentSeq: lastSequenceNumber,\n\t\t\t},\n\t\t\tschemaCodec,\n\t\t);\n\t\tconst fieldBatchCodec = makeFieldBatchCodec(options);\n\n\t\tconst encoderContext = {\n\t\t\tschema: {\n\t\t\t\tschema,\n\t\t\t\tpolicy: defaultSchemaPolicy,\n\t\t\t},\n\t\t\tencodeType: options.treeEncodeType,\n\t\t\toriginatorId: idCompressor.localSessionId,\n\t\t\tidCompressor,\n\t\t};\n\t\tconst forestSummarizer = new ForestSummarizer(\n\t\t\tforest,\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\tencoderContext,\n\t\t\toptions,\n\t\t\tidCompressor,\n\t\t\tinitialSequenceNumber,\n\t\t\toptions.shouldEncodeIncrementally,\n\t\t);\n\t\tconst removedRootsSummarizer = new DetachedFieldIndexSummarizer(removedRoots);\n\t\tconst innerChangeFamily = new SharedTreeChangeFamily(\n\t\t\trevisionTagCodec,\n\t\t\tfieldBatchCodec,\n\t\t\toptions,\n\t\t\toptions.treeEncodeType,\n\t\t\tidCompressor,\n\t\t);\n\t\tconst changeFamily = makeMitigatedChangeFamily(\n\t\t\tinnerChangeFamily,\n\t\t\tSharedTreeChangeFamily.emptyChange,\n\t\t\t(error: unknown) => {\n\t\t\t\t// TODO:6344 Add telemetry for these errors.\n\t\t\t\t// Rethrowing the error has a different effect depending on the context in which the\n\t\t\t\t// ChangeFamily was invoked:\n\t\t\t\t// - If the ChangeFamily was invoked as part of incoming op processing, rethrowing the error\n\t\t\t\t// will cause the runtime to disconnect the client, log a severe error, and not reconnect.\n\t\t\t\t// This will not cause the host application to crash because it is not on the stack at that time.\n\t\t\t\t// TODO: let the host application know that the client is now disconnected.\n\t\t\t\t// - If the ChangeFamily was invoked as part of dealing with a local change, rethrowing the\n\t\t\t\t// error will cause the host application to crash. This is not ideal, but is better than\n\t\t\t\t// letting the application either send an invalid change to the server or allowing the\n\t\t\t\t// application to continue working when its local branches contain edits that cannot be\n\t\t\t\t// reflected in its views.\n\t\t\t\t// The best course of action for a host application in such a state is to restart.\n\t\t\t\t// TODO: let the host application know about this situation and provide a way to\n\t\t\t\t// programmatically reload the SharedTree container.\n\t\t\t\tthrow error;\n\t\t\t},\n\t\t);\n\t\tconst changeEnricher = new SharedTreeReadonlyChangeEnricher(forest, schema, removedRoots);\n\t\tsuper(\n\t\t\tbreaker,\n\t\t\tsharedObject,\n\t\t\tserializer,\n\t\t\tsubmitLocalMessage,\n\t\t\tlogger,\n\t\t\t[schemaSummarizer, forestSummarizer, removedRootsSummarizer],\n\t\t\tchangeFamily,\n\t\t\toptions,\n\t\t\tchangeFormatVersionForEditManager,\n\t\t\tchangeFormatVersionForMessage,\n\t\t\tidCompressor,\n\t\t\tschema,\n\t\t\tdefaultSchemaPolicy,\n\t\t\tundefined,\n\t\t\tchangeEnricher,\n\t\t);\n\n\t\tthis.checkout = createTreeCheckout(idCompressor, this.mintRevisionTag, revisionTagCodec, {\n\t\t\tbranch: this.getLocalBranch(),\n\t\t\tchangeFamily,\n\t\t\tschema,\n\t\t\tforest,\n\t\t\tfieldBatchCodec,\n\t\t\tremovedRoots,\n\t\t\tchunkCompressionStrategy: options.treeEncodeType,\n\t\t\tlogger,\n\t\t\tbreaker: this.breaker,\n\t\t\tdisposeForksAfterTransaction: options.disposeForksAfterTransaction,\n\t\t});\n\n\t\tthis.registerCheckout(\"main\", this.checkout);\n\n\t\tthis.view = {\n\t\t\tcontentSnapshot: () => this.contentSnapshot(),\n\t\t\texportSimpleSchema: () => this.exportSimpleSchema(),\n\t\t\texportVerbose: () => this.exportVerbose(),\n\t\t\tviewWith: this.viewWith.bind(this),\n\t\t\tviewSharedBranchWith: this.viewBranchWith.bind(this),\n\t\t\tcreateSharedBranch: this.createSharedBranch.bind(this),\n\t\t\tgetSharedBranchIds: this.getSharedBranchIds.bind(this),\n\t\t\tkernel: this,\n\t\t};\n\t}\n\n\tprivate registerCheckout(branchId: BranchId, checkout: TreeCheckout): void {\n\t\tthis.checkouts.set(branchId, checkout);\n\t\tconst enricher = this.getCommitEnricher(branchId);\n\t\tcheckout.transaction.events.on(\"started\", () => {\n\t\t\tif (this.sharedObject.isAttached()) {\n\t\t\t\t// It is currently forbidden to attach during a transaction, so transaction state changes can be ignored until after attaching.\n\t\t\t\tenricher.startTransaction();\n\t\t\t}\n\t\t});\n\n\t\tcheckout.transaction.events.on(\"aborting\", () => {\n\t\t\tif (this.sharedObject.isAttached()) {\n\t\t\t\t// It is currently forbidden to attach during a transaction, so transaction state changes can be ignored until after attaching.\n\t\t\t\tenricher.abortTransaction();\n\t\t\t}\n\t\t});\n\t\tcheckout.transaction.events.on(\"committing\", () => {\n\t\t\tif (this.sharedObject.isAttached()) {\n\t\t\t\t// It is currently forbidden to attach during a transaction, so transaction state changes can be ignored until after attaching.\n\t\t\t\tenricher.commitTransaction();\n\t\t\t}\n\t\t});\n\t\tcheckout.events.on(\"beforeBatch\", (event) => {\n\t\t\tif (event.type === \"append\" && this.sharedObject.isAttached()) {\n\t\t\t\tif (checkout.transaction.isInProgress()) {\n\t\t\t\t\tenricher.addTransactionCommits(event.newCommits);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tpublic exportVerbose(): VerboseTree | undefined {\n\t\treturn this.checkout.exportVerbose();\n\t}\n\n\tpublic exportSimpleSchema(): SimpleTreeSchema {\n\t\treturn exportSimpleSchema(this.storedSchema);\n\t}\n\n\t@throwIfBroken\n\tpublic contentSnapshot(): SharedTreeContentSnapshot {\n\t\tconst cursor = this.checkout.forest.allocateCursor(\"contentSnapshot\");\n\t\ttry {\n\t\t\tmoveToDetachedField(this.checkout.forest, cursor);\n\t\t\treturn {\n\t\t\t\tschema: this.storedSchema.clone(),\n\t\t\t\ttree: jsonableTreeFromFieldCursor(cursor),\n\t\t\t\tremoved: this.checkout.getRemovedRoots(),\n\t\t\t};\n\t\t} finally {\n\t\t\tcursor.free();\n\t\t}\n\t}\n\n\t// For the new TreeViewAlpha API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;\n\n\t// For the old TreeView API\n\tpublic viewWith<TRoot extends ImplicitFieldSchema>(\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<TRoot>;\n\n\tpublic viewWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>> {\n\t\treturn this.checkout.viewWith(config) as SchematizingSimpleTreeView<TRoot> &\n\t\t\tTreeView<ReadSchema<TRoot>>;\n\t}\n\n\tpublic viewBranchWith<TRoot extends ImplicitFieldSchema>(\n\t\tbranchId: string,\n\t\tconfig: TreeViewConfiguration<TRoot>,\n\t): TreeView<TRoot>;\n\n\tpublic viewBranchWith<TRoot extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\t\tbranchId: string,\n\t\tconfig: TreeViewConfiguration<ReadSchema<TRoot>>,\n\t): SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>> {\n\t\tconst compressedId = this.idCompressor.tryRecompress(branchId as StableId);\n\t\tif (compressedId === undefined) {\n\t\t\tthrow new UsageError(`No branch found with id: ${branchId}`);\n\t\t}\n\t\treturn this.getCheckout(compressedId).viewWith(\n\t\t\tconfig,\n\t\t) as SchematizingSimpleTreeView<TRoot> & TreeView<ReadSchema<TRoot>>;\n\t}\n\n\tprivate getCheckout(branchId: BranchId): TreeCheckout {\n\t\treturn this.checkouts.get(branchId) ?? this.checkoutBranch(branchId);\n\t}\n\n\tprivate checkoutBranch(branchId: BranchId): TreeCheckout {\n\t\tconst checkout = this.checkout.branch();\n\t\tcheckout.switchBranch(this.getSharedBranch(branchId));\n\t\tconst enricher = new SharedTreeReadonlyChangeEnricher(\n\t\t\tcheckout.forest,\n\t\t\tcheckout.storedSchema,\n\t\t\tcheckout.removedRoots,\n\t\t);\n\n\t\tthis.registerSharedBranchForEditing(branchId, enricher);\n\t\tthis.registerCheckout(branchId, checkout);\n\t\treturn checkout;\n\t}\n\n\tpublic override async loadCore(services: IChannelStorageService): Promise<void> {\n\t\tawait super.loadCore(services);\n\t\tthis.checkout.load();\n\t}\n\n\tpublic override didAttach(): void {\n\t\tfor (const checkout of this.checkouts.values()) {\n\t\t\tif (checkout.transaction.isInProgress()) {\n\t\t\t\t// Attaching during a transaction is not currently supported.\n\t\t\t\t// At least part of of the system is known to not handle this case correctly - commit enrichment - and there may be others.\n\t\t\t\tthrow new UsageError(\n\t\t\t\t\t\"Cannot attach while a transaction is in progress. Commit or abort the transaction before attaching.\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tsuper.didAttach();\n\t}\n\n\tpublic override applyStashedOp(\n\t\t...args: Parameters<\n\t\t\tSharedTreeCore<SharedTreeEditBuilder, SharedTreeChange>[\"applyStashedOp\"]\n\t\t>\n\t): void {\n\t\tfor (const checkout of this.checkouts.values()) {\n\t\t\tassert(\n\t\t\t\t!checkout.transaction.isInProgress(),\n\t\t\t\t0x674 /* Unexpected transaction is open while applying stashed ops */,\n\t\t\t);\n\t\t}\n\t\tsuper.applyStashedOp(...args);\n\t}\n\n\tprotected override submitCommit(\n\t\tbranchId: BranchId,\n\t\tcommit: GraphCommit<SharedTreeChange>,\n\t\tschemaAndPolicy: ClonableSchemaAndPolicy,\n\t\tisResubmit: boolean,\n\t): void {\n\t\tconst checkout = this.getCheckout(branchId);\n\t\tassert(\n\t\t\t!checkout.transaction.isInProgress(),\n\t\t\t0xaa6 /* Cannot submit a commit while a transaction is in progress */,\n\t\t);\n\t\tif (isResubmit) {\n\t\t\treturn super.submitCommit(branchId, commit, schemaAndPolicy, isResubmit);\n\t\t}\n\n\t\t// Refrain from submitting new commits until they are validated by the checkout.\n\t\t// This is not a strict requirement for correctness in our system, but in the event that there is a bug when applying commits to the checkout\n\t\t// that causes a crash (e.g. in the forest), this will at least prevent this client from sending the problematic commit to any other clients.\n\t\tcheckout.onCommitValid(commit, () =>\n\t\t\tsuper.submitCommit(branchId, commit, schemaAndPolicy, isResubmit),\n\t\t);\n\t}\n\n\tpublic onDisconnect(): void {}\n}\n\nexport function exportSimpleSchema(storedSchema: TreeStoredSchema): SimpleTreeSchema {\n\treturn {\n\t\troot: exportSimpleFieldSchemaStored(storedSchema.rootFieldSchema),\n\t\tdefinitions: new Map(\n\t\t\t[...storedSchema.nodeSchema].map(([key, schema]) => {\n\t\t\t\treturn [key, exportSimpleNodeSchemaStored(schema)];\n\t\t\t}),\n\t\t),\n\t};\n}\n\n/**\n * A way to parse schema in the persisted format from {@link extractPersistedSchema}.\n * @remarks\n * This behaves identically to {@link ITreeAlpha.exportSimpleSchema},\n * except that it gets the schema from the caller instead of from an existing tree.\n *\n * This can be useful for inspecting the contents of persisted schema,\n * such as those generated by {@link extractPersistedSchema} for use in testing.\n * Since that data format is otherwise unspecified,\n * this provides a way to inspect its contents with documented semantics.\n * @alpha\n */\nexport function persistedToSimpleSchema(\n\tpersisted: JsonCompatible,\n\toptions: ICodecOptions,\n): SimpleTreeSchema {\n\t// Any version can be passed down to makeSchemaCodec here.\n\t// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not the version passed to `makeSchemaCodec`.\n\tconst schemaCodec = makeSchemaCodec({\n\t\t...options,\n\t\tminVersionForCollab: FluidClientVersion.v2_0,\n\t});\n\tconst stored = schemaCodec.decode(persisted as FormatV1);\n\treturn exportSimpleSchema(stored);\n}\n\n/**\n * Get a {@link BranchableTree} from a {@link ITree}.\n * @remarks The branch can be used for \"version control\"-style coordination of edits on the tree.\n * @privateRemarks This function will be removed if/when the branching API becomes public,\n * but it (or something like it) is necessary in the meantime to prevent the alpha types from being exposed as public.\n * @alpha\n * @deprecated This API is superseded by {@link TreeBranch}, which should be used instead.\n */\nexport function getBranch(tree: ITree): BranchableTree;\n/**\n * Get a {@link BranchableTree} from a {@link TreeView}.\n * @remarks The branch can be used for \"version control\"-style coordination of edits on the tree.\n * Branches are currently an unstable \"alpha\" API and are subject to change in the future.\n * @privateRemarks This function will be removed if/when the branching API becomes public,\n * but it (or something like it) is necessary in the meantime to prevent the alpha types from being exposed as public.\n * @alpha\n * @deprecated This API is superseded by {@link TreeBranch}, which should be used instead.\n */\nexport function getBranch<T extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\tview: TreeViewAlpha<T>,\n): BranchableTree;\nexport function getBranch<T extends ImplicitFieldSchema | UnsafeUnknownSchema>(\n\ttreeOrView: ITree | TreeViewAlpha<T>,\n): BranchableTree {\n\tif (treeOrView instanceof SchematizingSimpleTreeView) {\n\t\treturn treeOrView.checkout as unknown as BranchableTree;\n\t}\n\tconst kernel = (treeOrView as ITree as ITreePrivate).kernel;\n\tassert(kernel instanceof SharedTreeKernel, 0xb56 /* Invalid ITree */);\n\t// This cast is safe so long as TreeCheckout supports all the operations on the branch interface.\n\treturn kernel.checkout as unknown as BranchableTree;\n}\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @alpha\n */\nexport const SharedTreeFormatVersion = {\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t *\n\t * @deprecated FF does not currently plan on supporting this format long-term.\n\t * Do not write production documents using this format, as they may not be loadable in the future.\n\t */\n\tv1: 1,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv2: 2,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv3: 3,\n\n\t/**\n\t * Requires \\@fluidframework/tree \\>= 2.0.0.\n\t */\n\tv5: 5,\n\n\t/**\n\t * For testing purposes only.\n\t */\n\tvSharedBranches: 100,\n} as const;\n\n/**\n * Format versions supported by SharedTree.\n *\n * Each version documents a required minimum version of the \\@fluidframework/tree package.\n * @alpha\n * @privateRemarks\n * See packages/dds/tree/docs/main/compatibility.md for information on how to add support for a new format.\n *\n * TODO: Before this gets promoted past Alpha,\n * a separate abstraction more suited for use in the public API should be adopted rather than reusing the same types used internally.\n * Such an abstraction should probably be in the form of a Fluid-Framework wide compatibility enum.\n */\nexport type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;\n\n/**\n * Defines for each EditManagerFormatVersion the SharedTreeChangeFormatVersion to use.\n * This is an arbitrary mapping that is injected in the EditManger codec.\n * Once an entry is defined and used in production, it cannot be changed.\n * This is because the format for SharedTree changes are not explicitly versioned.\n */\nexport const changeFormatVersionForEditManager = DependentFormatVersion.fromPairs([\n\t[\n\t\tbrand<EditManagerFormatVersion>(EditManagerFormatVersion.v1),\n\t\tbrand<SharedTreeChangeFormatVersion>(1),\n\t],\n\t[\n\t\tbrand<EditManagerFormatVersion>(EditManagerFormatVersion.v2),\n\t\tbrand<SharedTreeChangeFormatVersion>(2),\n\t],\n\t[\n\t\tbrand<EditManagerFormatVersion>(EditManagerFormatVersion.v3),\n\t\tbrand<SharedTreeChangeFormatVersion>(3),\n\t],\n\t[\n\t\tbrand<EditManagerFormatVersion>(EditManagerFormatVersion.v4),\n\t\tbrand<SharedTreeChangeFormatVersion>(4),\n\t],\n\t[\n\t\tbrand<EditManagerFormatVersion>(EditManagerFormatVersion.v5),\n\t\tbrand<SharedTreeChangeFormatVersion>(4),\n\t],\n]);\n\n/**\n * Defines for each MessageFormatVersion the SharedTreeChangeFormatVersion to use.\n * This is an arbitrary mapping that is injected in the message codec.\n * Once an entry is defined and used in production, it cannot be changed.\n * This is because the format for SharedTree changes are not explicitly versioned.\n */\nexport const changeFormatVersionForMessage = DependentFormatVersion.fromPairs([\n\t[\n\t\tbrand<MessageFormatVersion>(MessageFormatVersion.undefined),\n\t\tbrand<SharedTreeChangeFormatVersion>(1),\n\t],\n\t[\n\t\tbrand<MessageFormatVersion>(MessageFormatVersion.v1),\n\t\tbrand<SharedTreeChangeFormatVersion>(1),\n\t],\n\t[\n\t\tbrand<MessageFormatVersion>(MessageFormatVersion.v2),\n\t\tbrand<SharedTreeChangeFormatVersion>(2),\n\t],\n\t[\n\t\tbrand<MessageFormatVersion>(MessageFormatVersion.v3),\n\t\tbrand<SharedTreeChangeFormatVersion>(3),\n\t],\n\t[\n\t\tbrand<MessageFormatVersion>(MessageFormatVersion.v4),\n\t\tbrand<SharedTreeChangeFormatVersion>(4),\n\t],\n\t[\n\t\tbrand<MessageFormatVersion>(MessageFormatVersion.v5),\n\t\tbrand<SharedTreeChangeFormatVersion>(4),\n\t],\n]);\n\nfunction getCodecTreeForEditManagerFormat(clientVersion: MinimumVersionForCollab): CodecTree {\n\tconst change = changeFormatVersionForEditManager.lookup(\n\t\tclientVersionToEditManagerFormatVersion(clientVersion),\n\t);\n\tconst changeCodecTree = getCodecTreeForChangeFormat(change, clientVersion);\n\treturn getCodecTreeForEditManagerFormatWithChange(clientVersion, changeCodecTree);\n}\n\nfunction getCodecTreeForMessageFormat(clientVersion: MinimumVersionForCollab): CodecTree {\n\tconst change = changeFormatVersionForMessage.lookup(\n\t\tclientVersionToMessageFormatVersion(clientVersion),\n\t);\n\tconst changeCodecTree = getCodecTreeForChangeFormat(change, clientVersion);\n\treturn getCodecTreeForMessageFormatWithChange(clientVersion, changeCodecTree);\n}\n\nexport function getCodecTreeForSharedTreeFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\tconst children: CodecTree[] = [];\n\tchildren.push(getCodecTreeForForestFormat(clientVersion));\n\tchildren.push(getCodecTreeForSchemaFormat(clientVersion));\n\tchildren.push(getCodecTreeForDetachedFieldIndexFormat(clientVersion));\n\tchildren.push(getCodecTreeForEditManagerFormat(clientVersion));\n\tchildren.push(getCodecTreeForMessageFormat(clientVersion));\n\tchildren.push(getCodecTreeForFieldBatchFormat(clientVersion));\n\treturn {\n\t\tname: \"SharedTree\",\n\t\tversion: undefined, // SharedTree does not have a version of its own.\n\t\tchildren,\n\t};\n}\n\n/**\n * Configuration options for SharedTree.\n * @beta @input\n */\nexport type SharedTreeOptionsBeta = ForestOptions;\n\n/**\n * Configuration options for SharedTree.\n * @alpha @input\n */\nexport interface SharedTreeOptions\n\textends Partial<CodecWriteOptions>,\n\t\tPartial<SharedTreeFormatOptions>,\n\t\tSharedTreeOptionsBeta {\n\t/**\n\t * Experimental feature flag to enable shared branches.\n\t * This feature is not yet complete and should not be used in production.\n\t * Defaults to false.\n\t */\n\treadonly enableSharedBranches?: boolean;\n}\n\nexport interface SharedTreeOptionsInternal\n\textends Partial<SharedTreCoreOptionsInternal>,\n\t\tPartial<ForestOptions>,\n\t\tPartial<SharedTreeFormatOptionsInternal> {\n\tdisposeForksAfterTransaction?: boolean;\n\t/**\n\t * Returns whether a node / field should be incrementally encoded.\n\t * @remarks\n\t * See {@link IncrementalEncodingPolicy}.\n\t */\n\tshouldEncodeIncrementally?: IncrementalEncodingPolicy;\n}\n\n/**\n * Configuration options for SharedTree's internal tree storage.\n * @beta @input\n */\nexport interface ForestOptions {\n\t/**\n\t * The {@link ForestType} indicating which forest type should be created for the SharedTree.\n\t */\n\treadonly forest?: ForestType;\n}\n\n/**\n * Options for configuring the persisted format SharedTree uses.\n * @alpha @input\n */\nexport interface SharedTreeFormatOptions {\n\t/**\n\t * See {@link TreeCompressionStrategy}.\n\t * default: TreeCompressionStrategy.Compressed\n\t */\n\ttreeEncodeType: TreeCompressionStrategy;\n}\n\nexport interface SharedTreeFormatOptionsInternal\n\textends Omit<SharedTreeFormatOptions, \"treeEncodeType\"> {\n\ttreeEncodeType: TreeCompressionStrategyPrivate;\n}\n\n/**\n * Used to distinguish between different forest types.\n * @remarks\n * The \"Forest\" is the internal data structure used to store all the trees (the main tree and any removed ones) for a given view or branch.\n * ForestTypes should all have the same behavior, but may differ in performance and debuggability.\n *\n * Current options are {@link ForestTypeReference}, {@link ForestTypeOptimized} and {@link ForestTypeExpensiveDebug}.\n * @privateRemarks\n * Implement using {@link toForestType}.\n * Consume using {@link buildConfiguredForest}.\n * @sealed @beta\n */\nexport interface ForestType extends ErasedType<\"ForestType\"> {}\n\n/**\n * Reference implementation of forest.\n * @remarks\n * A simple implementation with minimal complexity and moderate debuggability, validation and performance.\n * @privateRemarks\n * The \"ObjectForest\" forest type.\n * @beta\n */\nexport const ForestTypeReference = toForestType(\n\t(breaker: Breakable, schema: TreeStoredSchemaSubscription, idCompressor: IIdCompressor) =>\n\t\tbuildForest(breaker, schema),\n);\n\n/**\n * Optimized implementation of forest.\n * @remarks\n * A complex optimized forest implementation, which has minimal validation and debuggability to optimize for performance.\n * Uses an internal representation optimized for size designed to scale to larger datasets with reduced overhead.\n * @privateRemarks\n * The \"ChunkedForest\" forest type.\n * @beta\n */\nexport const ForestTypeOptimized = toForestType(\n\t(\n\t\tbreaker: Breakable,\n\t\tschema: TreeStoredSchemaSubscription,\n\t\tidCompressor: IIdCompressor,\n\t\tshouldEncodeIncrementally: IncrementalEncodingPolicy,\n\t) =>\n\t\tbuildChunkedForest(\n\t\t\tmakeTreeChunker(schema, defaultSchemaPolicy, shouldEncodeIncrementally),\n\t\t\tundefined,\n\t\t\tidCompressor,\n\t\t),\n);\n\n/**\n * Slow implementation of forest intended only for debugging.\n * @remarks\n * Includes validation with scales poorly.\n * May be asymptotically slower than {@link ForestTypeReference}, and may perform very badly with larger data sizes.\n * @privateRemarks\n * The \"ObjectForest\" forest type with expensive asserts for debugging.\n * @beta\n */\nexport const ForestTypeExpensiveDebug = toForestType(\n\t(breaker: Breakable, schema: TreeStoredSchemaSubscription) =>\n\t\tbuildForest(breaker, schema, undefined, true),\n);\n\ntype ForestFactory = (\n\tbreaker: Breakable,\n\tschema: TreeStoredSchemaSubscription,\n\tidCompressor: IIdCompressor,\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy,\n) => IEditableForest;\n\nfunction toForestType(factory: ForestFactory): ForestType {\n\treturn factory as unknown as ForestType;\n}\n\n/**\n * Build and return a forest of the requested type.\n */\nexport function buildConfiguredForest(\n\tbreaker: Breakable,\n\tfactory: ForestType,\n\tschema: TreeStoredSchemaSubscription,\n\tidCompressor: IIdCompressor,\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy,\n): IEditableForest {\n\treturn (factory as unknown as ForestFactory)(\n\t\tbreaker,\n\t\tschema,\n\t\tidCompressor,\n\t\tshouldEncodeIncrementally,\n\t);\n}\n\nexport const defaultSharedTreeOptions: Required<SharedTreeOptionsInternal> = {\n\tjsonValidator: FormatValidatorNoOp,\n\tminVersionForCollab: FluidClientVersion.v2_0,\n\tforest: ForestTypeReference,\n\ttreeEncodeType: TreeCompressionStrategy.Compressed,\n\tdisposeForksAfterTransaction: true,\n\tshouldEncodeIncrementally: defaultIncrementalEncodingPolicy,\n\teditManagerFormatSelector: clientVersionToEditManagerFormatVersion,\n\tmessageFormatSelector: clientVersionToMessageFormatVersion,\n};\n\n/**\n * Build the allowed types for a Stored Schema.\n *\n * @remarks Staged upgrades do not apply to stored schemas, so we omit the {@link SimpleAllowedTypeAttributes.isStaged | staging flag } when building {@link SimpleAllowedTypeAttributes}.\n * @param types - The types to create allowed types for.\n * @returns The allowed types.\n */\nfunction buildSimpleAllowedTypeAttributesForStoredSchema(\n\ttypes: TreeTypeSet,\n): ReadonlyMap<string, SimpleAllowedTypeAttributes> {\n\tconst allowedTypesInfo = new Map<string, SimpleAllowedTypeAttributes>();\n\tfor (const type of types) {\n\t\t// Stored schemas do not have staged upgrades\n\t\tallowedTypesInfo.set(type, { isStaged: undefined });\n\t}\n\treturn allowedTypesInfo;\n}\n\nfunction exportSimpleFieldSchemaStored(schema: TreeFieldStoredSchema): SimpleFieldSchema {\n\tlet kind: FieldKind;\n\tswitch (schema.kind) {\n\t\tcase FieldKinds.identifier.identifier:\n\t\t\tkind = FieldKind.Identifier;\n\t\t\tbreak;\n\t\tcase FieldKinds.optional.identifier:\n\t\t\tkind = FieldKind.Optional;\n\t\t\tbreak;\n\t\tcase FieldKinds.required.identifier:\n\t\t\tkind = FieldKind.Required;\n\t\t\tbreak;\n\t\tcase FieldKinds.forbidden.identifier:\n\t\t\tkind = FieldKind.Optional;\n\t\t\tassert(schema.types.size === 0, 0xa94 /* invalid forbidden field */);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tfail(0xaca /* invalid field kind */);\n\t}\n\treturn {\n\t\tkind,\n\t\tsimpleAllowedTypes: buildSimpleAllowedTypeAttributesForStoredSchema(schema.types),\n\t\tmetadata: {},\n\t\tpersistedMetadata: schema.persistedMetadata,\n\t};\n}\n\n/**\n * Export a {@link SimpleNodeSchema} from a {@link TreeNodeStoredSchema}.\n * @privateRemarks\n * TODO: Persist node metadata once schema FormatV2 is supported.\n * Note on SimpleNodeSchema construction: In the persisted format `persistedMetadata` is just called `metadata` whereas the `metadata`\n * field on SimpleNodeSchema is not persisted.\n */\nfunction exportSimpleNodeSchemaStored(schema: TreeNodeStoredSchema): SimpleNodeSchema {\n\tconst arrayTypes = tryStoredSchemaAsArray(schema);\n\tif (arrayTypes !== undefined) {\n\t\treturn {\n\t\t\tkind: NodeKind.Array,\n\t\t\tsimpleAllowedTypes: buildSimpleAllowedTypeAttributesForStoredSchema(arrayTypes),\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\tconst fields = new Map<FieldKey, SimpleObjectFieldSchema>();\n\t\tfor (const [storedKey, field] of schema.objectNodeFields) {\n\t\t\tfields.set(storedKey, { ...exportSimpleFieldSchemaStored(field), storedKey });\n\t\t}\n\t\treturn {\n\t\t\tkind: NodeKind.Object,\n\t\t\tfields,\n\t\t\tallowUnknownOptionalFields: undefined,\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tassert(\n\t\t\tschema.mapFields.kind === FieldKinds.optional.identifier,\n\t\t\t0xa95 /* Invalid map schema */,\n\t\t);\n\t\treturn {\n\t\t\tkind: NodeKind.Map,\n\t\t\tsimpleAllowedTypes: buildSimpleAllowedTypeAttributesForStoredSchema(\n\t\t\t\tschema.mapFields.types,\n\t\t\t),\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\treturn {\n\t\t\tkind: NodeKind.Leaf,\n\t\t\tleafKind: schema.leafValue,\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: schema.metadata,\n\t\t};\n\t}\n\tfail(0xacb /* invalid schema kind */);\n}\n"]}
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import type
|
|
7
|
-
import { type
|
|
5
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
6
|
+
import { type CodecTree, type CodecWriteOptions, type ICodecFamily } from "../codec/index.js";
|
|
7
|
+
import { type ChangeEncodingContext, SchemaFormatVersion } from "../core/index.js";
|
|
8
|
+
import { type ModularChangeFormatVersion, type ModularChangeset } from "../feature-libraries/index.js";
|
|
8
9
|
import { type Brand } from "../util/index.js";
|
|
9
10
|
import type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|
|
10
|
-
export declare function makeSharedTreeChangeCodecFamily(modularChangeCodecFamily: ICodecFamily<ModularChangeset, ChangeEncodingContext>, options:
|
|
11
|
+
export declare function makeSharedTreeChangeCodecFamily(modularChangeCodecFamily: ICodecFamily<ModularChangeset, ChangeEncodingContext>, options: CodecWriteOptions): ICodecFamily<SharedTreeChange, ChangeEncodingContext>;
|
|
11
12
|
interface ChangeFormatDependencies {
|
|
12
13
|
readonly modularChange: ModularChangeFormatVersion;
|
|
13
|
-
readonly schemaChange:
|
|
14
|
+
readonly schemaChange: SchemaFormatVersion;
|
|
14
15
|
}
|
|
15
16
|
export type SharedTreeChangeFormatVersion = Brand<1 | 2 | 3 | 4, "SharedTreeChangeFormatVersion">;
|
|
16
17
|
/**
|
|
@@ -20,6 +21,6 @@ export type SharedTreeChangeFormatVersion = Brand<1 | 2 | 3 | 4, "SharedTreeChan
|
|
|
20
21
|
* This is because the format for the dependent formats are not explicitly versioned.
|
|
21
22
|
*/
|
|
22
23
|
export declare const dependenciesForChangeFormat: Map<SharedTreeChangeFormatVersion, ChangeFormatDependencies>;
|
|
23
|
-
export declare function getCodecTreeForChangeFormat(version: SharedTreeChangeFormatVersion): CodecTree;
|
|
24
|
+
export declare function getCodecTreeForChangeFormat(version: SharedTreeChangeFormatVersion, clientVersion: MinimumVersionForCollab): CodecTree;
|
|
24
25
|
export {};
|
|
25
26
|
//# sourceMappingURL=sharedTreeChangeCodecs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTreeChangeCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"sharedTreeChangeCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree/sharedTreeChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EAGtB,KAAK,YAAY,EAKjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,KAAK,qBAAqB,EAC1B,mBAAmB,EAEnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EAMrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAEN,KAAK,KAAK,EAGV,MAAM,kBAAkB,CAAC;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAyB,MAAM,4BAA4B,CAAC;AAE1F,wBAAgB,+BAA+B,CAC9C,wBAAwB,EAAE,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,EAC/E,OAAO,EAAE,iBAAiB,GACxB,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAqBvD;AAED,UAAU,wBAAwB;IACjC,QAAQ,CAAC,aAAa,EAAE,0BAA0B,CAAC;IACnD,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;CAC3C;AAED,MAAM,MAAM,6BAA6B,GAAG,KAAK,CAChD,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EACb,+BAA+B,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,GAAG,CAC5C,6BAA6B,EAC7B,wBAAwB,CAMvB,CAAC;AAEH,wBAAgB,2BAA2B,CAC1C,OAAO,EAAE,6BAA6B,EACtC,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAWX"}
|
|
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.getCodecTreeForChangeFormat = exports.dependenciesForChangeFormat = exports.makeSharedTreeChangeCodecFamily = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../codec/index.js");
|
|
10
|
-
const index_js_2 = require("../
|
|
11
|
-
const index_js_3 = require("../
|
|
10
|
+
const index_js_2 = require("../core/index.js");
|
|
11
|
+
const index_js_3 = require("../feature-libraries/index.js");
|
|
12
|
+
const index_js_4 = require("../util/index.js");
|
|
12
13
|
const sharedTreeChangeFormat_js_1 = require("./sharedTreeChangeFormat.js");
|
|
13
14
|
function makeSharedTreeChangeCodecFamily(modularChangeCodecFamily, options) {
|
|
14
|
-
const schemaChangeCodecs = (0,
|
|
15
|
+
const schemaChangeCodecs = (0, index_js_3.makeSchemaChangeCodecs)(options);
|
|
15
16
|
const versions = Array.from(exports.dependenciesForChangeFormat.entries()).map(([format, { modularChange, schemaChange }]) => [
|
|
16
17
|
format,
|
|
17
18
|
makeSharedTreeChangeCodec(modularChangeCodecFamily.resolve(modularChange).json, schemaChangeCodecs.resolve(schemaChange).json, options),
|
|
@@ -26,19 +27,19 @@ exports.makeSharedTreeChangeCodecFamily = makeSharedTreeChangeCodecFamily;
|
|
|
26
27
|
* This is because the format for the dependent formats are not explicitly versioned.
|
|
27
28
|
*/
|
|
28
29
|
exports.dependenciesForChangeFormat = new Map([
|
|
29
|
-
[(0,
|
|
30
|
-
[(0,
|
|
31
|
-
[(0,
|
|
32
|
-
[(0,
|
|
30
|
+
[(0, index_js_4.brand)(1), { modularChange: (0, index_js_4.brand)(1), schemaChange: (0, index_js_4.brand)(index_js_2.SchemaFormatVersion.v1) }],
|
|
31
|
+
[(0, index_js_4.brand)(2), { modularChange: (0, index_js_4.brand)(2), schemaChange: (0, index_js_4.brand)(index_js_2.SchemaFormatVersion.v1) }],
|
|
32
|
+
[(0, index_js_4.brand)(3), { modularChange: (0, index_js_4.brand)(3), schemaChange: (0, index_js_4.brand)(index_js_2.SchemaFormatVersion.v1) }],
|
|
33
|
+
[(0, index_js_4.brand)(4), { modularChange: (0, index_js_4.brand)(4), schemaChange: (0, index_js_4.brand)(index_js_2.SchemaFormatVersion.v1) }],
|
|
33
34
|
]);
|
|
34
|
-
function getCodecTreeForChangeFormat(version) {
|
|
35
|
+
function getCodecTreeForChangeFormat(version, clientVersion) {
|
|
35
36
|
const { modularChange, schemaChange } = exports.dependenciesForChangeFormat.get(version) ?? (0, internal_1.fail)(0xc78 /* Unknown change format */);
|
|
36
37
|
return {
|
|
37
38
|
name: "SharedTreeChange",
|
|
38
39
|
version,
|
|
39
40
|
children: [
|
|
40
|
-
(0,
|
|
41
|
-
(0,
|
|
41
|
+
(0, index_js_3.getCodecTreeForModularChangeFormat)(modularChange),
|
|
42
|
+
(0, index_js_3.getCodecTreeForSchemaChangeFormat)(schemaChange, clientVersion),
|
|
42
43
|
],
|
|
43
44
|
};
|
|
44
45
|
}
|
|
@@ -68,7 +69,7 @@ function makeSharedTreeChangeCodec(modularChangeCodec, schemaChangeCodec, codecO
|
|
|
68
69
|
? {
|
|
69
70
|
policy: context.schema !== undefined
|
|
70
71
|
? context.schema.policy
|
|
71
|
-
:
|
|
72
|
+
: index_js_3.defaultSchemaPolicy,
|
|
72
73
|
schema: updatedSchema,
|
|
73
74
|
}
|
|
74
75
|
: context.schema;
|