@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":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAEhC,+DAU+B;AAE/B,2CAOqB;AAErB,qDAAyD;AACzD,iFAAkF;AAClF,qDAAgE;AAEhE;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IAE3B,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,SAAS,CAAC,wBAAwB,EAClC,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAdD,4DAcC;AAED;;;;G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,CAAC,2BAA2B,CAAC,CAAC;AACzC,CAAC;AAjDD,wCAiDC;AAED,SAAS,oBAAoB,CAAC,MAA+B;IAC5D,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,SAAS;YACb,OAAO,KAAK,CAAC;QACd,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,OAAO,CAAC;QACzB,KAAK,sBAAW,CAAC,WAAW;YAC3B,OAAO,IAAI,CAAC;QACb,KAAK,sBAAW,CAAC,IAAI;YACpB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf;YACC,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\n\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype !== undefined ? nodeBuilder.nodeEncoderFromSchema(type) : anyNodeEncoder;\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\n\t\tconst shouldEncodeIncrementally =\n\t\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tfalse,\n\t\t\t[],\n\t\t\tfieldBuilder.fieldEncoderFromSchema(schema.mapFields),\n\t\t);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined:\n\t\t\treturn false;\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle:\n\t\t\treturn true;\n\t\tcase ValueSchema.Null:\n\t\t\treturn [null];\n\t\tdefault:\n\t\t\tunreachableCase(schema);\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schemaBasedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAAoF;AAGpF,qDAWgC;AAEhC,+DAU+B;AAE/B,2CAOqB;AAErB,qDAAyD;AACzD,iFAAkF;AAClF,qDAAgE;AAEhE;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UAAsB,EACtB,YAA2B;IAE3B,OAAO,sBAAsB,CAC5B,MAAM,EACN,MAAM,EACN,UAAU,EACV,YAAY,EACZ,SAAS,CAAC,wBAAwB,EAClC,IAAA,gBAAK,EAAC,mCAAuB,CAAC,EAAE,CAAC,CACjC,CAAC;AACH,CAAC;AAdD,4DAcC;AAED;;;;GAIG;AACH,SAAgB,wBAAwB,CACvC,MAA8B,EAC9B,MAAoB,EACpB,UA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,YAAY,CAAC,CAAC;QAC7E,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAA,eAAI,EAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;AACzC,CAAC;AAjDD,wCAiDC;AAED,SAAS,oBAAoB,CAAC,MAA+B;IAC5D,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,SAAS;YACb,OAAO,KAAK,CAAC;QACd,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,MAAM,CAAC;QACxB,KAAK,sBAAW,CAAC,OAAO,CAAC;QACzB,KAAK,sBAAW,CAAC,WAAW;YAC3B,OAAO,IAAI,CAAC;QACb,KAAK,sBAAW,CAAC,IAAI;YACpB,OAAO,CAAC,IAAI,CAAC,CAAC;QACf;YACC,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype StoredSchemaCollection,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\tValueSchema,\n\tMultiplicity,\n\tidentifierFieldKindIdentifier,\n\ttype SchemaPolicy,\n} from \"../../../core/index.js\";\n\nimport {\n\tEncoderContext,\n\ttype FieldEncoder,\n\ttype FieldEncodeBuilder,\n\ttype KeyedFieldEncoder,\n\ttype NodeEncodeBuilder,\n\tanyNodeEncoder,\n\tasFieldEncoder,\n\tcompressedEncode,\n\tincrementalFieldEncoder,\n} from \"./compressedEncode.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\ttype EncodedFieldBatchV1,\n\ttype EncodedFieldBatchV2,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport { NodeShapeBasedEncoder } from \"./nodeEncoder.js\";\nimport { defaultIncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { brand, oneFromIterable } from \"../../../util/index.js\";\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * This version does not support incremental encoding.\n */\nexport function schemaCompressedEncodeV1(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n): EncodedFieldBatchV1 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tundefined /* incrementalEncoder */,\n\t\tbrand(FieldBatchFormatVersion.v1),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v2}.\n * @remarks See {@link schemaCompressedEncode} for more details.\n * Incremental encoding is supported from this version onwards.\n */\nexport function schemaCompressedEncodeV2(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n): EncodedFieldBatchV2 {\n\treturn schemaCompressedEncode(\n\t\tschema,\n\t\tpolicy,\n\t\tfieldBatch,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tbrand(FieldBatchFormatVersion.v2),\n\t);\n}\n\n/**\n * Encode data from `fieldBatch` in into an `EncodedChunk`.\n * @remarks\n * If `incrementalEncoder` is provided,\n * fields that support incremental encoding will encode their chunks separately via the `incrementalEncoder`.\n * See {@link IncrementalEncoder} for more details.\n *\n * Optimized for encoded size and encoding performance.\n * TODO: This function should eventually also take in the root FieldSchema to more efficiently compress the nodes.\n */\nfunction schemaCompressedEncode(\n\tschema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tfieldBatch: FieldBatch,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncodedFieldBatch {\n\treturn compressedEncode(\n\t\tfieldBatch,\n\t\tbuildContext(schema, policy, idCompressor, incrementalEncoder, version),\n\t);\n}\n\nexport function buildContext(\n\tstoredSchema: StoredSchemaCollection,\n\tpolicy: SchemaPolicy,\n\tidCompressor: IIdCompressor,\n\tincrementalEncoder: IncrementalEncoder | undefined,\n\tversion: FieldBatchFormatVersion,\n): EncoderContext {\n\tconst context: EncoderContext = new EncoderContext(\n\t\t(fieldBuilder: FieldEncodeBuilder, schemaName: TreeNodeSchemaIdentifier) =>\n\t\t\tgetNodeEncoder(fieldBuilder, storedSchema, schemaName, incrementalEncoder),\n\t\t(nodeBuilder: NodeEncodeBuilder, fieldSchema: TreeFieldStoredSchema) =>\n\t\t\tgetFieldEncoder(nodeBuilder, fieldSchema, context, storedSchema),\n\t\tpolicy.fieldKinds,\n\t\tidCompressor,\n\t\tincrementalEncoder,\n\t\tversion,\n\t);\n\treturn context;\n}\n\n/**\n * Selects an encoder to use to encode fields.\n */\nexport function getFieldEncoder(\n\tnodeBuilder: NodeEncodeBuilder,\n\tfield: TreeFieldStoredSchema,\n\tcontext: EncoderContext,\n\tstoredSchema: StoredSchemaCollection,\n): FieldEncoder {\n\tconst kind = context.fieldShapes.get(field.kind) ?? fail(0xb52 /* missing FieldKind */);\n\tconst type = oneFromIterable(field.types);\n\tconst nodeEncoder =\n\t\ttype !== undefined ? nodeBuilder.nodeEncoderFromSchema(type) : anyNodeEncoder;\n\tif (kind.multiplicity === Multiplicity.Single) {\n\t\tif (field.kind === identifierFieldKindIdentifier) {\n\t\t\tassert(type !== undefined, 0x999 /* field type must be defined in identifier field */);\n\t\t\tconst nodeSchema = storedSchema.nodeSchema.get(type);\n\t\t\tassert(nodeSchema !== undefined, 0x99a /* nodeSchema must be defined */);\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof LeafNodeStoredSchema,\n\t\t\t\t0x99b /* nodeSchema must be LeafNodeStoredSchema */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tnodeSchema.leafValue === ValueSchema.String,\n\t\t\t\t0x99c /* identifier field can only be type string */,\n\t\t\t);\n\t\t\tconst identifierNodeEncoder = new NodeShapeBasedEncoder(\n\t\t\t\ttype,\n\t\t\t\tSpecialField.Identifier,\n\t\t\t\t[],\n\t\t\t\tundefined,\n\t\t\t);\n\t\t\treturn asFieldEncoder(identifierNodeEncoder);\n\t\t}\n\t\treturn asFieldEncoder(nodeEncoder);\n\t} else {\n\t\treturn context.nestedArrayEncoder(nodeEncoder);\n\t}\n}\n\n/**\n * Selects an encoder to use to encode nodes.\n */\nexport function getNodeEncoder(\n\tfieldBuilder: FieldEncodeBuilder,\n\tstoredSchema: StoredSchemaCollection,\n\tschemaName: TreeNodeSchemaIdentifier,\n\tincrementalEncoder?: IncrementalEncoder,\n): NodeShapeBasedEncoder {\n\tconst shouldEncodeIncrementally =\n\t\tincrementalEncoder?.shouldEncodeIncrementally ?? defaultIncrementalEncodingPolicy;\n\tconst schema =\n\t\tstoredSchema.nodeSchema.get(schemaName) ?? fail(0xb53 /* missing node schema */);\n\n\t// This handles both object and array nodes.\n\tif (schema instanceof ObjectNodeStoredSchema) {\n\t\t// TODO:Performance:\n\t\t// consider moving some optional and sequence fields to extra fields if they are commonly empty\n\t\t// to reduce encoded size.\n\t\tconst objectNodeFields: KeyedFieldEncoder[] = [];\n\t\tfor (const [key, field] of schema.objectNodeFields ?? []) {\n\t\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName, key)\n\t\t\t\t? incrementalFieldEncoder\n\t\t\t\t: fieldBuilder.fieldEncoderFromSchema(field);\n\t\t\tobjectNodeFields.push({\n\t\t\t\tkey,\n\t\t\t\tencoder: fieldEncoder,\n\t\t\t});\n\t\t}\n\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, objectNodeFields, undefined);\n\t\treturn shape;\n\t}\n\tif (schema instanceof LeafNodeStoredSchema) {\n\t\tconst shape = new NodeShapeBasedEncoder(\n\t\t\tschemaName,\n\t\t\tvalueShapeFromSchema(schema.leafValue),\n\t\t\t[],\n\t\t\tundefined,\n\t\t);\n\t\treturn shape;\n\t}\n\n\t// This handles both maps and record nodes.\n\tif (schema instanceof MapNodeStoredSchema) {\n\t\tconst fieldEncoder = shouldEncodeIncrementally(schemaName)\n\t\t\t? incrementalFieldEncoder\n\t\t\t: fieldBuilder.fieldEncoderFromSchema(schema.mapFields);\n\t\tconst shape = new NodeShapeBasedEncoder(schemaName, false, [], fieldEncoder);\n\t\treturn shape;\n\t}\n\tfail(0xb54 /* unsupported node kind */);\n}\n\nfunction valueShapeFromSchema(schema: ValueSchema | undefined): undefined | EncodedValueShape {\n\tswitch (schema) {\n\t\tcase undefined:\n\t\t\treturn false;\n\t\tcase ValueSchema.Number:\n\t\tcase ValueSchema.String:\n\t\tcase ValueSchema.Boolean:\n\t\tcase ValueSchema.FluidHandle:\n\t\t\treturn true;\n\t\tcase ValueSchema.Null:\n\t\t\treturn [null];\n\t\tdefault:\n\t\t\tunreachableCase(schema);\n\t}\n}\n"]}
|
|
@@ -31,23 +31,23 @@ export interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {
|
|
|
31
31
|
}): OptionalChangeset;
|
|
32
32
|
}
|
|
33
33
|
declare const optionalIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Optional";
|
|
34
|
+
declare const requiredIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value";
|
|
35
|
+
declare const sequenceIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence";
|
|
36
|
+
declare const identifierFieldIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Identifier";
|
|
34
37
|
/**
|
|
35
38
|
* 0 or 1 items.
|
|
36
39
|
*/
|
|
37
40
|
export declare const optional: FlexFieldKind<OptionalFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Optional", Multiplicity.Optional>;
|
|
38
41
|
export declare const requiredFieldEditor: RequiredFieldEditor;
|
|
39
42
|
export declare const requiredFieldChangeHandler: FieldChangeHandler<OptionalChangeset, RequiredFieldEditor>;
|
|
40
|
-
declare const requiredIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value";
|
|
41
43
|
/**
|
|
42
44
|
* Exactly one item.
|
|
43
45
|
*/
|
|
44
46
|
export declare const required: FlexFieldKind<RequiredFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Value", Multiplicity.Single>;
|
|
45
|
-
declare const sequenceIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence";
|
|
46
47
|
/**
|
|
47
48
|
* 0 or more items.
|
|
48
49
|
*/
|
|
49
50
|
export declare const sequence: FlexFieldKind<SequenceFieldEditor, import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Sequence", Multiplicity.Sequence>;
|
|
50
|
-
declare const identifierFieldIdentifier: import("../../util/brand.js").BrandedType<string, "tree.FieldKindIdentifier"> & "Identifier";
|
|
51
51
|
/**
|
|
52
52
|
* Exactly one identifier.
|
|
53
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultFieldKinds.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE3B,aAAa,EACb,KAAK,gBAAgB,
|
|
1
|
+
{"version":3,"file":"defaultFieldKinds.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,YAAY,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE3B,aAAa,EACb,KAAK,gBAAgB,EAGrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EAGxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEN,KAAK,mBAAmB,EACxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAqB,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAejD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,iBAAiB,CAAC;IAC1E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,YAAY,CAAA;KAAE,GAAG,iBAAiB,CAAC;CAC1E;AAED,QAAA,MAAM,kBAAkB,4FAAgD,CAAC;AACzE,QAAA,MAAM,kBAAkB,yFAA6C,CAAC;AACtE,QAAA,MAAM,kBAAkB,4FAAgD,CAAC;AACzE,QAAA,MAAM,yBAAyB,8FAAkD,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,QAAQ,uJAOnB,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,mBAMjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CA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CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC4B,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAEjC,CAAC"}
|
|
@@ -32,13 +32,19 @@ exports.noChangeHandler = {
|
|
|
32
32
|
getCrossFieldKeys: () => [],
|
|
33
33
|
};
|
|
34
34
|
const optionalIdentifier = (0, index_js_5.brandConst)("Optional")();
|
|
35
|
+
const requiredIdentifier = (0, index_js_5.brandConst)("Value")();
|
|
36
|
+
const sequenceIdentifier = (0, index_js_5.brandConst)("Sequence")();
|
|
37
|
+
const identifierFieldIdentifier = (0, index_js_5.brandConst)("Identifier")();
|
|
35
38
|
/**
|
|
36
39
|
* 0 or 1 items.
|
|
37
40
|
*/
|
|
38
41
|
exports.optional = new index_js_2.FlexFieldKind(optionalIdentifier, index_js_1.Multiplicity.Optional, {
|
|
39
42
|
changeHandler: index_js_3.optionalChangeHandler,
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
allowMonotonicUpgradeFrom: new Set([
|
|
44
|
+
identifierFieldIdentifier,
|
|
45
|
+
requiredIdentifier,
|
|
46
|
+
index_js_1.forbiddenFieldKindIdentifier,
|
|
47
|
+
]),
|
|
42
48
|
});
|
|
43
49
|
exports.requiredFieldEditor = {
|
|
44
50
|
...index_js_3.optionalFieldEditor,
|
|
@@ -48,45 +54,36 @@ exports.requiredFieldChangeHandler = {
|
|
|
48
54
|
...index_js_3.optionalChangeHandler,
|
|
49
55
|
editor: exports.requiredFieldEditor,
|
|
50
56
|
};
|
|
51
|
-
const requiredIdentifier = (0, index_js_5.brandConst)("Value")();
|
|
52
57
|
/**
|
|
53
58
|
* Exactly one item.
|
|
54
59
|
*/
|
|
55
60
|
exports.required = new index_js_2.FlexFieldKind(requiredIdentifier, index_js_1.Multiplicity.Single, {
|
|
56
61
|
changeHandler: exports.requiredFieldChangeHandler,
|
|
57
|
-
|
|
58
|
-
// By omitting Identifier here,
|
|
59
|
-
// this is making a policy choice that a schema upgrade cannot be done from required to identifier.
|
|
60
|
-
// Since an identifier can be upgraded into a required field,
|
|
61
|
-
// preventing the inverse helps ensure that schema upgrades are monotonic.
|
|
62
|
-
// Which direction is allowed is a subjective policy choice.
|
|
63
|
-
(other.kind === exports.sequence.identifier ||
|
|
64
|
-
other.kind === requiredIdentifier ||
|
|
65
|
-
other.kind === exports.optional.identifier) &&
|
|
66
|
-
(0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
|
|
62
|
+
allowMonotonicUpgradeFrom: new Set([identifierFieldIdentifier]),
|
|
67
63
|
});
|
|
68
|
-
const sequenceIdentifier = (0, index_js_5.brandConst)("Sequence")();
|
|
69
64
|
/**
|
|
70
65
|
* 0 or more items.
|
|
71
66
|
*/
|
|
72
67
|
exports.sequence = new index_js_2.FlexFieldKind(sequenceIdentifier, index_js_1.Multiplicity.Sequence, {
|
|
73
68
|
changeHandler: index_js_4.sequenceFieldChangeHandler,
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
allowMonotonicUpgradeFrom: new Set([
|
|
70
|
+
exports.required.identifier,
|
|
71
|
+
exports.optional.identifier,
|
|
72
|
+
identifierFieldIdentifier,
|
|
73
|
+
index_js_1.forbiddenFieldKindIdentifier,
|
|
74
|
+
]),
|
|
76
75
|
});
|
|
77
|
-
const identifierFieldIdentifier = (0, index_js_5.brandConst)("Identifier")();
|
|
78
76
|
/**
|
|
79
77
|
* Exactly one identifier.
|
|
80
78
|
*/
|
|
81
79
|
exports.identifier = new index_js_2.FlexFieldKind(identifierFieldIdentifier, index_js_1.Multiplicity.Single, {
|
|
82
80
|
changeHandler: exports.noChangeHandler,
|
|
83
|
-
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
(0, index_js_2.allowsTreeSchemaIdentifierSuperset)(types, other.types),
|
|
81
|
+
// By omitting required here,
|
|
82
|
+
// this is making a policy choice that a schema upgrade cannot be done from required to identifier.
|
|
83
|
+
// Since an identifier can be upgraded into a required field,
|
|
84
|
+
// preventing the inverse helps ensure that schema upgrades are monotonic.
|
|
85
|
+
// Which direction is allowed is a subjective policy choice.
|
|
86
|
+
allowMonotonicUpgradeFrom: new Set([]),
|
|
90
87
|
});
|
|
91
88
|
/**
|
|
92
89
|
* Exactly 0 items.
|
|
@@ -118,8 +115,7 @@ exports.identifier = new index_js_2.FlexFieldKind(identifierFieldIdentifier, ind
|
|
|
118
115
|
*/
|
|
119
116
|
exports.forbidden = new index_js_2.FlexFieldKind(index_js_1.forbiddenFieldKindIdentifier, index_js_1.Multiplicity.Forbidden, {
|
|
120
117
|
changeHandler: exports.noChangeHandler,
|
|
121
|
-
|
|
122
|
-
allowsTreeSupersetOf: (types, other) => exports.fieldKinds.get(other.kind)?.multiplicity !== index_js_1.Multiplicity.Single,
|
|
118
|
+
allowMonotonicUpgradeFrom: new Set(),
|
|
123
119
|
});
|
|
124
120
|
exports.fieldKindConfigurations = new Map([
|
|
125
121
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,kDAM6B;AAC7B,yDAWoC;AACpC,yDAKoC;AACpC,yDAGoC;AAEpC,2DAA0D;AAE1D,kDAAoE;AAEpE;;GAEG;AACU,QAAA,eAAe,GAA0B;IACrD,OAAO,EAAE,IAAA,0CAA+B,EAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB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Q,EAAE,gBAAQ,EAAE,gBAAQ,EAAE,kBAAU,EAAE,iBAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CACnF,CAAC;AAkCF;;GAEG;AACU,QAAA,UAAU,GAOnB,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,UAAU,EAAV,kBAAU,EAAE,SAAS,EAAT,iBAAS,EAAE,CAAC;AAE5D;;GAEG;AACU,QAAA,mBAAmB,GAAqB;IACpD,UAAU,EAAV,kBAAU;CACV,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\ttype ToDelta,\n\tallowsTreeSchemaIdentifierSuperset,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\ttype OptionalFieldEditor,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport {\n\tsequenceFieldChangeHandler,\n\ttype SequenceFieldEditor,\n} from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\nimport type { CodecTree } from \"../../codec/index.js\";\nimport { brand, brandConst, type Brand } from \"../../util/index.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\n/**\n * {@link FieldEditor} for required fields (always contain exactly 1 child).\n * @remarks\n * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,\n * and the content is always assumed to not be empty.\n * This means the actual edits implemented for optional fields are sufficient to support required fields\n * which is why this is defined and implemented in terms of optional fields.\n */\nexport interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = brandConst(\"Optional\")<FieldKindIdentifier>();\n\n/**\n * 0 or 1 items.\n */\nexport const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {\n\tchangeHandler: optionalChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t(other.kind === sequence.identifier || other.kind === optionalIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nexport const requiredFieldEditor: RequiredFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const requiredFieldChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tRequiredFieldEditor\n> = {\n\t...optionalChangeHandler,\n\teditor: requiredFieldEditor,\n};\n\nconst requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\n\n/**\n * Exactly one item.\n */\nexport const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {\n\tchangeHandler: requiredFieldChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t// By omitting Identifier here,\n\t\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t\t// Since an identifier can be upgraded into a required field,\n\t\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t\t// Which direction is allowed is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nconst sequenceIdentifier = brandConst(\"Sequence\")<FieldKindIdentifier>();\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {\n\tchangeHandler: sequenceFieldChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\tother.kind === sequenceIdentifier &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\nconst identifierFieldIdentifier = brandConst(\"Identifier\")<FieldKindIdentifier>();\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {\n\tchangeHandler: noChangeHandler,\n\tallowsTreeSupersetOf: (types, other) =>\n\t\t// Allows upgrading from identifier to required: which way this upgrade is allowed to go is a subjective policy choice.\n\t\t(other.kind === sequence.identifier ||\n\t\t\tother.kind === requiredIdentifier ||\n\t\t\tother.kind === optional.identifier ||\n\t\t\tother.kind === identifierFieldIdentifier) &&\n\t\tallowsTreeSchemaIdentifierSuperset(types, other.types),\n});\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\t// All multiplicities other than Value support empty.\n\t\tallowsTreeSupersetOf: (types, other) =>\n\t\t\tfieldKinds.get(other.kind)?.multiplicity !== Multiplicity.Single,\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map([\n\t[\n\t\tbrand(3),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(4),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport type ModularChangeFormatVersion = Brand<3 | 4, \"ModularChangeFormatVersion\">;\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = Array.from(dependencies.entries()).map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required\n\textends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}\nexport interface Optional\n\textends FlexFieldKind<\n\t\tOptionalFieldEditor,\n\t\ttypeof optionalIdentifier,\n\t\tMultiplicity.Optional\n\t> {}\nexport interface Sequence\n\textends FlexFieldKind<\n\t\tSequenceFieldEditor,\n\t\ttypeof sequenceIdentifier,\n\t\tMultiplicity.Sequence\n\t> {}\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"defaultFieldKinds.js","sourceRoot":"","sources":["../../../src/feature-libraries/default-schema/defaultFieldKinds.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA2D;AAE3D,kDAM6B;AAC7B,yDAUoC;AACpC,yDAKoC;AACpC,yDAGoC;AAEpC,2DAA0D;AAE1D,kDAAoE;AAEpE;;GAEG;AACU,QAAA,eAAe,GAA0B;IACrD,OAAO,EAAE,IAAA,0CAA+B,EAAC;QACxC,OAAO,EAAE,CAAC,OAAU,EAAE,OAAU,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,MAAS,EAAE,IAAO,EAAE,EAAE,CAAC,CAAC;QACjC,IAAI,EAAE,CAAC,OAAU,EAAE,EAAE,CAAC,CAAC;KACvB,CAAC;IACF,aAAa,EAAE,GAAG,EAAE,CAAC,uCAAmB;IACxC,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,IAAA,eAAI,EAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE;IAClF,SAAS,EAAE,CAAC,MAAM,EAAE,cAAuB,EAAoB,EAAE,CAAC,CAAC,EAAE,CAAC;IACtE,oBAAoB,EAAE,CA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CAAC;AAhBD,gFAgBC;AAED;;;;;;GAMG;AACU,QAAA,UAAU,GAAoD,IAAI,GAAG,CACjF,CAAC,gBAAQ,EAAE,gBAAQ,EAAE,gBAAQ,EAAE,kBAAU,EAAE,iBAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CACnF,CAAC;AAkCF;;GAEG;AACU,QAAA,UAAU,GAOnB,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,QAAQ,EAAR,gBAAQ,EAAE,UAAU,EAAV,kBAAU,EAAE,SAAS,EAAT,iBAAS,EAAE,CAAC;AAE5D;;GAEG;AACU,QAAA,mBAAmB,GAAqB;IACpD,UAAU,EAAV,kBAAU;CACV,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype ChangeAtomId,\n\ttype DeltaDetachedNodeId,\n\ttype FieldKindIdentifier,\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity,\n} from \"../../core/index.js\";\nimport {\n\ttype FieldChangeDelta,\n\ttype FieldChangeHandler,\n\ttype FieldEditor,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\ttype ToDelta,\n\treferenceFreeFieldChangeRebaser,\n} from \"../modular-schema/index.js\";\nimport {\n\ttype OptionalChangeset,\n\ttype OptionalFieldEditor,\n\toptionalChangeHandler,\n\toptionalFieldEditor,\n} from \"../optional-field/index.js\";\nimport {\n\tsequenceFieldChangeHandler,\n\ttype SequenceFieldEditor,\n} from \"../sequence-field/index.js\";\n\nimport { noChangeCodecFamily } from \"./noChangeCodecs.js\";\nimport type { CodecTree } from \"../../codec/index.js\";\nimport { brand, brandConst, type Brand } from \"../../util/index.js\";\n\n/**\n * ChangeHandler that only handles no-op / identity changes.\n */\nexport const noChangeHandler: FieldChangeHandler<0> = {\n\trebaser: referenceFreeFieldChangeRebaser({\n\t\tcompose: (change1: 0, change2: 0) => 0,\n\t\tinvert: (changes: 0) => 0,\n\t\trebase: (change: 0, over: 0) => 0,\n\t\tmute: (changes: 0) => 0,\n\t}),\n\tcodecsFactory: () => noChangeCodecFamily,\n\teditor: { buildChildChanges: () => fail(0xb0d /* Child changes not supported */) },\n\tintoDelta: (change, deltaFromChild: ToDelta): FieldChangeDelta => ({}),\n\trelevantRemovedRoots: (change): Iterable<DeltaDetachedNodeId> => [],\n\tisEmpty: (change: 0) => true,\n\tgetNestedChanges: (change: 0) => [],\n\tcreateEmpty: () => 0,\n\tgetCrossFieldKeys: () => [],\n};\n\n/**\n * {@link FieldEditor} for required fields (always contain exactly 1 child).\n * @remarks\n * This shares code with optional fields, since they are the same edit wise except setting to empty is not allowed,\n * and the content is always assumed to not be empty.\n * This means the actual edits implemented for optional fields are sufficient to support required fields\n * which is why this is defined and implemented in terms of optional fields.\n */\nexport interface RequiredFieldEditor extends FieldEditor<OptionalChangeset> {\n\t/**\n\t * Creates a change which replaces the current value of the field with `newValue`.\n\t * @param ids - The ids for the fill and detach fields.\n\t */\n\tset(ids: { fill: ChangeAtomId; detach: ChangeAtomId }): OptionalChangeset;\n}\n\nconst optionalIdentifier = brandConst(\"Optional\")<FieldKindIdentifier>();\nconst requiredIdentifier = brandConst(\"Value\")<FieldKindIdentifier>();\nconst sequenceIdentifier = brandConst(\"Sequence\")<FieldKindIdentifier>();\nconst identifierFieldIdentifier = brandConst(\"Identifier\")<FieldKindIdentifier>();\n\n/**\n * 0 or 1 items.\n */\nexport const optional = new FlexFieldKind(optionalIdentifier, Multiplicity.Optional, {\n\tchangeHandler: optionalChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([\n\t\tidentifierFieldIdentifier,\n\t\trequiredIdentifier,\n\t\tforbiddenFieldKindIdentifier,\n\t]),\n});\n\nexport const requiredFieldEditor: RequiredFieldEditor = {\n\t...optionalFieldEditor,\n\tset: (ids: {\n\t\tfill: ChangeAtomId;\n\t\tdetach: ChangeAtomId;\n\t}): OptionalChangeset => optionalFieldEditor.set(false, ids),\n};\n\nexport const requiredFieldChangeHandler: FieldChangeHandler<\n\tOptionalChangeset,\n\tRequiredFieldEditor\n> = {\n\t...optionalChangeHandler,\n\teditor: requiredFieldEditor,\n};\n\n/**\n * Exactly one item.\n */\nexport const required = new FlexFieldKind(requiredIdentifier, Multiplicity.Single, {\n\tchangeHandler: requiredFieldChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([identifierFieldIdentifier]),\n});\n\n/**\n * 0 or more items.\n */\nexport const sequence = new FlexFieldKind(sequenceIdentifier, Multiplicity.Sequence, {\n\tchangeHandler: sequenceFieldChangeHandler,\n\tallowMonotonicUpgradeFrom: new Set([\n\t\trequired.identifier,\n\t\toptional.identifier,\n\t\tidentifierFieldIdentifier,\n\t\tforbiddenFieldKindIdentifier,\n\t]),\n});\n\n/**\n * Exactly one identifier.\n */\nexport const identifier = new FlexFieldKind(identifierFieldIdentifier, Multiplicity.Single, {\n\tchangeHandler: noChangeHandler,\n\t// By omitting required here,\n\t// this is making a policy choice that a schema upgrade cannot be done from required to identifier.\n\t// Since an identifier can be upgraded into a required field,\n\t// preventing the inverse helps ensure that schema upgrades are monotonic.\n\t// Which direction is allowed is a subjective policy choice.\n\tallowMonotonicUpgradeFrom: new Set([]),\n});\n\n/**\n * Exactly 0 items.\n *\n * Using Forbidden makes what types are listed for allowed in a field irrelevant\n * since the field will never have values in it.\n *\n * Using Forbidden is equivalent to picking a kind that permits empty (like sequence or optional)\n * and having no allowed types (or only never types).\n * Because of this, its possible to express everything constraint wise without Forbidden,\n * but using Forbidden can be more semantically clear than optional with no allowed types.\n *\n * For view schema, this can be useful if you need to:\n * - run a specific out of schema handler when a field is present,\n * but otherwise are ignoring or tolerating (ex: via extra fields) unmentioned fields.\n * - prevent a specific field from being used as an extra field\n * (perhaps for some past of future compatibility reason)\n * - keep a field in a schema for metadata purposes\n * (ex: for improved error messaging, error handling or documentation)\n * that is not used in this specific version of the schema (ex: to document what it was or will be used for).\n *\n * For stored schema, this can be useful if you need to:\n * - have a field which can have its schema updated to Optional or Sequence of any type.\n * - to exclude a field from extra fields\n * - for the schema system to use as a default for fields which aren't declared\n * (ex: when updating a field that did not exist into one that does)\n *\n * See {@link emptyField} for a constant, reusable field using Forbidden.\n */\nexport const forbidden = new FlexFieldKind(\n\tforbiddenFieldKindIdentifier,\n\tMultiplicity.Forbidden,\n\t{\n\t\tchangeHandler: noChangeHandler,\n\t\tallowMonotonicUpgradeFrom: new Set(),\n\t},\n);\n\nexport const fieldKindConfigurations: ReadonlyMap<\n\tModularChangeFormatVersion,\n\tFieldKindConfiguration\n> = new Map([\n\t[\n\t\tbrand(3),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 2 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n\t[\n\t\tbrand(4),\n\t\tnew Map<FieldKindIdentifier, FieldKindConfigurationEntry>([\n\t\t\t[required.identifier, { kind: required, formatVersion: 2 }],\n\t\t\t[optional.identifier, { kind: optional, formatVersion: 2 }],\n\t\t\t[sequence.identifier, { kind: sequence, formatVersion: 3 }],\n\t\t\t[forbidden.identifier, { kind: forbidden, formatVersion: 1 }],\n\t\t\t[identifier.identifier, { kind: identifier, formatVersion: 1 }],\n\t\t]),\n\t],\n]);\n\nexport type ModularChangeFormatVersion = Brand<3 | 4, \"ModularChangeFormatVersion\">;\nexport function getCodecTreeForModularChangeFormat(\n\tversion: ModularChangeFormatVersion,\n): CodecTree {\n\tconst dependencies =\n\t\tfieldKindConfigurations.get(version) ?? fail(0xc7c /* Unknown modular change format */);\n\tconst children: CodecTree[] = Array.from(dependencies.entries()).map(\n\t\t([key, { formatVersion }]) => ({\n\t\t\tname: `FieldKind:${key}`,\n\t\t\tversion: formatVersion,\n\t\t}),\n\t);\n\treturn {\n\t\tname: \"ModularChange\",\n\t\tversion,\n\t\tchildren,\n\t};\n}\n\n/**\n * All supported field kinds.\n *\n * @privateRemarks\n * Before making a SharedTree format change which impacts which set of field kinds are allowed,\n * code which uses this should be audited for compatibility considerations.\n */\nexport const fieldKinds: ReadonlyMap<FieldKindIdentifier, FlexFieldKind> = new Map(\n\t[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),\n);\n\n// Create named Aliases for nicer intellisense.\n\n// TODO: Find a way to make docs like {@inheritDoc required} work in vscode.\n// TODO: ensure thy work in generated docs.\n// TODO: add these comments to the rest of the cases below.\nexport interface Required\n\textends FlexFieldKind<RequiredFieldEditor, typeof requiredIdentifier, Multiplicity.Single> {}\nexport interface Optional\n\textends FlexFieldKind<\n\t\tOptionalFieldEditor,\n\t\ttypeof optionalIdentifier,\n\t\tMultiplicity.Optional\n\t> {}\nexport interface Sequence\n\textends FlexFieldKind<\n\t\tSequenceFieldEditor,\n\t\ttypeof sequenceIdentifier,\n\t\tMultiplicity.Sequence\n\t> {}\nexport interface Identifier\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof identifierFieldIdentifier,\n\t\tMultiplicity.Single\n\t> {}\nexport interface Forbidden\n\textends FlexFieldKind<\n\t\tFieldEditor<0>,\n\t\ttypeof forbiddenFieldKindIdentifier,\n\t\tMultiplicity.Forbidden\n\t> {}\n\n/**\n * Default FieldKinds with their editor types erased.\n */\nexport const FieldKinds: {\n\t// TODO: inheritDoc for these somehow\n\treadonly required: Required;\n\treadonly optional: Optional;\n\treadonly sequence: Sequence;\n\treadonly identifier: Identifier;\n\treadonly forbidden: Forbidden;\n} = { required, optional, sequence, identifier, forbidden };\n\n/**\n * FullSchemaPolicy with the default field kinds.\n */\nexport const defaultSchemaPolicy: FullSchemaPolicy = {\n\tfieldKinds,\n};\n"]}
|
|
@@ -3,23 +3,45 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
6
|
-
import type { IExperimentalIncrementalSummaryContext,
|
|
6
|
+
import type { IExperimentalIncrementalSummaryContext, ITelemetryContext, MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
7
|
+
import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
7
8
|
import type { DetachedFieldIndex } from "../core/index.js";
|
|
8
|
-
import type
|
|
9
|
+
import { type Summarizable, type SummaryElementParser, type SummaryElementStringifier, VersionedSummarizer } from "../shared-tree-core/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* The storage key for the blob in the summary containing schema data
|
|
12
|
+
*/
|
|
13
|
+
export declare const detachedFieldIndexBlobKey = "DetachedFieldIndexBlob";
|
|
14
|
+
/**
|
|
15
|
+
* The versions for the detached field index summary format.
|
|
16
|
+
*/
|
|
17
|
+
export declare const enum DetachedFieldIndexSummaryFormatVersion {
|
|
18
|
+
/**
|
|
19
|
+
* This version represents summary format before summary versioning was introduced.
|
|
20
|
+
*/
|
|
21
|
+
v1 = 1,
|
|
22
|
+
/**
|
|
23
|
+
* This version adds metadata to the summary. This is backward compatible with version 1.
|
|
24
|
+
*/
|
|
25
|
+
v2 = 2,
|
|
26
|
+
/**
|
|
27
|
+
* The latest version of the summary. Must be updated when a new version is added.
|
|
28
|
+
*/
|
|
29
|
+
vLatest = 2
|
|
30
|
+
}
|
|
9
31
|
/**
|
|
10
32
|
* Provides methods for summarizing and loading a tree index.
|
|
11
33
|
*/
|
|
12
|
-
export declare class DetachedFieldIndexSummarizer implements Summarizable {
|
|
34
|
+
export declare class DetachedFieldIndexSummarizer extends VersionedSummarizer<DetachedFieldIndexSummaryFormatVersion> implements Summarizable {
|
|
13
35
|
private readonly detachedFieldIndex;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
summarize(props: {
|
|
36
|
+
constructor(detachedFieldIndex: DetachedFieldIndex, minVersionForCollab: MinimumVersionForCollab);
|
|
37
|
+
protected summarizeInternal(props: {
|
|
17
38
|
stringify: SummaryElementStringifier;
|
|
18
39
|
fullTree?: boolean;
|
|
19
40
|
trackState?: boolean;
|
|
20
41
|
telemetryContext?: ITelemetryContext;
|
|
21
42
|
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
builder: SummaryTreeBuilder;
|
|
44
|
+
}): void;
|
|
45
|
+
protected loadInternal(services: IChannelStorageService, parse: SummaryElementParser): Promise<void>;
|
|
24
46
|
}
|
|
25
47
|
//# sourceMappingURL=detachedFieldIndexSummarizer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachedFieldIndexSummarizer.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,sCAAsC,EACtC,
|
|
1
|
+
{"version":3,"file":"detachedFieldIndexSummarizer.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,sCAAsC,EACtC,iBAAiB,EACjB,uBAAuB,EACvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,mBAAmB,EACnB,MAAM,8BAA8B,CAAC;AAGtC;;GAEG;AACH,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAElE;;GAEG;AACH,0BAAkB,sCAAsC;IACvD;;OAEG;IACH,EAAE,IAAI;IACN;;OAEG;IACH,EAAE,IAAI;IACN;;OAEG;IACH,OAAO,IAAK;CACZ;AAiBD;;GAEG;AACH,qBAAa,4BACZ,SAAQ,mBAAmB,CAAC,sCAAsC,CAClE,YAAW,YAAY;IAGtB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBAAlB,kBAAkB,EAAE,kBAAkB,EACvD,mBAAmB,EAAE,uBAAuB;IAU7C,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE;QAClC,SAAS,EAAE,yBAAyB,CAAC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;QACrC,yBAAyB,CAAC,EAAE,sCAAsC,CAAC;QACnE,OAAO,EAAE,kBAAkB,CAAC;KAC5B,GAAG,IAAI;cAMQ,YAAY,CAC3B,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAQhB"}
|
|
@@ -4,28 +4,58 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DetachedFieldIndexSummarizer = void 0;
|
|
7
|
+
exports.DetachedFieldIndexSummarizer = exports.DetachedFieldIndexSummaryFormatVersion = exports.detachedFieldIndexBlobKey = void 0;
|
|
8
8
|
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
9
|
-
const
|
|
9
|
+
const index_js_1 = require("../shared-tree-core/index.js");
|
|
10
10
|
/**
|
|
11
11
|
* The storage key for the blob in the summary containing schema data
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
exports.detachedFieldIndexBlobKey = "DetachedFieldIndexBlob";
|
|
14
|
+
/**
|
|
15
|
+
* The versions for the detached field index summary format.
|
|
16
|
+
*/
|
|
17
|
+
var DetachedFieldIndexSummaryFormatVersion;
|
|
18
|
+
(function (DetachedFieldIndexSummaryFormatVersion) {
|
|
19
|
+
/**
|
|
20
|
+
* This version represents summary format before summary versioning was introduced.
|
|
21
|
+
*/
|
|
22
|
+
DetachedFieldIndexSummaryFormatVersion[DetachedFieldIndexSummaryFormatVersion["v1"] = 1] = "v1";
|
|
23
|
+
/**
|
|
24
|
+
* This version adds metadata to the summary. This is backward compatible with version 1.
|
|
25
|
+
*/
|
|
26
|
+
DetachedFieldIndexSummaryFormatVersion[DetachedFieldIndexSummaryFormatVersion["v2"] = 2] = "v2";
|
|
27
|
+
/**
|
|
28
|
+
* The latest version of the summary. Must be updated when a new version is added.
|
|
29
|
+
*/
|
|
30
|
+
DetachedFieldIndexSummaryFormatVersion[DetachedFieldIndexSummaryFormatVersion["vLatest"] = 2] = "vLatest";
|
|
31
|
+
})(DetachedFieldIndexSummaryFormatVersion || (exports.DetachedFieldIndexSummaryFormatVersion = DetachedFieldIndexSummaryFormatVersion = {}));
|
|
32
|
+
const supportedVersions = new Set([
|
|
33
|
+
1 /* DetachedFieldIndexSummaryFormatVersion.v1 */,
|
|
34
|
+
2 /* DetachedFieldIndexSummaryFormatVersion.v2 */,
|
|
35
|
+
]);
|
|
36
|
+
/**
|
|
37
|
+
* Returns the summary version to use as per the given minimum version for collab.
|
|
38
|
+
*/
|
|
39
|
+
function minVersionToDetachedFieldIndexSummaryFormatVersion(version) {
|
|
40
|
+
// Currently, version 2 is written which adds metadata blob to the summary.
|
|
41
|
+
return 2 /* DetachedFieldIndexSummaryFormatVersion.v2 */;
|
|
42
|
+
}
|
|
14
43
|
/**
|
|
15
44
|
* Provides methods for summarizing and loading a tree index.
|
|
16
45
|
*/
|
|
17
|
-
class DetachedFieldIndexSummarizer {
|
|
18
|
-
constructor(detachedFieldIndex) {
|
|
46
|
+
class DetachedFieldIndexSummarizer extends index_js_1.VersionedSummarizer {
|
|
47
|
+
constructor(detachedFieldIndex, minVersionForCollab) {
|
|
48
|
+
super("DetachedFieldIndex", minVersionToDetachedFieldIndexSummaryFormatVersion(minVersionForCollab), supportedVersions, true);
|
|
19
49
|
this.detachedFieldIndex = detachedFieldIndex;
|
|
20
|
-
this.key = "DetachedFieldIndex";
|
|
21
50
|
}
|
|
22
|
-
|
|
51
|
+
summarizeInternal(props) {
|
|
52
|
+
const { stringify, builder } = props;
|
|
23
53
|
const data = this.detachedFieldIndex.encode();
|
|
24
|
-
|
|
54
|
+
builder.addBlob(exports.detachedFieldIndexBlobKey, stringify(data));
|
|
25
55
|
}
|
|
26
|
-
async
|
|
27
|
-
if (await services.contains(detachedFieldIndexBlobKey)) {
|
|
28
|
-
const detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);
|
|
56
|
+
async loadInternal(services, parse) {
|
|
57
|
+
if (await services.contains(exports.detachedFieldIndexBlobKey)) {
|
|
58
|
+
const detachedFieldIndexBuffer = await services.readBlob(exports.detachedFieldIndexBlobKey);
|
|
29
59
|
const treeBufferString = (0, client_utils_1.bufferToString)(detachedFieldIndexBuffer, "utf8");
|
|
30
60
|
const parsed = parse(treeBufferString);
|
|
31
61
|
this.detachedFieldIndex.loadData(parsed);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detachedFieldIndexSummarizer.js","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;
|
|
1
|
+
{"version":3,"file":"detachedFieldIndexSummarizer.js","sourceRoot":"","sources":["../../src/feature-libraries/detachedFieldIndexSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAU9D,2DAKsC;AAGtC;;GAEG;AACU,QAAA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,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AAxCD,oEAwCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n\tMinimumVersionForCollab,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { SummaryTreeBuilder } from \"@fluidframework/runtime-utils/internal\";\n\nimport type { DetachedFieldIndex } from \"../core/index.js\";\nimport {\n\ttype Summarizable,\n\ttype SummaryElementParser,\n\ttype SummaryElementStringifier,\n\tVersionedSummarizer,\n} from \"../shared-tree-core/index.js\";\nimport type { JsonCompatibleReadOnly } from \"../util/index.js\";\n\n/**\n * The storage key for the blob in the summary containing schema data\n */\nexport const detachedFieldIndexBlobKey = \"DetachedFieldIndexBlob\";\n\n/**\n * The versions for the detached field index summary format.\n */\nexport const enum DetachedFieldIndexSummaryFormatVersion {\n\t/**\n\t * This version represents summary format before summary versioning was introduced.\n\t */\n\tv1 = 1,\n\t/**\n\t * This version adds metadata to the summary. This is backward compatible with version 1.\n\t */\n\tv2 = 2,\n\t/**\n\t * The latest version of the summary. Must be updated when a new version is added.\n\t */\n\tvLatest = v2,\n}\n\nconst supportedVersions = new Set<DetachedFieldIndexSummaryFormatVersion>([\n\tDetachedFieldIndexSummaryFormatVersion.v1,\n\tDetachedFieldIndexSummaryFormatVersion.v2,\n]);\n\n/**\n * Returns the summary version to use as per the given minimum version for collab.\n */\nfunction minVersionToDetachedFieldIndexSummaryFormatVersion(\n\tversion: MinimumVersionForCollab,\n): DetachedFieldIndexSummaryFormatVersion {\n\t// Currently, version 2 is written which adds metadata blob to the summary.\n\treturn DetachedFieldIndexSummaryFormatVersion.v2;\n}\n\n/**\n * Provides methods for summarizing and loading a tree index.\n */\nexport class DetachedFieldIndexSummarizer\n\textends VersionedSummarizer<DetachedFieldIndexSummaryFormatVersion>\n\timplements Summarizable\n{\n\tpublic constructor(\n\t\tprivate readonly detachedFieldIndex: DetachedFieldIndex,\n\t\tminVersionForCollab: MinimumVersionForCollab,\n\t) {\n\t\tsuper(\n\t\t\t\"DetachedFieldIndex\",\n\t\t\tminVersionToDetachedFieldIndexSummaryFormatVersion(minVersionForCollab),\n\t\t\tsupportedVersions,\n\t\t\ttrue,\n\t\t);\n\t}\n\n\tprotected summarizeInternal(props: {\n\t\tstringify: SummaryElementStringifier;\n\t\tfullTree?: boolean;\n\t\ttrackState?: boolean;\n\t\ttelemetryContext?: ITelemetryContext;\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext;\n\t\tbuilder: SummaryTreeBuilder;\n\t}): void {\n\t\tconst { stringify, builder } = props;\n\t\tconst data = this.detachedFieldIndex.encode();\n\t\tbuilder.addBlob(detachedFieldIndexBlobKey, stringify(data));\n\t}\n\n\tprotected async loadInternal(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(detachedFieldIndexBlobKey)) {\n\t\t\tconst detachedFieldIndexBuffer = await services.readBlob(detachedFieldIndexBlobKey);\n\t\t\tconst treeBufferString = bufferToString(detachedFieldIndexBuffer, \"utf8\");\n\t\t\tconst parsed = parse(treeBufferString) as JsonCompatibleReadOnly;\n\t\t\tthis.detachedFieldIndex.loadData(parsed);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -6,12 +6,18 @@ import type { MinimumVersionForCollab } from "@fluidframework/runtime-definition
|
|
|
6
6
|
import { type CodecTree, type CodecWriteOptions, type IJsonCodec } from "../../codec/index.js";
|
|
7
7
|
import type { FieldKey, ITreeCursorSynchronous } from "../../core/index.js";
|
|
8
8
|
import type { FieldBatchCodec, FieldBatchEncodingContext } from "../chunked-forest/index.js";
|
|
9
|
-
import { Format } from "./
|
|
9
|
+
import { ForestFormatVersion, type Format } from "./formatCommon.js";
|
|
10
10
|
/**
|
|
11
11
|
* Uses field cursors
|
|
12
12
|
*/
|
|
13
13
|
export type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;
|
|
14
14
|
export type ForestCodec = IJsonCodec<FieldSet, Format, Format, FieldBatchEncodingContext>;
|
|
15
|
+
/**
|
|
16
|
+
* Convert a MinimumVersionForCollab to a ForestFormatVersion.
|
|
17
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
18
|
+
* @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.
|
|
19
|
+
*/
|
|
20
|
+
export declare function clientVersionToForestFormatVersion(clientVersion: MinimumVersionForCollab): ForestFormatVersion;
|
|
15
21
|
export declare function makeForestSummarizerCodec(options: CodecWriteOptions, fieldBatchCodec: FieldBatchCodec): ForestCodec;
|
|
16
22
|
export declare function getCodecTreeForForestFormat(clientVersion: MinimumVersionForCollab): CodecTree;
|
|
17
23
|
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAM5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EACN,mBAAmB,EAEnB,KAAK,MAAM,EAEX,MAAM,mBAAmB,CAAC;AAG3B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAE1F;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,aAAa,EAAE,uBAAuB,GACpC,mBAAmB,CAOrB;AAED,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EAAE,eAAe,GAC9B,WAAW,CAwBb;AAED,wBAAgB,2BAA2B,CAC1C,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAEX"}
|
|
@@ -4,27 +4,29 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getCodecTreeForForestFormat = exports.makeForestSummarizerCodec = void 0;
|
|
7
|
+
exports.getCodecTreeForForestFormat = exports.makeForestSummarizerCodec = exports.clientVersionToForestFormatVersion = void 0;
|
|
8
8
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
9
|
+
const internal_2 = require("@fluidframework/runtime-utils/internal");
|
|
9
10
|
const index_js_1 = require("../../codec/index.js");
|
|
10
|
-
const
|
|
11
|
+
const formatCommon_js_1 = require("./formatCommon.js");
|
|
11
12
|
const index_js_2 = require("../../util/index.js");
|
|
12
13
|
/**
|
|
13
14
|
* Convert a MinimumVersionForCollab to a ForestFormatVersion.
|
|
14
15
|
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
15
16
|
* @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.
|
|
16
17
|
*/
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
function clientVersionToForestFormatVersion(clientVersion) {
|
|
19
|
+
return (0, index_js_2.brand)((0, internal_2.getConfigForMinVersionForCollab)(clientVersion, {
|
|
20
|
+
[internal_2.lowestMinVersionForCollab]: formatCommon_js_1.ForestFormatVersion.v1,
|
|
21
|
+
[index_js_1.FluidClientVersion.v2_74]: formatCommon_js_1.ForestFormatVersion.v2,
|
|
22
|
+
}));
|
|
20
23
|
}
|
|
24
|
+
exports.clientVersionToForestFormatVersion = clientVersionToForestFormatVersion;
|
|
21
25
|
function makeForestSummarizerCodec(options, fieldBatchCodec) {
|
|
22
26
|
const inner = fieldBatchCodec;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const writeVersion = clientVersionToForestSummaryVersion(options.minVersionForCollab);
|
|
27
|
-
return (0, index_js_1.makeVersionedValidatedCodec)(options, new Set([format_js_1.ForestFormatVersion.v1]), format_js_1.Format, {
|
|
27
|
+
const writeVersion = clientVersionToForestFormatVersion(options.minVersionForCollab);
|
|
28
|
+
const formatSchema = (0, formatCommon_js_1.FormatCommon)(writeVersion);
|
|
29
|
+
return (0, index_js_1.makeVersionedValidatedCodec)(options, formatCommon_js_1.validVersions, formatSchema, {
|
|
28
30
|
encode: (data, context) => {
|
|
29
31
|
const keys = [];
|
|
30
32
|
const fields = [];
|
|
@@ -47,7 +49,7 @@ function makeForestSummarizerCodec(options, fieldBatchCodec) {
|
|
|
47
49
|
}
|
|
48
50
|
exports.makeForestSummarizerCodec = makeForestSummarizerCodec;
|
|
49
51
|
function getCodecTreeForForestFormat(clientVersion) {
|
|
50
|
-
return { name: "Forest", version:
|
|
52
|
+
return { name: "Forest", version: clientVersionToForestFormatVersion(clientVersion) };
|
|
51
53
|
}
|
|
52
54
|
exports.getCodecTreeForForestFormat = getCodecTreeForForestFormat;
|
|
53
55
|
//# sourceMappingURL=codec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAE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AC,IAAY,EAAE,OAAkC,EAAY,EAAE;YACtE,MAAM,GAAG,GAA0C,IAAI,GAAG,EAAE,CAAC;YAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAClD,IAAA,iBAAM,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC3E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC/C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAA,cAAG,GAAE,EAAE,KAAK,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,GAAG,CAAC;QACZ,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AA3BD,8DA2BC;AAED,SAAgB,2BAA2B,CAC1C,aAAsC;IAEtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,CAAC,aAAa,CAAC,EAAE,CAAC;AACvF,CAAC;AAJD,kEAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollab,\n\tlowestMinVersionForCollab,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport type { FieldKey, ITreeCursorSynchronous } from \"../../core/index.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport {\n\tForestFormatVersion,\n\tvalidVersions,\n\ttype Format,\n\tFormatCommon,\n} from \"./formatCommon.js\";\nimport { brand } from \"../../util/index.js\";\n\n/**\n * Uses field cursors\n */\nexport type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;\nexport type ForestCodec = IJsonCodec<FieldSet, Format, Format, FieldBatchEncodingContext>;\n\n/**\n * Convert a MinimumVersionForCollab to a ForestFormatVersion.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n * @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.\n */\nexport function clientVersionToForestFormatVersion(\n\tclientVersion: MinimumVersionForCollab,\n): ForestFormatVersion {\n\treturn brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: ForestFormatVersion.v1,\n\t\t\t[FluidClientVersion.v2_74]: ForestFormatVersion.v2,\n\t\t}),\n\t);\n}\n\nexport function makeForestSummarizerCodec(\n\toptions: CodecWriteOptions,\n\tfieldBatchCodec: FieldBatchCodec,\n): ForestCodec {\n\tconst inner = fieldBatchCodec;\n\tconst writeVersion = clientVersionToForestFormatVersion(options.minVersionForCollab);\n\tconst formatSchema = FormatCommon(writeVersion);\n\treturn makeVersionedValidatedCodec(options, validVersions, formatSchema, {\n\t\tencode: (data: FieldSet, context: FieldBatchEncodingContext): Format => {\n\t\t\tconst keys: FieldKey[] = [];\n\t\t\tconst fields: ITreeCursorSynchronous[] = [];\n\t\t\tfor (const [key, value] of data) {\n\t\t\t\tkeys.push(key);\n\t\t\t\tfields.push(value);\n\t\t\t}\n\t\t\treturn { keys, fields: inner.encode(fields, context), version: writeVersion };\n\t\t},\n\t\tdecode: (data: Format, context: FieldBatchEncodingContext): FieldSet => {\n\t\t\tconst out: Map<FieldKey, ITreeCursorSynchronous> = new Map();\n\t\t\tconst fields = inner.decode(data.fields, context);\n\t\t\tassert(data.keys.length === fields.length, 0x891 /* mismatched lengths */);\n\t\t\tfor (const [index, field] of fields.entries()) {\n\t\t\t\tout.set(data.keys[index] ?? oob(), field);\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t});\n}\n\nexport function getCodecTreeForForestFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn { name: \"Forest\", version: clientVersionToForestFormatVersion(clientVersion) };\n}\n"]}
|
|
@@ -4,28 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IChannelStorageService } from "@fluidframework/datastore-definitions/internal";
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
-
import type { IExperimentalIncrementalSummaryContext,
|
|
7
|
+
import type { IExperimentalIncrementalSummaryContext, ITelemetryContext } from "@fluidframework/runtime-definitions/internal";
|
|
8
|
+
import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
8
9
|
import type { CodecWriteOptions } from "../../codec/index.js";
|
|
9
10
|
import { type IEditableForest, type RevisionTagCodec } from "../../core/index.js";
|
|
10
|
-
import type
|
|
11
|
+
import { VersionedSummarizer, type Summarizable, type SummaryElementParser, type SummaryElementStringifier } from "../../shared-tree-core/index.js";
|
|
11
12
|
import { type FieldBatchCodec, type FieldBatchEncodingContext, type IncrementalEncodingPolicy } from "../chunked-forest/index.js";
|
|
12
|
-
|
|
13
|
-
* The key for the tree that contains the overall forest's summary tree.
|
|
14
|
-
* This tree is added by the parent of the forest summarizer.
|
|
15
|
-
* See {@link ForestIncrementalSummaryBuilder} for details on the summary structure.
|
|
16
|
-
*/
|
|
17
|
-
export declare const forestSummaryKey = "Forest";
|
|
13
|
+
import { ForestSummaryFormatVersion } from "./summaryFormatCommon.js";
|
|
18
14
|
/**
|
|
19
15
|
* Provides methods for summarizing and loading a forest.
|
|
20
16
|
*/
|
|
21
|
-
export declare class ForestSummarizer implements Summarizable {
|
|
17
|
+
export declare class ForestSummarizer extends VersionedSummarizer<ForestSummaryFormatVersion> implements Summarizable {
|
|
22
18
|
private readonly forest;
|
|
23
19
|
private readonly revisionTagCodec;
|
|
24
20
|
private readonly encoderContext;
|
|
25
21
|
private readonly idCompressor;
|
|
26
|
-
readonly key = "Forest";
|
|
27
22
|
private readonly codec;
|
|
28
23
|
private readonly incrementalSummaryBuilder;
|
|
24
|
+
private readonly forestRootSummaryContentKey;
|
|
29
25
|
/**
|
|
30
26
|
* @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.
|
|
31
27
|
*/
|
|
@@ -40,13 +36,14 @@ export declare class ForestSummarizer implements Summarizable {
|
|
|
40
36
|
*
|
|
41
37
|
* TODO: when perf matters, this should be replaced with a chunked async version using a binary format.
|
|
42
38
|
*/
|
|
43
|
-
|
|
39
|
+
protected summarizeInternal(props: {
|
|
44
40
|
stringify: SummaryElementStringifier;
|
|
45
41
|
fullTree?: boolean;
|
|
46
42
|
trackState?: boolean;
|
|
47
43
|
telemetryContext?: ITelemetryContext;
|
|
48
44
|
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext;
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
builder: SummaryTreeBuilder;
|
|
46
|
+
}): void;
|
|
47
|
+
protected loadInternal(services: IChannelStorageService, parse: SummaryElementParser, version: ForestSummaryFormatVersion | undefined): Promise<void>;
|
|
51
48
|
}
|
|
52
49
|
//# sourceMappingURL=forestSummarizer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forestSummarizer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"forestSummarizer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EACX,sCAAsC,EACtC,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;A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