@fluidframework/tree 2.116.1 → 2.118.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 +202 -0
- package/api-report/tree.alpha.api.md +122 -31
- package/api-report/tree.beta.api.md +50 -9
- package/api-report/tree.legacy.beta.api.md +50 -9
- package/dist/codec/codec.d.ts +18 -0
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +18 -0
- package/dist/codec/codec.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 +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +39 -2
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +37 -2
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/rebase/utils.d.ts.map +1 -1
- package/dist/core/rebase/utils.js +1 -0
- package/dist/core/rebase/utils.js.map +1 -1
- package/dist/core/revertible.d.ts +62 -6
- package/dist/core/revertible.d.ts.map +1 -1
- package/dist/core/revertible.js.map +1 -1
- package/dist/entrypoints/alpha.d.ts +1 -1
- package/dist/entrypoints/alpha.d.ts.map +1 -1
- package/dist/entrypoints/alpha.js.map +1 -1
- package/dist/entrypoints/beta.d.ts +1 -1
- package/dist/entrypoints/beta.d.ts.map +1 -1
- package/dist/entrypoints/beta.js.map +1 -1
- package/dist/entrypoints/legacy.d.ts +1 -1
- package/dist/entrypoints/legacy.d.ts.map +1 -1
- package/dist/entrypoints/legacy.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/indexing/types.d.ts +1 -1
- package/dist/feature-libraries/indexing/types.js.map +1 -1
- package/dist/feature-libraries/schemaChecker.d.ts +9 -19
- package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/schemaChecker.js +130 -46
- package/dist/feature-libraries/schemaChecker.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/history.d.ts +22 -0
- package/dist/shared-tree/history.d.ts.map +1 -0
- package/dist/shared-tree/history.js +66 -0
- package/dist/shared-tree/history.js.map +1 -0
- package/dist/shared-tree/schematizingTreeView.d.ts +24 -9
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +61 -11
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +3 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -0
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/tree.js +1 -1
- package/dist/shared-tree/tree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +8 -20
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +9 -12
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +16 -9
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +122 -25
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/dist/shared-tree/unhydratedTreeContext.js +3 -0
- package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts +16 -2
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +20 -2
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/dist/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/dist/shared-tree-core/branchCommitCounter.js +79 -0
- package/dist/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/dist/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataCodec.js +37 -0
- package/dist/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/customMetadataFormat.js +15 -0
- package/dist/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/dist/shared-tree-core/editManager.d.ts.map +1 -1
- package/dist/shared-tree-core/editManager.js +15 -3
- package/dist/shared-tree-core/editManager.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +5 -0
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.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 +3 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +5 -0
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +1 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +6 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +4 -2
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/transaction.d.ts +9 -0
- package/dist/shared-tree-core/transaction.d.ts.map +1 -1
- package/dist/shared-tree-core/transaction.js +26 -4
- package/dist/shared-tree-core/transaction.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +4 -4
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +36 -3
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js +40 -14
- package/dist/simple-tree/api/discrepancies.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 +3 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -10
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/transactionTypes.d.ts +28 -2
- package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/transactionTypes.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +353 -68
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +7 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +2 -2
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -3
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/tableSchema.js +10 -10
- package/dist/tableSchema.js.map +1 -1
- package/docs/main/glossary.md +163 -0
- package/lib/codec/codec.d.ts +18 -0
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +18 -0
- package/lib/codec/codec.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/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +39 -2
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +35 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/rebase/utils.d.ts.map +1 -1
- package/lib/core/rebase/utils.js +1 -0
- package/lib/core/rebase/utils.js.map +1 -1
- package/lib/core/revertible.d.ts +62 -6
- package/lib/core/revertible.d.ts.map +1 -1
- package/lib/core/revertible.js.map +1 -1
- package/lib/entrypoints/alpha.d.ts +1 -1
- package/lib/entrypoints/alpha.d.ts.map +1 -1
- package/lib/entrypoints/alpha.js.map +1 -1
- package/lib/entrypoints/beta.d.ts +1 -1
- package/lib/entrypoints/beta.d.ts.map +1 -1
- package/lib/entrypoints/beta.js.map +1 -1
- package/lib/entrypoints/legacy.d.ts +1 -1
- package/lib/entrypoints/legacy.d.ts.map +1 -1
- package/lib/entrypoints/legacy.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/indexing/types.d.ts +1 -1
- package/lib/feature-libraries/indexing/types.js.map +1 -1
- package/lib/feature-libraries/schemaChecker.d.ts +9 -19
- package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/schemaChecker.js +133 -49
- package/lib/feature-libraries/schemaChecker.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/history.d.ts +22 -0
- package/lib/shared-tree/history.d.ts.map +1 -0
- package/lib/shared-tree/history.js +62 -0
- package/lib/shared-tree/history.js.map +1 -0
- package/lib/shared-tree/schematizingTreeView.d.ts +24 -9
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +62 -12
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +3 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -0
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/tree.js +1 -1
- package/lib/shared-tree/tree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +8 -20
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +9 -12
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +16 -9
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +123 -26
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.d.ts +3 -2
- package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
- package/lib/shared-tree/unhydratedTreeContext.js +3 -0
- package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts +16 -2
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +20 -2
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/shared-tree-core/branchCommitCounter.d.ts +31 -0
- package/lib/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
- package/lib/shared-tree-core/branchCommitCounter.js +75 -0
- package/lib/shared-tree-core/branchCommitCounter.js.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts +9 -0
- package/lib/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataCodec.js +32 -0
- package/lib/shared-tree-core/customMetadataCodec.js.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts +18 -0
- package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/customMetadataFormat.js +11 -0
- package/lib/shared-tree-core/customMetadataFormat.js.map +1 -0
- package/lib/shared-tree-core/editManager.d.ts.map +1 -1
- package/lib/shared-tree-core/editManager.js +16 -4
- package/lib/shared-tree-core/editManager.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +5 -0
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsCommons.js +17 -5
- package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
- package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +18 -8
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +4 -3
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.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 +1 -0
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js +12 -3
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +5 -0
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +1 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +6 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
- package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatV1ToV4.js +10 -2
- package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormatVSharedBranches.js +2 -0
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +5 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/transaction.d.ts +9 -0
- package/lib/shared-tree-core/transaction.d.ts.map +1 -1
- package/lib/shared-tree-core/transaction.js +27 -5
- package/lib/shared-tree-core/transaction.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +4 -4
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +36 -3
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js +40 -14
- package/lib/simple-tree/api/discrepancies.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 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/transactionTypes.d.ts +28 -2
- package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/transactionTypes.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +353 -68
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +7 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +3 -3
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -1
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/tableSchema.js +10 -10
- package/lib/tableSchema.js.map +1 -1
- package/package.json +22 -22
- package/src/codec/codec.ts +19 -0
- package/src/core/index.ts +4 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +72 -2
- package/src/core/rebase/utils.ts +1 -0
- package/src/core/revertible.ts +67 -6
- package/src/entrypoints/alpha.ts +11 -0
- package/src/entrypoints/beta.ts +3 -0
- package/src/entrypoints/legacy.ts +3 -0
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/indexing/types.ts +1 -1
- package/src/feature-libraries/schemaChecker.ts +198 -82
- package/src/index.ts +11 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +99 -0
- package/src/shared-tree/schematizingTreeView.ts +100 -29
- package/src/shared-tree/sharedTree.ts +5 -2
- package/src/shared-tree/tree.ts +1 -1
- package/src/shared-tree/treeAlpha.ts +17 -35
- package/src/shared-tree/treeCheckout.ts +170 -31
- package/src/shared-tree/unhydratedTreeContext.ts +6 -2
- package/src/shared-tree-core/branch.ts +34 -2
- package/src/shared-tree-core/branchCommitCounter.ts +103 -0
- package/src/shared-tree-core/customMetadataCodec.ts +42 -0
- package/src/shared-tree-core/customMetadataFormat.ts +39 -0
- package/src/shared-tree-core/editManager.ts +22 -3
- package/src/shared-tree-core/editManagerCodecs.ts +12 -0
- package/src/shared-tree-core/editManagerCodecsCommons.ts +41 -15
- package/src/shared-tree-core/editManagerCodecsV1toV4.ts +7 -1
- package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -0
- package/src/shared-tree-core/editManagerFormatCommons.ts +46 -12
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +13 -5
- package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -2
- package/src/shared-tree-core/index.ts +3 -0
- package/src/shared-tree-core/messageCodecV1ToV4.ts +18 -5
- package/src/shared-tree-core/messageCodecVSharedBranches.ts +9 -2
- package/src/shared-tree-core/messageCodecs.ts +12 -0
- package/src/shared-tree-core/messageFormat.ts +6 -0
- package/src/shared-tree-core/messageFormatV1ToV4.ts +21 -3
- package/src/shared-tree-core/messageFormatVSharedBranches.ts +8 -0
- package/src/shared-tree-core/sharedTreeCore.ts +5 -2
- package/src/shared-tree-core/transaction.ts +56 -4
- package/src/simple-tree/api/configuration.ts +4 -4
- package/src/simple-tree/api/discrepancies.ts +100 -5
- package/src/simple-tree/api/index.ts +12 -1
- package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
- package/src/simple-tree/api/transactionTypes.ts +29 -2
- package/src/simple-tree/api/tree.ts +384 -68
- package/src/simple-tree/core/toStored.ts +8 -0
- package/src/simple-tree/core/treeNodeValid.ts +3 -1
- package/src/simple-tree/index.ts +9 -0
- package/src/tableSchema.ts +9 -9
- package/docs/main/runtime-schema-upgrade.md +0 -208
|
@@ -7,16 +7,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.makeV1ToV4CodecWithVersion = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
9
|
const index_js_1 = require("../util/index.js");
|
|
10
|
+
const messageFormat_js_1 = require("./messageFormat.js");
|
|
11
|
+
const customMetadataCodec_js_1 = require("./customMetadataCodec.js");
|
|
10
12
|
const messageFormatV1ToV4_js_1 = require("./messageFormatV1ToV4.js");
|
|
11
13
|
function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, version) {
|
|
12
|
-
|
|
14
|
+
// Persisted commit metadata was introduced in v7; older formats must not write the field.
|
|
15
|
+
const supportsCustomMetadata = version >= messageFormat_js_1.MessageFormatVersion.v7;
|
|
16
|
+
const schema = (0, messageFormatV1ToV4_js_1.Message)(changeCodec.encodedSchema ?? index_js_1.JsonCompatibleReadOnlySchema, supportsCustomMetadata);
|
|
13
17
|
return {
|
|
14
18
|
schema,
|
|
15
19
|
encode: (decoded, context) => {
|
|
16
20
|
(0, internal_1.assert)(decoded.type === "commit", 0xc68 /* Only commit messages are supported */);
|
|
17
21
|
(0, internal_1.assert)(decoded.branchId === "main", 0xc69 /* Only commit messages to main are supported */);
|
|
18
22
|
const { commit, sessionId: originatorId } = decoded;
|
|
19
|
-
|
|
23
|
+
const encoded = {
|
|
20
24
|
revision: revisionTagCodec.encode(commit.revision, {
|
|
21
25
|
originatorId,
|
|
22
26
|
idCompressor: context.idCompressor,
|
|
@@ -33,9 +37,13 @@ function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, version) {
|
|
|
33
37
|
}),
|
|
34
38
|
version,
|
|
35
39
|
};
|
|
40
|
+
if (supportsCustomMetadata && commit.customMetadata !== undefined) {
|
|
41
|
+
encoded.customMetadata = (0, customMetadataCodec_js_1.encodeCustomMetadataTree)(commit.customMetadata);
|
|
42
|
+
}
|
|
43
|
+
return encoded;
|
|
36
44
|
},
|
|
37
45
|
decode: (encoded, context) => {
|
|
38
|
-
const { revision: encodedRevision, originatorId, changeset } = encoded;
|
|
46
|
+
const { revision: encodedRevision, originatorId, changeset, customMetadata } = encoded;
|
|
39
47
|
const revision = revisionTagCodec.decode(encodedRevision, {
|
|
40
48
|
originatorId,
|
|
41
49
|
revision: undefined,
|
|
@@ -53,6 +61,7 @@ function makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, version) {
|
|
|
53
61
|
idCompressor: context.idCompressor,
|
|
54
62
|
isSummary: false,
|
|
55
63
|
}),
|
|
64
|
+
customMetadata: (0, customMetadataCodec_js_1.decodeCustomMetadataTree)(customMetadata),
|
|
56
65
|
},
|
|
57
66
|
sessionId: originatorId,
|
|
58
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecV1ToV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAS7D,+
|
|
1
|
+
{"version":3,"file":"messageCodecV1ToV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAS7D,+CAI0B;AAG1B,yDAA0D;AAC1D,qEAA8F;AAC9F,qEAAmD;AAGnD,SAAgB,0BAA0B,CACzC,WAA0C,EAC1C,gBAKC,EACD,OAMiC;IAEjC,0FAA0F;IAC1F,MAAM,sBAAsB,GAAG,OAAO,IAAI,uCAAoB,CAAC,EAAE,CAAC;IAClE,MAAM,MAAM,GAAG,IAAA,gCAAO,EACrB,WAAW,CAAC,aAAa,IAAI,uCAA4B,EACzD,sBAAsB,CACtB,CAAC;IACF,OAAO;QACN,MAAM;QACN,MAAM,EAAE,CACP,OAAmC,EACnC,OAA+B,EACsB,EAAE;YACvD,IAAA,iBAAM,EAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAClF,IAAA,iBAAM,EACL,OAAO,CAAC,QAAQ,KAAK,MAAM,EAC3B,KAAK,CAAC,gDAAgD,CACtD,CAAC;YACF,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,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OAAO,CAAC,YAAY;wBAClC,SAAS,EAAE,KAAK;qBAChB,CAAC;oBACF,cAAc,EAAE,IAAA,iDAAwB,EAAC,cAAc,CAAC;iBACxD;gBACD,SAAS,EAAE,YAAY;aACvB,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AAtFD,gEAsFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport type { CodecAndSchema, IJsonCodec, Versioned } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n\ttype Mutable,\n} from \"../util/index.js\";\n\nimport type { MessageDecodingContext, MessageEncodingContext } from \"./messageCodecs.js\";\nimport { MessageFormatVersion } from \"./messageFormat.js\";\nimport { decodeCustomMetadataTree, encodeCustomMetadataTree } from \"./customMetadataCodec.js\";\nimport { Message } from \"./messageFormatV1ToV4.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport function makeV1ToV4CodecWithVersion<TChangeset>(\n\tchangeCodec: ChangeFamilyCodec<TChangeset>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion:\n\t\t| typeof MessageFormatVersion.v1\n\t\t| typeof MessageFormatVersion.v2\n\t\t| typeof MessageFormatVersion.v3\n\t\t| typeof MessageFormatVersion.v4\n\t\t| typeof MessageFormatVersion.v6\n\t\t| typeof MessageFormatVersion.v7,\n): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext, MessageDecodingContext> {\n\t// Persisted commit metadata was introduced in v7; older formats must not write the field.\n\tconst supportsCustomMetadata = version >= MessageFormatVersion.v7;\n\tconst schema = Message(\n\t\tchangeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema,\n\t\tsupportsCustomMetadata,\n\t);\n\treturn {\n\t\tschema,\n\t\tencode: (\n\t\t\tdecoded: DecodedMessage<TChangeset>,\n\t\t\tcontext: MessageEncodingContext,\n\t\t): Message & JsonCompatibleReadOnlyObject & Versioned => {\n\t\t\tassert(decoded.type === \"commit\", 0xc68 /* Only commit messages are supported */);\n\t\t\tassert(\n\t\t\t\tdecoded.branchId === \"main\",\n\t\t\t\t0xc69 /* Only commit messages to main are supported */,\n\t\t\t);\n\t\t\tconst { commit, sessionId: originatorId } = decoded;\n\t\t\tconst encoded: Mutable<Message & JsonCompatibleReadOnlyObject & Versioned> = {\n\t\t\t\trevision: revisionTagCodec.encode(commit.revision, {\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: undefined,\n\t\t\t\t\tisSummary: false,\n\t\t\t\t}),\n\t\t\t\toriginatorId,\n\t\t\t\tchangeset: changeCodec.encode(commit.change, {\n\t\t\t\t\toriginatorId,\n\t\t\t\t\tschema: context.schema,\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\trevision: commit.revision,\n\t\t\t\t\tisSummary: false,\n\t\t\t\t}),\n\t\t\t\tversion,\n\t\t\t};\n\t\t\tif (supportsCustomMetadata && commit.customMetadata !== undefined) {\n\t\t\t\tencoded.customMetadata = encodeCustomMetadataTree(commit.customMetadata);\n\t\t\t}\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (\n\t\t\tencoded: Message & JsonCompatibleReadOnlyObject & Versioned,\n\t\t\tcontext: MessageDecodingContext,\n\t\t): DecodedMessage<TChangeset> => {\n\t\t\tconst { revision: encodedRevision, originatorId, changeset, customMetadata } = encoded;\n\n\t\t\tconst revision = revisionTagCodec.decode(encodedRevision, {\n\t\t\t\toriginatorId,\n\t\t\t\trevision: undefined,\n\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\tisSummary: false,\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tbranchId: \"main\",\n\t\t\t\ttype: \"commit\",\n\t\t\t\tcommit: {\n\t\t\t\t\trevision,\n\t\t\t\t\tchange: changeCodec.decode(changeset, {\n\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\tisSummary: false,\n\t\t\t\t\t}),\n\t\t\t\t\tcustomMetadata: decodeCustomMetadataTree(customMetadata),\n\t\t\t\t},\n\t\t\t\tsessionId: originatorId,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"messageCodecVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAa,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAA0B,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAC1C,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,OAAO,oBAAoB,CAAC,eAAe,GAClD,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAC,CAqGpE"}
|
|
@@ -9,6 +9,7 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
10
10
|
const Type = tslib_1.__importStar(require("@sinclair/typebox"));
|
|
11
11
|
const branchIdCodec_js_1 = require("./branchIdCodec.js");
|
|
12
|
+
const customMetadataCodec_js_1 = require("./customMetadataCodec.js");
|
|
12
13
|
const messageFormatVSharedBranches_js_1 = require("./messageFormatVSharedBranches.js");
|
|
13
14
|
function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, version) {
|
|
14
15
|
const schema = (0, messageFormatVSharedBranches_js_1.Message)(changeCodec.encodedSchema ?? Type.Any());
|
|
@@ -25,7 +26,7 @@ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, versi
|
|
|
25
26
|
revision: message.commit.revision,
|
|
26
27
|
isSummary: false,
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
+
const encoded = {
|
|
29
30
|
revision: revisionTagCodec.encode(message.commit.revision, {
|
|
30
31
|
originatorId: message.sessionId,
|
|
31
32
|
idCompressor: context.idCompressor,
|
|
@@ -37,6 +38,10 @@ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, versi
|
|
|
37
38
|
branchId: (0, branchIdCodec_js_1.encodeBranchId)(context.idCompressor, message.branchId),
|
|
38
39
|
version,
|
|
39
40
|
};
|
|
41
|
+
if (message.commit.customMetadata !== undefined) {
|
|
42
|
+
encoded.customMetadata = (0, customMetadataCodec_js_1.encodeCustomMetadataTree)(message.commit.customMetadata);
|
|
43
|
+
}
|
|
44
|
+
return encoded;
|
|
40
45
|
}
|
|
41
46
|
case "branch": {
|
|
42
47
|
return {
|
|
@@ -52,7 +57,7 @@ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, versi
|
|
|
52
57
|
}
|
|
53
58
|
},
|
|
54
59
|
decode: (encoded, context) => {
|
|
55
|
-
const { revision: encodedRevision, originatorId, changeset, branchId: encodedBranchId, branchName: encodedBranchName, } = encoded;
|
|
60
|
+
const { revision: encodedRevision, originatorId, changeset, branchId: encodedBranchId, branchName: encodedBranchName, customMetadata, } = encoded;
|
|
56
61
|
const changeContext = {
|
|
57
62
|
originatorId,
|
|
58
63
|
revision: undefined,
|
|
@@ -80,6 +85,7 @@ function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, versi
|
|
|
80
85
|
idCompressor: context.idCompressor,
|
|
81
86
|
isSummary: false,
|
|
82
87
|
}),
|
|
88
|
+
customMetadata: (0, customMetadataCodec_js_1.decodeCustomMetadataTree)(customMetadata),
|
|
83
89
|
},
|
|
84
90
|
branchId,
|
|
85
91
|
sessionId: originatorId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA8E;AAC9E,gEAA0C;AAY1C,yDAAoE;
|
|
1
|
+
{"version":3,"file":"messageCodecVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,kEAA8E;AAC9E,gEAA0C;AAY1C,yDAAoE;AACpE,qEAA8F;AAG9F,uFAA4D;AAG5D,SAAgB,kCAAkC,CACjD,WAA0C,EAC1C,gBAKC,EACD,OAAoD;IAEpD,MAAM,MAAM,GAAe,IAAA,yCAAO,EAAC,WAAW,CAAC,aAAa,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAE5E,OAAO;QACN,MAAM;QACN,M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AC;oBACF,cAAc,EAAE,IAAA,iDAAwB,EAAC,cAAc,CAAC;iBACxD;gBACD,QAAQ;gBACR,SAAS,EAAE,YAAY;aACvB,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AA9GD,gFA8GC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport * as Type from \"@sinclair/typebox\";\nimport type { TAnySchema } from \"@sinclair/typebox\";\n\nimport type { CodecAndSchema, IJsonCodec, Versioned } from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tChangeFamilyCodec,\n\tEncodedRevisionTag,\n\tRevisionTag,\n} from \"../core/index.js\";\nimport type { JsonCompatibleReadOnlyObject, Mutable } from \"../util/index.js\";\n\nimport { decodeBranchId, encodeBranchId } from \"./branchIdCodec.js\";\nimport { decodeCustomMetadataTree, encodeCustomMetadataTree } from \"./customMetadataCodec.js\";\nimport type { MessageDecodingContext, MessageEncodingContext } from \"./messageCodecs.js\";\nimport type { MessageFormatVersion } from \"./messageFormat.js\";\nimport { Message } from \"./messageFormatVSharedBranches.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport function makeSharedBranchesCodecWithVersion<TChangeset>(\n\tchangeCodec: ChangeFamilyCodec<TChangeset>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion: typeof MessageFormatVersion.vSharedBranches,\n): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext> {\n\tconst schema: TAnySchema = Message(changeCodec.encodedSchema ?? Type.Any());\n\n\treturn {\n\t\tschema,\n\t\tencode: (\n\t\t\tmessage: DecodedMessage<TChangeset>,\n\t\t\tcontext: MessageEncodingContext,\n\t\t): Message & JsonCompatibleReadOnlyObject & Versioned => {\n\t\t\tconst type = message.type;\n\t\t\tswitch (type) {\n\t\t\t\tcase \"commit\": {\n\t\t\t\t\tconst changeContext: ChangeEncodingContext = {\n\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\tschema: context.schema,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\trevision: message.commit.revision,\n\t\t\t\t\t\tisSummary: false,\n\t\t\t\t\t};\n\n\t\t\t\t\tconst encoded: Mutable<Message & JsonCompatibleReadOnlyObject & Versioned> = {\n\t\t\t\t\t\trevision: revisionTagCodec.encode(message.commit.revision, {\n\t\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\t\trevision: undefined,\n\t\t\t\t\t\t\tisSummary: false,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\tchangeset: changeCodec.encode(message.commit.change, changeContext),\n\t\t\t\t\t\tbranchId: encodeBranchId(context.idCompressor, message.branchId),\n\t\t\t\t\t\tversion,\n\t\t\t\t\t};\n\t\t\t\t\tif (message.commit.customMetadata !== undefined) {\n\t\t\t\t\t\tencoded.customMetadata = encodeCustomMetadataTree(message.commit.customMetadata);\n\t\t\t\t\t}\n\t\t\t\t\treturn encoded;\n\t\t\t\t}\n\t\t\t\tcase \"branch\": {\n\t\t\t\t\treturn {\n\t\t\t\t\t\toriginatorId: message.sessionId,\n\t\t\t\t\t\tbranchId: encodeBranchId(context.idCompressor, message.branchId),\n\t\t\t\t\t\tbranchName: message.branchName,\n\t\t\t\t\t\tversion,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(type);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tdecode: (\n\t\t\tencoded: Message & JsonCompatibleReadOnlyObject & Versioned,\n\t\t\tcontext: MessageDecodingContext,\n\t\t): DecodedMessage<TChangeset> => {\n\t\t\tconst {\n\t\t\t\trevision: encodedRevision,\n\t\t\t\toriginatorId,\n\t\t\t\tchangeset,\n\t\t\t\tbranchId: encodedBranchId,\n\t\t\t\tbranchName: encodedBranchName,\n\t\t\t\tcustomMetadata,\n\t\t\t} = encoded;\n\n\t\t\tconst changeContext: ChangeEncodingContext = {\n\t\t\t\toriginatorId,\n\t\t\t\trevision: undefined,\n\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\tisSummary: false,\n\t\t\t};\n\n\t\t\tconst branchId = decodeBranchId(context.idCompressor, encodedBranchId, changeContext);\n\n\t\t\tif (changeset === undefined) {\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"branch\",\n\t\t\t\t\tsessionId: originatorId,\n\t\t\t\t\tbranchId,\n\t\t\t\t\tbranchName: encodedBranchName,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tassert(encodedRevision !== undefined, 0xc6a /* Commit messages must have a revision */);\n\t\t\tconst revision = revisionTagCodec.decode(encodedRevision, changeContext);\n\n\t\t\treturn {\n\t\t\t\ttype: \"commit\",\n\t\t\t\tcommit: {\n\t\t\t\t\trevision,\n\t\t\t\t\tchange: changeCodec.decode(changeset, {\n\t\t\t\t\t\toriginatorId,\n\t\t\t\t\t\trevision,\n\t\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\t\tisSummary: false,\n\t\t\t\t\t}),\n\t\t\t\t\tcustomMetadata: decodeCustomMetadataTree(customMetadata),\n\t\t\t\t},\n\t\t\t\tbranchId,\n\t\t\t\tsessionId: originatorId,\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecs.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAGjG,OAAO,EACN,8BAA8B,EA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a,EAAE,4BAA4B,EAC3C,YAAY,EAAE,SAAS,GACrB,SAAS,CAMX"}
|
|
@@ -40,6 +40,11 @@ function makeMessageCodecBuilder() {
|
|
|
40
40
|
formatVersion: messageFormat_js_1.MessageFormatVersion.v6,
|
|
41
41
|
codec: (options) => (0, messageCodecV1ToV4_js_1.makeV1ToV4CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(messageFormat_js_1.MessageFormatVersion.v6)), options.revisionTagCodec, messageFormat_js_1.MessageFormatVersion.v6),
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
minVersionForCollab: index_js_1.FluidClientVersion.v2_117,
|
|
45
|
+
formatVersion: messageFormat_js_1.MessageFormatVersion.v7,
|
|
46
|
+
codec: (options) => (0, messageCodecV1ToV4_js_1.makeV1ToV4CodecWithVersion)(options.changeCodecs.resolve(options.dependentChangeFormatVersion.lookup(messageFormat_js_1.MessageFormatVersion.v7)), options.revisionTagCodec, messageFormat_js_1.MessageFormatVersion.v7),
|
|
47
|
+
},
|
|
43
48
|
{
|
|
44
49
|
minVersionForCollab: undefined,
|
|
45
50
|
formatVersion: messageFormat_js_1.MessageFormatVersion.vSharedBranches,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecs.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,qEAAmF;AAEnF,gDAU2B;AAQ3B,mEAAqE;AACrE,qFAAsF;AACtF,yDAA0D;AAgB1D;;GAEG;AACU,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAmB1C;;GAEG;AACH,SAAgB,uBAAuB;IAQtC,8FAA8F;IAC9F,MAAM,QAAQ,GAMR;QACL,kEAAkE;QAClE,IAAA,yCAA8B,EAAC,SAAS,EAAE,QAAQ,CAAC;QACnD,IAAA,yCAA8B,EAAC,uCAAoB,CAAC,EAAE,EAAE,QAAQ,CAAC;QACjE,IAAA,yCAA8B,E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A8B,CAAC,KAAK,CAAC,wBAAgB,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC;AApFD,0DAoFC;AAED,SAAgB,sCAAsC,CACrD,aAA2C,EAC3C,YAAuB;IAEvB,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAC1C,OAAO;QACN,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC;QACtC,QAAQ,EAAE,CAAC,YAAY,CAAC;KACxB,CAAC;AACH,CAAC;AATD,wFASC","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 type { OldestSupportedClientVersion } from \"@fluidframework/runtime-definitions/internal\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tVersionDispatchingCodecBuilder,\n\ttype CodecTree,\n\ttype CodecVersion,\n\ttype DependentFormatVersion,\n\tFluidClientVersion,\n\ttype ICodecFamily,\n\ttype ICodecOptions,\n\ttype IJsonCodec,\n\tmakeDiscontinuedCodecAndSchema,\n} from \"../codec/index.js\";\nimport type {\n\tChangeEncodingContext,\n\tEncodedRevisionTag,\n\tRevisionTag,\n\tSchemaAndPolicy,\n} from \"../core/index.js\";\n\nimport { makeV1ToV4CodecWithVersion } from \"./messageCodecV1ToV4.js\";\nimport { makeSharedBranchesCodecWithVersion } from \"./messageCodecVSharedBranches.js\";\nimport { MessageFormatVersion } from \"./messageFormat.js\";\nimport type { DecodedMessage } from \"./messageTypes.js\";\n\nexport interface MessageEncodingContext {\n\tidCompressor: IIdCompressor;\n\tschema?: SchemaAndPolicy;\n}\n\n/**\n * Context required for decoding a message. Unlike {@link MessageEncodingContext}, no schema is\n * needed: message decoding is schema-agnostic.\n */\nexport interface MessageDecodingContext {\n\tidCompressor: IIdCompressor;\n}\n\n/**\n * Codec name used to identify the message codec, see {@link makeMessageCodecBuilder}.\n */\nexport const messageCodecName = \"Message\";\n\n/**\n * Options for constructing a message codec, see {@link makeMessageCodecBuilder}.\n */\ninterface MessageCodecBuilderOptions<TChangeset> extends ICodecOptions {\n\t/** Codecs for encoding changesets. */\n\tchangeCodecs: ICodecFamily<TChangeset, ChangeEncodingContext>;\n\t/** Maps each MessageFormatVersion to the corresponding changeset format version. */\n\tdependentChangeFormatVersion: DependentFormatVersion<MessageFormatVersion>;\n\t/** Codec for encoding revision tags within changesets. */\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>;\n}\n\n/**\n * Creates a {@link VersionDispatchingCodecBuilder} for encoding/decoding messages.\n */\nexport function makeMessageCodecBuilder<TChangeset>(): VersionDispatchingCodecBuilder<\n\tMessageCodecBuilderOptions<TChangeset>,\n\tDecodedMessage<TChangeset>,\n\tMessageEncodingContext,\n\tMessageFormatVersion | undefined,\n\ttypeof messageCodecName,\n\tMessageDecodingContext\n> {\n\t// See MessageFormatVersion and its members for documentation on what changed in each version.\n\tconst versions: CodecVersion<\n\t\tDecodedMessage<TChangeset>,\n\t\tMessageEncodingContext,\n\t\tMessageFormatVersion | undefined,\n\t\tMessageCodecBuilderOptions<TChangeset>,\n\t\tMessageDecodingContext\n\t>[] = [\n\t\t// The \"undefined\" wire format (no version field) is discontinued.\n\t\tmakeDiscontinuedCodecAndSchema(undefined, \"2.73.0\"),\n\t\tmakeDiscontinuedCodecAndSchema(MessageFormatVersion.v1, \"2.73.0\"),\n\t\tmakeDiscontinuedCodecAndSchema(MessageFormatVersion.v2, \"2.73.0\"),\n\t\t{\n\t\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\t\tformatVersion: MessageFormatVersion.v3,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v3),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v3,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_43,\n\t\t\tformatVersion: MessageFormatVersion.v4,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v4),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v4,\n\t\t\t\t),\n\t\t},\n\t\tmakeDiscontinuedCodecAndSchema(MessageFormatVersion.v5, \"2.74.0\"),\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_80,\n\t\t\tformatVersion: MessageFormatVersion.v6,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v6),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v6,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_117,\n\t\t\tformatVersion: MessageFormatVersion.v7,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeV1ToV4CodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.v7),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.v7,\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: undefined,\n\t\t\tformatVersion: MessageFormatVersion.vSharedBranches,\n\t\t\tcodec: (options: MessageCodecBuilderOptions<TChangeset>) =>\n\t\t\t\tmakeSharedBranchesCodecWithVersion(\n\t\t\t\t\toptions.changeCodecs.resolve(\n\t\t\t\t\t\toptions.dependentChangeFormatVersion.lookup(MessageFormatVersion.vSharedBranches),\n\t\t\t\t\t),\n\t\t\t\t\toptions.revisionTagCodec,\n\t\t\t\t\tMessageFormatVersion.vSharedBranches,\n\t\t\t\t),\n\t\t},\n\t];\n\n\treturn VersionDispatchingCodecBuilder.build(messageCodecName, versions);\n}\n\nexport function getCodecTreeForMessageFormatWithChange(\n\tclientVersion: OldestSupportedClientVersion,\n\tchangeFormat: CodecTree,\n): CodecTree {\n\tconst builder = makeMessageCodecBuilder();\n\treturn {\n\t\t...builder.getCodecTree(clientVersion),\n\t\tchildren: [changeFormat],\n\t};\n}\n"]}
|
|
@@ -14,6 +14,7 @@ export declare const MessageFormatVersion: {
|
|
|
14
14
|
readonly v4: import("../util/brand.js").Brand<4, "MessageFormatVersion">;
|
|
15
15
|
readonly v5: import("../util/brand.js").Brand<5, "MessageFormatVersion">;
|
|
16
16
|
readonly v6: import("../util/brand.js").Brand<6, "MessageFormatVersion">;
|
|
17
|
+
readonly v7: import("../util/brand.js").Brand<7, "MessageFormatVersion">;
|
|
17
18
|
readonly vSharedBranches: import("../util/brand.js").Brand<"shared-branches|v0.2", "MessageFormatVersion">;
|
|
18
19
|
};
|
|
19
20
|
export type MessageFormatVersion = Values<typeof MessageFormatVersion>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormat.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"messageFormat.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;CAsD/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,oBAAoB,CAM3E,CAAC"}
|
|
@@ -53,6 +53,11 @@ exports.MessageFormatVersion = (0, index_js_1.strictEnum)("MessageFormatVersion"
|
|
|
53
53
|
* Adds support for "no change" constraints.
|
|
54
54
|
*/
|
|
55
55
|
v6: 6,
|
|
56
|
+
/**
|
|
57
|
+
* Introduced and made available for writing in 2.117.0.
|
|
58
|
+
* Adds support for {@link GraphCommit.customMetadata | persisted commit metadata}.
|
|
59
|
+
*/
|
|
60
|
+
v7: 7,
|
|
56
61
|
/**
|
|
57
62
|
* Not yet released.
|
|
58
63
|
* Only used for testing shared branches.
|
|
@@ -63,6 +68,7 @@ exports.supportedMessageFormatVersions = new Set([
|
|
|
63
68
|
exports.MessageFormatVersion.v3,
|
|
64
69
|
exports.MessageFormatVersion.v4,
|
|
65
70
|
exports.MessageFormatVersion.v6,
|
|
71
|
+
exports.MessageFormatVersion.v7,
|
|
66
72
|
exports.MessageFormatVersion.vSharedBranches,
|
|
67
73
|
]);
|
|
68
74
|
//# sourceMappingURL=messageFormat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormat.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA2D;AAE3D;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAU,EAAC,sBAAsB,EAAE;IACtE;;;;OAIG;IACH,SAAS,EAAE,CAAC;IACZ;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;;OAIG;IACH,EAAE,EAAE,CAAC;IACL;;;;;;;OAOG;IACH,EAAE,EAAE,CAAC;IACL;;;;;OAKG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,eAAe,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAsC,IAAI,GAAG,CAAC;IACxF,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,eAAe;CACpC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strictEnum, type Values } from \"../util/index.js\";\n\n/**\n * The format version for the message.\n */\nexport const MessageFormatVersion = strictEnum(\"MessageFormatVersion\", {\n\t/**\n\t * NOTE: this is written as `undefined` rather than `0` in the wire format.\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tundefined: 0,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv1: 1,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv2: 2,\n\t/**\n\t * Introduced prior to 2.0 and used beyond.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.\n\t */\n\tv3: 3,\n\t/**\n\t * Introduced in 2.2.0.\n\t * Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability could be dropped in favor of {@link MessageFormatVersion.v3},\n\t * but doing so would make the pattern of writable versions more complex and gain little\n\t * because most of the logic for this format is shared with {@link MessageFormatVersion.v3}.\n\t */\n\tv4: 4,\n\t/**\n\t * This version number was used internally for testing shared branches.\n\t * This format was never made stable.\n\t * This version number is kept here solely to avoid reusing the number: it is not supported for either reading or writing.\n\t * @deprecated Use {@link MessageFormatVersion.vSharedBranches} for testing shared branches.\n\t */\n\tv5: 5,\n\t/**\n\t * Introduced and made available for writing in 2.80.0\n\t * Adds support for \"no change\" constraints.\n\t */\n\tv6: 6,\n\t/**\n\t * Not yet released.\n\t * Only used for testing shared branches.\n\t */\n\tvSharedBranches: \"shared-branches|v0.2\",\n});\nexport type MessageFormatVersion = Values<typeof MessageFormatVersion>;\nexport const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([\n\tMessageFormatVersion.v3,\n\tMessageFormatVersion.v4,\n\tMessageFormatVersion.v6,\n\tMessageFormatVersion.vSharedBranches,\n]);\n"]}
|
|
1
|
+
{"version":3,"file":"messageFormat.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+CAA2D;AAE3D;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAU,EAAC,sBAAsB,EAAE;IACtE;;;;OAIG;IACH,SAAS,EAAE,CAAC;IACZ;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;;OAIG;IACH,EAAE,EAAE,CAAC;IACL;;;;;;;OAOG;IACH,EAAE,EAAE,CAAC;IACL;;;;;OAKG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,EAAE,EAAE,CAAC;IACL;;;OAGG;IACH,eAAe,EAAE,sBAAsB;CACvC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAsC,IAAI,GAAG,CAAC;IACxF,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,EAAE;IACvB,4BAAoB,CAAC,eAAe;CACpC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { strictEnum, type Values } from \"../util/index.js\";\n\n/**\n * The format version for the message.\n */\nexport const MessageFormatVersion = strictEnum(\"MessageFormatVersion\", {\n\t/**\n\t * NOTE: this is written as `undefined` rather than `0` in the wire format.\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tundefined: 0,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv1: 1,\n\t/**\n\t * Introduced and retired prior to 2.0.\n\t * Reading and writing capability removed in 2.73.0.\n\t */\n\tv2: 2,\n\t/**\n\t * Introduced prior to 2.0 and used beyond.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability needs to be maintained so long as {@link lowestMinVersionForCollab} is less than 2.2.0.\n\t */\n\tv3: 3,\n\t/**\n\t * Introduced in 2.2.0.\n\t * Was inadvertently made usable for writing in 2.43.0 (through configuredSharedTree) and remains available.\n\t * Reading capability must be maintained for backwards compatibility.\n\t * Writing capability could be dropped in favor of {@link MessageFormatVersion.v3},\n\t * but doing so would make the pattern of writable versions more complex and gain little\n\t * because most of the logic for this format is shared with {@link MessageFormatVersion.v3}.\n\t */\n\tv4: 4,\n\t/**\n\t * This version number was used internally for testing shared branches.\n\t * This format was never made stable.\n\t * This version number is kept here solely to avoid reusing the number: it is not supported for either reading or writing.\n\t * @deprecated Use {@link MessageFormatVersion.vSharedBranches} for testing shared branches.\n\t */\n\tv5: 5,\n\t/**\n\t * Introduced and made available for writing in 2.80.0\n\t * Adds support for \"no change\" constraints.\n\t */\n\tv6: 6,\n\t/**\n\t * Introduced and made available for writing in 2.117.0.\n\t * Adds support for {@link GraphCommit.customMetadata | persisted commit metadata}.\n\t */\n\tv7: 7,\n\t/**\n\t * Not yet released.\n\t * Only used for testing shared branches.\n\t */\n\tvSharedBranches: \"shared-branches|v0.2\",\n});\nexport type MessageFormatVersion = Values<typeof MessageFormatVersion>;\nexport const supportedMessageFormatVersions: ReadonlySet<MessageFormatVersion> = new Set([\n\tMessageFormatVersion.v3,\n\tMessageFormatVersion.v4,\n\tMessageFormatVersion.v6,\n\tMessageFormatVersion.v7,\n\tMessageFormatVersion.vSharedBranches,\n]);\n"]}
|
|
@@ -6,6 +6,7 @@ import type { SessionId } from "@fluidframework/id-compressor";
|
|
|
6
6
|
import * as Type from "@sinclair/typebox";
|
|
7
7
|
import { type EncodedRevisionTag } from "../core/index.js";
|
|
8
8
|
import type { JsonCompatibleReadOnly } from "../util/index.js";
|
|
9
|
+
import { EncodedCustomMetadataTree } from "./customMetadataFormat.js";
|
|
9
10
|
import { MessageFormatVersion } from "./messageFormat.js";
|
|
10
11
|
/**
|
|
11
12
|
* The format of messages that SharedTree sends and receives.
|
|
@@ -23,18 +24,24 @@ export interface Message {
|
|
|
23
24
|
* The changeset to be applied.
|
|
24
25
|
*/
|
|
25
26
|
readonly changeset: JsonCompatibleReadOnly;
|
|
27
|
+
/**
|
|
28
|
+
* Arbitrary, application-defined metadata to persist alongside the commit in this message.
|
|
29
|
+
* @remarks Only written at {@link MessageFormatVersion.v7} and later.
|
|
30
|
+
*/
|
|
31
|
+
readonly customMetadata?: EncodedCustomMetadataTree;
|
|
26
32
|
/**
|
|
27
33
|
* The version of the message. This controls how the message is encoded.
|
|
28
34
|
*
|
|
29
35
|
* This was not set historically and was added before making any breaking changes to the format.
|
|
30
36
|
* For that reason, absence of a 'version' field is synonymous with version 1.
|
|
31
37
|
*/
|
|
32
|
-
readonly version?: typeof MessageFormatVersion.v1 | typeof MessageFormatVersion.v2 | typeof MessageFormatVersion.v3 | typeof MessageFormatVersion.v4 | typeof MessageFormatVersion.v6;
|
|
38
|
+
readonly version?: typeof MessageFormatVersion.v1 | typeof MessageFormatVersion.v2 | typeof MessageFormatVersion.v3 | typeof MessageFormatVersion.v4 | typeof MessageFormatVersion.v6 | typeof MessageFormatVersion.v7;
|
|
33
39
|
}
|
|
34
|
-
export declare const Message: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema) => Type.TObject<{
|
|
40
|
+
export declare const Message: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema, includeCustomMetadata: boolean) => Type.TObject<{
|
|
41
|
+
version: Type.TOptional<Type.TUnion<[Type.TLiteral<import("../util/brand.js").Brand<1, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<2, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<3, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<4, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<6, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<7, "MessageFormatVersion">>]>>;
|
|
42
|
+
customMetadata?: Type.TOptional<Type.TSchema> | undefined;
|
|
35
43
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
36
44
|
originatorId: Type.TUnsafe<SessionId>;
|
|
37
45
|
changeset: ChangeSchema;
|
|
38
|
-
version: Type.TOptional<Type.TUnion<[Type.TLiteral<import("../util/brand.js").Brand<1, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<2, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<3, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<4, "MessageFormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<6, "MessageFormatVersion">>]>>;
|
|
39
46
|
}>;
|
|
40
47
|
//# sourceMappingURL=messageFormatV1ToV4.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatV1ToV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormatV1ToV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,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;IACtC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,sBAAsB,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAEpD;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EACd,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,GAC9B,OAAO,oBAAoB,CAAC,EAAE,CAAC;CAClC;AAMD,eAAO,MAAM,OAAO,+CACV,YAAY,yBACE,OAAO;;;;;;EAmB5B,CAAC"}
|
|
@@ -8,20 +8,28 @@ exports.Message = void 0;
|
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const Type = tslib_1.__importStar(require("@sinclair/typebox"));
|
|
10
10
|
const index_js_1 = require("../core/index.js");
|
|
11
|
+
const customMetadataFormat_js_1 = require("./customMetadataFormat.js");
|
|
11
12
|
const messageFormat_js_1 = require("./messageFormat.js");
|
|
13
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
12
14
|
// Return type is intentionally derived.
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
+
// Unlike the summary formats, this schema does not set `additionalProperties: false`: the op envelope
|
|
16
|
+
// has always tolerated unknown properties, and tightening it could reject ops from other versions.
|
|
17
|
+
const Message = (tChange, includeCustomMetadata) => Type.Object({
|
|
15
18
|
revision: index_js_1.RevisionTagSchema,
|
|
16
19
|
originatorId: index_js_1.SessionIdSchema,
|
|
17
20
|
changeset: tChange,
|
|
21
|
+
...(includeCustomMetadata
|
|
22
|
+
? { customMetadata: Type.Optional(customMetadataFormat_js_1.EncodedCustomMetadataTree) }
|
|
23
|
+
: {}),
|
|
18
24
|
version: Type.Optional(Type.Union([
|
|
19
25
|
Type.Literal(messageFormat_js_1.MessageFormatVersion.v1),
|
|
20
26
|
Type.Literal(messageFormat_js_1.MessageFormatVersion.v2),
|
|
21
27
|
Type.Literal(messageFormat_js_1.MessageFormatVersion.v3),
|
|
22
28
|
Type.Literal(messageFormat_js_1.MessageFormatVersion.v4),
|
|
23
29
|
Type.Literal(messageFormat_js_1.MessageFormatVersion.v6),
|
|
30
|
+
Type.Literal(messageFormat_js_1.MessageFormatVersion.v7),
|
|
24
31
|
])),
|
|
25
32
|
});
|
|
26
33
|
exports.Message = Message;
|
|
34
|
+
/* eslint-enable @typescript-eslint/explicit-function-return-type */
|
|
27
35
|
//# sourceMappingURL=messageFormatV1ToV4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatV1ToV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormatV1ToV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAGH,gEAA0C;AAG1C,+CAA+F;AAG/F,yDAA0D;
|
|
1
|
+
{"version":3,"file":"messageFormatV1ToV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormatV1ToV4.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAGH,gEAA0C;AAG1C,+CAA+F;AAG/F,uEAAsE;AACtE,yDAA0D;AAwC1D,qEAAqE;AACrE,wCAAwC;AACxC,sGAAsG;AACtG,mGAAmG;AAC5F,MAAM,OAAO,GAAG,CACtB,OAAqB,EACrB,qBAA8B,EAC7B,EAAE,CACH,IAAI,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,4BAAiB;IAC3B,YAAY,EAAE,0BAAe;IAC7B,SAAS,EAAE,OAAO;IAClB,GAAG,CAAC,qBAAqB;QACxB,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,mDAAyB,CAAC,EAAE;QAC9D,CAAC,CAAC,EAAE,CAAC;IACN,OAAO,EAAE,IAAI,CAAC,QAAQ,CACrB,IAAI,CAAC,KAAK,CAAC;QACV,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,EAAE,CAAC;KACrC,CAAC,CACF;CACD,CAAC,CAAC;AArBS,QAAA,OAAO,WAqBhB;AACJ,oEAAoE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { SessionId } from \"@fluidframework/id-compressor\";\nimport * as Type from \"@sinclair/typebox\";\nimport type { TSchema } from \"@sinclair/typebox\";\n\nimport { type EncodedRevisionTag, RevisionTagSchema, SessionIdSchema } from \"../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport { EncodedCustomMetadataTree } from \"./customMetadataFormat.js\";\nimport { MessageFormatVersion } from \"./messageFormat.js\";\n\n/**\n * The format of messages that SharedTree sends and receives.\n */\nexport interface Message {\n\t/**\n\t * The revision tag for the change in this message\n\t */\n\treadonly revision: EncodedRevisionTag;\n\t/**\n\t * The stable ID that identifies the originator of the message.\n\t */\n\treadonly originatorId: SessionId;\n\t/**\n\t * The changeset to be applied.\n\t */\n\treadonly changeset: JsonCompatibleReadOnly;\n\n\t/**\n\t * Arbitrary, application-defined metadata to persist alongside the commit in this message.\n\t * @remarks Only written at {@link MessageFormatVersion.v7} and later.\n\t */\n\treadonly customMetadata?: EncodedCustomMetadataTree;\n\n\t/**\n\t * The version of the message. This controls how the message is encoded.\n\t *\n\t * This was not set historically and was added before making any breaking changes to the format.\n\t * For that reason, absence of a 'version' field is synonymous with version 1.\n\t */\n\treadonly version?:\n\t\t| typeof MessageFormatVersion.v1\n\t\t| typeof MessageFormatVersion.v2\n\t\t| typeof MessageFormatVersion.v3\n\t\t| typeof MessageFormatVersion.v4\n\t\t| typeof MessageFormatVersion.v6\n\t\t| typeof MessageFormatVersion.v7;\n}\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n// Return type is intentionally derived.\n// Unlike the summary formats, this schema does not set `additionalProperties: false`: the op envelope\n// has always tolerated unknown properties, and tightening it could reject ops from other versions.\nexport const Message = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) =>\n\tType.Object({\n\t\trevision: RevisionTagSchema,\n\t\toriginatorId: SessionIdSchema,\n\t\tchangeset: tChange,\n\t\t...(includeCustomMetadata\n\t\t\t? { customMetadata: Type.Optional(EncodedCustomMetadataTree) }\n\t\t\t: {}),\n\t\tversion: Type.Optional(\n\t\t\tType.Union([\n\t\t\t\tType.Literal(MessageFormatVersion.v1),\n\t\t\t\tType.Literal(MessageFormatVersion.v2),\n\t\t\t\tType.Literal(MessageFormatVersion.v3),\n\t\t\t\tType.Literal(MessageFormatVersion.v4),\n\t\t\t\tType.Literal(MessageFormatVersion.v6),\n\t\t\t\tType.Literal(MessageFormatVersion.v7),\n\t\t\t]),\n\t\t),\n\t});\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
|
|
@@ -7,6 +7,7 @@ import * as Type from "@sinclair/typebox";
|
|
|
7
7
|
import { type EncodedRevisionTag } from "../core/index.js";
|
|
8
8
|
import type { JsonCompatibleReadOnly } from "../util/index.js";
|
|
9
9
|
import type { EncodedBranchId } from "./branch.js";
|
|
10
|
+
import { EncodedCustomMetadataTree } from "./customMetadataFormat.js";
|
|
10
11
|
import { MessageFormatVersion } from "./messageFormat.js";
|
|
11
12
|
/**
|
|
12
13
|
* The format of messages that SharedTree sends and receives.
|
|
@@ -33,6 +34,11 @@ export interface Message {
|
|
|
33
34
|
* Not guaranteed to be unique.
|
|
34
35
|
*/
|
|
35
36
|
readonly branchName?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Arbitrary, application-defined metadata to persist alongside the commit in this message.
|
|
39
|
+
* @remarks See {@link GraphCommit.customMetadata}.
|
|
40
|
+
*/
|
|
41
|
+
readonly customMetadata?: EncodedCustomMetadataTree;
|
|
36
42
|
/**
|
|
37
43
|
* The version of the message format.
|
|
38
44
|
*/
|
|
@@ -44,6 +50,7 @@ export declare const Message: <ChangeSchema extends Type.TSchema>(tChange: Chang
|
|
|
44
50
|
changeset: ChangeSchema extends Type.TOptional<infer S extends Type.TSchema> ? Type.TOptional<S> : Type.Ensure<Type.TOptional<ChangeSchema>>;
|
|
45
51
|
branchId: Type.TOptional<Type.TNumber>;
|
|
46
52
|
branchName: Type.TOptional<Type.TString>;
|
|
53
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
47
54
|
version: Type.TLiteral<import("../util/brand.js").Brand<"shared-branches|v0.2", "MessageFormatVersion">>;
|
|
48
55
|
}>;
|
|
49
56
|
//# sourceMappingURL=messageFormatVSharedBranches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormatVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,KAAK,kBAAkB,EAAsC,MAAM,kBAAkB,CAAC;AAC/F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB;;OAEG;IACH,QAAQ,CAAC,QAAQ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AC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAEpD;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,oBAAoB,CAAC,eAAe,CAAC;CAC9D;AAID,eAAO,MAAM,OAAO,+CAA2C,YAAY;;;;;;;;EASxE,CAAC"}
|
|
@@ -8,6 +8,7 @@ exports.Message = void 0;
|
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const Type = tslib_1.__importStar(require("@sinclair/typebox"));
|
|
10
10
|
const index_js_1 = require("../core/index.js");
|
|
11
|
+
const customMetadataFormat_js_1 = require("./customMetadataFormat.js");
|
|
11
12
|
const messageFormat_js_1 = require("./messageFormat.js");
|
|
12
13
|
// Return type is intentionally derived.
|
|
13
14
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
@@ -17,6 +18,7 @@ const Message = (tChange) => Type.Object({
|
|
|
17
18
|
changeset: Type.Optional(tChange),
|
|
18
19
|
branchId: Type.Optional(Type.Number()),
|
|
19
20
|
branchName: Type.Optional(Type.String()),
|
|
21
|
+
customMetadata: Type.Optional(customMetadataFormat_js_1.EncodedCustomMetadataTree),
|
|
20
22
|
version: Type.Literal(messageFormat_js_1.MessageFormatVersion.vSharedBranches),
|
|
21
23
|
});
|
|
22
24
|
exports.Message = Message;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageFormatVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormatVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAGH,gEAA0C;AAG1C,+CAA+F;AAI/F,yDAA0D;
|
|
1
|
+
{"version":3,"file":"messageFormatVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/messageFormatVSharedBranches.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAGH,gEAA0C;AAG1C,+CAA+F;AAI/F,uEAAsE;AACtE,yDAA0D;AA0C1D,wCAAwC;AACxC,4EAA4E;AACrE,MAAM,OAAO,GAAG,CAA+B,OAAqB,EAAE,EAAE,CAC9E,IAAI,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAAiB,CAAC;IAC1C,YAAY,EAAE,0BAAe;IAC7B,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;IACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACxC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,mDAAyB,CAAC;IACxD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,uCAAoB,CAAC,eAAe,CAAC;CAC3D,CAAC,CAAC;AATS,QAAA,OAAO,WAShB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { SessionId } from \"@fluidframework/id-compressor\";\nimport * as Type from \"@sinclair/typebox\";\nimport type { TSchema } from \"@sinclair/typebox\";\n\nimport { type EncodedRevisionTag, RevisionTagSchema, SessionIdSchema } from \"../core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\n\nimport type { EncodedBranchId } from \"./branch.js\";\nimport { EncodedCustomMetadataTree } from \"./customMetadataFormat.js\";\nimport { MessageFormatVersion } from \"./messageFormat.js\";\n\n/**\n * The format of messages that SharedTree sends and receives.\n */\nexport interface Message {\n\t/**\n\t * The revision tag for the change in this message\n\t */\n\treadonly revision?: EncodedRevisionTag;\n\t/**\n\t * The stable ID that identifies the originator of the message.\n\t */\n\treadonly originatorId: SessionId;\n\t/**\n\t * The changeset to be applied.\n\t */\n\treadonly changeset?: JsonCompatibleReadOnly;\n\n\t/**\n\t * Unique ID associated with the branch.\n\t */\n\treadonly branchId?: EncodedBranchId;\n\n\t/**\n\t * Application-defined name of the branch, if any.\n\t * Not guaranteed to be unique.\n\t */\n\treadonly branchName?: string;\n\n\t/**\n\t * Arbitrary, application-defined metadata to persist alongside the commit in this message.\n\t * @remarks See {@link GraphCommit.customMetadata}.\n\t */\n\treadonly customMetadata?: EncodedCustomMetadataTree;\n\n\t/**\n\t * The version of the message format.\n\t */\n\treadonly version: typeof MessageFormatVersion.vSharedBranches;\n}\n\n// Return type is intentionally derived.\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport const Message = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Object({\n\t\trevision: Type.Optional(RevisionTagSchema),\n\t\toriginatorId: SessionIdSchema,\n\t\tchangeset: Type.Optional(tChange),\n\t\tbranchId: Type.Optional(Type.Number()),\n\t\tbranchName: Type.Optional(Type.String()),\n\t\tcustomMetadata: Type.Optional(EncodedCustomMetadataTree),\n\t\tversion: Type.Literal(MessageFormatVersion.vSharedBranches),\n\t});\n"]}
|
|
@@ -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,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAE7F,OAAO,KAAK,EACX,aAAa,EAIb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACX,sCAAsC,EACtC,yBAAyB,EACzB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,EACX,YAAY,EACZ,gBAAgB,EAChB,MAAM,6CAA6C,CAAC;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAc,MAAM,mBAAmB,CAAC;AAC/F,OAAO,EACN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AmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQzD,SAAS,IAAI,IAAI;IAIjB,YAAY,CAAC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IA6C7E,QAAQ,CAAC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IA+BzE,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI;IA4B5D,SAAS,CAAC,8BAA8B,CACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,EACjC,eAAe,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,GACxC,IAAI;IAcP,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAItB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,oBAAoB,CAAC,OAAO,CAAC;IAI3E,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,mBAAmB;CAG3B"}
|
|
@@ -373,8 +373,10 @@ let SharedTreeCore = (() => {
|
|
|
373
373
|
const type = message.type;
|
|
374
374
|
switch (type) {
|
|
375
375
|
case "commit": {
|
|
376
|
-
const { commit: { revision, change }, branchId, } = message;
|
|
377
|
-
this.editManager
|
|
376
|
+
const { commit: { revision, change, customMetadata }, branchId, } = message;
|
|
377
|
+
this.editManager
|
|
378
|
+
.getLocalBranch(branchId)
|
|
379
|
+
.apply({ change, revision }, index_js_1.CommitKind.Default, customMetadata);
|
|
378
380
|
break;
|
|
379
381
|
}
|
|
380
382
|
case "branch": {
|