@fluidframework/tree 2.63.0-358419 → 2.63.0-359286
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/.eslintrc.cjs +4 -0
- package/api-report/tree.alpha.api.md +31 -5
- package/api-report/tree.beta.api.md +26 -0
- package/api-report/tree.legacy.beta.api.md +26 -0
- package/dist/alpha.d.ts +4 -3
- package/dist/beta.d.ts +3 -0
- package/dist/codec/codec.d.ts +32 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +32 -1
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/index.d.ts +1 -1
- package/dist/codec/index.d.ts.map +1 -1
- package/dist/codec/index.js +3 -1
- package/dist/codec/index.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/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.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +5 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +3 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +4 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +5 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/index.d.ts +1 -0
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +5 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +2 -0
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- 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 +2 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +2 -1
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +19 -5
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -1
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +4 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +5 -1
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +1 -0
- 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 +5 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +7 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.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 +2 -1
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +4 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +9 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +2 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +5 -1
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts +1 -1
- package/dist/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/index.js +2 -1
- package/dist/feature-libraries/schema-index/index.js.map +1 -1
- package/dist/legacy.d.ts +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/serializableDomainSchema.d.ts +12 -16
- package/dist/serializableDomainSchema.d.ts.map +1 -1
- package/dist/serializableDomainSchema.js +8 -8
- package/dist/serializableDomainSchema.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +4 -1
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +18 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +122 -8
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +17 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +31 -18
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts +7 -12
- package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/defaultResubmitMachine.js +53 -73
- package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +7 -4
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +42 -11
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +2 -1
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +6 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +7 -4
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +44 -23
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.d.ts +9 -18
- package/dist/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/dist/shared-tree-core/resubmitMachine.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts +6 -4
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +12 -13
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +7 -166
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +11 -44
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +90 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +55 -0
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +12 -2
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +6 -0
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts +3 -2
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +3 -2
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/util/brand.d.ts +1 -1
- package/dist/util/brand.js.map +1 -1
- package/docs/main/compatibility.md +8 -0
- package/lib/alpha.d.ts +4 -3
- package/lib/beta.d.ts +3 -0
- package/lib/codec/codec.d.ts +32 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +28 -0
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.d.ts.map +1 -1
- package/lib/codec/index.js +1 -1
- package/lib/codec/index.js.map +1 -1
- package/lib/core/index.d.ts +2 -2
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/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.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +5 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +4 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +3 -0
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/index.d.ts +1 -0
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -0
- package/lib/core/tree/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +3 -2
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -0
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +2 -0
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- 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 +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.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 +5 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +17 -4
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +4 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +3 -0
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +1 -0
- 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 +5 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.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 +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +4 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +8 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +2 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +3 -0
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts +1 -1
- package/lib/feature-libraries/schema-index/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/index.js +1 -1
- package/lib/feature-libraries/schema-index/index.js.map +1 -1
- package/lib/legacy.d.ts +3 -0
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/serializableDomainSchema.d.ts +12 -16
- package/lib/serializableDomainSchema.d.ts.map +1 -1
- package/lib/serializableDomainSchema.js +9 -9
- package/lib/serializableDomainSchema.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +18 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +126 -13
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +17 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +30 -18
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts +7 -12
- package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/defaultResubmitMachine.js +55 -75
- package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +7 -4
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +40 -10
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +2 -1
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +2 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +7 -4
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +42 -22
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.d.ts +9 -18
- package/lib/shared-tree-core/resubmitMachine.d.ts.map +1 -1
- package/lib/shared-tree-core/resubmitMachine.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts +6 -4
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +13 -14
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +7 -166
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +12 -45
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +90 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +56 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +12 -2
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +7 -1
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts +3 -2
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +3 -2
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/util/brand.d.ts +1 -1
- package/lib/util/brand.js.map +1 -1
- package/package.json +21 -21
- package/src/codec/codec.ts +60 -0
- package/src/codec/index.ts +3 -0
- package/src/core/index.ts +3 -0
- package/src/core/schema-stored/index.ts +1 -0
- package/src/core/schema-stored/schema.ts +5 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +9 -0
- package/src/core/tree/index.ts +6 -0
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +6 -1
- package/src/feature-libraries/chunked-forest/codec/format.ts +2 -0
- package/src/feature-libraries/chunked-forest/codec/index.ts +2 -1
- package/src/feature-libraries/chunked-forest/index.ts +2 -0
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +29 -5
- package/src/feature-libraries/default-schema/index.ts +2 -0
- package/src/feature-libraries/forest-summary/codec.ts +7 -0
- package/src/feature-libraries/forest-summary/index.ts +1 -0
- package/src/feature-libraries/index.ts +12 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +1 -1
- package/src/feature-libraries/schema-edits/index.ts +5 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +17 -1
- package/src/feature-libraries/schema-index/codec.ts +5 -0
- package/src/feature-libraries/schema-index/index.ts +1 -0
- package/src/packageVersion.ts +1 -1
- package/src/serializableDomainSchema.ts +12 -11
- package/src/shared-tree/index.ts +6 -0
- package/src/shared-tree/sharedTree.ts +151 -11
- package/src/shared-tree/sharedTreeChangeCodecs.ts +68 -30
- package/src/shared-tree/treeCheckout.ts +1 -1
- package/src/shared-tree-core/defaultResubmitMachine.ts +77 -120
- package/src/shared-tree-core/editManagerCodecs.ts +62 -9
- package/src/shared-tree-core/index.ts +12 -1
- package/src/shared-tree-core/messageCodecs.ts +70 -27
- package/src/shared-tree-core/resubmitMachine.ts +12 -20
- package/src/shared-tree-core/sharedTreeCore.ts +26 -18
- package/src/simple-tree/api/schemaFactoryAlpha.ts +16 -296
- package/src/simple-tree/api/schemaFactoryBeta.ts +269 -1
- package/src/simple-tree/api/treeBeta.ts +36 -1
- package/src/simple-tree/api/typesUnsafe.ts +1 -1
- package/src/simple-tree/core/treeNode.ts +3 -2
- package/src/simple-tree/core/treeNodeKernel.ts +1 -1
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +2 -2
- package/src/util/brand.ts +1 -1
|
@@ -3,14 +3,17 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
6
|
-
import { type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../codec/index.js";
|
|
6
|
+
import { type CodecTree, type DependentFormatVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../codec/index.js";
|
|
7
7
|
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag, SchemaAndPolicy } from "../core/index.js";
|
|
8
|
-
import type
|
|
8
|
+
import { type Brand, type JsonCompatibleReadOnly } from "../util/index.js";
|
|
9
9
|
import type { SummaryData } from "./editManager.js";
|
|
10
10
|
export interface EditManagerEncodingContext {
|
|
11
11
|
idCompressor: IIdCompressor;
|
|
12
12
|
readonly schema?: SchemaAndPolicy;
|
|
13
13
|
}
|
|
14
|
-
export declare function makeEditManagerCodec<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, writeVersion: number): IJsonCodec<SummaryData<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, EditManagerEncodingContext>;
|
|
15
|
-
export declare function makeEditManagerCodecs<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions): ICodecFamily<SummaryData<TChangeset>, EditManagerEncodingContext>;
|
|
14
|
+
export declare function makeEditManagerCodec<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, dependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, writeVersion: number): IJsonCodec<SummaryData<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, EditManagerEncodingContext>;
|
|
15
|
+
export declare function makeEditManagerCodecs<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, dependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions): ICodecFamily<SummaryData<TChangeset>, EditManagerEncodingContext>;
|
|
16
|
+
export type EditManagerFormatVersion = Brand<1 | 2 | 3 | 4 | 5, "EditManagerFormatVersion">;
|
|
17
|
+
export declare const editManagerFormatVersions: ReadonlySet<EditManagerFormatVersion>;
|
|
18
|
+
export declare function getCodecTreeForEditManagerFormatWithChange(version: EditManagerFormatVersion, changeFormat: CodecTree): CodecTree;
|
|
16
19
|
//# sourceMappingURL=editManagerCodecs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"editManagerCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAGnE,OAAO,EACN,KAAK,SAAS,EACd,KAAK,sBAAsB,EAE3B,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAS,KAAK,KAAK,EAAE,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAElF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,MAAM,WAAW,0BAA0B;IAC1C,YAAY,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAC9C,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,qBAAqB,CAAC,EAC7D,4BAA4B,EAAE,sBAAsB,CAAC,wBAAwB,CAAC,EAC9E,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,MAAM,GAClB,UAAU,CACZ,WAAW,CAAC,UAAU,CAAC,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,CAC1B,CAQA;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAC/C,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,qBAAqB,CAAC,EAC7D,4BAA4B,EAAE,sBAAsB,CAAC,wBAAwB,CAAC,EAC9E,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,aAAa,GACpB,YAAY,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,0BAA0B,CAAC,CA8BnE;AAED,MAAM,MAAM,wBAAwB,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,0BAA0B,CAAC,CAAC;AAC5F,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,wBAAwB,CAM1E,CAAC;AAEH,wBAAgB,0CAA0C,CACzD,OAAO,EAAE,wBAAwB,EACjC,YAAY,EAAE,SAAS,GACrB,SAAS,CAMX"}
|
|
@@ -2,21 +2,51 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
5
6
|
import { makeCodecFamily, } from "../codec/index.js";
|
|
6
7
|
import { makeVersionDispatchingCodec } from "../codec/index.js";
|
|
8
|
+
import { brand } from "../util/index.js";
|
|
7
9
|
import { makeV1CodecWithVersion } from "./editManagerCodecsV1toV4.js";
|
|
8
10
|
import { makeV5CodecWithVersion } from "./editManagerCodecsV5.js";
|
|
9
|
-
export function makeEditManagerCodec(changeCodecs, revisionTagCodec, options, writeVersion) {
|
|
10
|
-
const family = makeEditManagerCodecs(changeCodecs, revisionTagCodec, options);
|
|
11
|
+
export function makeEditManagerCodec(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options, writeVersion) {
|
|
12
|
+
const family = makeEditManagerCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options);
|
|
11
13
|
return makeVersionDispatchingCodec(family, { ...options, writeVersion });
|
|
12
14
|
}
|
|
13
|
-
export function makeEditManagerCodecs(changeCodecs, revisionTagCodec, options) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
export function makeEditManagerCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options) {
|
|
16
|
+
const registry = Array.from(editManagerFormatVersions, (version) => {
|
|
17
|
+
const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
|
|
18
|
+
switch (version) {
|
|
19
|
+
case 1:
|
|
20
|
+
case 2:
|
|
21
|
+
case 3:
|
|
22
|
+
case 4:
|
|
23
|
+
return [
|
|
24
|
+
version,
|
|
25
|
+
makeV1CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
26
|
+
];
|
|
27
|
+
case 5:
|
|
28
|
+
return [
|
|
29
|
+
version,
|
|
30
|
+
makeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
31
|
+
];
|
|
32
|
+
default:
|
|
33
|
+
unreachableCase(version);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return makeCodecFamily(registry);
|
|
37
|
+
}
|
|
38
|
+
export const editManagerFormatVersions = new Set([
|
|
39
|
+
brand(1),
|
|
40
|
+
brand(2),
|
|
41
|
+
brand(3),
|
|
42
|
+
brand(4),
|
|
43
|
+
brand(5),
|
|
44
|
+
]);
|
|
45
|
+
export function getCodecTreeForEditManagerFormatWithChange(version, changeFormat) {
|
|
46
|
+
return {
|
|
47
|
+
name: "EditManager",
|
|
48
|
+
version,
|
|
49
|
+
children: [changeFormat],
|
|
50
|
+
};
|
|
21
51
|
}
|
|
22
52
|
//# sourceMappingURL=editManagerCodecs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"editManagerCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAON,eAAe,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAOhE,OAAO,EAAE,KAAK,EAA2C,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAOlE,MAAM,UAAU,oBAAoB,CACnC,YAA6D,EAC7D,4BAA8E,EAC9E,gBAKC,EACD,OAAsB,EACtB,YAAoB;IAOpB,MAAM,MAAM,GAAG,qBAAqB,CACnC,YAAY,EACZ,4BAA4B,EAC5B,gBAAgB,EAChB,OAAO,CACP,CAAC;IACF,OAAO,2BAA2B,CAAC,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,qBAAqB,CACpC,YAA6D,EAC7D,4BAA8E,EAC9E,gBAKC,EACD,OAAsB;IAEtB,MAAM,QAAQ,GAQR,KAAK,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,OAAO,EAAE,EAAE;QACvD,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACvF,QAAQ,OAAO,EAAE,CAAC;YACjB,KAAK,CAAC,CAAC;YACP,KAAK,CAAC,CAAC;YACP,KAAK,CAAC,CAAC;YACP,KAAK,CAAC;gBACL,OAAO;oBACN,OAAO;oBACP,sBAAsB,CAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC;iBACvE,CAAC;YACH,KAAK,CAAC;gBACL,OAAO;oBACN,OAAO;oBACP,sBAAsB,CAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC;iBACvE,CAAC;YACH;gBACC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC,CAAC,CAAC;IACH,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAGD,MAAM,CAAC,MAAM,yBAAyB,GAA0C,IAAI,GAAG,CAAC;IACvF,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;CACR,CAAC,CAAC;AAEH,MAAM,UAAU,0CAA0C,CACzD,OAAiC,EACjC,YAAuB;IAEvB,OAAO;QACN,IAAI,EAAE,aAAa;QACnB,OAAO;QACP,QAAQ,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype DependentFormatVersion,\n\ttype FormatVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n} from \"../codec/index.js\";\nimport { makeVersionDispatchingCodec } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { brand, type Brand, type JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport type { SummaryData } from \"./editManager.js\";\nimport { makeV1CodecWithVersion } from \"./editManagerCodecsV1toV4.js\";\nimport { makeV5CodecWithVersion } from \"./editManagerCodecsV5.js\";\n\nexport interface EditManagerEncodingContext {\n\tidCompressor: IIdCompressor;\n\treadonly schema?: SchemaAndPolicy;\n}\n\nexport function makeEditManagerCodec<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n\twriteVersion: number,\n): IJsonCodec<\n\tSummaryData<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tEditManagerEncodingContext\n> {\n\tconst family = makeEditManagerCodecs(\n\t\tchangeCodecs,\n\t\tdependentChangeFormatVersion,\n\t\trevisionTagCodec,\n\t\toptions,\n\t);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\nexport function makeEditManagerCodecs<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<EditManagerFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n): ICodecFamily<SummaryData<TChangeset>, EditManagerEncodingContext> {\n\tconst registry: [\n\t\tFormatVersion,\n\t\tIJsonCodec<\n\t\t\tSummaryData<TChangeset>,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tEditManagerEncodingContext\n\t\t>,\n\t][] = Array.from(editManagerFormatVersions, (version) => {\n\t\tconst changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));\n\t\tswitch (version) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeV1CodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\tcase 5:\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\tdefault:\n\t\t\t\tunreachableCase(version);\n\t\t}\n\t});\n\treturn makeCodecFamily(registry);\n}\n\nexport type EditManagerFormatVersion = Brand<1 | 2 | 3 | 4 | 5, \"EditManagerFormatVersion\">;\nexport const editManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> = new Set([\n\tbrand(1),\n\tbrand(2),\n\tbrand(3),\n\tbrand(4),\n\tbrand(5),\n]);\n\nexport function getCodecTreeForEditManagerFormatWithChange(\n\tversion: EditManagerFormatVersion,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\treturn {\n\t\tname: \"EditManager\",\n\t\tversion,\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
|
|
@@ -8,8 +8,9 @@ export { type ExplicitCoreCodecVersions, SharedTreeCore, type Summarizable, type
|
|
|
8
8
|
export type { ResubmitMachine } from "./resubmitMachine.js";
|
|
9
9
|
export { DefaultResubmitMachine } from "./defaultResubmitMachine.js";
|
|
10
10
|
export { type ChangeEnricherReadonlyCheckout, type ChangeEnricherMutableCheckout, NoOpChangeEnricher, } from "./changeEnricher.js";
|
|
11
|
-
export { makeEditManagerCodec } from "./editManagerCodecs.js";
|
|
11
|
+
export { makeEditManagerCodec, getCodecTreeForEditManagerFormatWithChange, type EditManagerFormatVersion, editManagerFormatVersions, } from "./editManagerCodecs.js";
|
|
12
12
|
export { EditManagerSummarizer } from "./editManagerSummarizer.js";
|
|
13
13
|
export { EditManager, minimumPossibleSequenceNumber, type SummaryData, type SharedBranchSummaryData, } from "./editManager.js";
|
|
14
14
|
export type { Commit, SeqNumber, SequencedCommit, SummarySessionBranch, EncodedCommit, } from "./editManagerFormatCommons.js";
|
|
15
|
+
export { type MessageFormatVersion, messageFormatVersions, getCodecTreeForMessageFormatWithChange, } from "./messageCodecs.js";
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,MAAM,EACX,KAAK,KAAK,GACV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,KAAK,yBAAyB,EAC9B,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,GAC5B,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EACN,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,iBAAiB,EACjB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,MAAM,EACX,KAAK,KAAK,GACV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,KAAK,yBAAyB,EAC9B,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,GAC5B,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EACN,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,oBAAoB,EACpB,0CAA0C,EAC1C,KAAK,wBAAwB,EAC7B,yBAAyB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,KAAK,WAAW,EAChB,KAAK,uBAAuB,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,MAAM,EACN,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,aAAa,GACb,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EACN,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,sCAAsC,GACtC,MAAM,oBAAoB,CAAC"}
|
|
@@ -7,7 +7,8 @@ export { TransactionResult, TransactionStack, SquashingTransactionStack, } from
|
|
|
7
7
|
export { SharedTreeCore, } from "./sharedTreeCore.js";
|
|
8
8
|
export { DefaultResubmitMachine } from "./defaultResubmitMachine.js";
|
|
9
9
|
export { NoOpChangeEnricher, } from "./changeEnricher.js";
|
|
10
|
-
export { makeEditManagerCodec } from "./editManagerCodecs.js";
|
|
10
|
+
export { makeEditManagerCodec, getCodecTreeForEditManagerFormatWithChange, editManagerFormatVersions, } from "./editManagerCodecs.js";
|
|
11
11
|
export { EditManagerSummarizer } from "./editManagerSummarizer.js";
|
|
12
12
|
export { EditManager, minimumPossibleSequenceNumber, } from "./editManager.js";
|
|
13
|
+
export { messageFormatVersions, getCodecTreeForMessageFormatWithChange, } from "./messageCodecs.js";
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAIhB,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,iBAAiB,EAGjB,gBAAgB,EAChB,yBAAyB,GAGzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,cAAc,GAKd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAGN,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAIhB,MAAM,aAAa,CAAC;AAErB,OAAO,EACN,iBAAiB,EAGjB,gBAAgB,EAChB,yBAAyB,GAGzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAEN,cAAc,GAKd,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAGN,kBAAkB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,oBAAoB,EACpB,0CAA0C,EAE1C,yBAAyB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,WAAW,EACX,6BAA6B,GAG7B,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAEN,qBAAqB,EACrB,sCAAsC,GACtC,MAAM,oBAAoB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tonForkTransitive,\n\tSharedTreeBranch,\n\ttype SharedTreeBranchChange,\n\ttype SharedTreeBranchEvents,\n\ttype BranchId,\n} from \"./branch.js\";\n\nexport {\n\tTransactionResult,\n\ttype Transactor,\n\ttype TransactionEvents,\n\tTransactionStack,\n\tSquashingTransactionStack,\n\ttype OnPush,\n\ttype OnPop,\n} from \"./transaction.js\";\n\nexport {\n\ttype ExplicitCoreCodecVersions,\n\tSharedTreeCore,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n\ttype ClonableSchemaAndPolicy,\n} from \"./sharedTreeCore.js\";\n\nexport type { ResubmitMachine } from \"./resubmitMachine.js\";\nexport { DefaultResubmitMachine } from \"./defaultResubmitMachine.js\";\n\nexport {\n\ttype ChangeEnricherReadonlyCheckout,\n\ttype ChangeEnricherMutableCheckout,\n\tNoOpChangeEnricher,\n} from \"./changeEnricher.js\";\n\nexport {\n\tmakeEditManagerCodec,\n\tgetCodecTreeForEditManagerFormatWithChange,\n\ttype EditManagerFormatVersion,\n\teditManagerFormatVersions,\n} from \"./editManagerCodecs.js\";\nexport { EditManagerSummarizer } from \"./editManagerSummarizer.js\";\nexport {\n\tEditManager,\n\tminimumPossibleSequenceNumber,\n\ttype SummaryData,\n\ttype SharedBranchSummaryData,\n} from \"./editManager.js\";\nexport type {\n\tCommit,\n\tSeqNumber,\n\tSequencedCommit,\n\tSummarySessionBranch,\n\tEncodedCommit,\n} from \"./editManagerFormatCommons.js\";\n\nexport {\n\ttype MessageFormatVersion,\n\tmessageFormatVersions,\n\tgetCodecTreeForMessageFormatWithChange,\n} from \"./messageCodecs.js\";\n"]}
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../codec/index.js";
|
|
5
|
+
import { type CodecTree, type DependentFormatVersion, type ICodecFamily, type ICodecOptions, type IJsonCodec } from "../codec/index.js";
|
|
6
6
|
import type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag, SchemaAndPolicy } from "../core/index.js";
|
|
7
|
-
import type
|
|
7
|
+
import { type Brand, type JsonCompatibleReadOnly } from "../util/index.js";
|
|
8
8
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
9
9
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
10
10
|
export interface MessageEncodingContext {
|
|
11
11
|
idCompressor: IIdCompressor;
|
|
12
12
|
schema?: SchemaAndPolicy;
|
|
13
13
|
}
|
|
14
|
-
export declare function makeMessageCodec<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, writeVersion
|
|
14
|
+
export declare function makeMessageCodec<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, dependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions, writeVersion?: MessageFormatVersion): IJsonCodec<DecodedMessage<TChangeset>, JsonCompatibleReadOnly, JsonCompatibleReadOnly, MessageEncodingContext>;
|
|
15
15
|
/**
|
|
16
16
|
* @privateRemarks Exported for testing.
|
|
17
17
|
*/
|
|
18
|
-
export declare function makeMessageCodecs<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions): ICodecFamily<DecodedMessage<TChangeset>, MessageEncodingContext>;
|
|
18
|
+
export declare function makeMessageCodecs<TChangeset>(changeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>, dependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, options: ICodecOptions): ICodecFamily<DecodedMessage<TChangeset>, MessageEncodingContext>;
|
|
19
|
+
export type MessageFormatVersion = Brand<undefined | 1 | 2 | 3 | 4 | 5, "MessageFormatVersion">;
|
|
20
|
+
export declare const messageFormatVersions: ReadonlySet<MessageFormatVersion>;
|
|
21
|
+
export declare function getCodecTreeForMessageFormatWithChange(version: MessageFormatVersion, changeFormat: CodecTree): CodecTree;
|
|
19
22
|
//# sourceMappingURL=messageCodecs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"messageCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,sBAAsB,EAE3B,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KA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AC,GAAG,CAAC,EAC7B,sBAAsB,CACtB,CAAC;AACF,eAAO,MAAM,qBAAqB,EAAE,WAAW,CAAC,oBAAoB,CAOlE,CAAC;AAEH,wBAAgB,sCAAsC,CACrD,OAAO,EAAE,oBAAoB,EAC7B,YAAY,EAAE,SAAS,GACrB,SAAS,CAMX"}
|
|
@@ -2,35 +2,55 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { unreachableCase } from "@fluidframework/core-utils/internal";
|
|
5
6
|
import { makeCodecFamily, makeVersionDispatchingCodec, } from "../codec/index.js";
|
|
7
|
+
import { brand } from "../util/index.js";
|
|
6
8
|
import { makeV1ToV4CodecWithVersion } from "./messageCodecV1ToV4.js";
|
|
7
9
|
import { makeV5CodecWithVersion } from "./messageCodecV5.js";
|
|
8
|
-
export function makeMessageCodec(changeCodecs, revisionTagCodec, options, writeVersion) {
|
|
9
|
-
const family = makeMessageCodecs(changeCodecs, revisionTagCodec, options);
|
|
10
|
+
export function makeMessageCodec(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options, writeVersion = brand(1)) {
|
|
11
|
+
const family = makeMessageCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options);
|
|
10
12
|
return makeVersionDispatchingCodec(family, { ...options, writeVersion });
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* @privateRemarks Exported for testing.
|
|
14
16
|
*/
|
|
15
|
-
export function makeMessageCodecs(changeCodecs, revisionTagCodec, options) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
export function makeMessageCodecs(changeCodecs, dependentChangeFormatVersion, revisionTagCodec, options) {
|
|
18
|
+
const registry = Array.from(messageFormatVersions).map((version) => {
|
|
19
|
+
const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version)).json;
|
|
20
|
+
switch (version) {
|
|
21
|
+
case undefined:
|
|
22
|
+
case 1:
|
|
23
|
+
case 2:
|
|
24
|
+
case 3:
|
|
25
|
+
case 4:
|
|
26
|
+
return [
|
|
27
|
+
version,
|
|
28
|
+
makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version ?? 1),
|
|
29
|
+
];
|
|
30
|
+
case 5:
|
|
31
|
+
return [
|
|
32
|
+
version,
|
|
33
|
+
makeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),
|
|
34
|
+
];
|
|
35
|
+
default:
|
|
36
|
+
unreachableCase(version);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return makeCodecFamily(registry);
|
|
40
|
+
}
|
|
41
|
+
export const messageFormatVersions = new Set([
|
|
42
|
+
brand(undefined),
|
|
43
|
+
brand(1),
|
|
44
|
+
brand(2),
|
|
45
|
+
brand(3),
|
|
46
|
+
brand(4),
|
|
47
|
+
brand(5),
|
|
48
|
+
]);
|
|
49
|
+
export function getCodecTreeForMessageFormatWithChange(version, changeFormat) {
|
|
50
|
+
return {
|
|
51
|
+
name: "Message",
|
|
52
|
+
version,
|
|
53
|
+
children: [changeFormat],
|
|
54
|
+
};
|
|
35
55
|
}
|
|
36
56
|
//# sourceMappingURL=messageCodecs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"messageCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE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AAE,OAAO,CAAC;iBACvE,CAAC;YACH;gBACC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;IACF,CAAC,CAAC,CAAC;IACH,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAMD,MAAM,CAAC,MAAM,qBAAqB,GAAsC,IAAI,GAAG,CAAC;IAC/E,KAAK,CAAC,SAAS,CAAC;IAChB,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;IACR,KAAK,CAAC,CAAC,CAAC;CACR,CAAC,CAAC;AAEH,MAAM,UAAU,sCAAsC,CACrD,OAA6B,EAC7B,YAAuB;IAEvB,OAAO;QACN,IAAI,EAAE,SAAS;QACf,OAAO;QACP,QAAQ,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\ttype CodecTree,\n\ttype DependentFormatVersion,\n\ttype FormatVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n} from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\nimport { brand, type Brand, type JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport type { DecodedMessage } from \"./messageTypes.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\nimport { makeV1ToV4CodecWithVersion } from \"./messageCodecV1ToV4.js\";\nimport { makeV5CodecWithVersion } from \"./messageCodecV5.js\";\n\nexport interface MessageEncodingContext {\n\tidCompressor: IIdCompressor;\n\tschema?: SchemaAndPolicy;\n}\n\nexport function makeMessageCodec<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n\twriteVersion: MessageFormatVersion = brand(1),\n): IJsonCodec<\n\tDecodedMessage<TChangeset>,\n\tJsonCompatibleReadOnly,\n\tJsonCompatibleReadOnly,\n\tMessageEncodingContext\n> {\n\tconst family = makeMessageCodecs(\n\t\tchangeCodecs,\n\t\tdependentChangeFormatVersion,\n\t\trevisionTagCodec,\n\t\toptions,\n\t);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * @privateRemarks Exported for testing.\n */\nexport function makeMessageCodecs<TChangeset>(\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>,\n\tdependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\toptions: ICodecOptions,\n): ICodecFamily<DecodedMessage<TChangeset>, MessageEncodingContext> {\n\tconst registry: [\n\t\tFormatVersion,\n\t\tIJsonCodec<\n\t\t\tDecodedMessage<TChangeset>,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tJsonCompatibleReadOnly,\n\t\t\tMessageEncodingContext\n\t\t>,\n\t][] = Array.from(messageFormatVersions).map((version) => {\n\t\tconst changeCodec = changeCodecs.resolve(\n\t\t\tdependentChangeFormatVersion.lookup(version),\n\t\t).json;\n\t\tswitch (version) {\n\t\t\tcase undefined:\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\tcase 4:\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version ?? 1),\n\t\t\t\t];\n\t\t\tcase 5:\n\t\t\t\treturn [\n\t\t\t\t\tversion,\n\t\t\t\t\tmakeV5CodecWithVersion(changeCodec, revisionTagCodec, options, version),\n\t\t\t\t];\n\t\t\tdefault:\n\t\t\t\tunreachableCase(version);\n\t\t}\n\t});\n\treturn makeCodecFamily(registry);\n}\n\nexport type MessageFormatVersion = Brand<\n\tundefined | 1 | 2 | 3 | 4 | 5,\n\t\"MessageFormatVersion\"\n>;\nexport const messageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([\n\tbrand(undefined),\n\tbrand(1),\n\tbrand(2),\n\tbrand(3),\n\tbrand(4),\n\tbrand(5),\n]);\n\nexport function getCodecTreeForMessageFormatWithChange(\n\tversion: MessageFormatVersion,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\treturn {\n\t\tname: \"Message\",\n\t\tversion,\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
|
|
@@ -2,30 +2,20 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { GraphCommit } from "../core/index.js";
|
|
5
|
+
import type { GraphCommit, RevisionTag } from "../core/index.js";
|
|
6
6
|
/**
|
|
7
7
|
* Encapsulates a state machine that can be used by a {@link SharedTreeCore} manage resubmit phases,
|
|
8
8
|
* especially dealing with the proper updating of enrichments on resubmitted commits.
|
|
9
9
|
*/
|
|
10
10
|
export interface ResubmitMachine<TChange> {
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* @param revision - the revision of the commit that should be enriched
|
|
13
|
+
* @param getLocalCommitsSince - the local commits on this branch from oldest to newest, starting with the `revision`.
|
|
14
|
+
* @returns a version of the commit with updated enrichment, or undefined if this revision does not need to be resubmitted.
|
|
15
|
+
* A revision does not need to be resubmitted if it has already been sequenced, which can happen if it was also submitted by another client.
|
|
16
|
+
* Two clients can submit the same revision by both merging from the same shared branch.
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @returns the next commit that should be resubmitted.
|
|
21
|
-
*
|
|
22
|
-
* Throws when invoked outside of a resubmit phase.
|
|
23
|
-
*/
|
|
24
|
-
peekNextCommit(): GraphCommit<TChange>;
|
|
25
|
-
/**
|
|
26
|
-
* Is true iff the commit enricher is currently in a resubmit phase.
|
|
27
|
-
*/
|
|
28
|
-
readonly isInResubmitPhase: boolean;
|
|
18
|
+
getEnrichedCommit(revision: RevisionTag, getLocalCommitsSince: () => readonly GraphCommit<TChange>[]): GraphCommit<TChange> | undefined;
|
|
29
19
|
/**
|
|
30
20
|
* Must be when a commit is submitted or resubmitted.
|
|
31
21
|
* @param commit - the (enriched) commit (re)submitted. Not mutated.
|
|
@@ -41,8 +31,9 @@ export interface ResubmitMachine<TChange> {
|
|
|
41
31
|
* Must be called after a sequenced commit is applied.
|
|
42
32
|
* Note that this may be called multiples times in a row after a number of sequenced commits have been applied
|
|
43
33
|
* (as opposed to always being called before the next sequenced commit is applied).
|
|
34
|
+
* @param revision - the revision of the sequenced commit.
|
|
44
35
|
* @param isLocal - whether the sequenced commit was generated by the local session.
|
|
45
36
|
*/
|
|
46
|
-
onSequencedCommitApplied(isLocal: boolean): void;
|
|
37
|
+
onSequencedCommitApplied(revision: RevisionTag, isLocal: boolean): void;
|
|
47
38
|
}
|
|
48
39
|
//# sourceMappingURL=resubmitMachine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resubmitMachine.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/resubmitMachine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"resubmitMachine.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/resubmitMachine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,OAAO;IACvC;;;;;;OAMG;IACH,iBAAiB,CAChB,QAAQ,EAAE,WAAW,EACrB,oBAAoB,EAAE,MAAM,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,GACzD,WAAW,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IAEpC;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEtD;;;;OAIG;IACH,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAErD;;;;;;OAMG;IACH,wBAAwB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resubmitMachine.js","sourceRoot":"","sources":["../../src/shared-tree-core/resubmitMachine.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { GraphCommit } from \"../core/index.js\";\n\n/**\n * Encapsulates a state machine that can be used by a {@link SharedTreeCore} manage resubmit phases,\n * especially dealing with the proper updating of enrichments on resubmitted commits.\n */\nexport interface ResubmitMachine<TChange> {\n\t/**\n\t *
|
|
1
|
+
{"version":3,"file":"resubmitMachine.js","sourceRoot":"","sources":["../../src/shared-tree-core/resubmitMachine.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { GraphCommit, RevisionTag } from \"../core/index.js\";\n\n/**\n * Encapsulates a state machine that can be used by a {@link SharedTreeCore} manage resubmit phases,\n * especially dealing with the proper updating of enrichments on resubmitted commits.\n */\nexport interface ResubmitMachine<TChange> {\n\t/**\n\t * @param revision - the revision of the commit that should be enriched\n\t * @param getLocalCommitsSince - the local commits on this branch from oldest to newest, starting with the `revision`.\n\t * @returns a version of the commit with updated enrichment, or undefined if this revision does not need to be resubmitted.\n\t * A revision does not need to be resubmitted if it has already been sequenced, which can happen if it was also submitted by another client.\n\t * Two clients can submit the same revision by both merging from the same shared branch.\n\t */\n\tgetEnrichedCommit(\n\t\trevision: RevisionTag,\n\t\tgetLocalCommitsSince: () => readonly GraphCommit<TChange>[],\n\t): GraphCommit<TChange> | undefined;\n\n\t/**\n\t * Must be when a commit is submitted or resubmitted.\n\t * @param commit - the (enriched) commit (re)submitted. Not mutated.\n\t */\n\tonCommitSubmitted(commit: GraphCommit<TChange>): void;\n\n\t/**\n\t * Must be called on a commit after rollback, so it can be removed\n\t * as it will never be (re)submitted.\n\t * @param commit - The commit that was rolled back\n\t */\n\tonCommitRollback(commit: GraphCommit<TChange>): void;\n\n\t/**\n\t * Must be called after a sequenced commit is applied.\n\t * Note that this may be called multiples times in a row after a number of sequenced commits have been applied\n\t * (as opposed to always being called before the next sequenced commit is applied).\n\t * @param revision - the revision of the sequenced commit.\n\t * @param isLocal - whether the sequenced commit was generated by the local session.\n\t */\n\tonSequencedCommitApplied(revision: RevisionTag, isLocal: boolean): void;\n}\n"]}
|
|
@@ -7,16 +7,18 @@ import type { IChannelStorageService } from "@fluidframework/datastore-definitio
|
|
|
7
7
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
8
8
|
import type { IExperimentalIncrementalSummaryContext, IRuntimeMessageCollection, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
|
|
9
9
|
import type { IChannelView, IFluidSerializer } from "@fluidframework/shared-object-base/internal";
|
|
10
|
-
import type { ICodecOptions } from "../codec/index.js";
|
|
10
|
+
import type { DependentFormatVersion, ICodecOptions } from "../codec/index.js";
|
|
11
11
|
import { type ChangeFamily, type ChangeFamilyEditor, type GraphCommit, type RevisionTag, type SchemaAndPolicy, type SchemaPolicy, type TreeStoredSchemaRepository } from "../core/index.js";
|
|
12
12
|
import { type JsonCompatibleReadOnly, type Breakable, type WithBreakable } from "../util/index.js";
|
|
13
13
|
import type { BranchId, SharedTreeBranch } from "./branch.js";
|
|
14
14
|
import { BranchCommitEnricher } from "./branchCommitEnricher.js";
|
|
15
15
|
import { type ChangeEnricherReadonlyCheckout } from "./changeEnricher.js";
|
|
16
|
+
import { type EditManagerFormatVersion } from "./editManagerCodecs.js";
|
|
17
|
+
import { type MessageFormatVersion } from "./messageCodecs.js";
|
|
16
18
|
import type { ResubmitMachine } from "./resubmitMachine.js";
|
|
17
19
|
export interface ExplicitCoreCodecVersions {
|
|
18
|
-
editManager:
|
|
19
|
-
message:
|
|
20
|
+
editManager: EditManagerFormatVersion;
|
|
21
|
+
message: MessageFormatVersion;
|
|
20
22
|
}
|
|
21
23
|
export interface ClonableSchemaAndPolicy extends SchemaAndPolicy {
|
|
22
24
|
schema: TreeStoredSchemaRepository;
|
|
@@ -61,7 +63,7 @@ export declare class SharedTreeCore<TEditor extends ChangeFamilyEditor, TChange>
|
|
|
61
63
|
* @param editor - Used to edit the state of the tree. Edits will be immediately applied locally to the tree.
|
|
62
64
|
* If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.
|
|
63
65
|
*/
|
|
64
|
-
constructor(breaker: Breakable, sharedObject: IChannelView & IFluidLoadable, serializer: IFluidSerializer, submitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void, logger: ITelemetryBaseLogger | undefined, summarizables: readonly Summarizable[], changeFamily: ChangeFamily<TEditor, TChange>, options: ICodecOptions, formatOptions: ExplicitCoreCodecVersions, idCompressor: IIdCompressor, schema: TreeStoredSchemaRepository, schemaPolicy: SchemaPolicy, resubmitMachine?: ResubmitMachine<TChange>, enricher?: ChangeEnricherReadonlyCheckout<TChange>, getEditor?: () => TEditor);
|
|
66
|
+
constructor(breaker: Breakable, sharedObject: IChannelView & IFluidLoadable, serializer: IFluidSerializer, submitLocalMessage: (content: unknown, localOpMetadata?: unknown) => void, logger: ITelemetryBaseLogger | undefined, summarizables: readonly Summarizable[], changeFamily: ChangeFamily<TEditor, TChange>, options: ICodecOptions, formatOptions: ExplicitCoreCodecVersions, changeFormatVersionForEditManager: DependentFormatVersion<EditManagerFormatVersion>, changeFormatVersionForMessage: DependentFormatVersion<MessageFormatVersion>, idCompressor: IIdCompressor, schema: TreeStoredSchemaRepository, schemaPolicy: SchemaPolicy, resubmitMachine?: ResubmitMachine<TChange>, enricher?: ChangeEnricherReadonlyCheckout<TChange>, getEditor?: () => TEditor);
|
|
65
67
|
summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext, fullTree?: boolean): ISummaryTreeWithStats;
|
|
66
68
|
loadCore(services: IChannelStorageService): Promise<void>;
|
|
67
69
|
private registerSharedBranch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharedTreeCore.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/sharedTreeCore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAE5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAE7F,OAAO,KAAK,EACX,aAAa,EAGb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACX,sCAAsC,EACtC,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sharedT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
|
|
@@ -51,7 +51,7 @@ import { DefaultResubmitMachine } from "./defaultResubmitMachine.js";
|
|
|
51
51
|
import { EditManager, minimumPossibleSequenceNumber } from "./editManager.js";
|
|
52
52
|
import { makeEditManagerCodec } from "./editManagerCodecs.js";
|
|
53
53
|
import { EditManagerSummarizer } from "./editManagerSummarizer.js";
|
|
54
|
-
import { makeMessageCodec } from "./messageCodecs.js";
|
|
54
|
+
import { makeMessageCodec, } from "./messageCodecs.js";
|
|
55
55
|
// TODO: Organize this to be adjacent to persisted types.
|
|
56
56
|
const summarizablesTreeKey = "indexes";
|
|
57
57
|
/**
|
|
@@ -73,7 +73,7 @@ let SharedTreeCore = (() => {
|
|
|
73
73
|
* @param editor - Used to edit the state of the tree. Edits will be immediately applied locally to the tree.
|
|
74
74
|
* If there is no transaction currently ongoing, then the edits will be submitted to Fluid immediately as well.
|
|
75
75
|
*/
|
|
76
|
-
constructor(breaker, sharedObject, serializer, submitLocalMessage, logger, summarizables, changeFamily, options, formatOptions, idCompressor, schema, schemaPolicy, resubmitMachine, enricher, getEditor = () => this.getLocalBranch().editor) {
|
|
76
|
+
constructor(breaker, sharedObject, serializer, submitLocalMessage, logger, summarizables, changeFamily, options, formatOptions, changeFormatVersionForEditManager, changeFormatVersionForMessage, idCompressor, schema, schemaPolicy, resubmitMachine, enricher, getEditor = () => this.getLocalBranch().editor) {
|
|
77
77
|
this.breaker = (__runInitializers(this, _instanceExtraInitializers), breaker);
|
|
78
78
|
this.sharedObject = sharedObject;
|
|
79
79
|
this.serializer = serializer;
|
|
@@ -106,13 +106,13 @@ let SharedTreeCore = (() => {
|
|
|
106
106
|
this.editManager = new EditManager(changeFamily, localSessionId, this.mintRevisionTag, (branchId) => this.registerSharedBranch(branchId), rebaseLogger);
|
|
107
107
|
this.registerSharedBranch("main");
|
|
108
108
|
const revisionTagCodec = new RevisionTagCodec(idCompressor);
|
|
109
|
-
const editManagerCodec = makeEditManagerCodec(this.editManager.changeFamily.codecs, revisionTagCodec, options, formatOptions.editManager);
|
|
109
|
+
const editManagerCodec = makeEditManagerCodec(this.editManager.changeFamily.codecs, changeFormatVersionForEditManager, revisionTagCodec, options, formatOptions.editManager);
|
|
110
110
|
this.summarizables = [
|
|
111
111
|
new EditManagerSummarizer(this.editManager, editManagerCodec, this.idCompressor, this.schemaAndPolicy),
|
|
112
112
|
...summarizables,
|
|
113
113
|
];
|
|
114
114
|
assert(new Set(this.summarizables.map((e) => e.key)).size === this.summarizables.length, 0x350 /* Index summary element keys must be unique */);
|
|
115
|
-
this.messageCodec = makeMessageCodec(changeFamily.codecs, new RevisionTagCodec(idCompressor), options, formatOptions.message);
|
|
115
|
+
this.messageCodec = makeMessageCodec(changeFamily.codecs, changeFormatVersionForMessage, new RevisionTagCodec(idCompressor), options, formatOptions.message);
|
|
116
116
|
this.registerSharedBranchForEditing("main", enricher ?? new NoOpChangeEnricher(), resubmitMachine);
|
|
117
117
|
}
|
|
118
118
|
// TODO: SharedObject's merging of the two summary methods into summarizeCore is not what we want here:
|
|
@@ -274,8 +274,8 @@ let SharedTreeCore = (() => {
|
|
|
274
274
|
processCommits(sessionId, sequenceNumber, referenceSequenceNumber, isLocal, branchId, commits) {
|
|
275
275
|
this.editManager.addSequencedChanges(commits, sessionId, sequenceNumber, referenceSequenceNumber, branchId);
|
|
276
276
|
// Update the resubmit machine for each commit applied.
|
|
277
|
-
for (const
|
|
278
|
-
this.tryGetResubmitMachine(branchId)?.onSequencedCommitApplied(isLocal);
|
|
277
|
+
for (const commit of commits) {
|
|
278
|
+
this.tryGetResubmitMachine(branchId)?.onSequencedCommitApplied(commit.revision, isLocal);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
getLocalBranch() {
|
|
@@ -312,18 +312,17 @@ let SharedTreeCore = (() => {
|
|
|
312
312
|
case "commit": {
|
|
313
313
|
const { commit: { revision }, branchId, } = message;
|
|
314
314
|
const resubmitMachine = this.getResubmitMachine(branchId);
|
|
315
|
-
|
|
316
|
-
if (resubmitMachine.isInResubmitPhase === false) {
|
|
315
|
+
const getLocalCommits = () => {
|
|
317
316
|
const localCommits = this.editManager.getLocalCommits(branchId);
|
|
318
317
|
const revisionIndex = localCommits.findIndex((c) => c.revision === revision);
|
|
319
318
|
assert(revisionIndex >= 0, 0xbdb /* revision must exist in local commits */);
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
319
|
+
return localCommits.slice(revisionIndex);
|
|
320
|
+
};
|
|
323
321
|
assert(isClonableSchemaPolicy(localOpMetadata), 0x95e /* Local metadata must contain schema and policy. */);
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
322
|
+
const enrichedCommit = resubmitMachine.getEnrichedCommit(revision, getLocalCommits);
|
|
323
|
+
if (enrichedCommit !== undefined) {
|
|
324
|
+
this.submitCommit(branchId, enrichedCommit, localOpMetadata, true);
|
|
325
|
+
}
|
|
327
326
|
break;
|
|
328
327
|
}
|
|
329
328
|
case "branch": {
|