@fluidframework/tree 2.51.0 → 2.53.0-350190
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 +0 -1
- package/CHANGELOG.md +43 -0
- package/api-report/tree.alpha.api.md +40 -30
- package/dist/alpha.d.ts +2 -1
- package/dist/codec/codec.d.ts +2 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +4 -3
- package/dist/codec/codec.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/rebase/index.d.ts +1 -1
- package/dist/core/rebase/index.d.ts.map +1 -1
- package/dist/core/rebase/index.js +2 -1
- package/dist/core/rebase/index.js.map +1 -1
- package/dist/core/rebase/types.d.ts +3 -1
- package/dist/core/rebase/types.d.ts.map +1 -1
- package/dist/core/rebase/types.js +2 -1
- package/dist/core/rebase/types.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +1 -23
- 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.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +2 -3
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecCommon.js +68 -0
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.js +55 -0
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.js +49 -0
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexCodecs.js +26 -0
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
- package/dist/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +18 -13
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.js +12 -0
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.js +14 -0
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js +21 -21
- package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
- package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +74 -61
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +18 -12
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/{lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts → dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +23 -17
- package/dist/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +22 -22
- package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +15 -2
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultSchema.js +0 -2
- package/dist/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts +1 -1
- package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/index.js +2 -2
- package/dist/feature-libraries/default-schema/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
- package/dist/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/schemaChecker.js +31 -26
- package/dist/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +1 -2
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -4
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts +5 -6
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +15 -16
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
- package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/genericFieldKind.js +1 -0
- package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +49 -20
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
- package/dist/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/dist/feature-libraries/object-forest/objectForest.js +2 -3
- package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/dist/feature-libraries/optional-field/optionalField.js +3 -0
- package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
- package/dist/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/jsonDomainSchema.d.ts +5 -3
- package/dist/jsonDomainSchema.d.ts.map +1 -1
- package/dist/jsonDomainSchema.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 +8 -0
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +23 -11
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +1 -1
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +0 -1
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +9 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +1 -29
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +20 -6
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +18 -7
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +32 -0
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.d.ts.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/conciseTree.d.ts +2 -2
- package/dist/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/conciseTree.js +6 -6
- package/dist/simple-tree/api/conciseTree.js.map +1 -1
- package/dist/simple-tree/api/configuration.d.ts +11 -2
- package/dist/simple-tree/api/configuration.d.ts.map +1 -1
- package/dist/simple-tree/api/configuration.js +5 -1
- package/dist/simple-tree/api/configuration.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts +8 -7
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +33 -23
- package/dist/simple-tree/api/create.js.map +1 -1
- package/dist/simple-tree/api/customTree.d.ts +25 -4
- package/dist/simple-tree/api/customTree.d.ts.map +1 -1
- package/dist/simple-tree/api/customTree.js +42 -16
- package/dist/simple-tree/api/customTree.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +94 -0
- package/dist/simple-tree/api/discrepancies.d.ts.map +1 -0
- package/dist/simple-tree/api/discrepancies.js +256 -0
- package/dist/simple-tree/api/discrepancies.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +3 -2
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +3 -2
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
- package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaCompatibilityTester.js +17 -117
- package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/dist/simple-tree/api/schemaFactory.d.ts +16 -159
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +4 -47
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +33 -11
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
- package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -7
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaStatics.d.ts +158 -0
- package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -0
- package/dist/simple-tree/api/schemaStatics.js +59 -0
- package/dist/simple-tree/api/schemaStatics.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +5 -3
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +9 -3
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/treeBeta.d.ts +2 -2
- package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/treeBeta.js +16 -4
- package/dist/simple-tree/api/treeBeta.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.d.ts +2 -2
- package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +15 -15
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +43 -11
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +51 -11
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/context.d.ts +13 -2
- package/dist/simple-tree/core/context.d.ts.map +1 -1
- package/dist/simple-tree/core/context.js +22 -9
- package/dist/simple-tree/core/context.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +6 -4
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +8 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.js +7 -0
- package/dist/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
- package/dist/simple-tree/core/toStored.d.ts +32 -0
- package/dist/simple-tree/core/toStored.d.ts.map +1 -0
- package/dist/simple-tree/core/toStored.js +37 -0
- package/dist/simple-tree/core/toStored.js.map +1 -0
- package/dist/simple-tree/core/treeNodeKernel.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +7 -2
- package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.d.ts +7 -2
- package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeValid.js +19 -4
- package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/core/walkSchema.d.ts +22 -5
- package/dist/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/dist/simple-tree/core/walkSchema.js +6 -2
- package/dist/simple-tree/core/walkSchema.js.map +1 -1
- package/dist/simple-tree/createContext.d.ts +2 -0
- package/dist/simple-tree/createContext.d.ts.map +1 -1
- package/dist/simple-tree/createContext.js +4 -2
- package/dist/simple-tree/createContext.js.map +1 -1
- package/dist/simple-tree/fieldSchema.d.ts +1 -0
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +2 -1
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +7 -7
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +13 -8
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +1 -0
- package/dist/simple-tree/leafNodeSchema.js.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 +18 -4
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/index.js +1 -2
- package/dist/simple-tree/node-kinds/index.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 +9 -2
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/dist/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/index.js +1 -2
- package/dist/simple-tree/node-kinds/object/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +3 -8
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +41 -44
- package/dist/simple-tree/node-kinds/object/objectNode.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 +9 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/prepareForInsertion.d.ts +6 -6
- package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/dist/simple-tree/prepareForInsertion.js +19 -13
- package/dist/simple-tree/prepareForInsertion.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +6 -21
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/toStoredSchema.d.ts +38 -11
- package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +71 -33
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/dist/simple-tree/walkFieldSchema.d.ts +1 -0
- package/dist/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/walkFieldSchema.js +1 -0
- package/dist/simple-tree/walkFieldSchema.js.map +1 -1
- package/lib/alpha.d.ts +2 -1
- package/lib/codec/codec.d.ts +2 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +4 -3
- package/lib/codec/codec.js.map +1 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/rebase/index.d.ts +1 -1
- package/lib/core/rebase/index.d.ts.map +1 -1
- package/lib/core/rebase/index.js +1 -1
- package/lib/core/rebase/index.js.map +1 -1
- package/lib/core/rebase/types.d.ts +3 -1
- package/lib/core/rebase/types.d.ts.map +1 -1
- package/lib/core/rebase/types.js +1 -0
- package/lib/core/rebase/types.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +1 -23
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +2 -2
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +2 -3
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +17 -0
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecCommon.js +64 -0
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +11 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.js +51 -0
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts +11 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.js +45 -0
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +11 -0
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexCodecs.js +21 -0
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +37 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -0
- package/lib/core/tree/{detachedFieldIndexFormat.js → detachedFieldIndexFormatCommon.js} +13 -10
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +13 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.js +9 -0
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +14 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.js +11 -0
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +9 -9
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js +19 -19
- package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js +4 -4
- package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +50 -31
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +70 -57
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +20 -14
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +17 -11
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/{dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts → lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts} +20 -14
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.d.ts.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/{nodeShape.js → nodeEncoder.js} +21 -15
- package/lib/feature-libraries/chunked-forest/codec/nodeEncoder.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +7 -7
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +19 -19
- package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +5 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +15 -2
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultSchema.js +0 -2
- package/lib/feature-libraries/default-schema/defaultSchema.js.map +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts +1 -1
- package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/index.js +1 -1
- package/lib/feature-libraries/default-schema/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts +14 -4
- package/lib/feature-libraries/default-schema/schemaChecker.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/schemaChecker.js +29 -24
- package/lib/feature-libraries/default-schema/schemaChecker.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +1 -2
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +1 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts +5 -6
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +14 -14
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +7 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js +1 -0
- package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/genericFieldKind.js +1 -0
- package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +9 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +50 -21
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts +9 -3
- package/lib/feature-libraries/modular-schema/modularChangeFormat.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
- package/lib/feature-libraries/object-forest/objectForest.js +3 -4
- package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
- package/lib/feature-libraries/optional-field/optionalField.js +3 -0
- package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts +1 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.d.ts.map +1 -1
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js +4 -0
- package/lib/feature-libraries/sequence-field/sequenceFieldChangeRebaser.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/jsonDomainSchema.d.ts +5 -3
- package/lib/jsonDomainSchema.d.ts.map +1 -1
- package/lib/jsonDomainSchema.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 +8 -0
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +21 -10
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +2 -2
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +0 -1
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +10 -13
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -30
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +20 -6
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +19 -8
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +33 -1
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.d.ts.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/conciseTree.d.ts +2 -2
- package/lib/simple-tree/api/conciseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/conciseTree.js +6 -6
- package/lib/simple-tree/api/conciseTree.js.map +1 -1
- package/lib/simple-tree/api/configuration.d.ts +11 -2
- package/lib/simple-tree/api/configuration.d.ts.map +1 -1
- package/lib/simple-tree/api/configuration.js +6 -2
- package/lib/simple-tree/api/configuration.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts +8 -7
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +35 -25
- package/lib/simple-tree/api/create.js.map +1 -1
- package/lib/simple-tree/api/customTree.d.ts +25 -4
- package/lib/simple-tree/api/customTree.d.ts.map +1 -1
- package/lib/simple-tree/api/customTree.js +43 -17
- package/lib/simple-tree/api/customTree.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +94 -0
- package/lib/simple-tree/api/discrepancies.d.ts.map +1 -0
- package/lib/simple-tree/api/discrepancies.js +251 -0
- package/lib/simple-tree/api/discrepancies.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +3 -2
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +2 -1
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +9 -7
- package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaCompatibilityTester.js +19 -119
- package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
- package/lib/simple-tree/api/schemaFactory.d.ts +16 -159
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +2 -45
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +157 -16
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +23 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -3
- package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +0 -5
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaStatics.d.ts +158 -0
- package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -0
- package/lib/simple-tree/api/schemaStatics.js +56 -0
- package/lib/simple-tree/api/schemaStatics.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +5 -3
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +12 -6
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/treeBeta.d.ts +2 -2
- package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/treeBeta.js +14 -2
- package/lib/simple-tree/api/treeBeta.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.d.ts +2 -2
- package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +9 -9
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +43 -11
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +52 -11
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/context.d.ts +13 -2
- package/lib/simple-tree/core/context.d.ts.map +1 -1
- package/lib/simple-tree/core/context.js +22 -9
- package/lib/simple-tree/core/context.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +6 -4
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +4 -3
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts +25 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.d.ts.map +1 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.js +6 -0
- package/lib/simple-tree/core/simpleNodeSchemaBase.js.map +1 -0
- package/lib/simple-tree/core/toStored.d.ts +32 -0
- package/lib/simple-tree/core/toStored.d.ts.map +1 -0
- package/lib/simple-tree/core/toStored.js +32 -0
- package/lib/simple-tree/core/toStored.js.map +1 -0
- package/lib/simple-tree/core/treeNodeKernel.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +7 -2
- package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.d.ts +7 -2
- package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeValid.js +17 -3
- package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/core/walkSchema.d.ts +22 -5
- package/lib/simple-tree/core/walkSchema.d.ts.map +1 -1
- package/lib/simple-tree/core/walkSchema.js +6 -2
- package/lib/simple-tree/core/walkSchema.js.map +1 -1
- package/lib/simple-tree/createContext.d.ts +2 -0
- package/lib/simple-tree/createContext.d.ts.map +1 -1
- package/lib/simple-tree/createContext.js +5 -3
- package/lib/simple-tree/createContext.js.map +1 -1
- package/lib/simple-tree/fieldSchema.d.ts +1 -0
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +2 -1
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +7 -7
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +2 -1
- package/lib/simple-tree/leafNodeSchema.js.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 +21 -7
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/index.js +1 -1
- package/lib/simple-tree/node-kinds/index.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 +12 -5
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts +1 -1
- package/lib/simple-tree/node-kinds/object/index.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/index.js +1 -1
- package/lib/simple-tree/node-kinds/object/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +3 -8
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +19 -21
- package/lib/simple-tree/node-kinds/object/objectNode.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 +12 -5
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/prepareForInsertion.d.ts +6 -6
- package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
- package/lib/simple-tree/prepareForInsertion.js +21 -15
- package/lib/simple-tree/prepareForInsertion.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +6 -21
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/toStoredSchema.d.ts +38 -11
- package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +70 -34
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +2 -2
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +1 -1
- package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
- package/lib/simple-tree/walkFieldSchema.d.ts +1 -0
- package/lib/simple-tree/walkFieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/walkFieldSchema.js +1 -0
- package/lib/simple-tree/walkFieldSchema.js.map +1 -1
- package/package.json +23 -23
- package/src/codec/codec.ts +4 -3
- package/src/core/index.ts +2 -0
- package/src/core/rebase/index.ts +2 -0
- package/src/core/rebase/types.ts +4 -0
- package/src/core/schema-stored/schema.ts +2 -26
- package/src/core/tree/detachedFieldIndex.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +87 -0
- package/src/core/tree/{detachedFieldIndexCodec.ts → detachedFieldIndexCodecV1.ts} +22 -68
- package/src/core/tree/detachedFieldIndexCodecV2.ts +72 -0
- package/src/core/tree/detachedFieldIndexCodecs.ts +44 -0
- package/src/core/tree/{detachedFieldIndexFormat.ts → detachedFieldIndexFormatCommon.ts} +32 -23
- package/src/core/tree/detachedFieldIndexFormatV1.ts +15 -0
- package/src/core/tree/detachedFieldIndexFormatV2.ts +17 -0
- package/src/feature-libraries/chunked-forest/codec/README.md +1 -1
- package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +25 -25
- package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +10 -6
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +96 -73
- package/src/feature-libraries/chunked-forest/codec/format.ts +20 -14
- package/src/feature-libraries/chunked-forest/codec/{nodeShape.ts → nodeEncoder.ts} +23 -17
- package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +34 -34
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +5 -5
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +11 -0
- package/src/feature-libraries/default-schema/defaultSchema.ts +0 -2
- package/src/feature-libraries/default-schema/index.ts +1 -1
- package/src/feature-libraries/default-schema/schemaChecker.ts +47 -30
- package/src/feature-libraries/index.ts +1 -3
- package/src/feature-libraries/modular-schema/comparison.ts +14 -29
- package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +9 -0
- package/src/feature-libraries/modular-schema/genericFieldKind.ts +1 -0
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +61 -19
- package/src/feature-libraries/object-forest/objectForest.ts +10 -6
- package/src/feature-libraries/optional-field/optionalField.ts +4 -0
- package/src/feature-libraries/sequence-field/sequenceFieldChangeRebaser.ts +4 -0
- package/src/index.ts +7 -1
- package/src/jsonDomainSchema.ts +4 -0
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +45 -19
- package/src/shared-tree/schematizeTree.ts +2 -2
- package/src/shared-tree/schematizingTreeView.ts +24 -15
- package/src/shared-tree/sharedTree.ts +2 -42
- package/src/shared-tree/treeAlpha.ts +48 -22
- package/src/shared-tree/treeCheckout.ts +54 -10
- package/src/shared-tree-core/branch.ts +1 -6
- package/src/simple-tree/api/conciseTree.ts +9 -7
- package/src/simple-tree/api/configuration.ts +18 -4
- package/src/simple-tree/api/create.ts +44 -36
- package/src/simple-tree/api/customTree.ts +59 -20
- package/src/simple-tree/api/discrepancies.ts +474 -0
- package/src/simple-tree/api/index.ts +2 -3
- package/src/simple-tree/api/schemaCompatibilityTester.ts +23 -151
- package/src/simple-tree/api/schemaFactory.ts +13 -254
- package/src/simple-tree/api/schemaFactoryAlpha.ts +174 -1
- package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -25
- package/src/simple-tree/api/schemaStatics.ts +291 -0
- package/src/simple-tree/api/storedSchema.ts +18 -14
- package/src/simple-tree/api/treeBeta.ts +24 -4
- package/src/simple-tree/api/verboseTree.ts +17 -8
- package/src/simple-tree/core/allowedTypes.ts +87 -34
- package/src/simple-tree/core/context.ts +24 -22
- package/src/simple-tree/core/index.ts +11 -2
- package/src/simple-tree/core/simpleNodeSchemaBase.ts +30 -0
- package/src/simple-tree/core/toStored.ts +58 -0
- package/src/simple-tree/core/treeNodeKernel.ts +1 -1
- package/src/simple-tree/core/treeNodeSchema.ts +8 -2
- package/src/simple-tree/core/treeNodeValid.ts +23 -4
- package/src/simple-tree/core/walkSchema.ts +26 -6
- package/src/simple-tree/createContext.ts +11 -3
- package/src/simple-tree/fieldSchema.ts +3 -1
- package/src/simple-tree/index.ts +19 -13
- package/src/simple-tree/leafNodeSchema.ts +2 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +64 -23
- package/src/simple-tree/node-kinds/index.ts +0 -1
- package/src/simple-tree/node-kinds/map/mapNode.ts +23 -2
- package/src/simple-tree/node-kinds/object/index.ts +0 -1
- package/src/simple-tree/node-kinds/object/objectNode.ts +42 -30
- package/src/simple-tree/node-kinds/record/recordNode.ts +20 -2
- package/src/simple-tree/prepareForInsertion.ts +28 -15
- package/src/simple-tree/simpleSchema.ts +6 -26
- package/src/simple-tree/toStoredSchema.ts +110 -44
- package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +6 -2
- package/src/simple-tree/walkFieldSchema.ts +1 -0
- package/dist/core/tree/detachedFieldIndexCodec.d.ts +0 -11
- package/dist/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
- package/dist/core/tree/detachedFieldIndexCodec.js +0 -100
- package/dist/core/tree/detachedFieldIndexCodec.js.map +0 -1
- package/dist/core/tree/detachedFieldIndexFormat.d.ts +0 -33
- package/dist/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
- package/dist/core/tree/detachedFieldIndexFormat.js.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
- package/dist/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
- package/dist/feature-libraries/initializeForest.d.ts +0 -18
- package/dist/feature-libraries/initializeForest.d.ts.map +0 -1
- package/dist/feature-libraries/initializeForest.js +0 -35
- package/dist/feature-libraries/initializeForest.js.map +0 -1
- package/dist/simple-tree/discrepancies.d.ts +0 -167
- package/dist/simple-tree/discrepancies.d.ts.map +0 -1
- package/dist/simple-tree/discrepancies.js +0 -382
- package/dist/simple-tree/discrepancies.js.map +0 -1
- package/lib/core/tree/detachedFieldIndexCodec.d.ts +0 -11
- package/lib/core/tree/detachedFieldIndexCodec.d.ts.map +0 -1
- package/lib/core/tree/detachedFieldIndexCodec.js +0 -96
- package/lib/core/tree/detachedFieldIndexCodec.js.map +0 -1
- package/lib/core/tree/detachedFieldIndexFormat.d.ts +0 -33
- package/lib/core/tree/detachedFieldIndexFormat.d.ts.map +0 -1
- package/lib/core/tree/detachedFieldIndexFormat.js.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.d.ts.map +0 -1
- package/lib/feature-libraries/chunked-forest/codec/nodeShape.js.map +0 -1
- package/lib/feature-libraries/initializeForest.d.ts +0 -18
- package/lib/feature-libraries/initializeForest.d.ts.map +0 -1
- package/lib/feature-libraries/initializeForest.js +0 -31
- package/lib/feature-libraries/initializeForest.js.map +0 -1
- package/lib/simple-tree/discrepancies.d.ts +0 -167
- package/lib/simple-tree/discrepancies.d.ts.map +0 -1
- package/lib/simple-tree/discrepancies.js +0 -376
- package/lib/simple-tree/discrepancies.js.map +0 -1
- package/src/feature-libraries/initializeForest.ts +0 -55
- package/src/simple-tree/discrepancies.ts +0 -648
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { toStoredSchema } from "../toStoredSchema.js";
|
|
5
|
+
import { allowsRepoSuperset, defaultSchemaPolicy } from "../../feature-libraries/index.js";
|
|
6
|
+
import { getDiscrepanciesInAllowedContent } from "./discrepancies.js";
|
|
7
|
+
import { toUpgradeSchema } from "../toStoredSchema.js";
|
|
9
8
|
/**
|
|
10
|
-
* A collection of View information for schema
|
|
9
|
+
* A collection of View information for schema
|
|
11
10
|
* @remarks
|
|
12
11
|
* This contains everything needed to determine compatibility with a given stored schema.
|
|
13
12
|
*/
|
|
14
13
|
export class SchemaCompatibilityTester {
|
|
14
|
+
constructor(
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Schema for the view
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
this.
|
|
20
|
-
this.viewSchemaRoot = viewSchemaRoot;
|
|
18
|
+
viewSchema) {
|
|
19
|
+
this.viewSchema = viewSchema;
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* Determines the compatibility of a stored document
|
|
@@ -30,125 +29,26 @@ export class SchemaCompatibilityTester {
|
|
|
30
29
|
* It should be wrapped with (or replaced by) a parse style API.
|
|
31
30
|
*/
|
|
32
31
|
checkCompatibility(stored) {
|
|
32
|
+
// The public API surface assumes defaultSchemaPolicy
|
|
33
|
+
const policy = defaultSchemaPolicy;
|
|
33
34
|
// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy
|
|
34
35
|
// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.
|
|
35
36
|
// In the future, this would also include things like:
|
|
36
37
|
// - fields with more allowed types in the stored schema than in the view schema have out-of-schema "unknown content" adapters
|
|
37
38
|
let canView = true;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const updateCompatibilityFromFieldDiscrepancy = (discrepancy) => {
|
|
42
|
-
switch (discrepancy.mismatch) {
|
|
43
|
-
case "allowedTypes": {
|
|
44
|
-
// Since we only track the symmetric difference between the allowed types in the view and
|
|
45
|
-
// stored schemas, it's sufficient to check if any extra allowed types still exist in the
|
|
46
|
-
// stored schema.
|
|
47
|
-
if (discrepancy.stored.some((identifier) => !isNeverTree(this.policy, stored, stored.nodeSchema.get(identifier)))) {
|
|
48
|
-
// Stored schema has extra allowed types that the view schema does not.
|
|
49
|
-
canUpgrade = false;
|
|
50
|
-
canView = false;
|
|
51
|
-
}
|
|
52
|
-
if (discrepancy.view.length > 0) {
|
|
53
|
-
// View schema has extra allowed types that the stored schema does not.
|
|
54
|
-
canView = false;
|
|
55
|
-
}
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
case "fieldKind": {
|
|
59
|
-
const result = comparePosetElements(discrepancy.stored, discrepancy.view, fieldRealizer);
|
|
60
|
-
if (result === PosetComparisonResult.Greater) {
|
|
61
|
-
// Stored schema is more relaxed than view schema.
|
|
62
|
-
canUpgrade = false;
|
|
63
|
-
if (discrepancy.view === FieldKinds.forbidden.identifier &&
|
|
64
|
-
discrepancy.identifier !== undefined &&
|
|
65
|
-
this.policy.allowUnknownOptionalFields(discrepancy.identifier)) {
|
|
66
|
-
// When the application has opted into it, we allow viewing documents which have additional
|
|
67
|
-
// optional fields in the stored schema that are not present in the view schema.
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
canView = false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
if (result === PosetComparisonResult.Less) {
|
|
74
|
-
// View schema is more relaxed than stored schema.
|
|
75
|
-
canView = false;
|
|
76
|
-
}
|
|
77
|
-
if (result === PosetComparisonResult.Incomparable) {
|
|
78
|
-
canUpgrade = false;
|
|
79
|
-
canView = false;
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
case "valueSchema": {
|
|
84
|
-
canView = false;
|
|
85
|
-
canUpgrade = false;
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
default:
|
|
89
|
-
unreachableCase(discrepancy);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
for (const discrepancy of getAllowedContentDiscrepancies(this.viewSchemaRoot, stored)) {
|
|
93
|
-
if (!canView && !canUpgrade) {
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
switch (discrepancy.mismatch) {
|
|
97
|
-
case "nodeKind": {
|
|
98
|
-
const storedNodeSchema = stored.nodeSchema.get(discrepancy.identifier);
|
|
99
|
-
// We conservatively do not allow node types to change.
|
|
100
|
-
// The only time this might be valid in the sense that the data canonically converts is converting an object node
|
|
101
|
-
// to a map node over the union of all the object fields' types.
|
|
102
|
-
if (discrepancy.stored === undefined) {
|
|
103
|
-
// View schema has added a node type that the stored schema doesn't know about.
|
|
104
|
-
// Note that all cases which trigger this should also trigger an AllowedTypeDiscrepancy (where the type is used).
|
|
105
|
-
// This means this case should be redundant and could be removed in the future if there is a reason to do so
|
|
106
|
-
// (like simplifying enablable type support).
|
|
107
|
-
// See the TODO in getAllowedContentDiscrepancies.
|
|
108
|
-
canView = false;
|
|
109
|
-
}
|
|
110
|
-
else if (discrepancy.view === undefined) {
|
|
111
|
-
const storedIsNever = storedNodeSchema !== undefined
|
|
112
|
-
? isNeverTree(this.policy, stored, storedNodeSchema)
|
|
113
|
-
: true;
|
|
114
|
-
if (!storedIsNever) {
|
|
115
|
-
// Stored schema has a node type that the view schema doesn't know about.
|
|
116
|
-
// The design of allowUnknownOptionalFields allows adding new optional content to types,
|
|
117
|
-
// and the new optional content can use new types.
|
|
118
|
-
// Therefore this case needs to be supported for viewing.
|
|
119
|
-
// However, it is not supported for upgrade as the stored document must be newer (or at least more general) than the view in this case.
|
|
120
|
-
// The fact that there might be removed trees with a root of this type which only appears in the stored schema is why this must set canUpgrade to false.
|
|
121
|
-
canUpgrade = false;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
// Node type exists in both schemas but kind has changed. We conservatively never allow this.
|
|
126
|
-
// See note above about cases where this could be allowed if needed.
|
|
127
|
-
canView = false;
|
|
128
|
-
canUpgrade = false;
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case "valueSchema":
|
|
133
|
-
case "allowedTypes":
|
|
134
|
-
case "fieldKind": {
|
|
135
|
-
updateCompatibilityFromFieldDiscrepancy(discrepancy);
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
case "fields": {
|
|
139
|
-
discrepancy.differences.forEach(updateCompatibilityFromFieldDiscrepancy);
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
// No default
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
if (canUpgrade) {
|
|
146
|
-
assert(allowsRepoSuperset(this.policy, stored, toStoredSchema(this.viewSchemaRoot)), 0xbf2 /* View schema must be a superset of the stored schema to allow upgrade */);
|
|
39
|
+
for (const _discrepancy of getDiscrepanciesInAllowedContent(this.viewSchema, stored)) {
|
|
40
|
+
canView = false;
|
|
41
|
+
break;
|
|
147
42
|
}
|
|
43
|
+
const wouldUpgradeTo = toUpgradeSchema(this.viewSchema.root);
|
|
44
|
+
const canUpgrade = allowsRepoSuperset(policy, stored, wouldUpgradeTo);
|
|
45
|
+
// If true, then upgrading has no effect on what can be stored in the document.
|
|
46
|
+
// TODO: This should likely be changed to indicate up a schema upgrade would be a no-op, including stored schema metadata.
|
|
47
|
+
const isEquivalent = canView && canUpgrade && allowsRepoSuperset(policy, wouldUpgradeTo, stored);
|
|
148
48
|
return {
|
|
149
49
|
canView,
|
|
150
50
|
canUpgrade,
|
|
151
|
-
isEquivalent
|
|
51
|
+
isEquivalent,
|
|
152
52
|
};
|
|
153
53
|
}
|
|
154
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EACN,kBAAkB,EAClB,UAAU,EAEV,WAAW,GACX,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,8BAA8B,EAC9B,qBAAqB,GAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACrC;;OAEG;IACH,YACiB,MAAwB,EACxB,cAA2B;QAD3B,WAAM,GAAN,MAAM,CAAkB;QACxB,mBAAc,GAAd,cAAc,CAAa;IACzC,CAAC;IAEJ;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAwB;QAExB,gHAAgH;QAChH,6HAA6H;QAC7H,sDAAsD;QACtD,8HAA8H;QAC9H,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,sIAAsI;QACtI,4CAA4C;QAC5C,IAAI,UAAU,GAAG,IAAI,CAAC;QAEtB,MAAM,uCAAuC,GAAG,CAAC,WAA6B,EAAQ,EAAE;YACvF,QAAQ,WAAW,CAAC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uIAAuI;4BACvI,wJAAwJ;4BACxJ,UAAU,GAAG,KAAK,CAAC;wBACpB,CAAC;oBACF,CAAC;yBAAM,CAAC;wBACP,6FAA6F;wBAC7F,oEAAoE;wBACpE,OAAO,GAAG,KAAK,CAAC;wBAChB,UAAU,GAAG,KAAK,CAAC;oBACpB,CAAC;oBACD,MAAM;gBACP,CAAC;gBACD,KAAK,aAAa,CAAC;gBACnB,KAAK,cAAc,CAAC;gBACpB,KAAK,WAAW,CAAC,CAAC,CAAC;oBAClB,uCAAuC,CAAC,WAAW,CAAC,CAAC;oBACrD,MAAM;gBACP,CAAC;gBACD,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACf,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;oBACzE,MAAM;gBACP,CAAC;gBACD,aAAa;YACd,CAAC;QACF,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YAChB,MAAM,CACL,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,EAC5E,KAAK,CAAC,0EAA0E,CAChF,CAAC;QACH,CAAC;QAED,OAAO;YACN,OAAO;YACP,UAAU;YACV,YAAY,EAAE,OAAO,IAAI,UAAU;SACnC,CAAC;IACH,CAAC;CACD","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\";\n\nimport type { TreeStoredSchema } from \"../../core/index.js\";\nimport {\n\tallowsRepoSuperset,\n\tFieldKinds,\n\ttype FullSchemaPolicy,\n\tisNeverTree,\n} from \"../../feature-libraries/index.js\";\nimport type { FieldSchema } from \"../fieldSchema.js\";\n\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\nimport {\n\tcomparePosetElements,\n\tfieldRealizer,\n\tgetAllowedContentDiscrepancies,\n\tPosetComparisonResult,\n\ttype FieldDiscrepancy,\n} from \"../discrepancies.js\";\nimport { toStoredSchema } from \"../toStoredSchema.js\";\n\n/**\n * A collection of View information for schema, including policy.\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\t/**\n\t * @param viewSchemaRoot - Schema for the root field.\n\t */\n\tpublic constructor(\n\t\tpublic readonly policy: FullSchemaPolicy,\n\t\tpublic readonly viewSchemaRoot: FieldSchema,\n\t) {}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\t\t// View schema allows a superset of documents that stored schema does, hence the document could be upgraded to use a persisted version\n\t\t// of this view schema as its stored schema.\n\t\tlet canUpgrade = true;\n\n\t\tconst updateCompatibilityFromFieldDiscrepancy = (discrepancy: FieldDiscrepancy): void => {\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"allowedTypes\": {\n\t\t\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t\t\t// stored schema.\n\t\t\t\t\tif (\n\t\t\t\t\t\tdiscrepancy.stored.some(\n\t\t\t\t\t\t\t(identifier) =>\n\t\t\t\t\t\t\t\t!isNeverTree(this.policy, stored, stored.nodeSchema.get(identifier)),\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Stored schema has extra allowed types that the view schema does not.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (discrepancy.view.length > 0) {\n\t\t\t\t\t\t// View schema has extra allowed types that the stored schema does not.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tconst result = comparePosetElements(\n\t\t\t\t\t\tdiscrepancy.stored,\n\t\t\t\t\t\tdiscrepancy.view,\n\t\t\t\t\t\tfieldRealizer,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (result === PosetComparisonResult.Greater) {\n\t\t\t\t\t\t// Stored schema is more relaxed than view schema.\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tdiscrepancy.view === FieldKinds.forbidden.identifier &&\n\t\t\t\t\t\t\tdiscrepancy.identifier !== undefined &&\n\t\t\t\t\t\t\tthis.policy.allowUnknownOptionalFields(discrepancy.identifier)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// When the application has opted into it, we allow viewing documents which have additional\n\t\t\t\t\t\t\t// optional fields in the stored schema that are not present in the view schema.\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Less) {\n\t\t\t\t\t\t// View schema is more relaxed than stored schema.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (result === PosetComparisonResult.Incomparable) {\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\": {\n\t\t\t\t\tcanView = false;\n\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tunreachableCase(discrepancy);\n\t\t\t}\n\t\t};\n\n\t\tfor (const discrepancy of getAllowedContentDiscrepancies(this.viewSchemaRoot, stored)) {\n\t\t\tif (!canView && !canUpgrade) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tswitch (discrepancy.mismatch) {\n\t\t\t\tcase \"nodeKind\": {\n\t\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(discrepancy.identifier);\n\t\t\t\t\t// We conservatively do not allow node types to change.\n\t\t\t\t\t// The only time this might be valid in the sense that the data canonically converts is converting an object node\n\t\t\t\t\t// to a map node over the union of all the object fields' types.\n\t\t\t\t\tif (discrepancy.stored === undefined) {\n\t\t\t\t\t\t// View schema has added a node type that the stored schema doesn't know about.\n\t\t\t\t\t\t// Note that all cases which trigger this should also trigger an AllowedTypeDiscrepancy (where the type is used).\n\t\t\t\t\t\t// This means this case should be redundant and could be removed in the future if there is a reason to do so\n\t\t\t\t\t\t// (like simplifying enablable type support).\n\t\t\t\t\t\t// See the TODO in getAllowedContentDiscrepancies.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t} else if (discrepancy.view === undefined) {\n\t\t\t\t\t\tconst storedIsNever =\n\t\t\t\t\t\t\tstoredNodeSchema !== undefined\n\t\t\t\t\t\t\t\t? isNeverTree(this.policy, stored, storedNodeSchema)\n\t\t\t\t\t\t\t\t: true;\n\t\t\t\t\t\tif (!storedIsNever) {\n\t\t\t\t\t\t\t// Stored schema has a node type that the view schema doesn't know about.\n\t\t\t\t\t\t\t// The design of allowUnknownOptionalFields allows adding new optional content to types,\n\t\t\t\t\t\t\t// and the new optional content can use new types.\n\t\t\t\t\t\t\t// Therefore this case needs to be supported for viewing.\n\t\t\t\t\t\t\t// However, it is not supported for upgrade as the stored document must be newer (or at least more general) than the view in this case.\n\t\t\t\t\t\t\t// The fact that there might be removed trees with a root of this type which only appears in the stored schema is why this must set canUpgrade to false.\n\t\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Node type exists in both schemas but kind has changed. We conservatively never allow this.\n\t\t\t\t\t\t// See note above about cases where this could be allowed if needed.\n\t\t\t\t\t\tcanView = false;\n\t\t\t\t\t\tcanUpgrade = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"valueSchema\":\n\t\t\t\tcase \"allowedTypes\":\n\t\t\t\tcase \"fieldKind\": {\n\t\t\t\t\tupdateCompatibilityFromFieldDiscrepancy(discrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"fields\": {\n\t\t\t\t\tdiscrepancy.differences.forEach(updateCompatibilityFromFieldDiscrepancy);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// No default\n\t\t\t}\n\t\t}\n\n\t\tif (canUpgrade) {\n\t\t\tassert(\n\t\t\t\tallowsRepoSuperset(this.policy, stored, toStoredSchema(this.viewSchemaRoot)),\n\t\t\t\t0xbf2 /* View schema must be a superset of the stored schema to allow upgrade */,\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent: canView && canUpgrade,\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"schemaCompatibilityTester.js","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaCompatibilityTester.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAG3F,OAAO,EAAE,gCAAgC,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACrC;IACC;;OAEG;IACa,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IACpC,CAAC;IAEJ;;;;;;;;;OASG;IACI,kBAAkB,CACxB,MAAwB;QAExB,qDAAqD;QACrD,MAAM,MAAM,GAAG,mBAAmB,CAAC;QAEnC,gHAAgH;QAChH,6HAA6H;QAC7H,sDAAsD;QACtD,8HAA8H;QAC9H,IAAI,OAAO,GAAG,IAAI,CAAC;QAEnB,KAAK,MAAM,YAAY,IAAI,gCAAgC,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC;YACtF,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM;QACP,CAAC;QAED,MAAM,cAAc,GAAG,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE7D,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;QAEtE,+EAA+E;QAC/E,0HAA0H;QAC1H,MAAM,YAAY,GACjB,OAAO,IAAI,UAAU,IAAI,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QAE7E,OAAO;YACN,OAAO;YACP,UAAU;YACV,YAAY;SACZ,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TreeStoredSchema } from \"../../core/index.js\";\nimport { allowsRepoSuperset, defaultSchemaPolicy } from \"../../feature-libraries/index.js\";\n\nimport type { SchemaCompatibilityStatus } from \"./tree.js\";\nimport { getDiscrepanciesInAllowedContent } from \"./discrepancies.js\";\nimport { toUpgradeSchema } from \"../toStoredSchema.js\";\nimport type { TreeSchema } from \"./configuration.js\";\n\n/**\n * A collection of View information for schema\n * @remarks\n * This contains everything needed to determine compatibility with a given stored schema.\n */\nexport class SchemaCompatibilityTester {\n\tpublic constructor(\n\t\t/**\n\t\t * Schema for the view\n\t\t */\n\t\tpublic readonly viewSchema: TreeSchema,\n\t) {}\n\n\t/**\n\t * Determines the compatibility of a stored document\n\t * (based on its stored schema) with a viewer (based on its view schema).\n\t *\n\t * Adapters can be provided to handle differences between the two schema.\n\t * Adapters should only use to types in the `view` SchemaRepository.\n\t *\n\t * TODO: this API violates the parse don't validate design philosophy.\n\t * It should be wrapped with (or replaced by) a parse style API.\n\t */\n\tpublic checkCompatibility(\n\t\tstored: TreeStoredSchema,\n\t): Omit<SchemaCompatibilityStatus, \"canInitialize\"> {\n\t\t// The public API surface assumes defaultSchemaPolicy\n\t\tconst policy = defaultSchemaPolicy;\n\n\t\t// View schema allows a subset of documents that stored schema does, and the discrepancies are allowed by policy\n\t\t// determined by the view schema (i.e. objects with extra optional fields in the stored schema have opted into allowing this.\n\t\t// In the future, this would also include things like:\n\t\t// - fields with more allowed types in the stored schema than in the view schema have out-of-schema \"unknown content\" adapters\n\t\tlet canView = true;\n\n\t\tfor (const _discrepancy of getDiscrepanciesInAllowedContent(this.viewSchema, stored)) {\n\t\t\tcanView = false;\n\t\t\tbreak;\n\t\t}\n\n\t\tconst wouldUpgradeTo = toUpgradeSchema(this.viewSchema.root);\n\n\t\tconst canUpgrade = allowsRepoSuperset(policy, stored, wouldUpgradeTo);\n\n\t\t// If true, then upgrading has no effect on what can be stored in the document.\n\t\t// TODO: This should likely be changed to indicate up a schema upgrade would be a no-op, including stored schema metadata.\n\t\tconst isEquivalent =\n\t\t\tcanView && canUpgrade && allowsRepoSuperset(policy, wouldUpgradeTo, stored);\n\n\t\treturn {\n\t\t\tcanView,\n\t\t\tcanUpgrade,\n\t\t\tisEquivalent,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import type { IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
5
|
import type { TreeValue } from "../../core/index.js";
|
|
7
6
|
import { type JsonCompatibleReadOnlyObject, type RestrictiveStringRecord } from "../../util/index.js";
|
|
8
|
-
import type { NodeKind, WithType, TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaNonClass, NodeSchemaMetadata,
|
|
9
|
-
import {
|
|
7
|
+
import type { NodeKind, WithType, TreeNodeSchema, TreeNodeSchemaClass, TreeNodeSchemaNonClass, NodeSchemaMetadata, ImplicitAllowedTypes, InsertableTreeNodeFromImplicitAllowedTypes } from "../core/index.js";
|
|
8
|
+
import { type LeafSchema } from "../leafNodeSchema.js";
|
|
10
9
|
import { type MapNodeInsertableData, type TreeArrayNode, type InsertableObjectFromSchemaRecord, type TreeMapNode, type TreeObjectNode } from "../node-kinds/index.js";
|
|
11
|
-
import { FieldKind, type FieldSchema, type ImplicitFieldSchema, type FieldProps
|
|
12
|
-
import type { System_Unsafe
|
|
10
|
+
import { FieldKind, type FieldSchema, type ImplicitFieldSchema, type FieldProps } from "../fieldSchema.js";
|
|
11
|
+
import type { System_Unsafe } from "./typesUnsafe.js";
|
|
12
|
+
import { type SchemaStatics } from "./schemaStatics.js";
|
|
13
13
|
/**
|
|
14
14
|
* Gets the leaf domain schema compatible with a given {@link TreeValue}.
|
|
15
15
|
*/
|
|
@@ -55,12 +55,15 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends N
|
|
|
55
55
|
* // Then the alleged clone wouldn't actually clone the entire person in either case, it would drop the nickname.
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
58
|
+
* The existing import and export APIs have similar problems.
|
|
59
|
+
* For example currently the {@link (TreeAlpha:interface).exportVerbose|exportVerbose} API with stored keys preserves unknown optional fields,
|
|
60
|
+
* but {@link Unhydrated} nodes produced by {@link TreeNode} constructors, insertable content, and {@link (TreeAlpha:interface).importVerbose|importVerbose} do not.
|
|
61
|
+
* {@link (TreeBeta:interface).clone} however can be used to clone a node preserving unknown optional fields.
|
|
60
62
|
*
|
|
61
63
|
* Note that public API methods which operate on entire nodes (such as `moveTo`, `moveToEnd`, etc. on arrays) do not encounter
|
|
62
|
-
* this problem as SharedTree's implementation stores the entire node in its lower layers.
|
|
63
|
-
*
|
|
64
|
+
* this problem as SharedTree's implementation stores the entire node in its lower layers.
|
|
65
|
+
* It's only when application code reaches into a node
|
|
66
|
+
* (either by accessing its fields, spreading it, or some other means) that this problem arises.
|
|
64
67
|
*/
|
|
65
68
|
allowUnknownOptionalFields?: boolean;
|
|
66
69
|
}
|
|
@@ -75,151 +78,6 @@ export declare const defaultSchemaFactoryObjectOptions: Required<Omit<SchemaFact
|
|
|
75
78
|
* @system @public
|
|
76
79
|
*/
|
|
77
80
|
export type ScopedSchemaName<TScope extends string | undefined, TName extends number | string> = TScope extends undefined ? `${TName}` : `${TScope}.${TName}`;
|
|
78
|
-
/**
|
|
79
|
-
* Stateless APIs exposed via {@link SchemaFactory} as both instance properties and as statics.
|
|
80
|
-
* @privateRemarks
|
|
81
|
-
* We have no way to make linkable members which exist both as statics and instance properties since API-Extractor does not support this.
|
|
82
|
-
* As a workaround, we have this type as a third place which can be linked.
|
|
83
|
-
* @system @sealed @public
|
|
84
|
-
*/
|
|
85
|
-
export interface SchemaStatics {
|
|
86
|
-
/**
|
|
87
|
-
* {@link TreeNodeSchema} for holding a JavaScript `string`.
|
|
88
|
-
*
|
|
89
|
-
* @remarks
|
|
90
|
-
* Strings containing unpaired UTF-16 surrogate pair code units may not be handled correctly.
|
|
91
|
-
*
|
|
92
|
-
* These limitations come from the use of UTF-8 encoding of the strings, which requires them to be valid unicode.
|
|
93
|
-
* JavaScript does not make this requirement for its strings so not all possible JavaScript strings are supported.
|
|
94
|
-
* @privateRemarks
|
|
95
|
-
* TODO:
|
|
96
|
-
* We should be much more clear about what happens if you use problematic values.
|
|
97
|
-
* We should validate and/or normalize them when inserting content.
|
|
98
|
-
*/
|
|
99
|
-
readonly string: LeafSchema<"string", string>;
|
|
100
|
-
/**
|
|
101
|
-
* {@link TreeNodeSchema} for holding a JavaScript `number`.
|
|
102
|
-
*
|
|
103
|
-
* @remarks
|
|
104
|
-
* The number is a {@link https://en.wikipedia.org/wiki/Double-precision_floating-point_format | double-precision 64-bit binary format IEEE 754} value, however there are some exceptions:
|
|
105
|
-
*
|
|
106
|
-
* - `NaN`, and the infinities are converted to `null` (and may therefore only be used where `null` is allowed by the schema).
|
|
107
|
-
*
|
|
108
|
-
* - `-0` may be converted to `0` in some cases.
|
|
109
|
-
*
|
|
110
|
-
* These limitations match the limitations of JSON.
|
|
111
|
-
* @privateRemarks
|
|
112
|
-
* TODO:
|
|
113
|
-
* We should be much more clear about what happens if you use problematic values.
|
|
114
|
-
* We should validate and/or normalize them when inserting content.
|
|
115
|
-
*/
|
|
116
|
-
readonly number: LeafSchema<"number", number>;
|
|
117
|
-
/**
|
|
118
|
-
* {@link TreeNodeSchema} for holding a boolean.
|
|
119
|
-
*/
|
|
120
|
-
readonly boolean: LeafSchema<"boolean", boolean>;
|
|
121
|
-
/**
|
|
122
|
-
* {@link TreeNodeSchema} for JavaScript `null`.
|
|
123
|
-
*
|
|
124
|
-
* @remarks
|
|
125
|
-
* There are good {@link https://www.npmjs.com/package/%40rushstack/eslint-plugin#rushstackno-new-null | reasons to avoid using null} in JavaScript, however sometimes it is desired.
|
|
126
|
-
* This {@link TreeNodeSchema} node provides the option to include nulls in trees when desired.
|
|
127
|
-
* Unless directly inter-operating with existing data using null, consider other approaches, like wrapping the value in an optional field, or using a more specifically named empty object node.
|
|
128
|
-
*/
|
|
129
|
-
readonly null: LeafSchema<"null", null>;
|
|
130
|
-
/**
|
|
131
|
-
* {@link TreeNodeSchema} for holding an {@link @fluidframework/core-interfaces#(IFluidHandle:interface)}.
|
|
132
|
-
*/
|
|
133
|
-
readonly handle: LeafSchema<"handle", IFluidHandle>;
|
|
134
|
-
/**
|
|
135
|
-
* {@link AllowedTypes} for holding any of the leaf types.
|
|
136
|
-
*/
|
|
137
|
-
readonly leaves: readonly [
|
|
138
|
-
SchemaStatics["string"],
|
|
139
|
-
SchemaStatics["number"],
|
|
140
|
-
SchemaStatics["boolean"],
|
|
141
|
-
SchemaStatics["null"],
|
|
142
|
-
SchemaStatics["handle"]
|
|
143
|
-
];
|
|
144
|
-
/**
|
|
145
|
-
* Make a field optional instead of the default, which is required.
|
|
146
|
-
*
|
|
147
|
-
* @param t - The types allowed under the field.
|
|
148
|
-
* @param props - Optional properties to associate with the field.
|
|
149
|
-
*
|
|
150
|
-
* @typeParam TCustomMetadata - Custom metadata properties to associate with the field.
|
|
151
|
-
* See {@link FieldSchemaMetadata.custom}.
|
|
152
|
-
*/
|
|
153
|
-
readonly optional: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchema<FieldKind.Optional, T, TCustomMetadata>;
|
|
154
|
-
/**
|
|
155
|
-
* Make a field explicitly required.
|
|
156
|
-
*
|
|
157
|
-
* @param t - The types allowed under the field.
|
|
158
|
-
* @param props - Optional properties to associate with the field.
|
|
159
|
-
*
|
|
160
|
-
* @remarks
|
|
161
|
-
* Fields are required by default, but this API can be used to make the required nature explicit in the schema,
|
|
162
|
-
* and allows associating custom {@link FieldProps | properties} with the field.
|
|
163
|
-
*
|
|
164
|
-
* @typeParam TCustomMetadata - Custom metadata properties to associate with the field.
|
|
165
|
-
* See {@link FieldSchemaMetadata.custom}.
|
|
166
|
-
*/
|
|
167
|
-
readonly required: <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchema<FieldKind.Required, T, TCustomMetadata>;
|
|
168
|
-
/**
|
|
169
|
-
* {@link SchemaStatics.optional} except tweaked to work better for recursive types.
|
|
170
|
-
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
171
|
-
* @remarks
|
|
172
|
-
* This version of {@link SchemaStatics.optional} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
173
|
-
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
174
|
-
*/
|
|
175
|
-
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
|
|
176
|
-
/**
|
|
177
|
-
* {@link SchemaStatics.required} except tweaked to work better for recursive types.
|
|
178
|
-
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
179
|
-
* @remarks
|
|
180
|
-
* This version of {@link SchemaStatics.required} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
181
|
-
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
182
|
-
*/
|
|
183
|
-
readonly requiredRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => System_Unsafe.FieldSchemaUnsafe<FieldKind.Required, T, TCustomMetadata>;
|
|
184
|
-
}
|
|
185
|
-
declare function optional<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, T, TCustomMetadata>;
|
|
186
|
-
declare function optional<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Optional, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
187
|
-
declare function required<const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, T, TCustomMetadata>;
|
|
188
|
-
declare function required<const T extends ImplicitAnnotatedAllowedTypes, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">): FieldSchemaAlpha<FieldKind.Required, UnannotateImplicitAllowedTypes<T>, TCustomMetadata>;
|
|
189
|
-
/**
|
|
190
|
-
* Implementation of {@link SchemaStatics}.
|
|
191
|
-
* @remarks
|
|
192
|
-
* Entries can use more specific types than {@link SchemaStatics} requires to be more useful for non-public consumers.
|
|
193
|
-
* Additional non-public members are in {@link schemaStatics}.
|
|
194
|
-
*/
|
|
195
|
-
export declare const schemaStaticsBase: {
|
|
196
|
-
readonly string: LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
197
|
-
readonly number: LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
198
|
-
readonly boolean: LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
199
|
-
readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
200
|
-
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
201
|
-
readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
|
|
202
|
-
readonly optional: typeof optional;
|
|
203
|
-
readonly required: typeof required;
|
|
204
|
-
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata>;
|
|
205
|
-
readonly requiredRecursive: <const T_1 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_1 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_1, TCustomMetadata_1>;
|
|
206
|
-
};
|
|
207
|
-
/**
|
|
208
|
-
* Unstable extensions to {@link schemaStaticsBase}.
|
|
209
|
-
*/
|
|
210
|
-
export declare const schemaStatics: {
|
|
211
|
-
readonly identifier: <const TCustomMetadata = unknown>(props?: Omit<FieldProps<TCustomMetadata>, "defaultProvider">) => FieldSchemaAlpha<FieldKind.Identifier, typeof stringSchema, TCustomMetadata>;
|
|
212
|
-
readonly string: LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
213
|
-
readonly number: LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
214
|
-
readonly boolean: LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
215
|
-
readonly null: LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
216
|
-
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema;
|
|
217
|
-
readonly leaves: readonly [LeafSchema<"string", string> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"number", number> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"boolean", boolean> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"null", null> & import("../simpleSchema.js").SimpleLeafNodeSchema, LeafSchema<"handle", IFluidHandle<unknown>> & import("../simpleSchema.js").SimpleLeafNodeSchema];
|
|
218
|
-
readonly optional: typeof optional;
|
|
219
|
-
readonly required: typeof required;
|
|
220
|
-
readonly optionalRecursive: <const T extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_1 = unknown>(t: T, props?: Omit<FieldPropsAlpha<TCustomMetadata_1>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Optional, T, TCustomMetadata_1>;
|
|
221
|
-
readonly requiredRecursive: <const T_1 extends System_Unsafe.ImplicitAllowedTypesUnsafe, const TCustomMetadata_2 = unknown>(t: T_1, props?: Omit<FieldPropsAlpha<TCustomMetadata_2>, "defaultProvider"> | undefined) => FieldSchemaAlphaUnsafe<FieldKind.Required, T_1, TCustomMetadata_2>;
|
|
222
|
-
};
|
|
223
81
|
/**
|
|
224
82
|
* Creates various types of {@link TreeNodeSchema|schema} for {@link TreeNode}s.
|
|
225
83
|
*
|
|
@@ -428,11 +286,11 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
428
286
|
/**
|
|
429
287
|
* {@inheritDoc SchemaStatics.handle}
|
|
430
288
|
*/
|
|
431
|
-
readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
289
|
+
readonly handle: LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>>;
|
|
432
290
|
/**
|
|
433
291
|
* {@inheritDoc SchemaStatics.leaves}
|
|
434
292
|
*/
|
|
435
|
-
readonly leaves: readonly [LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", IFluidHandle<unknown>>];
|
|
293
|
+
readonly leaves: readonly [LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>>];
|
|
436
294
|
/**
|
|
437
295
|
* {@inheritDoc SchemaStatics.string}
|
|
438
296
|
*/
|
|
@@ -452,11 +310,11 @@ export declare class SchemaFactory<out TScope extends string | undefined = strin
|
|
|
452
310
|
/**
|
|
453
311
|
* {@inheritDoc SchemaStatics.handle}
|
|
454
312
|
*/
|
|
455
|
-
static readonly handle: LeafSchema<"handle", IFluidHandle<unknown>>;
|
|
313
|
+
static readonly handle: LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>>;
|
|
456
314
|
/**
|
|
457
315
|
* {@inheritDoc SchemaStatics.leaves}
|
|
458
316
|
*/
|
|
459
|
-
static readonly leaves: readonly [LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", IFluidHandle<unknown>>];
|
|
317
|
+
static readonly leaves: readonly [LeafSchema<"string", string>, LeafSchema<"number", number>, LeafSchema<"boolean", boolean>, LeafSchema<"null", null>, LeafSchema<"handle", import("@fluidframework/core-interfaces").IFluidHandle<unknown>>];
|
|
460
318
|
/**
|
|
461
319
|
* Define a {@link TreeNodeSchemaClass} for a {@link TreeObjectNode}.
|
|
462
320
|
*
|
|
@@ -729,5 +587,4 @@ export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends N
|
|
|
729
587
|
*/
|
|
730
588
|
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
731
589
|
}
|
|
732
|
-
export {};
|
|
733
590
|
//# sourceMappingURL=schemaFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"schemaFactory.d.ts","sourceRoot":"","sources":["../../../src/simple-tree/api/schemaFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,OAAO,EACN,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAI5B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EAGtB,kBAAkB,EAElB,oBAAoB,EACpB,0CAA0C,EAC1C,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAQN,KAAK,UAAU,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEN,KAAK,qBAAq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CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC;CACpE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB,CAAC,GAAG,CAAC,eAAe,GAAG,OAAO,CACpE,SAAQ,iBAAiB,CAAC,eAAe,CAAC;IAC1C;;OAEG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAC;CACtE"}
|
|
@@ -10,9 +10,9 @@ import { normalizeAllowedTypes, markSchemaMostDerived, isLazy } from "../core/in
|
|
|
10
10
|
import { booleanSchema, handleSchema, nullSchema, numberSchema, stringSchema, } from "../leafNodeSchema.js";
|
|
11
11
|
import { arraySchema, mapSchema, objectSchema, } from "../node-kinds/index.js";
|
|
12
12
|
import { FieldKind, createFieldSchema, getDefaultProvider, } from "../fieldSchema.js";
|
|
13
|
-
import { createFieldSchemaUnsafe } from "./schemaFactoryRecursive.js";
|
|
14
13
|
import { createIdCompressor } from "@fluidframework/id-compressor/internal";
|
|
15
14
|
import { unhydratedFlexTreeFromInsertable } from "../unhydratedFlexTreeFromInsertable.js";
|
|
15
|
+
import { schemaStatics } from "./schemaStatics.js";
|
|
16
16
|
/**
|
|
17
17
|
* Gets the leaf domain schema compatible with a given {@link TreeValue}.
|
|
18
18
|
*/
|
|
@@ -42,50 +42,7 @@ export function schemaFromValue(value) {
|
|
|
42
42
|
export const defaultSchemaFactoryObjectOptions = {
|
|
43
43
|
allowUnknownOptionalFields: false,
|
|
44
44
|
};
|
|
45
|
-
|
|
46
|
-
function optional(t, props) {
|
|
47
|
-
return createFieldSchema(FieldKind.Optional, t, {
|
|
48
|
-
defaultProvider: defaultOptionalProvider,
|
|
49
|
-
...props,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function required(t, props) {
|
|
53
|
-
return createFieldSchema(FieldKind.Required, t, props);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Implementation of {@link SchemaStatics}.
|
|
57
|
-
* @remarks
|
|
58
|
-
* Entries can use more specific types than {@link SchemaStatics} requires to be more useful for non-public consumers.
|
|
59
|
-
* Additional non-public members are in {@link schemaStatics}.
|
|
60
|
-
*/
|
|
61
|
-
export const schemaStaticsBase = {
|
|
62
|
-
string: stringSchema,
|
|
63
|
-
number: numberSchema,
|
|
64
|
-
boolean: booleanSchema,
|
|
65
|
-
null: nullSchema,
|
|
66
|
-
handle: handleSchema,
|
|
67
|
-
leaves: [stringSchema, numberSchema, booleanSchema, nullSchema, handleSchema],
|
|
68
|
-
optional,
|
|
69
|
-
required,
|
|
70
|
-
optionalRecursive: (t, props) => {
|
|
71
|
-
return createFieldSchemaUnsafe(FieldKind.Optional, t, {
|
|
72
|
-
defaultProvider: defaultOptionalProvider,
|
|
73
|
-
...props,
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
requiredRecursive: (t, props) => {
|
|
77
|
-
return createFieldSchemaUnsafe(FieldKind.Required, t, props);
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Unstable extensions to {@link schemaStaticsBase}.
|
|
82
|
-
*/
|
|
83
|
-
export const schemaStatics = {
|
|
84
|
-
...schemaStaticsBase,
|
|
85
|
-
identifier: (props) => {
|
|
86
|
-
return createFieldSchema(FieldKind.Identifier, stringSchema, props);
|
|
87
|
-
},
|
|
88
|
-
};
|
|
45
|
+
// > = `${TScope extends undefined ? "" : `${TScope}.`}${TName}`;
|
|
89
46
|
const schemaStaticsPublic = schemaStatics;
|
|
90
47
|
// TODO:
|
|
91
48
|
// SchemaFactory.array references should link to the correct overloads, however the syntax for this does not seems to work currently for methods unless the they are not qualified with the class.
|