@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,40 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { type ImplicitFieldSchema } from "../fieldSchema.js";
|
|
6
|
-
import type { SimpleNodeSchema, SimpleTreeSchema } from "../simpleSchema.js";
|
|
7
|
-
/**
|
|
8
|
-
* Converts an {@link ImplicitFieldSchema} to a "simple" schema representation.
|
|
9
|
-
*
|
|
10
|
-
* @param schema - The schema to convert
|
|
11
|
-
* @param copySchemaObjects - If true, TreeNodeSchema and FieldSchema are copied into plain JavaScript objects. Either way, custom metadata is referenced and not copied.
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Given that the Schema types used in {@link ImplicitFieldSchema} already implement the {@link SimpleNodeSchema} interfaces, there are limited use-cases for this function.
|
|
15
|
-
* One possible use-case is converting schema to a more serialization friendly format.
|
|
16
|
-
* This format however is not JSON compatible due to use of Maps and Sets,
|
|
17
|
-
* but it it does not rely on cyclic object references for handling recursive schema and instead uses the `definitions` map.
|
|
18
|
-
*
|
|
19
|
-
* @privateRemarks
|
|
20
|
-
* TODO: once SimpleTreeSchema is stable, {@link TreeViewConfiguration} could implement {@link SimpleTreeSchema} directly.
|
|
21
|
-
* That would provide the non-copying alternative that could expose the value type of the definitions map as {@link TreeNodeSchema}.
|
|
22
|
-
*/
|
|
23
|
-
export declare function toSimpleTreeSchema(schema: ImplicitFieldSchema, copySchemaObjects: boolean): SimpleTreeSchema;
|
|
24
|
-
/**
|
|
25
|
-
* Copies a {@link SimpleNodeSchema} into a new plain JavaScript object.
|
|
26
|
-
*
|
|
27
|
-
* @remarks Caches the result on the input schema for future calls.
|
|
28
|
-
*/
|
|
29
|
-
export declare function copySimpleNodeSchema(schema: SimpleNodeSchema): SimpleNodeSchema;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a copy of a SimpleTreeSchema without metadata fields. This is useful for comparing deserialized view schemas with in-memory schemas.
|
|
32
|
-
* metadata and persistedMetadata are not relevant for schema compatibility checks and are not serialized by the Simple Schema serializer.
|
|
33
|
-
* @see {@link simpleSchemaSerializer.ts} for the serialization logic.
|
|
34
|
-
*
|
|
35
|
-
* @param schema - The SimpleTreeSchema to remove fields from.
|
|
36
|
-
* @param fieldsToRemove - An object specifying which fields to remove.
|
|
37
|
-
* @returns A new SimpleTreeSchema without the specified fields.
|
|
38
|
-
*/
|
|
39
|
-
export declare function copySimpleTreeSchemaWithoutMetadata(schema: SimpleTreeSchema): SimpleTreeSchema;
|
|
40
|
-
//# sourceMappingURL=viewSchemaToSimpleSchema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewSchemaToSimpleSchema.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/viewSchemaToSimpleSchema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAKX,gBAAgB,EAIhB,gBAAgB,EAChB,MAAM,oBAAoB,CAAC;AAW5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,mBAAmB,EAC3B,iBAAiB,EAAE,OAAO,GACxB,gBAAgB,CA8BlB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAc/E;AAgDD;;;;;;;;GAQG;AACH,wBAAgB,mCAAmC,CAClD,MAAM,EAAE,gBAAgB,GACtB,gBAAgB,CAmDlB"}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
6
|
-
import { normalizeFieldSchema } from "../fieldSchema.js";
|
|
7
|
-
import { NodeKind } from "../core/index.js";
|
|
8
|
-
import { ArrayNodeSchema, MapNodeSchema, ObjectNodeSchema, RecordNodeSchema, } from "../node-kinds/index.js";
|
|
9
|
-
import { walkFieldSchema } from "../walkFieldSchema.js";
|
|
10
|
-
import { LeafNodeSchema } from "../leafNodeSchema.js";
|
|
11
|
-
/**
|
|
12
|
-
* Converts an {@link ImplicitFieldSchema} to a "simple" schema representation.
|
|
13
|
-
*
|
|
14
|
-
* @param schema - The schema to convert
|
|
15
|
-
* @param copySchemaObjects - If true, TreeNodeSchema and FieldSchema are copied into plain JavaScript objects. Either way, custom metadata is referenced and not copied.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Given that the Schema types used in {@link ImplicitFieldSchema} already implement the {@link SimpleNodeSchema} interfaces, there are limited use-cases for this function.
|
|
19
|
-
* One possible use-case is converting schema to a more serialization friendly format.
|
|
20
|
-
* This format however is not JSON compatible due to use of Maps and Sets,
|
|
21
|
-
* but it it does not rely on cyclic object references for handling recursive schema and instead uses the `definitions` map.
|
|
22
|
-
*
|
|
23
|
-
* @privateRemarks
|
|
24
|
-
* TODO: once SimpleTreeSchema is stable, {@link TreeViewConfiguration} could implement {@link SimpleTreeSchema} directly.
|
|
25
|
-
* That would provide the non-copying alternative that could expose the value type of the definitions map as {@link TreeNodeSchema}.
|
|
26
|
-
*/
|
|
27
|
-
export function toSimpleTreeSchema(schema, copySchemaObjects) {
|
|
28
|
-
const normalizedSchema = normalizeFieldSchema(schema);
|
|
29
|
-
const definitions = new Map();
|
|
30
|
-
walkFieldSchema(normalizedSchema, {
|
|
31
|
-
node: (nodeSchema) => {
|
|
32
|
-
// The set of node kinds is extensible, but the typing of SimpleNodeSchema is not, so we need to check that the schema is one of the known kinds.
|
|
33
|
-
assert(nodeSchema instanceof ArrayNodeSchema ||
|
|
34
|
-
nodeSchema instanceof MapNodeSchema ||
|
|
35
|
-
nodeSchema instanceof LeafNodeSchema ||
|
|
36
|
-
nodeSchema instanceof ObjectNodeSchema ||
|
|
37
|
-
nodeSchema instanceof RecordNodeSchema, 0xb60 /* Invalid schema */);
|
|
38
|
-
const outSchema = copySchemaObjects ? copySimpleNodeSchema(nodeSchema) : nodeSchema;
|
|
39
|
-
definitions.set(nodeSchema.identifier, outSchema);
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
root: copySchemaObjects
|
|
44
|
-
? ({
|
|
45
|
-
simpleAllowedTypes: normalizedSchema.simpleAllowedTypes,
|
|
46
|
-
kind: normalizedSchema.kind,
|
|
47
|
-
metadata: normalizedSchema.metadata,
|
|
48
|
-
persistedMetadata: normalizedSchema.persistedMetadata,
|
|
49
|
-
})
|
|
50
|
-
: normalizedSchema,
|
|
51
|
-
definitions,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Copies a {@link SimpleNodeSchema} into a new plain JavaScript object.
|
|
56
|
-
*
|
|
57
|
-
* @remarks Caches the result on the input schema for future calls.
|
|
58
|
-
*/
|
|
59
|
-
export function copySimpleNodeSchema(schema) {
|
|
60
|
-
const kind = schema.kind;
|
|
61
|
-
switch (kind) {
|
|
62
|
-
case NodeKind.Leaf:
|
|
63
|
-
return copySimpleLeafSchema(schema);
|
|
64
|
-
case NodeKind.Array:
|
|
65
|
-
case NodeKind.Map:
|
|
66
|
-
case NodeKind.Record:
|
|
67
|
-
return copySimpleSchemaWithAllowedTypes(schema);
|
|
68
|
-
case NodeKind.Object:
|
|
69
|
-
return copySimpleObjectSchema(schema);
|
|
70
|
-
default:
|
|
71
|
-
unreachableCase(kind);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function copySimpleLeafSchema(schema) {
|
|
75
|
-
return {
|
|
76
|
-
kind: NodeKind.Leaf,
|
|
77
|
-
leafKind: schema.leafKind,
|
|
78
|
-
metadata: schema.metadata,
|
|
79
|
-
persistedMetadata: schema.persistedMetadata,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function copySimpleSchemaWithAllowedTypes(schema) {
|
|
83
|
-
return {
|
|
84
|
-
kind: schema.kind,
|
|
85
|
-
simpleAllowedTypes: schema.simpleAllowedTypes,
|
|
86
|
-
metadata: schema.metadata,
|
|
87
|
-
persistedMetadata: schema.persistedMetadata,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function copySimpleObjectSchema(schema) {
|
|
91
|
-
const fields = new Map();
|
|
92
|
-
for (const [propertyKey, field] of schema.fields) {
|
|
93
|
-
// field already is a SimpleObjectFieldSchema, but copy the subset of the properties needed by this interface to get a clean simple object.
|
|
94
|
-
const simpleField = {
|
|
95
|
-
kind: field.kind,
|
|
96
|
-
simpleAllowedTypes: field.simpleAllowedTypes,
|
|
97
|
-
metadata: field.metadata,
|
|
98
|
-
persistedMetadata: field.persistedMetadata,
|
|
99
|
-
storedKey: field.storedKey,
|
|
100
|
-
};
|
|
101
|
-
fields.set(propertyKey, simpleField);
|
|
102
|
-
}
|
|
103
|
-
const simpleObject = {
|
|
104
|
-
kind: NodeKind.Object,
|
|
105
|
-
fields,
|
|
106
|
-
metadata: schema.metadata,
|
|
107
|
-
persistedMetadata: schema.persistedMetadata,
|
|
108
|
-
allowUnknownOptionalFields: schema.allowUnknownOptionalFields,
|
|
109
|
-
};
|
|
110
|
-
return simpleObject;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Creates a copy of a SimpleTreeSchema without metadata fields. This is useful for comparing deserialized view schemas with in-memory schemas.
|
|
114
|
-
* metadata and persistedMetadata are not relevant for schema compatibility checks and are not serialized by the Simple Schema serializer.
|
|
115
|
-
* @see {@link simpleSchemaSerializer.ts} for the serialization logic.
|
|
116
|
-
*
|
|
117
|
-
* @param schema - The SimpleTreeSchema to remove fields from.
|
|
118
|
-
* @param fieldsToRemove - An object specifying which fields to remove.
|
|
119
|
-
* @returns A new SimpleTreeSchema without the specified fields.
|
|
120
|
-
*/
|
|
121
|
-
export function copySimpleTreeSchemaWithoutMetadata(schema) {
|
|
122
|
-
const definitions = new Map();
|
|
123
|
-
for (const [identifier, nodeSchema] of schema.definitions.entries()) {
|
|
124
|
-
const kind = nodeSchema.kind;
|
|
125
|
-
switch (kind) {
|
|
126
|
-
case NodeKind.Array:
|
|
127
|
-
case NodeKind.Map:
|
|
128
|
-
case NodeKind.Record:
|
|
129
|
-
case NodeKind.Leaf: {
|
|
130
|
-
const outputNodeSchema = {
|
|
131
|
-
...nodeSchema,
|
|
132
|
-
metadata: {},
|
|
133
|
-
persistedMetadata: undefined,
|
|
134
|
-
};
|
|
135
|
-
definitions.set(identifier, outputNodeSchema);
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
case NodeKind.Object: {
|
|
139
|
-
const outputFields = new Map();
|
|
140
|
-
for (const [propertyKey, fieldSchema] of nodeSchema.fields.entries()) {
|
|
141
|
-
const outputField = {
|
|
142
|
-
...fieldSchema,
|
|
143
|
-
metadata: {},
|
|
144
|
-
persistedMetadata: undefined,
|
|
145
|
-
};
|
|
146
|
-
outputFields.set(propertyKey, outputField);
|
|
147
|
-
}
|
|
148
|
-
const outputNodeSchema = {
|
|
149
|
-
...nodeSchema,
|
|
150
|
-
metadata: {},
|
|
151
|
-
persistedMetadata: undefined,
|
|
152
|
-
fields: outputFields,
|
|
153
|
-
};
|
|
154
|
-
definitions.set(identifier, outputNodeSchema);
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
default:
|
|
158
|
-
unreachableCase(kind);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return {
|
|
162
|
-
root: {
|
|
163
|
-
kind: schema.root.kind,
|
|
164
|
-
simpleAllowedTypes: schema.root.simpleAllowedTypes,
|
|
165
|
-
metadata: {},
|
|
166
|
-
persistedMetadata: undefined,
|
|
167
|
-
},
|
|
168
|
-
definitions,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
//# sourceMappingURL=viewSchemaToSimpleSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewSchemaToSimpleSchema.js","sourceRoot":"","sources":["../../../src/simple-tree/api/viewSchemaToSimpleSchema.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { normalizeFieldSchema, type ImplicitFieldSchema } from \"../fieldSchema.js\";\nimport type {\n\tSimpleArrayNodeSchema,\n\tSimpleFieldSchema,\n\tSimpleLeafNodeSchema,\n\tSimpleMapNodeSchema,\n\tSimpleNodeSchema,\n\tSimpleObjectFieldSchema,\n\tSimpleObjectNodeSchema,\n\tSimpleRecordNodeSchema,\n\tSimpleTreeSchema,\n} from \"../simpleSchema.js\";\nimport { NodeKind } from \"../core/index.js\";\nimport {\n\tArrayNodeSchema,\n\tMapNodeSchema,\n\tObjectNodeSchema,\n\tRecordNodeSchema,\n} from \"../node-kinds/index.js\";\nimport { walkFieldSchema } from \"../walkFieldSchema.js\";\nimport { LeafNodeSchema } from \"../leafNodeSchema.js\";\n\n/**\n * Converts an {@link ImplicitFieldSchema} to a \"simple\" schema representation.\n *\n * @param schema - The schema to convert\n * @param copySchemaObjects - If true, TreeNodeSchema and FieldSchema are copied into plain JavaScript objects. Either way, custom metadata is referenced and not copied.\n *\n * @remarks\n * Given that the Schema types used in {@link ImplicitFieldSchema} already implement the {@link SimpleNodeSchema} interfaces, there are limited use-cases for this function.\n * One possible use-case is converting schema to a more serialization friendly format.\n * This format however is not JSON compatible due to use of Maps and Sets,\n * but it it does not rely on cyclic object references for handling recursive schema and instead uses the `definitions` map.\n *\n * @privateRemarks\n * TODO: once SimpleTreeSchema is stable, {@link TreeViewConfiguration} could implement {@link SimpleTreeSchema} directly.\n * That would provide the non-copying alternative that could expose the value type of the definitions map as {@link TreeNodeSchema}.\n */\nexport function toSimpleTreeSchema(\n\tschema: ImplicitFieldSchema,\n\tcopySchemaObjects: boolean,\n): SimpleTreeSchema {\n\tconst normalizedSchema = normalizeFieldSchema(schema);\n\tconst definitions = new Map<string, SimpleNodeSchema>();\n\twalkFieldSchema(normalizedSchema, {\n\t\tnode: (nodeSchema) => {\n\t\t\t// The set of node kinds is extensible, but the typing of SimpleNodeSchema is not, so we need to check that the schema is one of the known kinds.\n\t\t\tassert(\n\t\t\t\tnodeSchema instanceof ArrayNodeSchema ||\n\t\t\t\t\tnodeSchema instanceof MapNodeSchema ||\n\t\t\t\t\tnodeSchema instanceof LeafNodeSchema ||\n\t\t\t\t\tnodeSchema instanceof ObjectNodeSchema ||\n\t\t\t\t\tnodeSchema instanceof RecordNodeSchema,\n\t\t\t\t0xb60 /* Invalid schema */,\n\t\t\t);\n\t\t\tconst outSchema = copySchemaObjects ? copySimpleNodeSchema(nodeSchema) : nodeSchema;\n\t\t\tdefinitions.set(nodeSchema.identifier, outSchema);\n\t\t},\n\t});\n\n\treturn {\n\t\troot: copySchemaObjects\n\t\t\t? ({\n\t\t\t\t\tsimpleAllowedTypes: normalizedSchema.simpleAllowedTypes,\n\t\t\t\t\tkind: normalizedSchema.kind,\n\t\t\t\t\tmetadata: normalizedSchema.metadata,\n\t\t\t\t\tpersistedMetadata: normalizedSchema.persistedMetadata,\n\t\t\t\t} satisfies SimpleFieldSchema)\n\t\t\t: normalizedSchema,\n\t\tdefinitions,\n\t};\n}\n\n/**\n * Copies a {@link SimpleNodeSchema} into a new plain JavaScript object.\n *\n * @remarks Caches the result on the input schema for future calls.\n */\nexport function copySimpleNodeSchema(schema: SimpleNodeSchema): SimpleNodeSchema {\n\tconst kind = schema.kind;\n\tswitch (kind) {\n\t\tcase NodeKind.Leaf:\n\t\t\treturn copySimpleLeafSchema(schema);\n\t\tcase NodeKind.Array:\n\t\tcase NodeKind.Map:\n\t\tcase NodeKind.Record:\n\t\t\treturn copySimpleSchemaWithAllowedTypes(schema);\n\t\tcase NodeKind.Object:\n\t\t\treturn copySimpleObjectSchema(schema);\n\t\tdefault:\n\t\t\tunreachableCase(kind);\n\t}\n}\n\nfunction copySimpleLeafSchema(schema: SimpleLeafNodeSchema): SimpleLeafNodeSchema {\n\treturn {\n\t\tkind: NodeKind.Leaf,\n\t\tleafKind: schema.leafKind,\n\t\tmetadata: schema.metadata,\n\t\tpersistedMetadata: schema.persistedMetadata,\n\t};\n}\n\nfunction copySimpleSchemaWithAllowedTypes(\n\tschema: SimpleMapNodeSchema | SimpleArrayNodeSchema | SimpleRecordNodeSchema,\n): SimpleMapNodeSchema | SimpleArrayNodeSchema | SimpleRecordNodeSchema {\n\treturn {\n\t\tkind: schema.kind,\n\t\tsimpleAllowedTypes: schema.simpleAllowedTypes,\n\t\tmetadata: schema.metadata,\n\t\tpersistedMetadata: schema.persistedMetadata,\n\t};\n}\n\nfunction copySimpleObjectSchema(schema: SimpleObjectNodeSchema): SimpleObjectNodeSchema {\n\tconst fields: Map<string, SimpleObjectFieldSchema> = new Map();\n\tfor (const [propertyKey, field] of schema.fields) {\n\t\t// field already is a SimpleObjectFieldSchema, but copy the subset of the properties needed by this interface to get a clean simple object.\n\t\tconst simpleField = {\n\t\t\tkind: field.kind,\n\t\t\tsimpleAllowedTypes: field.simpleAllowedTypes,\n\t\t\tmetadata: field.metadata,\n\t\t\tpersistedMetadata: field.persistedMetadata,\n\t\t\tstoredKey: field.storedKey,\n\t\t};\n\n\t\tfields.set(propertyKey, simpleField);\n\t}\n\n\tconst simpleObject = {\n\t\tkind: NodeKind.Object,\n\t\tfields,\n\t\tmetadata: schema.metadata,\n\t\tpersistedMetadata: schema.persistedMetadata,\n\t\tallowUnknownOptionalFields: schema.allowUnknownOptionalFields,\n\t} satisfies SimpleObjectNodeSchema;\n\n\treturn simpleObject;\n}\n\n/**\n * Creates a copy of a SimpleTreeSchema without metadata fields. This is useful for comparing deserialized view schemas with in-memory schemas.\n * metadata and persistedMetadata are not relevant for schema compatibility checks and are not serialized by the Simple Schema serializer.\n * @see {@link simpleSchemaSerializer.ts} for the serialization logic.\n *\n * @param schema - The SimpleTreeSchema to remove fields from.\n * @param fieldsToRemove - An object specifying which fields to remove.\n * @returns A new SimpleTreeSchema without the specified fields.\n */\nexport function copySimpleTreeSchemaWithoutMetadata(\n\tschema: SimpleTreeSchema,\n): SimpleTreeSchema {\n\tconst definitions = new Map<string, SimpleNodeSchema>();\n\n\tfor (const [identifier, nodeSchema] of schema.definitions.entries()) {\n\t\tconst kind = nodeSchema.kind;\n\t\tswitch (kind) {\n\t\t\tcase NodeKind.Array:\n\t\t\tcase NodeKind.Map:\n\t\t\tcase NodeKind.Record:\n\t\t\tcase NodeKind.Leaf: {\n\t\t\t\tconst outputNodeSchema = {\n\t\t\t\t\t...nodeSchema,\n\t\t\t\t\tmetadata: {},\n\t\t\t\t\tpersistedMetadata: undefined,\n\t\t\t\t};\n\t\t\t\tdefinitions.set(identifier, outputNodeSchema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase NodeKind.Object: {\n\t\t\t\tconst outputFields = new Map<string, SimpleObjectFieldSchema>();\n\t\t\t\tfor (const [propertyKey, fieldSchema] of nodeSchema.fields.entries()) {\n\t\t\t\t\tconst outputField: SimpleObjectFieldSchema = {\n\t\t\t\t\t\t...fieldSchema,\n\t\t\t\t\t\tmetadata: {},\n\t\t\t\t\t\tpersistedMetadata: undefined,\n\t\t\t\t\t};\n\t\t\t\t\toutputFields.set(propertyKey, outputField);\n\t\t\t\t}\n\t\t\t\tconst outputNodeSchema = {\n\t\t\t\t\t...nodeSchema,\n\t\t\t\t\tmetadata: {},\n\t\t\t\t\tpersistedMetadata: undefined,\n\t\t\t\t\tfields: outputFields,\n\t\t\t\t};\n\t\t\t\tdefinitions.set(identifier, outputNodeSchema);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tunreachableCase(kind);\n\t\t}\n\t}\n\n\treturn {\n\t\troot: {\n\t\t\tkind: schema.root.kind,\n\t\t\tsimpleAllowedTypes: schema.root.simpleAllowedTypes,\n\t\t\tmetadata: {},\n\t\t\tpersistedMetadata: undefined,\n\t\t},\n\t\tdefinitions,\n\t};\n}\n"]}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
|
-
import { normalizeFieldSchema, type ImplicitFieldSchema } from "../fieldSchema.js";
|
|
8
|
-
import type {
|
|
9
|
-
SimpleArrayNodeSchema,
|
|
10
|
-
SimpleFieldSchema,
|
|
11
|
-
SimpleLeafNodeSchema,
|
|
12
|
-
SimpleMapNodeSchema,
|
|
13
|
-
SimpleNodeSchema,
|
|
14
|
-
SimpleObjectFieldSchema,
|
|
15
|
-
SimpleObjectNodeSchema,
|
|
16
|
-
SimpleRecordNodeSchema,
|
|
17
|
-
SimpleTreeSchema,
|
|
18
|
-
} from "../simpleSchema.js";
|
|
19
|
-
import { NodeKind } from "../core/index.js";
|
|
20
|
-
import {
|
|
21
|
-
ArrayNodeSchema,
|
|
22
|
-
MapNodeSchema,
|
|
23
|
-
ObjectNodeSchema,
|
|
24
|
-
RecordNodeSchema,
|
|
25
|
-
} from "../node-kinds/index.js";
|
|
26
|
-
import { walkFieldSchema } from "../walkFieldSchema.js";
|
|
27
|
-
import { LeafNodeSchema } from "../leafNodeSchema.js";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Converts an {@link ImplicitFieldSchema} to a "simple" schema representation.
|
|
31
|
-
*
|
|
32
|
-
* @param schema - The schema to convert
|
|
33
|
-
* @param copySchemaObjects - If true, TreeNodeSchema and FieldSchema are copied into plain JavaScript objects. Either way, custom metadata is referenced and not copied.
|
|
34
|
-
*
|
|
35
|
-
* @remarks
|
|
36
|
-
* Given that the Schema types used in {@link ImplicitFieldSchema} already implement the {@link SimpleNodeSchema} interfaces, there are limited use-cases for this function.
|
|
37
|
-
* One possible use-case is converting schema to a more serialization friendly format.
|
|
38
|
-
* This format however is not JSON compatible due to use of Maps and Sets,
|
|
39
|
-
* but it it does not rely on cyclic object references for handling recursive schema and instead uses the `definitions` map.
|
|
40
|
-
*
|
|
41
|
-
* @privateRemarks
|
|
42
|
-
* TODO: once SimpleTreeSchema is stable, {@link TreeViewConfiguration} could implement {@link SimpleTreeSchema} directly.
|
|
43
|
-
* That would provide the non-copying alternative that could expose the value type of the definitions map as {@link TreeNodeSchema}.
|
|
44
|
-
*/
|
|
45
|
-
export function toSimpleTreeSchema(
|
|
46
|
-
schema: ImplicitFieldSchema,
|
|
47
|
-
copySchemaObjects: boolean,
|
|
48
|
-
): SimpleTreeSchema {
|
|
49
|
-
const normalizedSchema = normalizeFieldSchema(schema);
|
|
50
|
-
const definitions = new Map<string, SimpleNodeSchema>();
|
|
51
|
-
walkFieldSchema(normalizedSchema, {
|
|
52
|
-
node: (nodeSchema) => {
|
|
53
|
-
// The set of node kinds is extensible, but the typing of SimpleNodeSchema is not, so we need to check that the schema is one of the known kinds.
|
|
54
|
-
assert(
|
|
55
|
-
nodeSchema instanceof ArrayNodeSchema ||
|
|
56
|
-
nodeSchema instanceof MapNodeSchema ||
|
|
57
|
-
nodeSchema instanceof LeafNodeSchema ||
|
|
58
|
-
nodeSchema instanceof ObjectNodeSchema ||
|
|
59
|
-
nodeSchema instanceof RecordNodeSchema,
|
|
60
|
-
0xb60 /* Invalid schema */,
|
|
61
|
-
);
|
|
62
|
-
const outSchema = copySchemaObjects ? copySimpleNodeSchema(nodeSchema) : nodeSchema;
|
|
63
|
-
definitions.set(nodeSchema.identifier, outSchema);
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
root: copySchemaObjects
|
|
69
|
-
? ({
|
|
70
|
-
simpleAllowedTypes: normalizedSchema.simpleAllowedTypes,
|
|
71
|
-
kind: normalizedSchema.kind,
|
|
72
|
-
metadata: normalizedSchema.metadata,
|
|
73
|
-
persistedMetadata: normalizedSchema.persistedMetadata,
|
|
74
|
-
} satisfies SimpleFieldSchema)
|
|
75
|
-
: normalizedSchema,
|
|
76
|
-
definitions,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Copies a {@link SimpleNodeSchema} into a new plain JavaScript object.
|
|
82
|
-
*
|
|
83
|
-
* @remarks Caches the result on the input schema for future calls.
|
|
84
|
-
*/
|
|
85
|
-
export function copySimpleNodeSchema(schema: SimpleNodeSchema): SimpleNodeSchema {
|
|
86
|
-
const kind = schema.kind;
|
|
87
|
-
switch (kind) {
|
|
88
|
-
case NodeKind.Leaf:
|
|
89
|
-
return copySimpleLeafSchema(schema);
|
|
90
|
-
case NodeKind.Array:
|
|
91
|
-
case NodeKind.Map:
|
|
92
|
-
case NodeKind.Record:
|
|
93
|
-
return copySimpleSchemaWithAllowedTypes(schema);
|
|
94
|
-
case NodeKind.Object:
|
|
95
|
-
return copySimpleObjectSchema(schema);
|
|
96
|
-
default:
|
|
97
|
-
unreachableCase(kind);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function copySimpleLeafSchema(schema: SimpleLeafNodeSchema): SimpleLeafNodeSchema {
|
|
102
|
-
return {
|
|
103
|
-
kind: NodeKind.Leaf,
|
|
104
|
-
leafKind: schema.leafKind,
|
|
105
|
-
metadata: schema.metadata,
|
|
106
|
-
persistedMetadata: schema.persistedMetadata,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function copySimpleSchemaWithAllowedTypes(
|
|
111
|
-
schema: SimpleMapNodeSchema | SimpleArrayNodeSchema | SimpleRecordNodeSchema,
|
|
112
|
-
): SimpleMapNodeSchema | SimpleArrayNodeSchema | SimpleRecordNodeSchema {
|
|
113
|
-
return {
|
|
114
|
-
kind: schema.kind,
|
|
115
|
-
simpleAllowedTypes: schema.simpleAllowedTypes,
|
|
116
|
-
metadata: schema.metadata,
|
|
117
|
-
persistedMetadata: schema.persistedMetadata,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function copySimpleObjectSchema(schema: SimpleObjectNodeSchema): SimpleObjectNodeSchema {
|
|
122
|
-
const fields: Map<string, SimpleObjectFieldSchema> = new Map();
|
|
123
|
-
for (const [propertyKey, field] of schema.fields) {
|
|
124
|
-
// field already is a SimpleObjectFieldSchema, but copy the subset of the properties needed by this interface to get a clean simple object.
|
|
125
|
-
const simpleField = {
|
|
126
|
-
kind: field.kind,
|
|
127
|
-
simpleAllowedTypes: field.simpleAllowedTypes,
|
|
128
|
-
metadata: field.metadata,
|
|
129
|
-
persistedMetadata: field.persistedMetadata,
|
|
130
|
-
storedKey: field.storedKey,
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
fields.set(propertyKey, simpleField);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const simpleObject = {
|
|
137
|
-
kind: NodeKind.Object,
|
|
138
|
-
fields,
|
|
139
|
-
metadata: schema.metadata,
|
|
140
|
-
persistedMetadata: schema.persistedMetadata,
|
|
141
|
-
allowUnknownOptionalFields: schema.allowUnknownOptionalFields,
|
|
142
|
-
} satisfies SimpleObjectNodeSchema;
|
|
143
|
-
|
|
144
|
-
return simpleObject;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Creates a copy of a SimpleTreeSchema without metadata fields. This is useful for comparing deserialized view schemas with in-memory schemas.
|
|
149
|
-
* metadata and persistedMetadata are not relevant for schema compatibility checks and are not serialized by the Simple Schema serializer.
|
|
150
|
-
* @see {@link simpleSchemaSerializer.ts} for the serialization logic.
|
|
151
|
-
*
|
|
152
|
-
* @param schema - The SimpleTreeSchema to remove fields from.
|
|
153
|
-
* @param fieldsToRemove - An object specifying which fields to remove.
|
|
154
|
-
* @returns A new SimpleTreeSchema without the specified fields.
|
|
155
|
-
*/
|
|
156
|
-
export function copySimpleTreeSchemaWithoutMetadata(
|
|
157
|
-
schema: SimpleTreeSchema,
|
|
158
|
-
): SimpleTreeSchema {
|
|
159
|
-
const definitions = new Map<string, SimpleNodeSchema>();
|
|
160
|
-
|
|
161
|
-
for (const [identifier, nodeSchema] of schema.definitions.entries()) {
|
|
162
|
-
const kind = nodeSchema.kind;
|
|
163
|
-
switch (kind) {
|
|
164
|
-
case NodeKind.Array:
|
|
165
|
-
case NodeKind.Map:
|
|
166
|
-
case NodeKind.Record:
|
|
167
|
-
case NodeKind.Leaf: {
|
|
168
|
-
const outputNodeSchema = {
|
|
169
|
-
...nodeSchema,
|
|
170
|
-
metadata: {},
|
|
171
|
-
persistedMetadata: undefined,
|
|
172
|
-
};
|
|
173
|
-
definitions.set(identifier, outputNodeSchema);
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
176
|
-
case NodeKind.Object: {
|
|
177
|
-
const outputFields = new Map<string, SimpleObjectFieldSchema>();
|
|
178
|
-
for (const [propertyKey, fieldSchema] of nodeSchema.fields.entries()) {
|
|
179
|
-
const outputField: SimpleObjectFieldSchema = {
|
|
180
|
-
...fieldSchema,
|
|
181
|
-
metadata: {},
|
|
182
|
-
persistedMetadata: undefined,
|
|
183
|
-
};
|
|
184
|
-
outputFields.set(propertyKey, outputField);
|
|
185
|
-
}
|
|
186
|
-
const outputNodeSchema = {
|
|
187
|
-
...nodeSchema,
|
|
188
|
-
metadata: {},
|
|
189
|
-
persistedMetadata: undefined,
|
|
190
|
-
fields: outputFields,
|
|
191
|
-
};
|
|
192
|
-
definitions.set(identifier, outputNodeSchema);
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
default:
|
|
196
|
-
unreachableCase(kind);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return {
|
|
201
|
-
root: {
|
|
202
|
-
kind: schema.root.kind,
|
|
203
|
-
simpleAllowedTypes: schema.root.simpleAllowedTypes,
|
|
204
|
-
metadata: {},
|
|
205
|
-
persistedMetadata: undefined,
|
|
206
|
-
},
|
|
207
|
-
definitions,
|
|
208
|
-
};
|
|
209
|
-
}
|