@fluidframework/tree 2.74.0-365691 → 2.74.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/.vscode/settings.json +4 -2
- package/CHANGELOG.md +11 -0
- package/api-report/tree.alpha.api.md +125 -87
- package/api-report/tree.beta.api.md +0 -1
- package/api-report/tree.legacy.beta.api.md +0 -1
- package/api-report/tree.legacy.public.api.md +0 -1
- package/api-report/tree.public.api.md +0 -1
- package/assertTagging.config.mjs +1 -1
- package/dist/alpha.d.ts +6 -2
- package/dist/codec/codec.d.ts +41 -13
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +46 -19
- package/dist/codec/codec.js.map +1 -1
- package/dist/codec/versioned/codec.d.ts +1 -1
- package/dist/codec/versioned/codec.d.ts.map +1 -1
- package/dist/codec/versioned/codec.js.map +1 -1
- package/dist/codec/versioned/format.d.ts +4 -1
- package/dist/codec/versioned/format.d.ts.map +1 -1
- package/dist/codec/versioned/format.js +4 -1
- package/dist/codec/versioned/format.js.map +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +20 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +4 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +2 -2
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +34 -13
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +12 -12
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +2 -2
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/index.d.ts +3 -2
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js +3 -0
- package/dist/core/tree/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +22 -26
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/dist/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js +41 -11
- package/dist/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +7 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +13 -11
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +35 -31
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatCommon.js +27 -0
- package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV1.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/formatV2.js +11 -0
- package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +21 -43
- package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -2
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -4
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js +43 -0
- package/dist/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js +14 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js +21 -0
- package/dist/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js +35 -0
- package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/dist/feature-libraries/index.d.ts +1 -1
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +3 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +54 -3
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/dist/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/dist/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +4 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts +1 -1
- package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/index.js +2 -1
- package/dist/feature-libraries/modular-schema/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +4 -4
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js +42 -16
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/shared-tree/independentView.d.ts +1 -1
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +1 -1
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +2 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +3 -0
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +2 -2
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +4 -4
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +2 -2
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +1 -1
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +10 -5
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +72 -17
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +10 -8
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{lib/shared-tree-core/editManagerCodecsV5.d.ts → dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +7 -7
- package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +18 -9
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
- package/dist/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/dist/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerSummarizer.js +41 -13
- package/dist/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -2
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +7 -1
- package/dist/shared-tree-core/index.js.map +1 -1
- package/{lib/shared-tree-core/messageCodecV5.d.ts → dist/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +6 -6
- package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +12 -10
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +9 -36
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/dist/shared-tree-core/messageFormat.js +19 -9
- package/dist/shared-tree-core/messageFormat.js.map +1 -1
- package/{lib/shared-tree-core/messageFormatV5.d.ts → dist/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
- package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/dist/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +13 -47
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +29 -17
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/shared-tree-core/summaryTypes.d.ts +94 -0
- package/dist/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/dist/shared-tree-core/summaryTypes.js +47 -0
- package/dist/shared-tree-core/summaryTypes.js.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts +72 -0
- package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/dist/shared-tree-core/versionedSummarizer.js +64 -0
- package/dist/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/dist/simple-tree/api/configuration.d.ts +3 -26
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +10 -21
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/dist/simple-tree/api/dirtyIndex.js +7 -0
- package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/dist/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js +97 -0
- package/dist/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/dist/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js +9 -3
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +7 -0
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/dist/simple-tree/api/index.d.ts +4 -4
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +8 -5
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +5 -0
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +12 -12
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.js +18 -6
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js +13 -8
- package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts +1 -1
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +1 -2
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +15 -2
- 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/api/typesUnsafe.d.ts +3 -3
- package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +2 -2
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +1 -1
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +2 -3
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/toStored.d.ts +17 -15
- package/dist/simple-tree/core/toStored.d.ts.map +1 -1
- package/dist/simple-tree/core/toStored.js +5 -40
- package/dist/simple-tree/core/toStored.js.map +1 -1
- package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -0
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +4 -0
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +20 -5
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +3 -3
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +6 -5
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +16 -11
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +5 -5
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +55 -23
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js +17 -0
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +58 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +205 -30
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/treeSchema.d.ts +23 -0
- package/dist/simple-tree/treeSchema.d.ts.map +1 -0
- package/dist/simple-tree/treeSchema.js +25 -0
- package/dist/simple-tree/treeSchema.js.map +1 -0
- package/dist/tableSchema.d.ts +107 -64
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +161 -60
- package/dist/tableSchema.js.map +1 -1
- package/dist/util/brand.d.ts +49 -0
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +47 -1
- package/dist/util/brand.js.map +1 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +6 -2
- package/dist/util/index.js.map +1 -1
- package/dist/util/readSnapshotBlob.d.ts +13 -0
- package/dist/util/readSnapshotBlob.d.ts.map +1 -0
- package/dist/util/readSnapshotBlob.js +18 -0
- package/dist/util/readSnapshotBlob.js.map +1 -0
- package/eslint.config.mts +98 -0
- package/lib/alpha.d.ts +6 -2
- package/lib/codec/codec.d.ts +41 -13
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +40 -13
- package/lib/codec/codec.js.map +1 -1
- package/lib/codec/versioned/codec.d.ts +1 -1
- package/lib/codec/versioned/codec.d.ts.map +1 -1
- package/lib/codec/versioned/codec.js.map +1 -1
- package/lib/codec/versioned/format.d.ts +4 -1
- package/lib/codec/versioned/format.d.ts.map +1 -1
- package/lib/codec/versioned/format.js +4 -1
- package/lib/codec/versioned/format.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.map +1 -1
- package/lib/core/rebase/types.d.ts +20 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +4 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +3 -3
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +34 -13
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +12 -12
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +4 -4
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/index.d.ts +3 -2
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +2 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +3 -3
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +5 -5
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts +14 -6
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +7 -2
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +3 -3
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +23 -27
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts +30 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js +38 -8
- package/lib/feature-libraries/detachedFieldIndexSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +7 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +12 -11
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +10 -13
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +33 -29
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts +61 -0
- package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatCommon.js +23 -0
- package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV1.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts +51 -0
- package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/formatV2.js +8 -0
- package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +18 -24
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +20 -42
- package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -2
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +2 -2
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts +35 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js +40 -0
- package/lib/feature-libraries/forest-summary/summaryFormatCommon.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js +11 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV1ToV2.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js +18 -0
- package/lib/feature-libraries/forest-summary/summaryFormatV3.js.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts +17 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js +30 -0
- package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -0
- package/lib/feature-libraries/index.d.ts +1 -1
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -1
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts +18 -2
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +55 -5
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts +25 -13
- package/lib/feature-libraries/modular-schema/fieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldKind.js +0 -21
- package/lib/feature-libraries/modular-schema/fieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +4 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts +1 -1
- package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/index.js +1 -1
- package/lib/feature-libraries/modular-schema/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +2 -3
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +5 -5
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +27 -8
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js +38 -12
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/shared-tree/independentView.d.ts +1 -1
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +2 -2
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +2 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +3 -0
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +2 -2
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +4 -4
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +2 -2
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +20 -8
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +25 -11
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +2 -2
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +10 -5
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +73 -18
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +11 -9
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/{dist/shared-tree-core/editManagerCodecsV5.d.ts → lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerCodecsV5.js → editManagerCodecsVSharedBranches.js} +4 -4
- package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +8 -30
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +19 -10
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +1 -1
- package/lib/shared-tree-core/{editManagerFormatV5.d.ts → editManagerFormatVSharedBranches.d.ts} +3 -3
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{editManagerFormatV5.js → editManagerFormatVSharedBranches.js} +2 -2
- package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/editManagerSummarizer.d.ts +29 -9
- package/lib/shared-tree-core/editManagerSummarizer.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerSummarizer.js +39 -11
- package/lib/shared-tree-core/editManagerSummarizer.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -2
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +3 -1
- package/lib/shared-tree-core/index.js.map +1 -1
- package/{dist/shared-tree-core/messageCodecV5.d.ts → lib/shared-tree-core/messageCodecVSharedBranches.d.ts} +2 -2
- package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageCodecV5.js → messageCodecVSharedBranches.js} +3 -3
- package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +13 -11
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +9 -36
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
- package/lib/shared-tree-core/messageFormat.js +19 -9
- package/lib/shared-tree-core/messageFormat.js.map +1 -1
- package/{dist/shared-tree-core/messageFormatV5.d.ts → lib/shared-tree-core/messageFormatVSharedBranches.d.ts} +5 -7
- package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -0
- package/lib/shared-tree-core/{messageFormatV5.js → messageFormatVSharedBranches.js} +3 -2
- package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +13 -47
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +27 -15
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/shared-tree-core/summaryTypes.d.ts +94 -0
- package/lib/shared-tree-core/summaryTypes.d.ts.map +1 -0
- package/lib/shared-tree-core/summaryTypes.js +43 -0
- package/lib/shared-tree-core/summaryTypes.js.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts +72 -0
- package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -0
- package/lib/shared-tree-core/versionedSummarizer.js +60 -0
- package/lib/shared-tree-core/versionedSummarizer.js.map +1 -0
- package/lib/simple-tree/api/configuration.d.ts +3 -26
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +14 -25
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.d.ts +11 -0
- package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
- package/lib/simple-tree/api/dirtyIndex.js +7 -0
- package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts +89 -0
- package/lib/simple-tree/api/eraseSchemaDetails.d.ts.map +1 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js +92 -0
- package/lib/simple-tree/api/eraseSchemaDetails.js.map +1 -0
- package/lib/simple-tree/api/getSimpleSchema.d.ts +3 -3
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js +9 -3
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +8 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- package/lib/simple-tree/api/index.d.ts +4 -4
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -3
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +5 -5
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts +6 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +5 -0
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +12 -12
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.js +15 -3
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +8 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js +15 -10
- package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts +1 -1
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +1 -2
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +15 -2
- 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/api/typesUnsafe.d.ts +3 -3
- package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +2 -2
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +1 -1
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +1 -1
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/toStored.d.ts +17 -15
- package/lib/simple-tree/core/toStored.d.ts.map +1 -1
- package/lib/simple-tree/core/toStored.js +4 -37
- package/lib/simple-tree/core/toStored.js.map +1 -1
- package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -0
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +5 -1
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +20 -5
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +3 -3
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +6 -5
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -4
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +5 -5
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +2 -2
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +3 -3
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +55 -23
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js +16 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js +8 -1
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +58 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +204 -31
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/treeSchema.d.ts +23 -0
- package/lib/simple-tree/treeSchema.d.ts.map +1 -0
- package/lib/simple-tree/treeSchema.js +21 -0
- package/lib/simple-tree/treeSchema.js.map +1 -0
- package/lib/tableSchema.d.ts +107 -64
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +162 -61
- package/lib/tableSchema.js.map +1 -1
- package/lib/util/brand.d.ts +49 -0
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +44 -0
- package/lib/util/brand.js.map +1 -1
- package/lib/util/index.d.ts +2 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -1
- package/lib/util/index.js.map +1 -1
- package/lib/util/readSnapshotBlob.d.ts +13 -0
- package/lib/util/readSnapshotBlob.d.ts.map +1 -0
- package/lib/util/readSnapshotBlob.js +14 -0
- package/lib/util/readSnapshotBlob.js.map +1 -0
- package/package.json +24 -23
- package/src/codec/codec.ts +44 -14
- package/src/codec/versioned/codec.ts +1 -1
- package/src/codec/versioned/format.ts +4 -1
- package/src/core/index.ts +4 -1
- package/src/core/rebase/index.ts +1 -0
- package/src/core/rebase/types.ts +25 -0
- package/src/core/schema-stored/schema.ts +5 -7
- package/src/core/tree/detachedFieldIndex.ts +54 -13
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +4 -7
- package/src/core/tree/index.ts +7 -2
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +3 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +6 -9
- package/src/feature-libraries/chunked-forest/codec/incrementalEncodingPolicy.ts +15 -7
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +9 -9
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +22 -33
- package/src/feature-libraries/detachedFieldIndexSummarizer.ts +62 -15
- package/src/feature-libraries/forest-summary/codec.ts +22 -10
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +77 -44
- package/src/feature-libraries/forest-summary/{format.ts → formatCommon.ts} +12 -13
- package/src/feature-libraries/forest-summary/formatV1.ts +12 -0
- package/src/feature-libraries/forest-summary/formatV2.ts +12 -0
- package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +37 -56
- package/src/feature-libraries/forest-summary/index.ts +2 -2
- package/src/feature-libraries/forest-summary/summaryFormatCommon.ts +41 -0
- package/src/feature-libraries/forest-summary/summaryFormatV1ToV2.ts +11 -0
- package/src/feature-libraries/forest-summary/summaryFormatV3.ts +18 -0
- package/src/feature-libraries/forest-summary/summaryTypes.ts +41 -0
- package/src/feature-libraries/index.ts +1 -1
- package/src/feature-libraries/modular-schema/comparison.ts +64 -5
- package/src/feature-libraries/modular-schema/fieldKind.ts +24 -40
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +4 -1
- package/src/feature-libraries/modular-schema/index.ts +1 -0
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +2 -3
- package/src/feature-libraries/schema-index/codec.ts +7 -9
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +59 -18
- package/src/index.ts +6 -2
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +2 -3
- package/src/shared-tree/schematizingTreeView.ts +5 -0
- package/src/shared-tree/sharedTree.ts +20 -9
- package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
- package/src/shared-tree/sharedTreeChangeEnricher.ts +31 -11
- package/src/shared-tree/treeAlpha.ts +2 -3
- package/src/shared-tree/treeCheckout.ts +103 -20
- package/src/shared-tree-core/editManagerCodecs.ts +11 -9
- package/src/shared-tree-core/{editManagerCodecsV5.ts → editManagerCodecsVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/editManagerFormatCommons.ts +22 -16
- package/src/shared-tree-core/{editManagerFormatV5.ts → editManagerFormatVSharedBranches.ts} +2 -2
- package/src/shared-tree-core/editManagerSummarizer.ts +58 -16
- package/src/shared-tree-core/index.ts +12 -3
- package/src/shared-tree-core/{messageCodecV5.ts → messageCodecVSharedBranches.ts} +3 -3
- package/src/shared-tree-core/messageCodecs.ts +13 -11
- package/src/shared-tree-core/messageFormat.ts +23 -16
- package/src/shared-tree-core/{messageFormatV5.ts → messageFormatVSharedBranches.ts} +4 -6
- package/src/shared-tree-core/sharedTreeCore.ts +63 -75
- package/src/shared-tree-core/summaryTypes.ts +122 -0
- package/src/shared-tree-core/versionedSummarizer.ts +114 -0
- package/src/simple-tree/api/configuration.ts +21 -68
- package/src/simple-tree/api/dirtyIndex.ts +11 -0
- package/src/simple-tree/api/discrepancies.ts +1 -1
- package/src/simple-tree/api/eraseSchemaDetails.ts +123 -0
- package/src/simple-tree/api/getSimpleSchema.ts +13 -6
- package/src/simple-tree/api/incrementalAllowedTypes.ts +15 -3
- package/src/simple-tree/api/index.ts +7 -4
- package/src/simple-tree/api/schemaCompatibilityTester.ts +1 -1
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -2
- package/src/simple-tree/api/schemaFactoryRecursive.ts +0 -2
- package/src/simple-tree/api/schemaFromSimple.ts +11 -5
- package/src/simple-tree/api/simpleSchemaCodec.ts +17 -3
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +1 -1
- package/src/simple-tree/api/snapshotCompatibilityChecker.ts +18 -10
- package/src/simple-tree/api/storedSchema.ts +2 -2
- package/src/simple-tree/api/tree.ts +16 -1
- package/src/simple-tree/api/typesUnsafe.ts +7 -3
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/index.ts +2 -2
- package/src/simple-tree/core/toStored.ts +22 -55
- package/src/simple-tree/core/treeNode.ts +1 -0
- package/src/simple-tree/core/walkSchema.ts +6 -0
- package/src/simple-tree/createContext.ts +29 -11
- package/src/simple-tree/fieldSchema.ts +10 -3
- package/src/simple-tree/index.ts +12 -10
- package/src/simple-tree/node-kinds/array/arrayNode.ts +5 -2
- package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/map/mapNode.ts +5 -2
- package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +3 -3
- package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +6 -2
- package/src/simple-tree/node-kinds/record/recordNode.ts +5 -2
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +79 -32
- package/src/simple-tree/simpleSchemaFormatV1.ts +9 -1
- package/src/simple-tree/toStoredSchema.ts +319 -61
- package/src/simple-tree/treeSchema.ts +54 -0
- package/src/tableSchema.ts +487 -173
- package/src/util/brand.ts +61 -0
- package/src/util/index.ts +5 -0
- package/src/util/readSnapshotBlob.ts +23 -0
- package/dist/feature-libraries/forest-summary/format.d.ts +0 -23
- package/dist/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/dist/feature-libraries/forest-summary/format.js +0 -24
- package/dist/feature-libraries/forest-summary/format.js.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/dist/shared-tree-core/messageFormatV5.js.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +0 -177
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +0 -23
- package/lib/feature-libraries/forest-summary/format.d.ts.map +0 -1
- package/lib/feature-libraries/forest-summary/format.js +0 -21
- package/lib/feature-libraries/forest-summary/format.js.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerCodecsV5.js.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/editManagerFormatV5.js.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.d.ts.map +0 -1
- package/lib/shared-tree-core/messageFormatV5.js.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +0 -40
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +0 -171
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +0 -1
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +0 -209
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,QAAQ,EACb,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qB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,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,OAAO,EACP,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,cAAc,EACd,WAAW,EAEX,cAAc,EACd,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,+BAA+B,EAC/B,eAAe,EACf,eAAe,EACf,KAAK,QAAQ,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EACN,KAAK,YAAY,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,SAAS,EACd,eAAe,EACf,UAAU,EACV,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { toDownPath, } from "./editableTreeBinder.js";
|
|
6
6
|
export { allowsValue, assertAllowedValue, isTreeValue } from "./valueUtilities.js";
|
|
7
|
-
export { ForestSummarizer, getCodecTreeForForestFormat, } from "./forest-summary/index.js";
|
|
7
|
+
export { ForestSummarizer, getCodecTreeForForestFormat, ForestFormatVersion, } from "./forest-summary/index.js";
|
|
8
8
|
export { cursorForMapTreeField, cursorForMapTreeNode, mapTreeFromCursor, mapTreeFieldFromCursor, mapTreeFieldsWithField, mapTreeWithField, } from "./mapTreeCursor.js";
|
|
9
9
|
export { buildForest } from "./object-forest/index.js";
|
|
10
10
|
export { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec, makeSchemaCodecs, getCodecTreeForSchemaFormat, clientVersionToSchemaVersion, } from "./schema-index/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EACN,gBAAgB,EAChB,2BAA2B,EAC3B,mBAAmB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EAEtB,sBAAsB,EACtB,gBAAgB,GAIhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,mBAAmB,EAEnB,UAAU,EACV,eAAe,EAEf,oBAAoB,GACpB,MAAM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eAAe,EACf,eAAe,GAEf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EACnB,iCAAiC,GACjC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAEN,eAAe,EACf,UAAU,GAIV,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\ttype DownPath,\n\ttoDownPath,\n} from \"./editableTreeBinder.js\";\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport {\n\tForestSummarizer,\n\tgetCodecTreeForForestFormat,\n\tForestFormatVersion,\n} from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n\ttype MinimalMapTreeNodeView,\n\tmapTreeFieldsWithField,\n\tmapTreeWithField,\n\ttype MapTreeFieldViewGeneric,\n\ttype MapTreeNodeViewGeneric,\n\ttype MinimalFieldMap,\n} from \"./mapTreeCursor.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport {\n\tSchemaSummarizer,\n\tencodeTreeSchema,\n\tmakeSchemaCodec,\n\tmakeSchemaCodecs,\n\tgetCodecTreeForSchemaFormat,\n\tclientVersionToSchemaVersion,\n} from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tisNeverTree,\n} from \"./modular-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkField,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\temptyChunk,\n\tcombineChunks,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeIdentifiers,\n\tcreateNodeIdentifierManager,\n\tisStableNodeIdentifier,\n\ttype LocalNodeIdentifier,\n\tMockNodeIdentifierManager,\n\ttype NodeIdentifierManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeIdentifier,\n} from \"./node-identifier/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tgetCodecTreeForModularChangeFormat,\n\ttype ModularChangeFormatVersion,\n} from \"./default-schema/index.js\";\n\nexport {\n\tSchemaValidationError,\n\tisNodeInSchema,\n\tisFieldInSchema,\n\tthrowOutOfSchema,\n} from \"./schemaChecker.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n\tindexForAt,\n\tFlexTreeEntityKind,\n\ttype FlexibleNodeContent,\n\ttype FlexibleFieldContent,\n\ttype FlexTreeHydratedContextMinimal,\n\ttype HydratedFlexTreeNode,\n\tgetOrCreateHydratedFlexTreeNode,\n\tcurrentObserver,\n\twithObservation,\n\ttype Observer,\n} from \"./flex-tree/index.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n\tgetCodecTreeForSchemaChangeFormat,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype KeyFinder,\n\tAnchorTreeIndex,\n\thasElement,\n\ttype TreeIndex,\n\ttype TreeIndexKey,\n\ttype TreeIndexNodes,\n} from \"./indexing/index.js\";\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeTypeSet, type ValueSchema } from "../../core/index.js";
|
|
5
|
+
import { Multiplicity, type TreeFieldStoredSchema, type TreeNodeStoredSchema, type TreeStoredSchema, type TreeTypeSet, type ValueSchema } from "../../core/index.js";
|
|
6
6
|
import type { FullSchemaPolicy } from "./fieldKind.js";
|
|
7
7
|
/**
|
|
8
8
|
* Returns true iff `superset` is a superset of `original`.
|
|
@@ -22,8 +22,18 @@ export declare function allowsValueSuperset(original: ValueSchema | undefined, s
|
|
|
22
22
|
* Returns true iff `superset` is a superset of `original`.
|
|
23
23
|
*
|
|
24
24
|
* This does not require a strict (aka proper) superset: equivalent schema will return true.
|
|
25
|
+
*
|
|
26
|
+
* @param monotonicOnly - If true, only allow changes of field kinds which are explicitly listed in {@link FieldKindOptions.allowMonotonicUpgradeFrom}.
|
|
27
|
+
* This prevents this function from considering two different schema as equivalent, preventing upgrades which would allow their inverse.
|
|
28
|
+
* This prevents infinite upgrade loops where two clients could keep upgrading between two schema.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* True if a client should be able to {@link TreeView.upgradeSchema} from a field schema using this field kind and `originalTypes` to `superset`.
|
|
32
|
+
*
|
|
33
|
+
* @privateRemarks
|
|
34
|
+
* See also {@link FieldKindOptions.allowMonotonicUpgradeFrom} for constraints on the implementation.
|
|
25
35
|
*/
|
|
26
|
-
export declare function allowsFieldSuperset(policy: FullSchemaPolicy, originalData: TreeStoredSchema, original: TreeFieldStoredSchema, superset: TreeFieldStoredSchema): boolean;
|
|
36
|
+
export declare function allowsFieldSuperset(policy: FullSchemaPolicy, originalData: TreeStoredSchema, original: TreeFieldStoredSchema, superset: TreeFieldStoredSchema, monotonicOnly?: boolean): boolean;
|
|
27
37
|
/**
|
|
28
38
|
* Returns true iff `superset` is a superset of `original`.
|
|
29
39
|
*
|
|
@@ -40,4 +50,10 @@ export declare function allowsTreeSchemaIdentifierSuperset(original: TreeTypeSet
|
|
|
40
50
|
* it would have to compare everything anyway.
|
|
41
51
|
*/
|
|
42
52
|
export declare function allowsRepoSuperset(policy: FullSchemaPolicy, original: TreeStoredSchema, superset: TreeStoredSchema): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns true iff `superset` is a superset of `original`.
|
|
55
|
+
*
|
|
56
|
+
* This does not require a strict (aka proper) superset: equivalent schema will return true.
|
|
57
|
+
*/
|
|
58
|
+
export declare function allowsMultiplicitySuperset(original: Multiplicity, superset: Multiplicity): boolean;
|
|
43
59
|
//# sourceMappingURL=comparison.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAGN,YAAY,EAEZ,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CA0ET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,GAAE,OAAc,GAC3B,OAAO,CAwBT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAwBT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACzC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,GACpB,OAAO,CAiBT"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { assert, fail } from "@fluidframework/core-utils/internal";
|
|
6
|
-
import { LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, storedEmptyFieldSchema, } from "../../core/index.js";
|
|
5
|
+
import { assert, fail, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
6
|
+
import { LeafNodeStoredSchema, MapNodeStoredSchema, Multiplicity, ObjectNodeStoredSchema, storedEmptyFieldSchema, } from "../../core/index.js";
|
|
7
7
|
import { compareSets } from "../../util/index.js";
|
|
8
|
-
import { isNeverTree } from "./isNeverTree.js";
|
|
8
|
+
import { isNeverField, isNeverTree } from "./isNeverTree.js";
|
|
9
9
|
/**
|
|
10
10
|
* Returns true iff `superset` is a superset of `original`.
|
|
11
11
|
*
|
|
@@ -71,9 +71,37 @@ export function allowsValueSuperset(original, superset) {
|
|
|
71
71
|
* Returns true iff `superset` is a superset of `original`.
|
|
72
72
|
*
|
|
73
73
|
* This does not require a strict (aka proper) superset: equivalent schema will return true.
|
|
74
|
+
*
|
|
75
|
+
* @param monotonicOnly - If true, only allow changes of field kinds which are explicitly listed in {@link FieldKindOptions.allowMonotonicUpgradeFrom}.
|
|
76
|
+
* This prevents this function from considering two different schema as equivalent, preventing upgrades which would allow their inverse.
|
|
77
|
+
* This prevents infinite upgrade loops where two clients could keep upgrading between two schema.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* True if a client should be able to {@link TreeView.upgradeSchema} from a field schema using this field kind and `originalTypes` to `superset`.
|
|
81
|
+
*
|
|
82
|
+
* @privateRemarks
|
|
83
|
+
* See also {@link FieldKindOptions.allowMonotonicUpgradeFrom} for constraints on the implementation.
|
|
74
84
|
*/
|
|
75
|
-
export function allowsFieldSuperset(policy, originalData, original, superset) {
|
|
76
|
-
|
|
85
|
+
export function allowsFieldSuperset(policy, originalData, original, superset, monotonicOnly = true) {
|
|
86
|
+
if (!monotonicOnly) {
|
|
87
|
+
if (isNeverField(policy, originalData, original)) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (!allowsTreeSchemaIdentifierSuperset(original.types, superset.types)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
if (original.kind === superset.kind) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
const supersetKind = policy.fieldKinds.get(superset.kind) ?? fail(0xb1b /* missing kind */);
|
|
98
|
+
if (monotonicOnly) {
|
|
99
|
+
return supersetKind.options.allowMonotonicUpgradeFrom.has(original.kind);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const originalKind = policy.fieldKinds.get(original.kind) ?? fail(0xcab /* missing kind */);
|
|
103
|
+
return allowsMultiplicitySuperset(originalKind.multiplicity, supersetKind.multiplicity);
|
|
104
|
+
}
|
|
77
105
|
}
|
|
78
106
|
/**
|
|
79
107
|
* Returns true iff `superset` is a superset of `original`.
|
|
@@ -115,4 +143,26 @@ export function allowsRepoSuperset(policy, original, superset) {
|
|
|
115
143
|
// Therefore, we do not need to check them.
|
|
116
144
|
return true;
|
|
117
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Returns true iff `superset` is a superset of `original`.
|
|
148
|
+
*
|
|
149
|
+
* This does not require a strict (aka proper) superset: equivalent schema will return true.
|
|
150
|
+
*/
|
|
151
|
+
export function allowsMultiplicitySuperset(original, superset) {
|
|
152
|
+
if (original === superset) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
switch (superset) {
|
|
156
|
+
case Multiplicity.Forbidden:
|
|
157
|
+
return false;
|
|
158
|
+
case Multiplicity.Optional:
|
|
159
|
+
return original === Multiplicity.Single || original === Multiplicity.Forbidden;
|
|
160
|
+
case Multiplicity.Single:
|
|
161
|
+
return false;
|
|
162
|
+
case Multiplicity.Sequence:
|
|
163
|
+
return true;
|
|
164
|
+
default:
|
|
165
|
+
return unreachableCase(superset);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
118
168
|
//# sourceMappingURL=comparison.js.map
|
|
@@ -1 +1 @@
|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AE1B,CAAC;QACA,IACC,CAAC,mBAAmB,CACnB,MAAM,EACN,QAAQ,EACR,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,eAAe,CACxB,EACA,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,uGAAuG;IACvG,wHAAwH;IACxH,2FAA2F;IAC3F,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,mIAAmI;IACnI,2CAA2C;IAC3C,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn (\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xb1b /* missing kind */)\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EACN,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EAMtB,sBAAsB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,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Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, fail, unreachableCase } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tMultiplicity,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (superset instanceof LeafNodeStoredSchema) {\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(policy, originalData, original.mapFields, superset.mapFields);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (!allowsFieldSuperset(policy, originalData, field, superset.mapFields)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ??\n\t\t\t\t\tfail(0xb17 /* missing expected field */),\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tstoredEmptyFieldSchema,\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ??\n\t\t\t\t\tfail(0xb18 /* missing expected field */),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(0xb19 /* missing expected field */),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(0xb1a /* missing expected field */),\n\t\t\t),\n\t});\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * @param monotonicOnly - If true, only allow changes of field kinds which are explicitly listed in {@link FieldKindOptions.allowMonotonicUpgradeFrom}.\n * This prevents this function from considering two different schema as equivalent, preventing upgrades which would allow their inverse.\n * This prevents infinite upgrade loops where two clients could keep upgrading between two schema.\n *\n * @remarks\n * True if a client should be able to {@link TreeView.upgradeSchema} from a field schema using this field kind and `originalTypes` to `superset`.\n *\n * @privateRemarks\n * See also {@link FieldKindOptions.allowMonotonicUpgradeFrom} for constraints on the implementation.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n\tmonotonicOnly: boolean = true,\n): boolean {\n\tif (!monotonicOnly) {\n\t\tif (isNeverField(policy, originalData, original)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tif (!allowsTreeSchemaIdentifierSuperset(original.types, superset.types)) {\n\t\treturn false;\n\t}\n\n\tif (original.kind === superset.kind) {\n\t\treturn true;\n\t}\n\n\tconst supersetKind = policy.fieldKinds.get(superset.kind) ?? fail(0xb1b /* missing kind */);\n\n\tif (monotonicOnly) {\n\t\treturn supersetKind.options.allowMonotonicUpgradeFrom.has(original.kind);\n\t} else {\n\t\tconst originalKind =\n\t\t\tpolicy.fieldKinds.get(original.kind) ?? fail(0xcab /* missing kind */);\n\t\treturn allowsMultiplicitySuperset(originalKind.multiplicity, supersetKind.multiplicity);\n\t}\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Check if all schema in original are included in superset, and permit a superset of the node content.\n\t// Note that any schema from `original.nodeSchema` can be used as the schema for a node at the root of a detached field,\n\t// so we must check all of them, even if they are not reachable from the root field schema.\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// Any schema in superset not in original are already known to be superset of original since they are \"never\" due to being missing.\n\t// Therefore, we do not need to check them.\n\treturn true;\n}\n\n/**\n * Returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsMultiplicitySuperset(\n\toriginal: Multiplicity,\n\tsuperset: Multiplicity,\n): boolean {\n\tif (original === superset) {\n\t\treturn true;\n\t}\n\n\tswitch (superset) {\n\t\tcase Multiplicity.Forbidden:\n\t\t\treturn false;\n\t\tcase Multiplicity.Optional:\n\t\t\treturn original === Multiplicity.Single || original === Multiplicity.Forbidden;\n\t\tcase Multiplicity.Single:\n\t\t\treturn false;\n\t\tcase Multiplicity.Sequence:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn unreachableCase(superset);\n\t}\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { FieldKindIdentifier, FieldKindData, Multiplicity, SchemaPolicy
|
|
5
|
+
import type { FieldKindIdentifier, FieldKindData, Multiplicity, SchemaPolicy } from "../../core/index.js";
|
|
6
6
|
import type { MakeNominal } from "../../util/index.js";
|
|
7
7
|
import type { FieldChangeHandler, FieldEditor } from "./fieldChangeHandler.js";
|
|
8
8
|
/**
|
|
@@ -23,20 +23,13 @@ import type { FieldChangeHandler, FieldEditor } from "./fieldChangeHandler.js";
|
|
|
23
23
|
export declare class FlexFieldKind<TEditor extends FieldEditor<any> = FieldEditor<any>, TName extends FieldKindIdentifier = FieldKindIdentifier, TMultiplicity extends Multiplicity = Multiplicity> implements FieldKindData {
|
|
24
24
|
readonly identifier: TName;
|
|
25
25
|
readonly multiplicity: TMultiplicity;
|
|
26
|
-
|
|
26
|
+
readonly options: FieldKindOptions<FieldChangeHandler<any, TEditor>>;
|
|
27
27
|
protected _typeCheck: MakeNominal;
|
|
28
28
|
/**
|
|
29
29
|
* Change handling policy.
|
|
30
30
|
*/
|
|
31
31
|
readonly changeHandler: FieldChangeHandler<any, TEditor>;
|
|
32
32
|
constructor(identifier: TName, multiplicity: TMultiplicity, options: FieldKindOptions<FieldChangeHandler<any, TEditor>>);
|
|
33
|
-
/**
|
|
34
|
-
* Returns true if and only if `superset` permits a (non-strict) superset of the subtrees
|
|
35
|
-
* allowed by field made from `this` and `originalTypes`.
|
|
36
|
-
*
|
|
37
|
-
* TODO: clarify the relationship between this and FieldKindData, and issues with cyclic schema upgrades.
|
|
38
|
-
*/
|
|
39
|
-
allowsFieldSuperset(policy: SchemaPolicy, originalData: TreeStoredSchema, originalTypes: TreeTypeSet, superset: TreeFieldStoredSchema): boolean;
|
|
40
33
|
}
|
|
41
34
|
/**
|
|
42
35
|
* Additional options for {@link FlexFieldKind}.
|
|
@@ -50,12 +43,31 @@ export interface FieldKindOptions<TFieldChangeHandler> {
|
|
|
50
43
|
*/
|
|
51
44
|
readonly changeHandler: TFieldChangeHandler;
|
|
52
45
|
/**
|
|
53
|
-
*
|
|
54
|
-
* allowed by field made from `this` and `originalTypes`.
|
|
46
|
+
* The set of field kinds which can be migrated to this one by a {@link TreeView.upgradeSchema}.
|
|
55
47
|
* @remarks
|
|
56
|
-
*
|
|
48
|
+
* Must return false if such an upgrade could violate any invariants of `superset` for any document which is compatible with `this` + `originalTypes`.
|
|
49
|
+
*
|
|
50
|
+
* Unlike the rest of the FieldKind API, this may change over time without changing the FieldKind identifier without causing decoherence between clients.
|
|
51
|
+
* It has a different set of constraints:
|
|
52
|
+
*
|
|
53
|
+
* - This must never allow an upgrade that could violate any invariants of any field kind required by any version of client for any document content (that was not already invalid).
|
|
54
|
+
* This prevents a schema upgrade from causing a document to become out of schema.
|
|
55
|
+
* - The set of implementations of this function across all fields kinds and all client versions must never permit a cycle.
|
|
56
|
+
* This prevents applications which simply do an upgrade when possible from being able to have two clients both upgrade where one is actually a down grade and they cause an infinite loop of schema upgrade edits.
|
|
57
|
+
*
|
|
58
|
+
* To help maintain these invariants, any cases where the set of allowed contents does not increase (but is the same so the upgrade is still in schema) must be considered carefully.
|
|
59
|
+
* For example, a migration from `Sequence([])` to `Optional([])` can be problematic despite being permissible
|
|
60
|
+
* as it does not change what content is allowed (the field must be empty either way as no types are allowed in it).
|
|
61
|
+
* Such cases, if allowed, could lead to cycles if their inverse is also allowed.
|
|
62
|
+
* These cases, if supported, can be removed, but if doing so must be documented and still considered when avoiding cycles.
|
|
63
|
+
*
|
|
64
|
+
* Used by {@link allowsFieldSuperset}.
|
|
65
|
+
*
|
|
66
|
+
* TODO: this design is rather limiting, and there is some planned work in this area:
|
|
67
|
+
* - Provide schema upgrade schema not reliant on this to ensure monotonicity of schema upgrades like AB#7482.
|
|
68
|
+
* - This monotonic upgrade scheme can remain useful for features like AB#53604 so it should be kept and refined.
|
|
57
69
|
*/
|
|
58
|
-
readonly
|
|
70
|
+
readonly allowMonotonicUpgradeFrom: ReadonlySet<FieldKindIdentifier>;
|
|
59
71
|
}
|
|
60
72
|
/**
|
|
61
73
|
* Policy from the app for interpreting the stored schema.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"fieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,aAAa,CAGzB,OAAO,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EACnD,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,EACvD,aAAa,SAAS,YAAY,GAAG,YAAY,CAChD,YAAW,aAAa;aAYR,UAAU,EAAE,KAAK;aACjB,YAAY,EAAE,aAAa;aAG3B,OAAO,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAd5E,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAEnC;;OAEG;IAGH,SAAgB,aAAa,EAAE,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAG/C,UAAU,EAAE,KAAK,EACjB,YAAY,EAAE,aAAa,EAG3B,OAAO,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;CAI5E;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,mBAAmB;IACpD;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,QAAQ,CAAC,yBAAyB,EAAE,WAAW,CAAC,mBAAmB,CAAC,CAAC;CAUrE;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY;IACrD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;CACrE"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { isNeverField } from "./isNeverTree.js";
|
|
6
5
|
/**
|
|
7
6
|
* Functionality for FieldKinds that is stable,
|
|
8
7
|
* meaning that it can not change in any measurable way without providing a new identifier.
|
|
@@ -28,25 +27,5 @@ export class FlexFieldKind {
|
|
|
28
27
|
this.options = options;
|
|
29
28
|
this.changeHandler = options.changeHandler;
|
|
30
29
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Returns true if and only if `superset` permits a (non-strict) superset of the subtrees
|
|
33
|
-
* allowed by field made from `this` and `originalTypes`.
|
|
34
|
-
*
|
|
35
|
-
* TODO: clarify the relationship between this and FieldKindData, and issues with cyclic schema upgrades.
|
|
36
|
-
*/
|
|
37
|
-
allowsFieldSuperset(policy, originalData, originalTypes, superset) {
|
|
38
|
-
if (isNeverField(policy, originalData, {
|
|
39
|
-
kind: this.identifier,
|
|
40
|
-
types: originalTypes,
|
|
41
|
-
// Metadata is not used for this check.
|
|
42
|
-
persistedMetadata: undefined,
|
|
43
|
-
})) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
if (isNeverField(policy, originalData, superset)) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
return this.options.allowsTreeSupersetOf(originalTypes, superset);
|
|
50
|
-
}
|
|
51
30
|
}
|
|
52
31
|
//# sourceMappingURL=fieldKind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"fieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/fieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,aAAa;IAiBzB,YACiB,UAAiB,EACjB,YAA2B;IAC3C,wBAAwB;IACxB,8DAA8D;IAC9C,OAA2D;QAJ3D,eAAU,GAAV,UAAU,CAAO;QACjB,iBAAY,GAAZ,YAAY,CAAe;QAG3B,YAAO,GAAP,OAAO,CAAoD;QAE3E,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC5C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tFieldKindIdentifier,\n\tFieldKindData,\n\tMultiplicity,\n\tSchemaPolicy,\n} from \"../../core/index.js\";\nimport type { MakeNominal } from \"../../util/index.js\";\n\nimport type { FieldChangeHandler, FieldEditor } from \"./fieldChangeHandler.js\";\n\n/**\n * Functionality for FieldKinds that is stable,\n * meaning that it can not change in any measurable way without providing a new identifier.\n *\n * It is assumed that this information and policy is available on all clients interacting with a document\n * using the identifier.\n *\n * This must contain enough information to process remote edits to this FieldKind consistently with all clients.\n * All behavior must be deterministic, and not change across versions of the app/library.\n *\n * These policies include the data encoding, change encoding, change rebase and change application.\n *\n * @privateRemarks\n * Using a class gets stronger (nominal) typing for objects which will be down cast.\n */\nexport class FlexFieldKind<\n\t// TODO: stronger typing\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tTEditor extends FieldEditor<any> = FieldEditor<any>,\n\tTName extends FieldKindIdentifier = FieldKindIdentifier,\n\tTMultiplicity extends Multiplicity = Multiplicity,\n> implements FieldKindData\n{\n\tprotected _typeCheck!: MakeNominal;\n\n\t/**\n\t * Change handling policy.\n\t */\n\t// TODO: stronger typing\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpublic readonly changeHandler: FieldChangeHandler<any, TEditor>;\n\n\tpublic constructor(\n\t\tpublic readonly identifier: TName,\n\t\tpublic readonly multiplicity: TMultiplicity,\n\t\t// TODO: stronger typing\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tpublic readonly options: FieldKindOptions<FieldChangeHandler<any, TEditor>>,\n\t) {\n\t\tthis.changeHandler = options.changeHandler;\n\t}\n}\n\n/**\n * Additional options for {@link FlexFieldKind}.\n *\n * @remarks\n * Puts the more confusing parameters into this object so they get explicit names to help with clarity.\n */\nexport interface FieldKindOptions<TFieldChangeHandler> {\n\t/**\n\t * Change handling policy.\n\t */\n\treadonly changeHandler: TFieldChangeHandler;\n\n\t/**\n\t * The set of field kinds which can be migrated to this one by a {@link TreeView.upgradeSchema}.\n\t * @remarks\n\t * Must return false if such an upgrade could violate any invariants of `superset` for any document which is compatible with `this` + `originalTypes`.\n\t *\n\t * Unlike the rest of the FieldKind API, this may change over time without changing the FieldKind identifier without causing decoherence between clients.\n\t * It has a different set of constraints:\n\t *\n\t * - This must never allow an upgrade that could violate any invariants of any field kind required by any version of client for any document content (that was not already invalid).\n\t * This prevents a schema upgrade from causing a document to become out of schema.\n\t * - The set of implementations of this function across all fields kinds and all client versions must never permit a cycle.\n\t * This prevents applications which simply do an upgrade when possible from being able to have two clients both upgrade where one is actually a down grade and they cause an infinite loop of schema upgrade edits.\n\t *\n\t * To help maintain these invariants, any cases where the set of allowed contents does not increase (but is the same so the upgrade is still in schema) must be considered carefully.\n\t * For example, a migration from `Sequence([])` to `Optional([])` can be problematic despite being permissible\n\t * as it does not change what content is allowed (the field must be empty either way as no types are allowed in it).\n\t * Such cases, if allowed, could lead to cycles if their inverse is also allowed.\n\t * These cases, if supported, can be removed, but if doing so must be documented and still considered when avoiding cycles.\n\t *\n\t * Used by {@link allowsFieldSuperset}.\n\t *\n\t * TODO: this design is rather limiting, and there is some planned work in this area:\n\t * - Provide schema upgrade schema not reliant on this to ensure monotonicity of schema upgrades like AB#7482.\n\t * - This monotonic upgrade scheme can remain useful for features like AB#53604 so it should be kept and refined.\n\t */\n\treadonly allowMonotonicUpgradeFrom: ReadonlySet<FieldKindIdentifier>;\n\n\t/**\n\t * Kinds (in addition to this) whose edits can be processed by changeHandler.\n\t * If the kind of a field changes, and edits are rebased across that kind change,\n\t * listing the other old kind here can prevent those edits from being conflicted and\n\t * provide a chance to handle them.\n\t */\n\t// TODO: provide this and use it for improved support for rebasing changes across schema upgrades.\n\t// readonly handlesEditsFrom: ReadonlySet<FieldKindIdentifier>;\n}\n\n/**\n * Policy from the app for interpreting the stored schema.\n * The app must ensure consistency for all users of the document.\n */\nexport interface FullSchemaPolicy extends SchemaPolicy {\n\t/**\n\t * Policy information about FieldKinds:\n\t * This is typically stored as code, not in documents, and defines how to handles fields based on their kind.\n\t * It is assumed that all users of a document will have exactly the same FieldKind policies,\n\t * though older applications might be missing some,\n\t * and will be unable to process any changes that use those FieldKinds.\n\t */\n\treadonly fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericFieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,KAAK,EAEX,kBAAkB,EAOlB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,gBAAgB,CAkCrE,CAAC;AA+FF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"genericFieldKind.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,KAAK,EAEX,kBAAkB,EAOlB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,gBAAgB,CAkCrE,CAAC;AA+FF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,aAO9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAC3C,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,GACjC,OAAO,CAET"}
|
|
@@ -115,7 +115,10 @@ function replaceRevisions(changeset, oldRevisions, newRevision) {
|
|
|
115
115
|
/**
|
|
116
116
|
* {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.
|
|
117
117
|
*/
|
|
118
|
-
export const genericFieldKind = new FlexFieldKind(brandConst("ModularEditBuilder.Generic")(), Multiplicity.Sequence, {
|
|
118
|
+
export const genericFieldKind = new FlexFieldKind(brandConst("ModularEditBuilder.Generic")(), Multiplicity.Sequence, {
|
|
119
|
+
changeHandler: genericChangeHandler,
|
|
120
|
+
allowMonotonicUpgradeFrom: new Set(),
|
|
121
|
+
});
|
|
119
122
|
/**
|
|
120
123
|
* Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.
|
|
121
124
|
* @param changeset - The generic changeset to convert.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericFieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAIN,YAAY,EAEZ,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAY7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyC;IACzE,OAAO,EAAE;QACR,OAAO;QACP,MAAM,EAAE,CAAC,MAAwB,EAAoB,EAAE,CAAC,MAAM;QAC9D,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE,kBAAkB;QACzB,gBAAgB;QAChB,IAAI,EAAE,CAAC,MAAwB,EAAoB,EAAE,CAAC,MAAM;KAC5D;IACD,aAAa,EAAE,sBAAsB;IACrC,MAAM,EAAE;QACP,iBAAiB,CAAC,OAAmC;YACpD,OAAO,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;QACjD,CAAC;KACD;IACD,SAAS,EAAE,CAAC,MAAwB,EAAE,cAAuB,EAAoB,EAAE;QAClF,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,MAAM,QAAQ,GAAgB,EAAE,CAAC;QACjC,KAAK,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YACpD,IAAI,SAAS,GAAG,KAAK,EAAE,CAAC;gBACvB,MAAM,MAAM,GAAG,KAA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CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CACtF,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CACnC,SAA2B,EAC3B,MAAmC;IAEnC,OAAO,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;AAC7D,CAAC;AAED,QAAQ,CAAC,CAAC,oBAAoB,CAC7B,MAAwB,EACxB,6BAA4D;IAE5D,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1C,KAAK,CAAC,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;AACF,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\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport {\n\ttype DeltaDetachedNodeId,\n\ttype DeltaMark,\n\ttype FieldKindIdentifier,\n\tMultiplicity,\n\ttype RevisionTag,\n\treplaceAtomRevisions,\n} from \"../../core/index.js\";\n\nimport type {\n\tFieldChangeDelta,\n\tFieldChangeHandler,\n\tNestedChangesIndices,\n\tNodeChangeComposer,\n\tNodeChangePruner,\n\tNodeChangeRebaser,\n\tRelevantRemovedRootsFromChild,\n\tToDelta,\n} from \"./fieldChangeHandler.js\";\nimport { makeGenericChangeCodec } from \"./genericFieldKindCodecs.js\";\nimport { newGenericChangeset, type GenericChangeset } from \"./genericFieldKindTypes.js\";\nimport type { NodeId } from \"./modularChangeTypes.js\";\nimport { FlexFieldKind } from \"./fieldKind.js\";\nimport { brandConst } from \"../../util/index.js\";\n\n/**\n * {@link FieldChangeHandler} implementation for {@link GenericChangeset}.\n */\nexport const genericChangeHandler: FieldChangeHandler<GenericChangeset> = {\n\trebaser: {\n\t\tcompose,\n\t\tinvert: (change: GenericChangeset): GenericChangeset => change,\n\t\trebase: rebaseGenericChange,\n\t\tprune: pruneGenericChange,\n\t\treplaceRevisions,\n\t\tmute: (change: GenericChangeset): GenericChangeset => change,\n\t},\n\tcodecsFactory: makeGenericChangeCodec,\n\teditor: {\n\t\tbuildChildChanges(changes: Iterable<[number, NodeId]>): GenericChangeset {\n\t\t\treturn newGenericChangeset(Array.from(changes));\n\t\t},\n\t},\n\tintoDelta: (change: GenericChangeset, deltaFromChild: ToDelta): FieldChangeDelta => {\n\t\tlet nodeIndex = 0;\n\t\tconst markList: DeltaMark[] = [];\n\t\tfor (const [index, nodeChange] of change.entries()) {\n\t\t\tif (nodeIndex < index) {\n\t\t\t\tconst offset = index - nodeIndex;\n\t\t\t\tmarkList.push({ count: offset });\n\t\t\t\tnodeIndex = index;\n\t\t\t}\n\t\t\tmarkList.push({ count: 1, fields: deltaFromChild(nodeChange) });\n\t\t\tnodeIndex += 1;\n\t\t}\n\t\treturn { local: markList };\n\t},\n\trelevantRemovedRoots,\n\tisEmpty: (change: GenericChangeset): boolean => change.length === 0,\n\tgetNestedChanges,\n\tcreateEmpty: newGenericChangeset,\n\tgetCrossFieldKeys: (_change) => [],\n};\n\nfunction compose(\n\tchange1: GenericChangeset,\n\tchange2: GenericChangeset,\n\tcomposeChildren: NodeChangeComposer,\n): GenericChangeset {\n\tconst composed = change1.clone();\n\tfor (const [index, id2] of change2.entries()) {\n\t\tconst id1 = composed.get(index);\n\t\tconst idComposed = id1 !== undefined ? composeChildren(id1, id2) : id2;\n\t\tcomposed.set(index, idComposed);\n\t}\n\n\treturn composed;\n}\n\nfunction getNestedChanges(change: GenericChangeset): NestedChangesIndices {\n\t// For generic changeset, the indices in the input and output contexts are the same.\n\treturn change.toArray().map(([index, nodeChange]) => [nodeChange, index, index]);\n}\n\nfunction rebaseGenericChange(\n\tchange: GenericChangeset,\n\tover: GenericChangeset,\n\trebaseChild: NodeChangeRebaser,\n): GenericChangeset {\n\tconst rebased: GenericChangeset = new BTree();\n\tlet nextIndex = 0;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst newEntry = change.getPairOrNextHigher(nextIndex);\n\t\tconst baseEntry = over.getPairOrNextHigher(nextIndex);\n\n\t\tif (baseEntry === undefined && newEntry === undefined) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst newIndex = newEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tconst baseIndex = baseEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tlet newNodeChange: NodeId | undefined;\n\t\tlet baseNodeChange: NodeId | undefined;\n\t\tlet index: number;\n\t\tif (newIndex === baseIndex) {\n\t\t\tassert(\n\t\t\t\tnewEntry !== undefined && baseEntry !== undefined,\n\t\t\t\t0xa0d /* Entries should be defined */,\n\t\t\t);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t} else if (newIndex < baseIndex) {\n\t\t\tassert(newEntry !== undefined, 0xa0e /* Entry should be defined */);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t} else {\n\t\t\tassert(baseEntry !== undefined, 0xa0f /* Entry should be defined */);\n\t\t\tindex = baseIndex;\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t}\n\n\t\tconst nodeChange = rebaseChild(newNodeChange, baseNodeChange);\n\t\tif (nodeChange !== undefined) {\n\t\t\trebased.set(index, nodeChange);\n\t\t}\n\n\t\tnextIndex = index + 1;\n\t}\n\n\treturn rebased;\n}\n\nfunction pruneGenericChange(\n\tchangeset: GenericChangeset,\n\tpruneChild: NodeChangePruner,\n): GenericChangeset {\n\tconst pruned: GenericChangeset = new BTree();\n\tfor (const [index, node] of changeset.entries()) {\n\t\tconst prunedNode = pruneChild(node);\n\t\tif (prunedNode !== undefined) {\n\t\t\tpruned.set(index, node);\n\t\t}\n\t}\n\treturn pruned;\n}\n\nfunction replaceRevisions(\n\tchangeset: GenericChangeset,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): GenericChangeset {\n\treturn changeset.mapValues((node) => replaceAtomRevisions(node, oldRevisions, newRevision));\n}\n\n/**\n * {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.\n */\nexport const genericFieldKind: FlexFieldKind = new FlexFieldKind(\n\tbrandConst(\"ModularEditBuilder.Generic\")<FieldKindIdentifier>(),\n\tMultiplicity.Sequence,\n\t{ changeHandler: genericChangeHandler, allowsTreeSupersetOf: (types, other) => false },\n);\n\n/**\n * Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.\n * @param changeset - The generic changeset to convert.\n * @param target - The {@link FieldChangeHandler} for the `FieldKind` that the returned change should target.\n * @param composeChild - A delegate to compose {@link NodeChangeset}s.\n * @returns An equivalent changeset as represented by the `target` field-kind.\n */\nexport function convertGenericChange<TChange>(\n\tchangeset: GenericChangeset,\n\ttarget: FieldChangeHandler<TChange>,\n): TChange {\n\treturn target.editor.buildChildChanges(changeset.entries());\n}\n\nfunction* relevantRemovedRoots(\n\tchange: GenericChangeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const nodeChange of change.values()) {\n\t\tyield* relevantRemovedRootsFromChild(nodeChange);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"genericFieldKind.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/genericFieldKind.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAIN,YAAY,EAEZ,oBAAoB,GACpB,MAAM,qBAAqB,CAAC;AAY7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAg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corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport { BTree } from \"@tylerbu/sorted-btree-es6\";\n\nimport {\n\ttype DeltaDetachedNodeId,\n\ttype DeltaMark,\n\ttype FieldKindIdentifier,\n\tMultiplicity,\n\ttype RevisionTag,\n\treplaceAtomRevisions,\n} from \"../../core/index.js\";\n\nimport type {\n\tFieldChangeDelta,\n\tFieldChangeHandler,\n\tNestedChangesIndices,\n\tNodeChangeComposer,\n\tNodeChangePruner,\n\tNodeChangeRebaser,\n\tRelevantRemovedRootsFromChild,\n\tToDelta,\n} from \"./fieldChangeHandler.js\";\nimport { makeGenericChangeCodec } from \"./genericFieldKindCodecs.js\";\nimport { newGenericChangeset, type GenericChangeset } from \"./genericFieldKindTypes.js\";\nimport type { NodeId } from \"./modularChangeTypes.js\";\nimport { FlexFieldKind } from \"./fieldKind.js\";\nimport { brandConst } from \"../../util/index.js\";\n\n/**\n * {@link FieldChangeHandler} implementation for {@link GenericChangeset}.\n */\nexport const genericChangeHandler: FieldChangeHandler<GenericChangeset> = {\n\trebaser: {\n\t\tcompose,\n\t\tinvert: (change: GenericChangeset): GenericChangeset => change,\n\t\trebase: rebaseGenericChange,\n\t\tprune: pruneGenericChange,\n\t\treplaceRevisions,\n\t\tmute: (change: GenericChangeset): GenericChangeset => change,\n\t},\n\tcodecsFactory: makeGenericChangeCodec,\n\teditor: {\n\t\tbuildChildChanges(changes: Iterable<[number, NodeId]>): GenericChangeset {\n\t\t\treturn newGenericChangeset(Array.from(changes));\n\t\t},\n\t},\n\tintoDelta: (change: GenericChangeset, deltaFromChild: ToDelta): FieldChangeDelta => {\n\t\tlet nodeIndex = 0;\n\t\tconst markList: DeltaMark[] = [];\n\t\tfor (const [index, nodeChange] of change.entries()) {\n\t\t\tif (nodeIndex < index) {\n\t\t\t\tconst offset = index - nodeIndex;\n\t\t\t\tmarkList.push({ count: offset });\n\t\t\t\tnodeIndex = index;\n\t\t\t}\n\t\t\tmarkList.push({ count: 1, fields: deltaFromChild(nodeChange) });\n\t\t\tnodeIndex += 1;\n\t\t}\n\t\treturn { local: markList };\n\t},\n\trelevantRemovedRoots,\n\tisEmpty: (change: GenericChangeset): boolean => change.length === 0,\n\tgetNestedChanges,\n\tcreateEmpty: newGenericChangeset,\n\tgetCrossFieldKeys: (_change) => [],\n};\n\nfunction compose(\n\tchange1: GenericChangeset,\n\tchange2: GenericChangeset,\n\tcomposeChildren: NodeChangeComposer,\n): GenericChangeset {\n\tconst composed = change1.clone();\n\tfor (const [index, id2] of change2.entries()) {\n\t\tconst id1 = composed.get(index);\n\t\tconst idComposed = id1 !== undefined ? composeChildren(id1, id2) : id2;\n\t\tcomposed.set(index, idComposed);\n\t}\n\n\treturn composed;\n}\n\nfunction getNestedChanges(change: GenericChangeset): NestedChangesIndices {\n\t// For generic changeset, the indices in the input and output contexts are the same.\n\treturn change.toArray().map(([index, nodeChange]) => [nodeChange, index, index]);\n}\n\nfunction rebaseGenericChange(\n\tchange: GenericChangeset,\n\tover: GenericChangeset,\n\trebaseChild: NodeChangeRebaser,\n): GenericChangeset {\n\tconst rebased: GenericChangeset = new BTree();\n\tlet nextIndex = 0;\n\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst newEntry = change.getPairOrNextHigher(nextIndex);\n\t\tconst baseEntry = over.getPairOrNextHigher(nextIndex);\n\n\t\tif (baseEntry === undefined && newEntry === undefined) {\n\t\t\tbreak;\n\t\t}\n\n\t\tconst newIndex = newEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tconst baseIndex = baseEntry?.[0] ?? Number.POSITIVE_INFINITY;\n\t\tlet newNodeChange: NodeId | undefined;\n\t\tlet baseNodeChange: NodeId | undefined;\n\t\tlet index: number;\n\t\tif (newIndex === baseIndex) {\n\t\t\tassert(\n\t\t\t\tnewEntry !== undefined && baseEntry !== undefined,\n\t\t\t\t0xa0d /* Entries should be defined */,\n\t\t\t);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t} else if (newIndex < baseIndex) {\n\t\t\tassert(newEntry !== undefined, 0xa0e /* Entry should be defined */);\n\t\t\tindex = newIndex;\n\t\t\tnewNodeChange = newEntry[1];\n\t\t} else {\n\t\t\tassert(baseEntry !== undefined, 0xa0f /* Entry should be defined */);\n\t\t\tindex = baseIndex;\n\t\t\tbaseNodeChange = baseEntry[1];\n\t\t}\n\n\t\tconst nodeChange = rebaseChild(newNodeChange, baseNodeChange);\n\t\tif (nodeChange !== undefined) {\n\t\t\trebased.set(index, nodeChange);\n\t\t}\n\n\t\tnextIndex = index + 1;\n\t}\n\n\treturn rebased;\n}\n\nfunction pruneGenericChange(\n\tchangeset: GenericChangeset,\n\tpruneChild: NodeChangePruner,\n): GenericChangeset {\n\tconst pruned: GenericChangeset = new BTree();\n\tfor (const [index, node] of changeset.entries()) {\n\t\tconst prunedNode = pruneChild(node);\n\t\tif (prunedNode !== undefined) {\n\t\t\tpruned.set(index, node);\n\t\t}\n\t}\n\treturn pruned;\n}\n\nfunction replaceRevisions(\n\tchangeset: GenericChangeset,\n\toldRevisions: Set<RevisionTag | undefined>,\n\tnewRevision: RevisionTag | undefined,\n): GenericChangeset {\n\treturn changeset.mapValues((node) => replaceAtomRevisions(node, oldRevisions, newRevision));\n}\n\n/**\n * {@link FieldKind} used to represent changes to elements of a field in a field-kind-agnostic format.\n */\nexport const genericFieldKind: FlexFieldKind = new FlexFieldKind(\n\tbrandConst(\"ModularEditBuilder.Generic\")<FieldKindIdentifier>(),\n\tMultiplicity.Sequence,\n\t{\n\t\tchangeHandler: genericChangeHandler,\n\t\tallowMonotonicUpgradeFrom: new Set(),\n\t},\n);\n\n/**\n * Converts a {@link GenericChangeset} into a field-kind-specific `TChange`.\n * @param changeset - The generic changeset to convert.\n * @param target - The {@link FieldChangeHandler} for the `FieldKind` that the returned change should target.\n * @param composeChild - A delegate to compose {@link NodeChangeset}s.\n * @returns An equivalent changeset as represented by the `target` field-kind.\n */\nexport function convertGenericChange<TChange>(\n\tchangeset: GenericChangeset,\n\ttarget: FieldChangeHandler<TChange>,\n): TChange {\n\treturn target.editor.buildChildChanges(changeset.entries());\n}\n\nfunction* relevantRemovedRoots(\n\tchange: GenericChangeset,\n\trelevantRemovedRootsFromChild: RelevantRemovedRootsFromChild,\n): Iterable<DeltaDetachedNodeId> {\n\tfor (const nodeChange of change.values()) {\n\t\tyield* relevantRemovedRootsFromChild(nodeChange);\n\t}\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { allowsRepoSuperset, allowsTreeSchemaIdentifierSuperset, allowsFieldSuperset, allowsTreeSuperset, } from "./comparison.js";
|
|
5
|
+
export { allowsRepoSuperset, allowsTreeSchemaIdentifierSuperset, allowsFieldSuperset, allowsTreeSuperset, allowsMultiplicitySuperset, } from "./comparison.js";
|
|
6
6
|
export { isNeverField, isNeverTree } from "./isNeverTree.js";
|
|
7
7
|
export { addCrossFieldQuery, type CrossFieldManager, type CrossFieldMap, type CrossFieldQuerySet, CrossFieldTarget, setInCrossFieldMap, } from "./crossFieldQueries.js";
|
|
8
8
|
export { ChangesetLocalIdSchema, EncodedChangeAtomId, EncodedRevisionInfo, EncodedModularChangeset, EncodedNodeChangeset, } from "./modularChangeFormat.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO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EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,YAAY,EACX,sBAAsB,EACtB,2BAA2B,GAC3B,MAAM,6BAA6B,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { allowsRepoSuperset, allowsTreeSchemaIdentifierSuperset, allowsFieldSuperset, allowsTreeSuperset, } from "./comparison.js";
|
|
5
|
+
export { allowsRepoSuperset, allowsTreeSchemaIdentifierSuperset, allowsFieldSuperset, allowsTreeSuperset, allowsMultiplicitySuperset, } from "./comparison.js";
|
|
6
6
|
export { isNeverField, isNeverTree } from "./isNeverTree.js";
|
|
7
7
|
export { addCrossFieldQuery, CrossFieldTarget, setInCrossFieldMap, } from "./crossFieldQueries.js";
|
|
8
8
|
export { ChangesetLocalIdSchema, EncodedChangeAtomId, EncodedRevisionInfo, EncodedModularChangeset, EncodedNodeChangeset, } from "./modularChangeFormat.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,kCAAkC,EAClC,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAIlB,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAyB,MAAM,gBAAgB,CAAC;AACtE,OAAO,EASN,+BAA+B,EAI/B,eAAe,GAGf,MAAM,yBAAyB,CAAC;AAYjC,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,mBAAmB,EACnB,kBAAkB,EAIlB,8BAA8B,EAC9B,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tallowsRepoSuperset,\n\tallowsTreeSchemaIdentifierSuperset,\n\tallowsFieldSuperset,\n\tallowsTreeSuperset,\n\tallowsMultiplicitySuperset,\n} from \"./comparison.js\";\nexport { isNeverField, isNeverTree } from \"./isNeverTree.js\";\nexport {\n\taddCrossFieldQuery,\n\ttype CrossFieldManager,\n\ttype CrossFieldMap,\n\ttype CrossFieldQuerySet,\n\tCrossFieldTarget,\n\tsetInCrossFieldMap,\n} from \"./crossFieldQueries.js\";\nexport {\n\tChangesetLocalIdSchema,\n\tEncodedChangeAtomId,\n\tEncodedRevisionInfo,\n\tEncodedModularChangeset,\n\tEncodedNodeChangeset,\n} from \"./modularChangeFormat.js\";\nexport { FlexFieldKind, type FullSchemaPolicy } from \"./fieldKind.js\";\nexport {\n\ttype FieldChangeHandler,\n\ttype FieldChangeDelta,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\treferenceFreeFieldChangeRebaser,\n\ttype RebaseRevisionMetadata,\n\ttype RelevantRemovedRootsFromChild,\n\ttype ToDelta,\n\tNodeAttachState,\n\ttype FieldChangeEncodingContext,\n\ttype NestedChangesIndices,\n} from \"./fieldChangeHandler.js\";\nexport type {\n\tCrossFieldKey,\n\tCrossFieldKeyRange,\n\tFieldChange,\n\tFieldChangeMap,\n\tFieldChangeset,\n\tHasFieldChanges,\n\tModularChangeset,\n\tNodeExistsConstraint,\n\tNodeId,\n} from \"./modularChangeTypes.js\";\nexport {\n\tconvertGenericChange,\n\tgenericChangeHandler,\n\tgenericFieldKind,\n} from \"./genericFieldKind.js\";\nexport type { GenericChangeset } from \"./genericFieldKindTypes.js\";\nexport {\n\tModularChangeFamily,\n\tModularEditBuilder,\n\ttype EditDescription,\n\ttype GlobalEditDescription,\n\ttype FieldEditDescription,\n\trebaseRevisionMetadataFromInfo,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tupdateRefreshers,\n} from \"./modularChangeFamily.js\";\nexport { makeModularChangeCodecFamily } from \"./modularChangeCodecs.js\";\nexport type {\n\tFieldKindConfiguration,\n\tFieldKindConfigurationEntry,\n} from \"./fieldKindConfiguration.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemaChangeCodecs.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,iBAAiB,GACxB,YAAY,CAAC,YAAY,CAAC,CAK5B;AAED,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAMX;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,YAAY,EAAE,mBAAmB,GAC/B,UAAU,CAAC,YAAY,CAAC,CAG1B"}
|
|
@@ -7,7 +7,6 @@ import { makeCodecFamily, makeVersionDispatchingCodec, withSchemaValidation, } f
|
|
|
7
7
|
import { getCodecTreeForSchemaFormat, makeSchemaCodec } from "../schema-index/index.js";
|
|
8
8
|
import { EncodedSchemaChange } from "./schemaChangeFormat.js";
|
|
9
9
|
import { SchemaFormatVersion } from "../../core/index.js";
|
|
10
|
-
import { brand } from "../../util/index.js";
|
|
11
10
|
/**
|
|
12
11
|
* Create a family of schema change codecs.
|
|
13
12
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
@@ -15,8 +14,8 @@ import { brand } from "../../util/index.js";
|
|
|
15
14
|
*/
|
|
16
15
|
export function makeSchemaChangeCodecs(options) {
|
|
17
16
|
return makeCodecFamily([
|
|
18
|
-
[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options,
|
|
19
|
-
[SchemaFormatVersion.v2, makeSchemaChangeCodecV1(options,
|
|
17
|
+
[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v1)],
|
|
18
|
+
[SchemaFormatVersion.v2, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v2)],
|
|
20
19
|
]);
|
|
21
20
|
}
|
|
22
21
|
export function getCodecTreeForSchemaChangeFormat(version, clientVersion) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAKN,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemaChangeCodecs.js","sourceRoot":"","sources":["../../../src/feature-libraries/schema-edits/schemaChangeCodecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAKN,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACrC,OAA0B;IAE1B,OAAO,eAAe,CAAC;QACtB,CAAC,mBAAmB,CAAC,EAAE,EAAE,uBAAuB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MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;iBACpC;gBACD,SAAS,EAAE,KAAK;aAChB,CAAC;QACH,CAAC;QACD,aAAa,EAAE,mBAAmB;KAClC,CAAC;IAEF,OAAO,oBAAoB,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC5F,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\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\ttype ICodecFamily,\n\ttype IJsonCodec,\n\tmakeCodecFamily,\n\tmakeVersionDispatchingCodec,\n\twithSchemaValidation,\n} from \"../../codec/index.js\";\nimport { getCodecTreeForSchemaFormat, makeSchemaCodec } from \"../schema-index/index.js\";\n\nimport { EncodedSchemaChange } from \"./schemaChangeFormat.js\";\nimport type { SchemaChange } from \"./schemaChangeTypes.js\";\nimport { SchemaFormatVersion } from \"../../core/index.js\";\n\n/**\n * Create a family of schema change codecs.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @returns The composed codec family.\n */\nexport function makeSchemaChangeCodecs(\n\toptions: CodecWriteOptions,\n): ICodecFamily<SchemaChange> {\n\treturn makeCodecFamily([\n\t\t[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v1)],\n\t\t[SchemaFormatVersion.v2, makeSchemaChangeCodecV1(options, SchemaFormatVersion.v2)],\n\t]);\n}\n\nexport function getCodecTreeForSchemaChangeFormat(\n\tversion: SchemaFormatVersion,\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn {\n\t\tname: \"SchemaChange\",\n\t\tversion,\n\t\tchildren: [getCodecTreeForSchemaFormat(clientVersion)],\n\t};\n}\n\n/**\n * Create a schema change codec.\n * @param options - Specifies common codec options, including which `validator` to use.\n * @param writeVersion - The schema change write version.\n * @returns The composed codec.\n */\nexport function makeSchemaChangeCodec(\n\toptions: CodecWriteOptions,\n\twriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange> {\n\tconst family = makeSchemaChangeCodecs(options);\n\treturn makeVersionDispatchingCodec(family, { ...options, writeVersion });\n}\n\n/**\n * Compose the change codec using mostly v1 logic.\n * @param options - The codec options.\n * @param schemaWriteVersion - The schema write version.\n * @returns The composed schema change codec.\n */\nfunction makeSchemaChangeCodecV1(\n\toptions: CodecWriteOptions,\n\tschemaWriteVersion: SchemaFormatVersion,\n): IJsonCodec<SchemaChange, EncodedSchemaChange> {\n\tconst schemaCodec = makeSchemaCodec(options, schemaWriteVersion);\n\tconst schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {\n\t\tencode: (schemaChange) => {\n\t\t\tassert(\n\t\t\t\t!schemaChange.isInverse,\n\t\t\t\t0x933 /* Inverse schema changes should never be transmitted */,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tnew: schemaCodec.encode(schemaChange.schema.new),\n\t\t\t\told: schemaCodec.encode(schemaChange.schema.old),\n\t\t\t};\n\t\t},\n\t\tdecode: (encoded) => {\n\t\t\treturn {\n\t\t\t\tschema: {\n\t\t\t\t\tnew: schemaCodec.decode(encoded.new),\n\t\t\t\t\told: schemaCodec.decode(encoded.old),\n\t\t\t\t},\n\t\t\t\tisInverse: false,\n\t\t\t};\n\t\t},\n\t\tencodedSchema: EncodedSchemaChange,\n\t};\n\n\treturn withSchemaValidation(EncodedSchemaChange, schemaChangeCodec, options.jsonValidator);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAGnB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/schema-index/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,UAAU,EAIf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,mBAAmB,EAGnB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAE5F;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC3C,aAAa,EAAE,uBAAuB,GACpC,mBAAmB,CAKrB;AAED,wBAAgB,2BAA2B,CAC1C,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAEX;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,oBAAoB,CAAC,EAAE,mBAAmB,GACxC,UAAU,CAAC,gBAAgB,CAAC,CAO9B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAKvF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,mBAAmB,GAC1B,cAAc,CAShB"}
|