@fluidframework/tree 2.116.0 → 2.117.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 +116 -0
- package/api-report/tree.alpha.api.md +78 -30
- package/api-report/tree.beta.api.md +12 -9
- package/api-report/tree.legacy.beta.api.md +12 -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/indexing/types.d.ts +1 -1
- package/dist/feature-libraries/indexing/types.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 +12 -7
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +13 -0
- 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 +130 -33
- 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/index.d.ts +1 -1
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.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 +180 -61
- 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/index.d.ts +1 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/tableSchema.js +10 -10
- package/dist/tableSchema.js.map +1 -1
- 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/indexing/types.d.ts +1 -1
- package/lib/feature-libraries/indexing/types.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 +12 -7
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +13 -0
- 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 +131 -34
- 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/index.d.ts +1 -1
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.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 +180 -61
- 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/index.d.ts +1 -1
- package/lib/simple-tree/index.d.ts.map +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 +23 -23
- 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 +8 -0
- package/src/entrypoints/beta.ts +1 -0
- package/src/entrypoints/legacy.ts +1 -0
- package/src/feature-libraries/indexing/types.ts +1 -1
- package/src/index.ts +8 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/history.ts +99 -0
- package/src/shared-tree/schematizingTreeView.ts +25 -8
- 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 +178 -39
- 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/index.ts +5 -0
- package/src/simple-tree/api/transactionTypes.ts +29 -2
- package/src/simple-tree/api/tree.ts +199 -60
- package/src/simple-tree/index.ts +5 -0
- package/src/tableSchema.ts +9 -9
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { JsonCompatibleReadOnlySchema, } from "../util/index.js";
|
|
6
6
|
import { decodeSharedBranch, encodeSharedBranch, } from "./editManagerCodecsCommons.js";
|
|
7
7
|
import { EncodedEditManager } from "./editManagerFormatV1toV4.js";
|
|
8
|
+
import { EditManagerFormatVersion } from "./editManagerFormatCommons.js";
|
|
8
9
|
/**
|
|
9
10
|
* Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).
|
|
10
11
|
* @remarks
|
|
@@ -14,11 +15,12 @@ import { EncodedEditManager } from "./editManagerFormatV1toV4.js";
|
|
|
14
15
|
* TODO: this file should be renamed as this is used for v6 as well.
|
|
15
16
|
*/
|
|
16
17
|
export function makeV1toV4andV6CodecWithVersion(changeCodec, revisionTagCodec, version) {
|
|
17
|
-
const
|
|
18
|
+
const includeCustomMetadata = version >= EditManagerFormatVersion.v7;
|
|
19
|
+
const schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema, includeCustomMetadata);
|
|
18
20
|
const codec = {
|
|
19
21
|
schema,
|
|
20
22
|
encode: (data, context) => {
|
|
21
|
-
const mainBranch = encodeSharedBranch(changeCodec, revisionTagCodec, data.main, context, data.originator);
|
|
23
|
+
const mainBranch = encodeSharedBranch(changeCodec, revisionTagCodec, data.main, context, data.originator, includeCustomMetadata);
|
|
22
24
|
const encoded = {
|
|
23
25
|
trunk: mainBranch.trunk,
|
|
24
26
|
branches: mainBranch.peers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerCodecsV1toV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,4BAA4B,GAC5B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACN,kBAAkB,EAClB,kBAAkB,GAGlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"editManagerCodecsV1toV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,4BAA4B,GAC5B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACN,kBAAkB,EAClB,kBAAkB,GAGlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B,CAC9C,WAKC,EACD,gBAKC,EACD,OAAkD;IAMlD,MAAM,qBAAqB,GAAG,OAAO,IAAI,wBAAwB,CAAC,EAAE,CAAC;IACrE,MAAM,MAAM,GAAG,kBAAkB,CAChC,WAAW,CAAC,aAAa,IAAI,4BAA4B,EACzD,qBAAqB,CACrB,CAAC;IAEF,MAAM,KAAK,GAIP;QACH,MAAM;QACN,MAAM,EAAE,CACP,IAA6B,EAC7B,OAAmC,EACyC,EAAE;YAC9E,MAAM,UAAU,GAAG,kBAAkB,CACpC,WAAW,EACX,gBAAgB,EAChB,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,UAAU,EACf,qBAAqB,CACrB,CAAC;YACF,MAAM,OAAO,GAAmC;gBAC/C,KAAK,EAAE,UAAU,CAAC,KAAK;gBACvB,QAAQ,EAAE,UAAU,CAAC,KAAK;gBAC1B,OAAO;aACP,CAAC;YACF,OAAO,OAEsB,CAAC;QAC/B,CAAC;QACD,MAAM,EAAE,CACP,IAA6D,EAC7D,OAAmC,EACT,EAAE;YAC5B,OAAO;gBACN,IAAI,EAAE,kBAAkB,CACvB,WAAW,EACX,gBAAgB,EAChB;oBACC,KAAK,EAAE,IAAI,CAAC,KAAK;oBACjB,KAAK,EAAE,IAAI,CAAC,QAAQ;iBACpB,EACD,OAAO,EACP,SAAS,CACT;aACD,CAAC;QACH,CAAC;KACD,CAAC;IACF,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { CodecAndSchema, IJsonCodec, Versioned } from \"../codec/index.js\";\nimport type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n} from \"../util/index.js\";\n\nimport type { SummaryData } from \"./editManager.js\";\nimport {\n\tdecodeSharedBranch,\n\tencodeSharedBranch,\n\ttype EditManagerDecodingContext,\n\ttype EditManagerEncodingContext,\n} from \"./editManagerCodecsCommons.js\";\nimport { EncodedEditManager } from \"./editManagerFormatV1toV4.js\";\nimport { EditManagerFormatVersion } from \"./editManagerFormatCommons.js\";\n\n/**\n * Create the provided version of the {@link EditManager} codec (which encodes it's {@link SummaryData}).\n * @remarks\n * The changeCodec and revisionTagCodec are not explicitly versioned, so the exact right version of them must be provided here\n * or data will be incompatible.\n *\n * TODO: this file should be renamed as this is used for v6 as well.\n */\nexport function makeV1toV4andV6CodecWithVersion<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion: EncodedEditManager<TChangeset>[\"version\"],\n): CodecAndSchema<\n\tSummaryData<TChangeset>,\n\tEditManagerEncodingContext,\n\tEditManagerDecodingContext\n> {\n\tconst includeCustomMetadata = version >= EditManagerFormatVersion.v7;\n\tconst schema = EncodedEditManager(\n\t\tchangeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema,\n\t\tincludeCustomMetadata,\n\t);\n\n\tconst codec: CodecAndSchema<\n\t\tSummaryData<TChangeset>,\n\t\tEditManagerEncodingContext,\n\t\tEditManagerDecodingContext\n\t> = {\n\t\tschema,\n\t\tencode: (\n\t\t\tdata: SummaryData<TChangeset>,\n\t\t\tcontext: EditManagerEncodingContext,\n\t\t): EncodedEditManager<TChangeset> & Versioned & JsonCompatibleReadOnlyObject => {\n\t\t\tconst mainBranch = encodeSharedBranch(\n\t\t\t\tchangeCodec,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tdata.main,\n\t\t\t\tcontext,\n\t\t\t\tdata.originator,\n\t\t\t\tincludeCustomMetadata,\n\t\t\t);\n\t\t\tconst encoded: EncodedEditManager<TChangeset> = {\n\t\t\t\ttrunk: mainBranch.trunk,\n\t\t\t\tbranches: mainBranch.peers,\n\t\t\t\tversion,\n\t\t\t};\n\t\t\treturn encoded as EncodedEditManager<TChangeset> &\n\t\t\t\tVersioned &\n\t\t\t\tJsonCompatibleReadOnlyObject;\n\t\t},\n\t\tdecode: (\n\t\t\tjson: EncodedEditManager<TChangeset> & JsonCompatibleReadOnly,\n\t\t\tcontext: EditManagerDecodingContext,\n\t\t): SummaryData<TChangeset> => {\n\t\t\treturn {\n\t\t\t\tmain: decodeSharedBranch(\n\t\t\t\t\tchangeCodec,\n\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t{\n\t\t\t\t\t\ttrunk: json.trunk,\n\t\t\t\t\t\tpeers: json.branches,\n\t\t\t\t\t},\n\t\t\t\t\tcontext,\n\t\t\t\t\tundefined, // Non \"vSharedBranches\" versions do not encode the summary originatorId.\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t};\n\treturn codec;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerCodecsVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACN,KAAK,sBAAsB,EAI3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAGN,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,GAChD,cAAc,CAChB,WAAW,CAAC,UAAU,CAAC,EACvB,0BAA0B,EAC1B,0BAA0B,CAC1B,
|
|
1
|
+
{"version":3,"file":"editManagerCodecsVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EACN,KAAK,sBAAsB,EAI3B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAGN,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,wBAAgB,kCAAkC,CAAC,UAAU,EAC5D,WAAW,EAAE,UAAU,CACtB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,CACrB,EACD,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,GAChD,cAAc,CAChB,WAAW,CAAC,UAAU,CAAC,EACvB,0BAA0B,EAC1B,0BAA0B,CAC1B,CAoFA"}
|
|
@@ -11,7 +11,7 @@ export function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec
|
|
|
11
11
|
const codec = {
|
|
12
12
|
schema,
|
|
13
13
|
encode: (data, context) => {
|
|
14
|
-
const mainBranch = encodeSharedBranch(changeCodec, revisionTagCodec, data.main, context, data.originator);
|
|
14
|
+
const mainBranch = encodeSharedBranch(changeCodec, revisionTagCodec, data.main, context, data.originator, true);
|
|
15
15
|
assert(data.originator !== undefined, 0xca5 /* Cannot encode vSharedBranches summary without originator */);
|
|
16
16
|
const json = {
|
|
17
17
|
main: mainBranch,
|
|
@@ -21,7 +21,7 @@ export function makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec
|
|
|
21
21
|
if (data.branches !== undefined && data.branches.size > 0) {
|
|
22
22
|
const branches = [];
|
|
23
23
|
for (const [_, branch] of data.branches) {
|
|
24
|
-
branches.push(encodeSharedBranch(changeCodec, revisionTagCodec, branch, context, data.originator));
|
|
24
|
+
branches.push(encodeSharedBranch(changeCodec, revisionTagCodec, branch, context, data.originator, true));
|
|
25
25
|
}
|
|
26
26
|
json.branches = branches;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerCodecsVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D,OAAO,EAGN,4BAA4B,GAE5B,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACN,kBAAkB,EAClB,kBAAkB,GAGlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,UAAU,kCAAkC,CACjD,WAKC,EACD,gBAKC,EACD,OAAkD;IAMlD,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,aAAa,IAAI,4BAA4B,CAAC,CAAC;IAE7F,MAAM,KAAK,GAIP;QACH,MAAM;QACN,MAAM,EAAE,CAAC,IAA6B,EAAE,OAAmC,EAAE,EAAE;YAC9E,MAAM,UAAU,GAAG,kBAAkB,CACpC,WAAW,EACX,gBAAgB,EAChB,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"editManagerCodecsVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerCodecsVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAI7D,OAAO,EAGN,4BAA4B,GAE5B,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EACN,kBAAkB,EAClB,kBAAkB,GAGlB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E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F,MAAM,OAAO,GAAqC;gBACjD,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,IAAI,CAAC,UAAU;aAC3B,CAAC;YAEF,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;gBACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAiD,CAAC;gBAC1E,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpC,MAAM,aAAa,GAAG,kBAAkB,CACvC,WAAW,EACX,gBAAgB,EAChB,MAAM,EACN,OAAO,EACP,IAAI,CAAC,UAAU,CACf,CAAC;oBACF,MAAM,CAAC,aAAa,CAAC,EAAE,KAAK,SAAS,EAAE,KAAK,CAAC,qCAAqC,CAAC,CAAC;oBACpF,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;oBAChF,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;gBAC/C,CAAC;gBAED,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;YACD,OAAO,OAAO,CAAC;QAChB,CAAC;KACD,CAAC;IAEF,OAAO,KAAK,CAAC;AACd,CAAC","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 } from \"../codec/index.js\";\nimport type { ChangeEncodingContext, EncodedRevisionTag, RevisionTag } from \"../core/index.js\";\nimport {\n\ttype JsonCompatibleReadOnly,\n\ttype JsonCompatibleReadOnlyObject,\n\tJsonCompatibleReadOnlySchema,\n\ttype Mutable,\n} from \"../util/index.js\";\n\nimport type { BranchId } from \"./branch.js\";\nimport type { SharedBranchSummaryData, SummaryData } from \"./editManager.js\";\nimport {\n\tdecodeSharedBranch,\n\tencodeSharedBranch,\n\ttype EditManagerDecodingContext,\n\ttype EditManagerEncodingContext,\n} from \"./editManagerCodecsCommons.js\";\nimport type { EncodedSharedBranch } from \"./editManagerFormatCommons.js\";\nimport { EncodedEditManager } from \"./editManagerFormatVSharedBranches.js\";\n\nexport function makeSharedBranchesCodecWithVersion<TChangeset>(\n\tchangeCodec: IJsonCodec<\n\t\tTChangeset,\n\t\tJsonCompatibleReadOnly,\n\t\tJsonCompatibleReadOnly,\n\t\tChangeEncodingContext\n\t>,\n\trevisionTagCodec: IJsonCodec<\n\t\tRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tEncodedRevisionTag,\n\t\tChangeEncodingContext\n\t>,\n\tversion: EncodedEditManager<TChangeset>[\"version\"],\n): CodecAndSchema<\n\tSummaryData<TChangeset>,\n\tEditManagerEncodingContext,\n\tEditManagerDecodingContext\n> {\n\tconst schema = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);\n\n\tconst codec: CodecAndSchema<\n\t\tSummaryData<TChangeset>,\n\t\tEditManagerEncodingContext,\n\t\tEditManagerDecodingContext\n\t> = {\n\t\tschema,\n\t\tencode: (data: SummaryData<TChangeset>, context: EditManagerEncodingContext) => {\n\t\t\tconst mainBranch = encodeSharedBranch(\n\t\t\t\tchangeCodec,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tdata.main,\n\t\t\t\tcontext,\n\t\t\t\tdata.originator,\n\t\t\t\ttrue,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tdata.originator !== undefined,\n\t\t\t\t0xca5 /* Cannot encode vSharedBranches summary without originator */,\n\t\t\t);\n\t\t\tconst json: Mutable<EncodedEditManager<TChangeset>> = {\n\t\t\t\tmain: mainBranch,\n\t\t\t\toriginator: data.originator,\n\t\t\t\tversion,\n\t\t\t};\n\t\t\tif (data.branches !== undefined && data.branches.size > 0) {\n\t\t\t\tconst branches: EncodedSharedBranch<TChangeset>[] = [];\n\t\t\t\tfor (const [_, branch] of data.branches) {\n\t\t\t\t\tbranches.push(\n\t\t\t\t\t\tencodeSharedBranch(\n\t\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\t\tbranch,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tdata.originator,\n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tjson.branches = branches;\n\t\t\t}\n\t\t\treturn json as EncodedEditManager<TChangeset> & JsonCompatibleReadOnlyObject;\n\t\t},\n\t\tdecode: (\n\t\t\tjson: EncodedEditManager<TChangeset> & JsonCompatibleReadOnlyObject,\n\t\t\tcontext: EditManagerDecodingContext,\n\t\t): SummaryData<TChangeset> => {\n\t\t\tconst mainBranch = decodeSharedBranch(\n\t\t\t\tchangeCodec,\n\t\t\t\trevisionTagCodec,\n\t\t\t\tjson.main,\n\t\t\t\tcontext,\n\t\t\t\tjson.originator,\n\t\t\t);\n\n\t\t\tconst decoded: Mutable<SummaryData<TChangeset>> = {\n\t\t\t\tmain: mainBranch,\n\t\t\t\toriginator: json.originator,\n\t\t\t};\n\n\t\t\tif (json.branches !== undefined) {\n\t\t\t\tconst branches = new Map<BranchId, SharedBranchSummaryData<TChangeset>>();\n\t\t\t\tfor (const branch of json.branches) {\n\t\t\t\t\tconst decodedBranch = decodeSharedBranch(\n\t\t\t\t\t\tchangeCodec,\n\t\t\t\t\t\trevisionTagCodec,\n\t\t\t\t\t\tbranch,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tjson.originator,\n\t\t\t\t\t);\n\t\t\t\t\tassert(decodedBranch.id !== undefined, 0xc66 /* Shared branches must have an id */);\n\t\t\t\t\tassert(!branches.has(decodedBranch.id), 0xc67 /* Duplicate shared branch id */);\n\t\t\t\t\tbranches.set(decodedBranch.id, decodedBranch);\n\t\t\t\t}\n\n\t\t\t\tdecoded.branches = branches;\n\t\t\t}\n\t\t\treturn decoded;\n\t\t},\n\t};\n\n\treturn codec;\n}\n"]}
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import type { SessionId } from "@fluidframework/id-compressor";
|
|
6
6
|
import * as Type from "@sinclair/typebox";
|
|
7
7
|
import type { Static } from "@sinclair/typebox";
|
|
8
|
-
import { type EncodedRevisionTag, type RevisionTag } from "../core/index.js";
|
|
8
|
+
import { type CustomMetadataTree, type EncodedRevisionTag, type RevisionTag } from "../core/index.js";
|
|
9
9
|
import { type Brand, type Values } from "../util/index.js";
|
|
10
10
|
import type { EncodedBranchId } from "./branch.js";
|
|
11
|
+
import { EncodedCustomMetadataTree } from "./customMetadataFormat.js";
|
|
11
12
|
/**
|
|
12
13
|
* Contains a single change to the `SharedTree` and associated metadata.
|
|
13
14
|
*
|
|
@@ -19,11 +20,14 @@ export interface Commit<TChangeset> {
|
|
|
19
20
|
readonly change: TChangeset;
|
|
20
21
|
/** An identifier representing the session/user/client that made this commit */
|
|
21
22
|
readonly sessionId: SessionId;
|
|
23
|
+
/** Arbitrary, application-defined metadata stored alongside this commit */
|
|
24
|
+
readonly customMetadata: CustomMetadataTree | undefined;
|
|
22
25
|
}
|
|
23
26
|
export type EncodedCommit<TChangeset> = {
|
|
24
27
|
readonly revision: EncodedRevisionTag;
|
|
25
28
|
readonly change: TChangeset;
|
|
26
29
|
readonly sessionId: SessionId;
|
|
30
|
+
readonly customMetadata?: EncodedCustomMetadataTree;
|
|
27
31
|
};
|
|
28
32
|
export type SeqNumber = Brand<number, "edit-manager.SeqNumber">;
|
|
29
33
|
declare const SequenceId: Type.TObject<{
|
|
@@ -36,9 +40,12 @@ export type SequenceId = Static<typeof SequenceId>;
|
|
|
36
40
|
*/
|
|
37
41
|
export interface SequencedCommit<TChangeset> extends Commit<TChangeset>, SequenceId {
|
|
38
42
|
}
|
|
39
|
-
|
|
43
|
+
/** The persisted counterpart of {@link SequencedCommit}. */
|
|
44
|
+
export type EncodedSequencedCommit<TChangeset> = EncodedCommit<TChangeset> & SequenceId;
|
|
45
|
+
export declare const SequencedCommit: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema, includeCustomMetadata: boolean) => Type.TObject<{
|
|
40
46
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
41
47
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T ? T extends Type.Assert<ChangeSchema, Type.TSchema> ? T extends Type.TNever ? [] : [T] : never : never>;
|
|
48
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
42
49
|
sessionId: Type.TUnsafe<SessionId>;
|
|
43
50
|
sequenceNumber: Type.TUnsafe<SeqNumber>;
|
|
44
51
|
indexInBatch: Type.TOptional<Type.TNumber>;
|
|
@@ -55,13 +62,14 @@ export interface SummarySessionBranch<TChangeset> {
|
|
|
55
62
|
}
|
|
56
63
|
export interface EncodedSummarySessionBranch<TChangeset> {
|
|
57
64
|
readonly base: EncodedRevisionTag;
|
|
58
|
-
readonly commits:
|
|
65
|
+
readonly commits: EncodedCommit<TChangeset>[];
|
|
59
66
|
}
|
|
60
|
-
export declare const SummarySessionBranch: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema) => Type.TObject<{
|
|
67
|
+
export declare const SummarySessionBranch: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema, includeCustomMetadata: boolean) => Type.TObject<{
|
|
61
68
|
base: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
62
69
|
commits: Type.TArray<Type.TObject<{
|
|
63
70
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
64
71
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T ? T extends Type.Assert<ChangeSchema, Type.TSchema> ? T extends Type.TNever ? [] : [T] : never : never>;
|
|
72
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
65
73
|
sessionId: Type.TUnsafe<SessionId>;
|
|
66
74
|
}>>;
|
|
67
75
|
}>;
|
|
@@ -71,10 +79,10 @@ export interface EncodedSharedBranch<TChangeset> {
|
|
|
71
79
|
readonly author?: string;
|
|
72
80
|
readonly session?: SessionId;
|
|
73
81
|
readonly base?: EncodedRevisionTag;
|
|
74
|
-
readonly trunk: readonly Readonly<
|
|
82
|
+
readonly trunk: readonly Readonly<EncodedSequencedCommit<TChangeset>>[];
|
|
75
83
|
readonly peers: readonly [SessionId, Readonly<EncodedSummarySessionBranch<TChangeset>>][];
|
|
76
84
|
}
|
|
77
|
-
export declare const EncodedSharedBranch: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema) => Type.TObject<{
|
|
85
|
+
export declare const EncodedSharedBranch: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema, includeCustomMetadata: boolean) => Type.TObject<{
|
|
78
86
|
id: Type.TOptional<Type.TNumber>;
|
|
79
87
|
name: Type.TOptional<Type.TString>;
|
|
80
88
|
session: Type.TOptional<Type.TUnsafe<SessionId>>;
|
|
@@ -83,6 +91,7 @@ export declare const EncodedSharedBranch: <ChangeSchema extends Type.TSchema>(tC
|
|
|
83
91
|
trunk: Type.TArray<Type.TObject<{
|
|
84
92
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
85
93
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T ? T extends Type.Assert<ChangeSchema, Type.TSchema> ? T extends Type.TNever ? [] : [T] : never : never>;
|
|
94
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
86
95
|
sessionId: Type.TUnsafe<SessionId>;
|
|
87
96
|
sequenceNumber: Type.TUnsafe<SeqNumber>;
|
|
88
97
|
indexInBatch: Type.TOptional<Type.TNumber>;
|
|
@@ -92,6 +101,7 @@ export declare const EncodedSharedBranch: <ChangeSchema extends Type.TSchema>(tC
|
|
|
92
101
|
commits: Type.TArray<Type.TObject<{
|
|
93
102
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
94
103
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T_1 ? T_1 extends Type.Assert<ChangeSchema, Type.TSchema> ? T_1 extends Type.TNever ? [] : [T_1] : never : never>;
|
|
104
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
95
105
|
sessionId: Type.TUnsafe<SessionId>;
|
|
96
106
|
}>>;
|
|
97
107
|
}>]>>;
|
|
@@ -106,6 +116,7 @@ export declare const EditManagerFormatVersion: {
|
|
|
106
116
|
readonly v4: Brand<4, "editManager.FormatVersion">;
|
|
107
117
|
readonly v5: Brand<5, "editManager.FormatVersion">;
|
|
108
118
|
readonly v6: Brand<6, "editManager.FormatVersion">;
|
|
119
|
+
readonly v7: Brand<7, "editManager.FormatVersion">;
|
|
109
120
|
readonly vSharedBranches: Brand<"shared-branches|v0.2", "editManager.FormatVersion">;
|
|
110
121
|
};
|
|
111
122
|
export type EditManagerFormatVersion = Values<typeof EditManagerFormatVersion>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerFormatCommons.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatCommons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,EAAiB,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAExE,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAGhB,MAAM,kBAAkB,CA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EAAE,CAAC;IACxE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAC1F;AAED,eAAO,MAAM,mBAAmB,+CACtB,YAAY,yBACE,OAAO;;;;;;;;;;;;;;;;;;;;;;;EAe7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;CAgDnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,eAAO,MAAM,kCAAkC,EAAE,WAAW,CAAC,wBAAwB,CAOlF,CAAC;AACJ,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,wBAAwB,CAE3E,CAAC"}
|
|
@@ -5,37 +5,41 @@
|
|
|
5
5
|
import * as Type from "@sinclair/typebox";
|
|
6
6
|
import { RevisionTagSchema, SessionIdSchema, } from "../core/index.js";
|
|
7
7
|
import { brandedNumberType, strictEnum } from "../util/index.js";
|
|
8
|
+
import { EncodedCustomMetadataTree } from "./customMetadataFormat.js";
|
|
8
9
|
const noAdditionalProps = { additionalProperties: false };
|
|
9
10
|
// Many of the return types in this module are intentionally derived, rather than explicitly specified.
|
|
10
11
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
11
|
-
const CommitBase = (tChange) => Type.Object({
|
|
12
|
+
const CommitBase = (tChange, includeCustomMetadata) => Type.Object({
|
|
12
13
|
revision: RevisionTagSchema,
|
|
13
14
|
change: tChange,
|
|
14
15
|
sessionId: SessionIdSchema,
|
|
16
|
+
...(includeCustomMetadata
|
|
17
|
+
? { customMetadata: Type.Optional(EncodedCustomMetadataTree) }
|
|
18
|
+
: {}),
|
|
15
19
|
});
|
|
16
20
|
/**
|
|
17
21
|
* @privateRemarks Commits are generally encoded from `GraphCommit`s, which often contain extra data.
|
|
18
22
|
* This `noAdditionalProps` is especially important in that light.
|
|
19
23
|
*/
|
|
20
|
-
const Commit = (tChange) => Type.Composite([CommitBase(tChange)], noAdditionalProps);
|
|
24
|
+
const Commit = (tChange, includeCustomMetadata) => Type.Composite([CommitBase(tChange, includeCustomMetadata)], noAdditionalProps);
|
|
21
25
|
const SeqNumber = brandedNumberType({ multipleOf: 1 });
|
|
22
26
|
const SequenceId = Type.Object({
|
|
23
27
|
sequenceNumber: SeqNumber,
|
|
24
28
|
indexInBatch: Type.Optional(Type.Number({ multipleOf: 1, minimum: 0 })),
|
|
25
29
|
});
|
|
26
|
-
export const SequencedCommit = (tChange) => Type.Composite([CommitBase(tChange), SequenceId], noAdditionalProps);
|
|
27
|
-
export const SummarySessionBranch = (tChange) => Type.Object({
|
|
30
|
+
export const SequencedCommit = (tChange, includeCustomMetadata) => Type.Composite([CommitBase(tChange, includeCustomMetadata), SequenceId], noAdditionalProps);
|
|
31
|
+
export const SummarySessionBranch = (tChange, includeCustomMetadata) => Type.Object({
|
|
28
32
|
base: RevisionTagSchema,
|
|
29
|
-
commits: Type.Array(Commit(tChange)),
|
|
33
|
+
commits: Type.Array(Commit(tChange, includeCustomMetadata)),
|
|
30
34
|
}, noAdditionalProps);
|
|
31
|
-
export const EncodedSharedBranch = (tChange) => Type.Object({
|
|
35
|
+
export const EncodedSharedBranch = (tChange, includeCustomMetadata) => Type.Object({
|
|
32
36
|
id: Type.Optional(Type.Number()),
|
|
33
37
|
name: Type.Optional(Type.String()),
|
|
34
38
|
session: Type.Optional(SessionIdSchema),
|
|
35
39
|
author: Type.Optional(Type.String()),
|
|
36
40
|
base: Type.Optional(RevisionTagSchema),
|
|
37
|
-
trunk: Type.Array(SequencedCommit(tChange)),
|
|
38
|
-
peers: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange)])),
|
|
41
|
+
trunk: Type.Array(SequencedCommit(tChange, includeCustomMetadata)),
|
|
42
|
+
peers: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange, includeCustomMetadata)])),
|
|
39
43
|
}, noAdditionalProps);
|
|
40
44
|
/**
|
|
41
45
|
* The format version for the EditManager.
|
|
@@ -78,6 +82,11 @@ export const EditManagerFormatVersion = strictEnum("editManager.FormatVersion",
|
|
|
78
82
|
* Adds support for "no change" constraints.
|
|
79
83
|
*/
|
|
80
84
|
v6: 6,
|
|
85
|
+
/**
|
|
86
|
+
* Introduced and made available for writing in 2.117.0.
|
|
87
|
+
* Adds support for {@link GraphCommit.customMetadata | persisted commit metadata}.
|
|
88
|
+
*/
|
|
89
|
+
v7: 7,
|
|
81
90
|
/**
|
|
82
91
|
* Not yet released.
|
|
83
92
|
* Only used for testing shared branches.
|
|
@@ -88,6 +97,7 @@ export const supportedEditManagerFormatVersions = new Set([
|
|
|
88
97
|
EditManagerFormatVersion.v3,
|
|
89
98
|
EditManagerFormatVersion.v4,
|
|
90
99
|
EditManagerFormatVersion.v6,
|
|
100
|
+
EditManagerFormatVersion.v7,
|
|
91
101
|
EditManagerFormatVersion.vSharedBranches,
|
|
92
102
|
]);
|
|
93
103
|
export const editManagerFormatVersions = new Set(Object.values(EditManagerFormatVersion));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerFormatCommons.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatCommons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAGN,iBAAiB,EACjB,eAAe,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAc,iBAAiB,EAAE,UAAU,EAAe,MAAM,kBAAkB,CAAC;AAwB1F,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAEzE,uGAAuG;AACvG,qEAAqE;AAErE,MAAM,UAAU,GAAG,CAA+B,OAAqB,EAAE,EAAE,CAC1E,IAAI,CAAC,MAAM,CAAC;IACX,QAAQ,EAAE,iBAAiB;IAC3B,MAAM,EAAE,OAAO;IACf,SAAS,EAAE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,MAAM,EAAE,CAAC;IACpC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACtC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC3C,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/E,EACD,iBAAiB,CACjB,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,UAAU,CAAC,2BAA2B,EAAE;IAC/E;;;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;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAC9C,IAAI,GAAG,CAAC;IACP,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,eAAe;CACxC,CAAC,CAAC;AACJ,MAAM,CAAC,MAAM,yBAAyB,GAA0C,IAAI,GAAG,CACtF,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,CACvC,CAAC;AACF,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 { ObjectOptions, Static, TSchema } from \"@sinclair/typebox\";\n\nimport {\n\ttype EncodedRevisionTag,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tSessionIdSchema,\n} from \"../core/index.js\";\nimport { type Brand, brandedNumberType, strictEnum, type Values } from \"../util/index.js\";\n\nimport type { EncodedBranchId } from \"./branch.js\";\n\n/**\n * Contains a single change to the `SharedTree` and associated metadata.\n *\n * TODO: if this type is not used in the encoded format, move it out of this file, and stop using it in EncodedEditManager.\n * If this is an encoded format, clarify the difference between it and EncodedCommit.\n */\nexport interface Commit<TChangeset> {\n\treadonly revision: RevisionTag;\n\treadonly change: TChangeset;\n\t/** An identifier representing the session/user/client that made this commit */\n\treadonly sessionId: SessionId;\n}\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type EncodedCommit<TChangeset> = {\n\treadonly revision: EncodedRevisionTag;\n\treadonly change: TChangeset;\n\treadonly sessionId: SessionId;\n};\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// Many of the return types in this module are intentionally derived, rather than explicitly specified.\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nconst CommitBase = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Object({\n\t\trevision: RevisionTagSchema,\n\t\tchange: tChange,\n\t\tsessionId: SessionIdSchema,\n\t});\n/**\n * @privateRemarks Commits are generally encoded from `GraphCommit`s, which often contain extra data.\n * This `noAdditionalProps` is especially important in that light.\n */\nconst Commit = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Composite([CommitBase(tChange)], noAdditionalProps);\n\nexport type SeqNumber = Brand<number, \"edit-manager.SeqNumber\">;\nconst SeqNumber = brandedNumberType<SeqNumber>({ multipleOf: 1 });\n\nconst SequenceId = Type.Object({\n\tsequenceNumber: SeqNumber,\n\tindexInBatch: Type.Optional(Type.Number({ multipleOf: 1, minimum: 0 })),\n});\n\nexport type SequenceId = Static<typeof SequenceId>;\n\n/**\n * A commit with a sequence number but no parentage; used for serializing the `EditManager` into a summary\n */\nexport interface SequencedCommit<TChangeset> extends Commit<TChangeset>, SequenceId {}\n\nexport const SequencedCommit = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Composite([CommitBase(tChange), SequenceId], noAdditionalProps);\n\n/**\n * A branch off of the trunk for use in summaries.\n *\n * TODO: if this type is not used in the encoded format, move it out of this file, and stop using it in EncodedEditManager.\n * If this is an encoded format, use EncodedCommit instead of Commit or clarify that Commit is also an encoded format.\n */\nexport interface SummarySessionBranch<TChangeset> {\n\treadonly base: RevisionTag;\n\treadonly commits: Commit<TChangeset>[];\n}\n\nexport interface EncodedSummarySessionBranch<TChangeset> {\n\treadonly base: EncodedRevisionTag;\n\treadonly commits: Commit<TChangeset>[];\n}\n\nexport const SummarySessionBranch = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Object(\n\t\t{\n\t\t\tbase: RevisionTagSchema,\n\t\t\tcommits: Type.Array(Commit(tChange)),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\nexport interface EncodedSharedBranch<TChangeset> {\n\treadonly id?: EncodedBranchId;\n\treadonly name?: string;\n\treadonly author?: string;\n\treadonly session?: SessionId;\n\treadonly base?: EncodedRevisionTag;\n\treadonly trunk: readonly Readonly<SequencedCommit<TChangeset>>[];\n\treadonly peers: readonly [SessionId, Readonly<EncodedSummarySessionBranch<TChangeset>>][];\n}\n\nexport const EncodedSharedBranch = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Object(\n\t\t{\n\t\t\tid: Type.Optional(Type.Number()),\n\t\t\tname: Type.Optional(Type.String()),\n\t\t\tsession: Type.Optional(SessionIdSchema),\n\t\t\tauthor: Type.Optional(Type.String()),\n\t\t\tbase: Type.Optional(RevisionTagSchema),\n\t\t\ttrunk: Type.Array(SequencedCommit(tChange)),\n\t\t\tpeers: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange)])),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\n/**\n * The format version for the EditManager.\n */\nexport const EditManagerFormatVersion = strictEnum(\"editManager.FormatVersion\", {\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 EditManagerFormatVersion.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 EditManagerFormatVersion.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 EditManagerFormatVersion.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 EditManagerFormatVersion = Values<typeof EditManagerFormatVersion>;\nexport const supportedEditManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> =\n\tnew Set([\n\t\tEditManagerFormatVersion.v3,\n\t\tEditManagerFormatVersion.v4,\n\t\tEditManagerFormatVersion.v6,\n\t\tEditManagerFormatVersion.vSharedBranches,\n\t]);\nexport const editManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> = new Set(\n\tObject.values(EditManagerFormatVersion),\n);\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
|
|
1
|
+
{"version":3,"file":"editManagerFormatCommons.js","sourceRoot":"","sources":["../../src/shared-tree-core/editMan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GG;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;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAC9C,IAAI,GAAG,CAAC;IACP,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,EAAE;IAC3B,wBAAwB,CAAC,eAAe;CACxC,CAAC,CAAC;AACJ,MAAM,CAAC,MAAM,yBAAyB,GAA0C,IAAI,GAAG,CACtF,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,CACvC,CAAC;AACF,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 { ObjectOptions, Static, TSchema } from \"@sinclair/typebox\";\n\nimport {\n\ttype CustomMetadataTree,\n\ttype EncodedRevisionTag,\n\ttype RevisionTag,\n\tRevisionTagSchema,\n\tSessionIdSchema,\n} from \"../core/index.js\";\nimport { type Brand, brandedNumberType, strictEnum, type Values } from \"../util/index.js\";\n\nimport type { EncodedBranchId } from \"./branch.js\";\nimport { EncodedCustomMetadataTree } from \"./customMetadataFormat.js\";\n\n/**\n * Contains a single change to the `SharedTree` and associated metadata.\n *\n * TODO: if this type is not used in the encoded format, move it out of this file, and stop using it in EncodedEditManager.\n * If this is an encoded format, clarify the difference between it and EncodedCommit.\n */\nexport interface Commit<TChangeset> {\n\treadonly revision: RevisionTag;\n\treadonly change: TChangeset;\n\t/** An identifier representing the session/user/client that made this commit */\n\treadonly sessionId: SessionId;\n\t/** Arbitrary, application-defined metadata stored alongside this commit */\n\treadonly customMetadata: CustomMetadataTree | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport type EncodedCommit<TChangeset> = {\n\treadonly revision: EncodedRevisionTag;\n\treadonly change: TChangeset;\n\treadonly sessionId: SessionId;\n\treadonly customMetadata?: EncodedCustomMetadataTree;\n};\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// Many of the return types in this module are intentionally derived, rather than explicitly specified.\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nconst CommitBase = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) =>\n\tType.Object({\n\t\trevision: RevisionTagSchema,\n\t\tchange: tChange,\n\t\tsessionId: SessionIdSchema,\n\t\t...(includeCustomMetadata\n\t\t\t? { customMetadata: Type.Optional(EncodedCustomMetadataTree) }\n\t\t\t: {}),\n\t});\n\n/**\n * @privateRemarks Commits are generally encoded from `GraphCommit`s, which often contain extra data.\n * This `noAdditionalProps` is especially important in that light.\n */\nconst Commit = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) => Type.Composite([CommitBase(tChange, includeCustomMetadata)], noAdditionalProps);\n\nexport type SeqNumber = Brand<number, \"edit-manager.SeqNumber\">;\nconst SeqNumber = brandedNumberType<SeqNumber>({ multipleOf: 1 });\n\nconst SequenceId = Type.Object({\n\tsequenceNumber: SeqNumber,\n\tindexInBatch: Type.Optional(Type.Number({ multipleOf: 1, minimum: 0 })),\n});\n\nexport type SequenceId = Static<typeof SequenceId>;\n\n/**\n * A commit with a sequence number but no parentage; used for serializing the `EditManager` into a summary\n */\nexport interface SequencedCommit<TChangeset> extends Commit<TChangeset>, SequenceId {}\n\n/** The persisted counterpart of {@link SequencedCommit}. */\nexport type EncodedSequencedCommit<TChangeset> = EncodedCommit<TChangeset> & SequenceId;\n\nexport const SequencedCommit = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) =>\n\tType.Composite([CommitBase(tChange, includeCustomMetadata), SequenceId], noAdditionalProps);\n\n/**\n * A branch off of the trunk for use in summaries.\n *\n * TODO: if this type is not used in the encoded format, move it out of this file, and stop using it in EncodedEditManager.\n * If this is an encoded format, use EncodedCommit instead of Commit or clarify that Commit is also an encoded format.\n */\nexport interface SummarySessionBranch<TChangeset> {\n\treadonly base: RevisionTag;\n\treadonly commits: Commit<TChangeset>[];\n}\n\nexport interface EncodedSummarySessionBranch<TChangeset> {\n\treadonly base: EncodedRevisionTag;\n\treadonly commits: EncodedCommit<TChangeset>[];\n}\n\nexport const SummarySessionBranch = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) =>\n\tType.Object(\n\t\t{\n\t\t\tbase: RevisionTagSchema,\n\t\t\tcommits: Type.Array(Commit(tChange, includeCustomMetadata)),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\nexport interface EncodedSharedBranch<TChangeset> {\n\treadonly id?: EncodedBranchId;\n\treadonly name?: string;\n\treadonly author?: string;\n\treadonly session?: SessionId;\n\treadonly base?: EncodedRevisionTag;\n\treadonly trunk: readonly Readonly<EncodedSequencedCommit<TChangeset>>[];\n\treadonly peers: readonly [SessionId, Readonly<EncodedSummarySessionBranch<TChangeset>>][];\n}\n\nexport const EncodedSharedBranch = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) =>\n\tType.Object(\n\t\t{\n\t\t\tid: Type.Optional(Type.Number()),\n\t\t\tname: Type.Optional(Type.String()),\n\t\t\tsession: Type.Optional(SessionIdSchema),\n\t\t\tauthor: Type.Optional(Type.String()),\n\t\t\tbase: Type.Optional(RevisionTagSchema),\n\t\t\ttrunk: Type.Array(SequencedCommit(tChange, includeCustomMetadata)),\n\t\t\tpeers: Type.Array(\n\t\t\t\tType.Tuple([SessionIdSchema, SummarySessionBranch(tChange, includeCustomMetadata)]),\n\t\t\t),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\n/**\n * The format version for the EditManager.\n */\nexport const EditManagerFormatVersion = strictEnum(\"editManager.FormatVersion\", {\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 EditManagerFormatVersion.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 EditManagerFormatVersion.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 EditManagerFormatVersion.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 EditManagerFormatVersion = Values<typeof EditManagerFormatVersion>;\nexport const supportedEditManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> =\n\tnew Set([\n\t\tEditManagerFormatVersion.v3,\n\t\tEditManagerFormatVersion.v4,\n\t\tEditManagerFormatVersion.v6,\n\t\tEditManagerFormatVersion.v7,\n\t\tEditManagerFormatVersion.vSharedBranches,\n\t]);\nexport const editManagerFormatVersions: ReadonlySet<EditManagerFormatVersion> = new Set(\n\tObject.values(EditManagerFormatVersion),\n);\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { SessionId } from "@fluidframework/id-compressor";
|
|
6
6
|
import * as Type from "@sinclair/typebox";
|
|
7
|
-
import { EditManagerFormatVersion, type
|
|
7
|
+
import { EditManagerFormatVersion, type EncodedSequencedCommit, type EncodedSummarySessionBranch } from "./editManagerFormatCommons.js";
|
|
8
8
|
export interface EncodedEditManager<TChangeset> {
|
|
9
|
-
readonly trunk: readonly Readonly<
|
|
9
|
+
readonly trunk: readonly Readonly<EncodedSequencedCommit<TChangeset>>[];
|
|
10
10
|
readonly branches: readonly [SessionId, Readonly<EncodedSummarySessionBranch<TChangeset>>][];
|
|
11
|
-
readonly version: typeof EditManagerFormatVersion.v1 | typeof EditManagerFormatVersion.v2 | typeof EditManagerFormatVersion.v3 | typeof EditManagerFormatVersion.v4 | typeof EditManagerFormatVersion.v6;
|
|
11
|
+
readonly version: typeof EditManagerFormatVersion.v1 | typeof EditManagerFormatVersion.v2 | typeof EditManagerFormatVersion.v3 | typeof EditManagerFormatVersion.v4 | typeof EditManagerFormatVersion.v6 | typeof EditManagerFormatVersion.v7;
|
|
12
12
|
}
|
|
13
|
-
export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema) => Type.TObject<{
|
|
14
|
-
version: Type.TUnion<[Type.TLiteral<import("../util/brand.js").Brand<1, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<2, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<3, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<4, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<6, "editManager.FormatVersion">>]>;
|
|
13
|
+
export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tChange: ChangeSchema, includeCustomMetadata: boolean) => Type.TObject<{
|
|
14
|
+
version: Type.TUnion<[Type.TLiteral<import("../util/brand.js").Brand<1, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<2, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<3, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<4, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<6, "editManager.FormatVersion">>, Type.TLiteral<import("../util/brand.js").Brand<7, "editManager.FormatVersion">>]>;
|
|
15
15
|
trunk: Type.TArray<Type.TObject<{
|
|
16
16
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
17
17
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T ? T extends Type.Assert<ChangeSchema, Type.TSchema> ? T extends Type.TNever ? [] : [T] : never : never>;
|
|
18
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
18
19
|
sessionId: Type.TUnsafe<SessionId>;
|
|
19
20
|
sequenceNumber: Type.TUnsafe<import("./editManagerFormatCommons.js").SeqNumber>;
|
|
20
21
|
indexInBatch: Type.TOptional<Type.TNumber>;
|
|
@@ -24,6 +25,7 @@ export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tCh
|
|
|
24
25
|
commits: Type.TArray<Type.TObject<{
|
|
25
26
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
26
27
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T_1 ? T_1 extends Type.Assert<ChangeSchema, Type.TSchema> ? T_1 extends Type.TNever ? [] : [T_1] : never : never>;
|
|
28
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
27
29
|
sessionId: Type.TUnsafe<SessionId>;
|
|
28
30
|
}>>;
|
|
29
31
|
}>]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerFormatV1toV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAK1C,OAAO,EACN,wBAAwB,EACxB,KAAK,
|
|
1
|
+
{"version":3,"file":"editManagerFormatV1toV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAK1C,OAAO,EACN,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAGhC,MAAM,+BAA+B,CAAC;AAOvC,MAAM,WAAW,kBAAkB,CAAC,UAAU;IAC7C,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;IACxE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,2BAA2B,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7F,QAAQ,CAAC,OAAO,EACb,OAAO,wBAAwB,CAAC,EAAE,GAClC,OAAO,wBAAwB,CAAC,EAAE,GAClC,OAAO,wBAAwB,CAAC,EAAE,GAClC,OAAO,wBAAwB,CAAC,EAAE,GAClC,OAAO,wBAAwB,CAAC,EAAE,GAClC,OAAO,wBAAwB,CAAC,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,kBAAkB,+CACrB,YAAY,yBACE,OAAO;;;;;;;;;;;;;;;;;;;EAkB7B,CAAC"}
|
|
@@ -6,16 +6,17 @@ import * as Type from "@sinclair/typebox";
|
|
|
6
6
|
import { SessionIdSchema } from "../core/index.js";
|
|
7
7
|
import { EditManagerFormatVersion, SequencedCommit, SummarySessionBranch, } from "./editManagerFormatCommons.js";
|
|
8
8
|
const noAdditionalProps = { additionalProperties: false };
|
|
9
|
-
export const EncodedEditManager = (tChange) => Type.Object({
|
|
9
|
+
export const EncodedEditManager = (tChange, includeCustomMetadata) => Type.Object({
|
|
10
10
|
version: Type.Union([
|
|
11
11
|
Type.Literal(EditManagerFormatVersion.v1),
|
|
12
12
|
Type.Literal(EditManagerFormatVersion.v2),
|
|
13
13
|
Type.Literal(EditManagerFormatVersion.v3),
|
|
14
14
|
Type.Literal(EditManagerFormatVersion.v4),
|
|
15
15
|
Type.Literal(EditManagerFormatVersion.v6),
|
|
16
|
+
Type.Literal(EditManagerFormatVersion.v7),
|
|
16
17
|
]),
|
|
17
|
-
trunk: Type.Array(SequencedCommit(tChange)),
|
|
18
|
-
branches: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange)])),
|
|
18
|
+
trunk: Type.Array(SequencedCommit(tChange, includeCustomMetadata)),
|
|
19
|
+
branches: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange, includeCustomMetadata)])),
|
|
19
20
|
}, noAdditionalProps);
|
|
20
21
|
/* eslint-enable @typescript-eslint/explicit-function-return-type */
|
|
21
22
|
//# sourceMappingURL=editManagerFormatV1toV4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerFormatV1toV4.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatV1toV4.ts"],"names":[],"mappings":"AAAA;;;GAG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BAAiB,CACjB,CAAC;AAEH,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 { ObjectOptions, TSchema } from \"@sinclair/typebox\";\n\nimport { SessionIdSchema } from \"../core/index.js\";\n\nimport {\n\tEditManagerFormatVersion,\n\ttype EncodedSequencedCommit,\n\ttype EncodedSummarySessionBranch,\n\tSequencedCommit,\n\tSummarySessionBranch,\n} from \"./editManagerFormatCommons.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// Many of the return types in this module are intentionally derived, rather than explicitly specified.\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nexport interface EncodedEditManager<TChangeset> {\n\treadonly trunk: readonly Readonly<EncodedSequencedCommit<TChangeset>>[];\n\treadonly branches: readonly [SessionId, Readonly<EncodedSummarySessionBranch<TChangeset>>][];\n\treadonly version:\n\t\t| typeof EditManagerFormatVersion.v1\n\t\t| typeof EditManagerFormatVersion.v2\n\t\t| typeof EditManagerFormatVersion.v3\n\t\t| typeof EditManagerFormatVersion.v4\n\t\t| typeof EditManagerFormatVersion.v6\n\t\t| typeof EditManagerFormatVersion.v7;\n}\n\nexport const EncodedEditManager = <ChangeSchema extends TSchema>(\n\ttChange: ChangeSchema,\n\tincludeCustomMetadata: boolean,\n) =>\n\tType.Object(\n\t\t{\n\t\t\tversion: Type.Union([\n\t\t\t\tType.Literal(EditManagerFormatVersion.v1),\n\t\t\t\tType.Literal(EditManagerFormatVersion.v2),\n\t\t\t\tType.Literal(EditManagerFormatVersion.v3),\n\t\t\t\tType.Literal(EditManagerFormatVersion.v4),\n\t\t\t\tType.Literal(EditManagerFormatVersion.v6),\n\t\t\t\tType.Literal(EditManagerFormatVersion.v7),\n\t\t\t]),\n\t\t\ttrunk: Type.Array(SequencedCommit(tChange, includeCustomMetadata)),\n\t\t\tbranches: Type.Array(\n\t\t\t\tType.Tuple([SessionIdSchema, SummarySessionBranch(tChange, includeCustomMetadata)]),\n\t\t\t),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
|
|
@@ -23,6 +23,7 @@ export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tCh
|
|
|
23
23
|
trunk: Type.TArray<Type.TObject<{
|
|
24
24
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
25
25
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T ? T extends Type.Assert<ChangeSchema, Type.TSchema> ? T extends Type.TNever ? [] : [T] : never : never>;
|
|
26
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
26
27
|
sessionId: Type.TUnsafe<SessionId>;
|
|
27
28
|
sequenceNumber: Type.TUnsafe<import("./editManagerFormatCommons.js").SeqNumber>;
|
|
28
29
|
indexInBatch: Type.TOptional<Type.TNumber>;
|
|
@@ -32,6 +33,7 @@ export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tCh
|
|
|
32
33
|
commits: Type.TArray<Type.TObject<{
|
|
33
34
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
34
35
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T_1 ? T_1 extends Type.Assert<ChangeSchema, Type.TSchema> ? T_1 extends Type.TNever ? [] : [T_1] : never : never>;
|
|
36
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
35
37
|
sessionId: Type.TUnsafe<SessionId>;
|
|
36
38
|
}>>;
|
|
37
39
|
}>]>>;
|
|
@@ -45,6 +47,7 @@ export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tCh
|
|
|
45
47
|
trunk: Type.TArray<Type.TObject<{
|
|
46
48
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
47
49
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T_2 ? T_2 extends Type.Assert<ChangeSchema, Type.TSchema> ? T_2 extends Type.TNever ? [] : [T_2] : never : never>;
|
|
50
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
48
51
|
sessionId: Type.TUnsafe<SessionId>;
|
|
49
52
|
sequenceNumber: Type.TUnsafe<import("./editManagerFormatCommons.js").SeqNumber>;
|
|
50
53
|
indexInBatch: Type.TOptional<Type.TNumber>;
|
|
@@ -54,6 +57,7 @@ export declare const EncodedEditManager: <ChangeSchema extends Type.TSchema>(tCh
|
|
|
54
57
|
commits: Type.TArray<Type.TObject<{
|
|
55
58
|
revision: Type.TUnion<[Type.TLiteral<"root">, Type.TUnsafe<import("../util/brand.js").Brand<import("@fluidframework/id-compressor").OpSpaceCompressedId, "EncodedRevisionTag">>]>;
|
|
56
59
|
change: Type.TIntersectEvaluated<Type.Assert<ChangeSchema, Type.TSchema> extends infer T_3 ? T_3 extends Type.Assert<ChangeSchema, Type.TSchema> ? T_3 extends Type.TNever ? [] : [T_3] : never : never>;
|
|
60
|
+
customMetadata: Type.TOptional<Type.TSchema>;
|
|
57
61
|
sessionId: Type.TUnsafe<SessionId>;
|
|
58
62
|
}>>;
|
|
59
63
|
}>]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerFormatVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAK1C,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAO9F,MAAM,WAAW,kBAAkB,CAAC,UAAU;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,wBAAwB,CAAC,eAAe,CAAC;IAClE,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;CAC/D;AAED,eAAO,MAAM,kBAAkB,+CAA2C,YAAY
|
|
1
|
+
{"version":3,"file":"editManagerFormatVSharedBranches.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAK1C,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAO9F,MAAM,WAAW,kBAAkB,CAAC,UAAU;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,wBAAwB,CAAC,eAAe,CAAC;IAClE,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC/C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,mBAAmB,CAAC,UAAU,CAAC,EAAE,CAAC;CAC/D;AAED,eAAO,MAAM,kBAAkB,+CAA2C,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASpF,CAAC"}
|
|
@@ -9,8 +9,8 @@ const noAdditionalProps = { additionalProperties: false };
|
|
|
9
9
|
export const EncodedEditManager = (tChange) => Type.Object({
|
|
10
10
|
version: Type.Literal(EditManagerFormatVersion.vSharedBranches),
|
|
11
11
|
originator: SessionIdSchema,
|
|
12
|
-
main: EncodedSharedBranch(tChange),
|
|
13
|
-
branches: Type.Optional(Type.Array(EncodedSharedBranch(tChange))),
|
|
12
|
+
main: EncodedSharedBranch(tChange, true),
|
|
13
|
+
branches: Type.Optional(Type.Array(EncodedSharedBranch(tChange, true))),
|
|
14
14
|
}, noAdditionalProps);
|
|
15
15
|
/* eslint-enable @typescript-eslint/explicit-function-return-type */
|
|
16
16
|
//# sourceMappingURL=editManagerFormatVSharedBranches.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editManagerFormatVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9F,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAYzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAA+B,OAAqB,EAAE,EAAE,CACzF,IAAI,CAAC,MAAM,CACV;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,eAAe,CAAC;IAC/D,UAAU,EAAE,eAAe;IAC3B,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"editManagerFormatVSharedBranches.js","sourceRoot":"","sources":["../../src/shared-tree-core/editManagerFormatVSharedBranches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9F,MAAM,iBAAiB,GAAkB,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAYzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAA+B,OAAqB,EAAE,EAAE,CACzF,IAAI,CAAC,MAAM,CACV;IACC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,eAAe,CAAC;IAC/D,UAAU,EAAE,eAAe;IAC3B,IAAI,EAAE,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC;IACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;CACvE,EACD,iBAAiB,CACjB,CAAC;AAEH,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 { ObjectOptions, TSchema } from \"@sinclair/typebox\";\n\nimport { SessionIdSchema } from \"../core/index.js\";\n\nimport { EncodedSharedBranch, EditManagerFormatVersion } from \"./editManagerFormatCommons.js\";\n\nconst noAdditionalProps: ObjectOptions = { additionalProperties: false };\n\n// Many of the return types in this module are intentionally derived, rather than explicitly specified.\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\nexport interface EncodedEditManager<TChangeset> {\n\treadonly version: typeof EditManagerFormatVersion.vSharedBranches;\n\treadonly originator: SessionId;\n\treadonly main: EncodedSharedBranch<TChangeset>;\n\treadonly branches?: readonly EncodedSharedBranch<TChangeset>[];\n}\n\nexport const EncodedEditManager = <ChangeSchema extends TSchema>(tChange: ChangeSchema) =>\n\tType.Object(\n\t\t{\n\t\t\tversion: Type.Literal(EditManagerFormatVersion.vSharedBranches),\n\t\t\toriginator: SessionIdSchema,\n\t\t\tmain: EncodedSharedBranch(tChange, true),\n\t\t\tbranches: Type.Optional(Type.Array(EncodedSharedBranch(tChange, true))),\n\t\t},\n\t\tnoAdditionalProps,\n\t);\n\n/* eslint-enable @typescript-eslint/explicit-function-return-type */\n"]}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { onForkTransitive, SharedTreeBranch, type SharedTreeBranchChange, type SharedTreeBranchEvents, type BranchId, } from "./branch.js";
|
|
5
|
+
export { onForkTransitive, SharedTreeBranch, type SharedTreeBranchChange, type SharedTreeBranchEvents, type BranchId, type BranchTrimmingEvents, } from "./branch.js";
|
|
6
|
+
export { BranchCommitCounter } from "./branchCommitCounter.js";
|
|
6
7
|
export { type ChangeProcessor, type OnPop, type OnPush, type SquashingTransactionOptions, type TransactionEvents, type Transactor, ChangeProcessorApplicability, SquashingTransactionStack, TransactionResult, TransactionStack, } from "./transaction.js";
|
|
7
8
|
export { SharedTreeCore, type ClonableSchemaAndPolicy, type SharedTreeCoreOptionsInternal, type EnrichmentConfig, } from "./sharedTreeCore.js";
|
|
8
9
|
export { SharedTreeSummaryFormatVersion, type SharedTreeSummarizableMetadata, type Summarizable, type SummaryElementParser, type SummaryElementStringifier, summarizablesMetadataKey, } from "./summaryTypes.js";
|
|
@@ -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,
|
|
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,K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,CAAC;AAEvC,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACN,sCAAsC,EACtC,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,sBAAsB,GAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,EACpB,8BAA8B,GAC9B,MAAM,oBAAoB,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
export { onForkTransitive, SharedTreeBranch, } from "./branch.js";
|
|
6
|
+
export { BranchCommitCounter } from "./branchCommitCounter.js";
|
|
6
7
|
export { ChangeProcessorApplicability, SquashingTransactionStack, TransactionResult, TransactionStack, } from "./transaction.js";
|
|
7
8
|
export { SharedTreeCore, } from "./sharedTreeCore.js";
|
|
8
9
|
export { SharedTreeSummaryFormatVersion, summarizablesMetadataKey, } from "./summaryTypes.js";
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared-tree-core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAKhB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAON,4BAA4B,EAC5B,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,cAAc,GAId,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,8BAA8B,EAK9B,wBAAwB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAIrE,OAAO,EACN,2BAA2B,EAC3B,0CAA0C,EAC1C,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,wBAAwB,EACxB,kCAAkC,GAClC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACN,WAAW,EACX,6BAA6B,GAG7B,MAAM,kBAAkB,CAAC;AAU1B,OAAO,EACN,sCAAsC,EACtC,uBAAuB,EACvB,gBAAgB,GAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,oBAAoB,EACpB,8BAA8B,GAC9B,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\ttype BranchTrimmingEvents,\n} from \"./branch.js\";\n\nexport { BranchCommitCounter } from \"./branchCommitCounter.js\";\n\nexport {\n\ttype ChangeProcessor,\n\ttype OnPop,\n\ttype OnPush,\n\ttype SquashingTransactionOptions,\n\ttype TransactionEvents,\n\ttype Transactor,\n\tChangeProcessorApplicability,\n\tSquashingTransactionStack,\n\tTransactionResult,\n\tTransactionStack,\n} from \"./transaction.js\";\n\nexport {\n\tSharedTreeCore,\n\ttype ClonableSchemaAndPolicy,\n\ttype SharedTreeCoreOptionsInternal,\n\ttype EnrichmentConfig,\n} from \"./sharedTreeCore.js\";\nexport {\n\tSharedTreeSummaryFormatVersion,\n\ttype SharedTreeSummarizableMetadata,\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n\tsummarizablesMetadataKey,\n} from \"./summaryTypes.js\";\nexport { VersionedSummarizer } from \"./versionedSummarizer.js\";\n\nexport type { ResubmitMachine } from \"./resubmitMachine.js\";\nexport { DefaultResubmitMachine } from \"./defaultResubmitMachine.js\";\n\nexport { type ChangeEnricher } from \"./changeEnricher.js\";\n\nexport {\n\tmakeEditManagerCodecBuilder,\n\tgetCodecTreeForEditManagerFormatWithChange,\n\teditManagerCodecName,\n} from \"./editManagerCodecs.js\";\nexport {\n\tEditManagerFormatVersion,\n\tsupportedEditManagerFormatVersions,\n} from \"./editManagerFormatCommons.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 type { DecodedMessage } from \"./messageTypes.js\";\nexport {\n\tgetCodecTreeForMessageFormatWithChange,\n\tmakeMessageCodecBuilder,\n\tmessageCodecName,\n\ttype MessageEncodingContext,\n} from \"./messageCodecs.js\";\nexport {\n\tMessageFormatVersion,\n\tsupportedMessageFormatVersions,\n} from \"./messageFormat.js\";\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { CodecAndSchema, IJsonCodec } from "../codec/index.js";
|
|
6
6
|
import type { ChangeEncodingContext, ChangeFamilyCodec, EncodedRevisionTag, RevisionTag } from "../core/index.js";
|
|
7
7
|
import type { MessageDecodingContext, MessageEncodingContext } from "./messageCodecs.js";
|
|
8
|
-
import
|
|
8
|
+
import { MessageFormatVersion } from "./messageFormat.js";
|
|
9
9
|
import type { DecodedMessage } from "./messageTypes.js";
|
|
10
|
-
export declare function makeV1ToV4CodecWithVersion<TChangeset>(changeCodec: ChangeFamilyCodec<TChangeset>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, version: typeof MessageFormatVersion.v1 | typeof MessageFormatVersion.v2 | typeof MessageFormatVersion.v3 | typeof MessageFormatVersion.v4 | typeof MessageFormatVersion.v6): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext, MessageDecodingContext>;
|
|
10
|
+
export declare function makeV1ToV4CodecWithVersion<TChangeset>(changeCodec: ChangeFamilyCodec<TChangeset>, revisionTagCodec: IJsonCodec<RevisionTag, EncodedRevisionTag, EncodedRevisionTag, ChangeEncodingContext>, version: typeof MessageFormatVersion.v1 | typeof MessageFormatVersion.v2 | typeof MessageFormatVersion.v3 | typeof MessageFormatVersion.v4 | typeof MessageFormatVersion.v6 | typeof MessageFormatVersion.v7): CodecAndSchema<DecodedMessage<TChangeset>, MessageEncodingContext, MessageDecodingContext>;
|
|
11
11
|
//# sourceMappingURL=messageCodecV1ToV4.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageCodecV1ToV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,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":"messageCodecV1ToV4.d.ts","sourceRoot":"","sources":["../../src/shared-tree-core/messageCodecV1ToV4.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,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;AAO1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,wBAAgB,0BAA0B,CAAC,UAAU,EACpD,WAAW,EAAE,iBAAiB,CAAC,UAAU,CAAC,EAC1C,gBAAgB,EAAE,UAAU,CAC3B,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,CACrB,EACD,OAAO,EACJ,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,GAC/B,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,sBAAsB,EAAE,sBAAsB,CAAC,CAuE5F"}
|