@fluidframework/tree 2.71.0 → 2.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -40
- package/api-report/tree.alpha.api.md +27 -18
- package/api-report/tree.beta.api.md +42 -0
- package/api-report/tree.legacy.beta.api.md +42 -0
- package/dist/alpha.d.ts +9 -7
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/beta.d.ts +7 -0
- package/dist/codec/codec.d.ts +16 -1
- package/dist/codec/codec.d.ts.map +1 -1
- package/dist/codec/codec.js +16 -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 +2 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/schema-stored/index.d.ts +1 -1
- package/dist/core/schema-stored/index.d.ts.map +1 -1
- package/dist/core/schema-stored/index.js +2 -2
- package/dist/core/schema-stored/index.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +6 -6
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +6 -7
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js +3 -1
- package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexCodecs.js +29 -8
- package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js +8 -1
- package/dist/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/dist/core/tree/index.d.ts +2 -1
- package/dist/core/tree/index.d.ts.map +1 -1
- package/dist/core/tree/index.js.map +1 -1
- package/dist/external-utilities/typeboxValidator.js +1 -1
- package/dist/external-utilities/typeboxValidator.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/codecs.js +12 -8
- package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/format.js +9 -4
- package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/index.js +1 -2
- package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js +1 -1
- package/dist/feature-libraries/chunked-forest/codec/uncompressedEncode.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
- package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/index.js +1 -2
- package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
- package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js +3 -21
- package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/codec.js +15 -4
- package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/forest-summary/format.d.ts +8 -1
- package/dist/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/format.js +8 -3
- package/dist/feature-libraries/forest-summary/format.js.map +1 -1
- package/dist/feature-libraries/forest-summary/index.d.ts +2 -1
- package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/index.js +3 -1
- package/dist/feature-libraries/forest-summary/index.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -3
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +2 -2
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts +1 -1
- package/dist/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/index.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +5 -4
- package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/schema-index/codec.d.ts +10 -10
- package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/codec.js +22 -18
- package/dist/feature-libraries/schema-index/codec.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/dist/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js +1 -1
- package/dist/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/dist/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js +1 -1
- package/dist/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/dist/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +7 -0
- package/dist/packageVersion.d.ts +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 +22 -15
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts +12 -16
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +87 -127
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeCodecs.js +12 -11
- package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/treeAlpha.d.ts +1 -1
- package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
- package/dist/shared-tree/treeAlpha.js +4 -2
- package/dist/shared-tree/treeAlpha.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +1 -3
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerCodecs.js +35 -17
- package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js +43 -1
- package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -4
- package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/dist/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js +1 -1
- package/dist/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/dist/shared-tree-core/index.d.ts +5 -3
- package/dist/shared-tree-core/index.d.ts.map +1 -1
- package/dist/shared-tree-core/index.js +11 -3
- package/dist/shared-tree-core/index.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/dist/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecV5.js.map +1 -1
- package/dist/shared-tree-core/messageCodecs.d.ts +19 -6
- package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/dist/shared-tree-core/messageCodecs.js +38 -21
- package/dist/shared-tree-core/messageCodecs.js.map +1 -1
- package/dist/shared-tree-core/messageFormat.d.ts +50 -0
- package/dist/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/dist/shared-tree-core/messageFormat.js +51 -0
- package/dist/shared-tree-core/messageFormat.js.map +1 -0
- package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/dist/shared-tree-core/sharedTreeCore.js +3 -3
- package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/dist/simple-tree/api/discrepancies.d.ts +2 -2
- package/dist/simple-tree/api/discrepancies.js.map +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- 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 +4 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryBeta.js +61 -7
- package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +6 -3
- package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js +292 -0
- package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/dist/simple-tree/api/storedSchema.d.ts +2 -2
- package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/storedSchema.js +8 -6
- package/dist/simple-tree/api/storedSchema.js.map +1 -1
- package/dist/simple-tree/api/tree.d.ts +2 -2
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +78 -35
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +3 -3
- package/dist/simple-tree/core/allowedTypes.js +1 -1
- package/dist/simple-tree/core/allowedTypes.js.map +1 -1
- package/dist/simple-tree/core/treeNode.js +1 -1
- package/dist/simple-tree/core/treeNode.js.map +1 -1
- package/dist/simple-tree/index.d.ts +2 -1
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +4 -0
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js +1 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +2 -2
- package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNode.js +2 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +11 -3
- package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/simpleSchema.js.map +1 -1
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/dist/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js +115 -0
- package/dist/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/dist/tableSchema.d.ts.map +1 -1
- package/dist/tableSchema.js +1 -1
- package/dist/tableSchema.js.map +1 -1
- package/dist/treeFactory.d.ts +3 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +26 -2
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/brand.d.ts +31 -2
- package/dist/util/brand.d.ts.map +1 -1
- package/dist/util/brand.js +28 -2
- package/dist/util/brand.js.map +1 -1
- package/dist/util/brandedMap.d.ts +3 -1
- package/dist/util/brandedMap.d.ts.map +1 -1
- package/dist/util/brandedMap.js.map +1 -1
- package/dist/util/index.d.ts +1 -1
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/index.js +3 -2
- package/dist/util/index.js.map +1 -1
- package/lib/alpha.d.ts +9 -7
- package/lib/api.js +2 -2
- package/lib/api.js.map +1 -1
- package/lib/beta.d.ts +7 -0
- package/lib/codec/codec.d.ts +16 -1
- package/lib/codec/codec.d.ts.map +1 -1
- package/lib/codec/codec.js +16 -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/schema-stored/index.d.ts +1 -1
- package/lib/core/schema-stored/index.d.ts.map +1 -1
- package/lib/core/schema-stored/index.js +1 -1
- package/lib/core/schema-stored/index.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +6 -6
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +6 -7
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +2 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV1.js +3 -2
- package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecV2.js +4 -2
- package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts +2 -3
- package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexCodecs.js +29 -8
- package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts +10 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatCommon.js +7 -0
- package/lib/core/tree/detachedFieldIndexFormatCommon.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV1.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts +2 -2
- package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndexFormatV2.js +3 -3
- package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
- package/lib/core/tree/index.d.ts +2 -1
- package/lib/core/tree/index.d.ts.map +1 -1
- package/lib/core/tree/index.js +1 -1
- package/lib/core/tree/index.js.map +1 -1
- package/lib/external-utilities/typeboxValidator.js +1 -1
- package/lib/external-utilities/typeboxValidator.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +4 -10
- package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/codecs.js +13 -8
- package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/format.js +8 -3
- package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
- package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/codec/uncompressedEncode.d.ts.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/chunked-forest/index.d.ts +1 -1
- package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/index.js +1 -1
- package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +1 -9
- package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js +2 -20
- package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.d.ts +4 -5
- package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/codec.js +16 -5
- package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/forest-summary/format.d.ts +8 -1
- package/lib/feature-libraries/forest-summary/format.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/format.js +7 -2
- package/lib/feature-libraries/forest-summary/format.js.map +1 -1
- package/lib/feature-libraries/forest-summary/index.d.ts +2 -1
- package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/index.js +1 -0
- package/lib/feature-libraries/forest-summary/index.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -3
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +2 -2
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts +1 -1
- package/lib/feature-libraries/schema-edits/index.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/index.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +6 -7
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +6 -5
- package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/schema-index/codec.d.ts +10 -10
- package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/codec.js +24 -20
- package/lib/feature-libraries/schema-index/codec.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.d.ts +2 -2
- package/lib/feature-libraries/schema-index/formatV1.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV1.js +2 -2
- package/lib/feature-libraries/schema-index/formatV1.js.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.d.ts +1 -2
- package/lib/feature-libraries/schema-index/formatV2.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/formatV2.js +2 -2
- package/lib/feature-libraries/schema-index/formatV2.js.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts +2 -2
- package/lib/feature-libraries/schema-index/schemaSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/schema-index/schemaSummarizer.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +7 -0
- package/lib/packageVersion.d.ts +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 +11 -4
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts +12 -16
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +90 -130
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeCodecs.js +7 -6
- package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +2 -2
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/treeAlpha.d.ts +1 -1
- package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
- package/lib/shared-tree/treeAlpha.js +5 -3
- package/lib/shared-tree/treeAlpha.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +1 -3
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.d.ts +19 -6
- package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerCodecs.js +32 -16
- package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts +37 -0
- package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatCommons.js +42 -0
- package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV1toV4.js +5 -5
- package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.d.ts +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.d.ts.map +1 -1
- package/lib/shared-tree-core/editManagerFormatV5.js +2 -2
- package/lib/shared-tree-core/editManagerFormatV5.js.map +1 -1
- package/lib/shared-tree-core/index.d.ts +5 -3
- package/lib/shared-tree-core/index.d.ts.map +1 -1
- package/lib/shared-tree-core/index.js +4 -2
- package/lib/shared-tree-core/index.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts +2 -1
- package/lib/shared-tree-core/messageCodecV5.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecV5.js.map +1 -1
- package/lib/shared-tree-core/messageCodecs.d.ts +19 -6
- package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
- package/lib/shared-tree-core/messageCodecs.js +35 -20
- package/lib/shared-tree-core/messageCodecs.js.map +1 -1
- package/lib/shared-tree-core/messageFormat.d.ts +50 -0
- package/lib/shared-tree-core/messageFormat.d.ts.map +1 -0
- package/lib/shared-tree-core/messageFormat.js +48 -0
- package/lib/shared-tree-core/messageFormat.js.map +1 -0
- package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -8
- package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
- package/lib/shared-tree-core/sharedTreeCore.js +3 -3
- package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
- package/lib/simple-tree/api/discrepancies.d.ts +2 -2
- package/lib/simple-tree/api/discrepancies.js.map +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js +1 -1
- package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
- 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 +1 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +2 -98
- package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -52
- package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts +98 -2
- package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryBeta.js +58 -4
- package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +6 -3
- package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts +28 -0
- package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js +264 -0
- package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -0
- package/lib/simple-tree/api/storedSchema.d.ts +2 -2
- package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/storedSchema.js +5 -3
- package/lib/simple-tree/api/storedSchema.js.map +1 -1
- package/lib/simple-tree/api/tree.d.ts +2 -2
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/typesUnsafe.d.ts +6 -6
- package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts +18 -3
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +75 -34
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +3 -3
- package/lib/simple-tree/core/allowedTypes.js +1 -1
- package/lib/simple-tree/core/allowedTypes.js.map +1 -1
- package/lib/simple-tree/core/treeNode.js +1 -1
- package/lib/simple-tree/core/treeNode.js.map +1 -1
- package/lib/simple-tree/index.d.ts +2 -1
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +1 -0
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +2 -2
- package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/map/mapNode.js +2 -2
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +3 -3
- package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNode.js +3 -3
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +11 -3
- package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/simpleSchema.js.map +1 -1
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts +249 -0
- package/lib/simple-tree/simpleSchemaFormatV1.d.ts.map +1 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js +112 -0
- package/lib/simple-tree/simpleSchemaFormatV1.js.map +1 -0
- package/lib/tableSchema.d.ts.map +1 -1
- package/lib/tableSchema.js +1 -1
- package/lib/tableSchema.js.map +1 -1
- package/lib/treeFactory.d.ts +3 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +23 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/util/brand.d.ts +31 -2
- package/lib/util/brand.d.ts.map +1 -1
- package/lib/util/brand.js +26 -1
- package/lib/util/brand.js.map +1 -1
- package/lib/util/brandedMap.d.ts +3 -1
- package/lib/util/brandedMap.d.ts.map +1 -1
- package/lib/util/brandedMap.js.map +1 -1
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -1
- package/lib/util/index.js.map +1 -1
- package/package.json +24 -24
- package/src/api.ts +2 -2
- package/src/codec/codec.ts +17 -3
- package/src/core/index.ts +1 -2
- package/src/core/schema-stored/index.ts +1 -2
- package/src/core/schema-stored/schema.ts +10 -7
- package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
- package/src/core/tree/detachedFieldIndexCodecV1.ts +4 -2
- package/src/core/tree/detachedFieldIndexCodecV2.ts +4 -6
- package/src/core/tree/detachedFieldIndexCodecs.ts +33 -11
- package/src/core/tree/detachedFieldIndexFormatCommon.ts +17 -2
- package/src/core/tree/detachedFieldIndexFormatV1.ts +6 -4
- package/src/core/tree/detachedFieldIndexFormatV2.ts +6 -4
- package/src/core/tree/index.ts +2 -4
- package/src/external-utilities/typeboxValidator.ts +1 -1
- package/src/feature-libraries/chunked-forest/codec/codecs.ts +18 -13
- package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/codec/format.ts +15 -4
- package/src/feature-libraries/chunked-forest/codec/index.ts +4 -2
- package/src/feature-libraries/chunked-forest/codec/uncompressedEncode.ts +2 -2
- package/src/feature-libraries/chunked-forest/index.ts +0 -1
- package/src/feature-libraries/default-schema/defaultFieldKinds.ts +2 -29
- package/src/feature-libraries/forest-summary/codec.ts +24 -9
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +1 -1
- package/src/feature-libraries/forest-summary/format.ts +12 -2
- package/src/feature-libraries/forest-summary/index.ts +2 -1
- package/src/feature-libraries/index.ts +1 -2
- package/src/feature-libraries/schema-edits/index.ts +0 -1
- package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +16 -16
- package/src/feature-libraries/schema-index/codec.ts +34 -22
- package/src/feature-libraries/schema-index/formatV1.ts +2 -2
- package/src/feature-libraries/schema-index/formatV2.ts +2 -2
- package/src/feature-libraries/schema-index/schemaSummarizer.ts +2 -1
- package/src/index.ts +3 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +16 -5
- package/src/shared-tree/sharedTree.ts +112 -172
- package/src/shared-tree/sharedTreeChangeCodecs.ts +15 -9
- package/src/shared-tree/sharedTreeChangeFamily.ts +2 -2
- package/src/shared-tree/treeAlpha.ts +6 -5
- package/src/shared-tree/treeCheckout.ts +1 -3
- package/src/shared-tree-core/editManagerCodecs.ts +56 -19
- package/src/shared-tree-core/editManagerFormatCommons.ts +47 -0
- package/src/shared-tree-core/editManagerFormatV1toV4.ts +10 -5
- package/src/shared-tree-core/editManagerFormatV5.ts +3 -3
- package/src/shared-tree-core/index.ts +11 -5
- package/src/shared-tree-core/messageCodecV1ToV4.ts +6 -1
- package/src/shared-tree-core/messageCodecV5.ts +2 -1
- package/src/shared-tree-core/messageCodecs.ts +60 -26
- package/src/shared-tree-core/messageFormat.ts +56 -0
- package/src/shared-tree-core/sharedTreeCore.ts +11 -13
- package/src/simple-tree/api/discrepancies.ts +2 -2
- package/src/simple-tree/api/incrementalAllowedTypes.ts +1 -1
- package/src/simple-tree/api/index.ts +6 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
- package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
- package/src/simple-tree/api/schemaFromSimple.ts +6 -3
- package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
- package/src/simple-tree/api/storedSchema.ts +8 -5
- package/src/simple-tree/api/tree.ts +2 -2
- package/src/simple-tree/api/typesUnsafe.ts +6 -6
- package/src/simple-tree/api/viewSchemaToSimpleSchema.ts +80 -47
- package/src/simple-tree/core/allowedTypes.ts +3 -3
- package/src/simple-tree/core/treeNode.ts +2 -2
- package/src/simple-tree/index.ts +5 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +2 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +2 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +3 -3
- package/src/simple-tree/node-kinds/record/recordNode.ts +3 -3
- package/src/simple-tree/simpleSchema.ts +12 -3
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/tableSchema.ts +5 -2
- package/src/treeFactory.ts +33 -1
- package/src/util/brand.ts +40 -2
- package/src/util/brandedMap.ts +3 -1
- package/src/util/index.ts +1 -0
|
@@ -25,35 +25,21 @@ import type { ImplicitFieldSchema } from "../fieldSchema.js";
|
|
|
25
25
|
import type { RestrictiveStringRecord } from "../../util/index.js";
|
|
26
26
|
import type {
|
|
27
27
|
NodeKind,
|
|
28
|
-
TreeNodeSchema,
|
|
29
28
|
TreeNodeSchemaClass,
|
|
30
29
|
ImplicitAllowedTypes,
|
|
31
|
-
AnnotatedAllowedType,
|
|
32
|
-
LazyItem,
|
|
33
30
|
WithType,
|
|
34
|
-
AllowedTypesMetadata,
|
|
35
|
-
AllowedTypesFullFromMixed,
|
|
36
|
-
} from "../core/index.js";
|
|
37
|
-
import {
|
|
38
|
-
normalizeToAnnotatedAllowedType,
|
|
39
|
-
createSchemaUpgrade,
|
|
40
|
-
AnnotatedAllowedTypesInternal,
|
|
41
31
|
} from "../core/index.js";
|
|
42
32
|
import type {
|
|
43
|
-
AllowedTypesFullFromMixedUnsafe,
|
|
44
|
-
AnnotatedAllowedTypeUnsafe,
|
|
45
33
|
ArrayNodeCustomizableSchemaUnsafe,
|
|
46
34
|
MapNodeCustomizableSchemaUnsafe,
|
|
47
35
|
System_Unsafe,
|
|
48
36
|
TreeRecordNodeUnsafe,
|
|
49
|
-
UnannotateAllowedTypeUnsafe,
|
|
50
|
-
Unenforced,
|
|
51
37
|
} from "./typesUnsafe.js";
|
|
52
38
|
import type { SimpleObjectNodeSchema } from "../simpleSchema.js";
|
|
53
39
|
import { SchemaFactoryBeta } from "./schemaFactoryBeta.js";
|
|
54
40
|
|
|
55
41
|
// These imports prevent a large number of type references in the API reports from showing up as *_2.
|
|
56
|
-
/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import/no-duplicates */
|
|
42
|
+
/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */
|
|
57
43
|
import type {
|
|
58
44
|
FieldProps,
|
|
59
45
|
FieldSchemaAlpha,
|
|
@@ -63,119 +49,7 @@ import type {
|
|
|
63
49
|
import type { LeafSchema } from "../leafNodeSchema.js";
|
|
64
50
|
import type { SimpleLeafNodeSchema } from "../simpleSchema.js";
|
|
65
51
|
import type { FieldSchemaAlphaUnsafe } from "./typesUnsafe.js";
|
|
66
|
-
/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import/no-duplicates */
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Stateless APIs exposed via {@link SchemaFactoryAlpha} as both instance properties and as statics.
|
|
70
|
-
* @remarks
|
|
71
|
-
* See {@link SchemaStatics} for why this is useful.
|
|
72
|
-
* @system @sealed @alpha
|
|
73
|
-
*/
|
|
74
|
-
export interface SchemaStaticsAlpha {
|
|
75
|
-
/**
|
|
76
|
-
* Declares a staged type in a set of {@link AllowedTypes}.
|
|
77
|
-
*
|
|
78
|
-
* @remarks
|
|
79
|
-
* Staged allowed types add support for loading documents which may contain that type at the declared location.
|
|
80
|
-
* This allows for an incremental rollout of a schema change to add a {@link TreeNodeSchema} to an {@link AllowedTypes} without breaking cross version collaboration.
|
|
81
|
-
* A guide on this process can be found here: https://fluidframework.com/docs/data-structures/tree/schema-evolution/allowed-types-rollout
|
|
82
|
-
*
|
|
83
|
-
* Once enough clients have the type staged (and thus can read documents which allow it), documents can start being created and upgraded to allow the staged type.
|
|
84
|
-
* This is done by deploying a new version of the app which removes the `staged` wrapper around the allowed type in the the schema definition.
|
|
85
|
-
* This will also require {@link TreeView.upgradeSchema|upgrading the schema} for existing documents.
|
|
86
|
-
*
|
|
87
|
-
* Using a staged allowed type in a schema is just like using the schema as an allowed type with the following exceptions:
|
|
88
|
-
*
|
|
89
|
-
* 1. {@link TreeView.initialize} will omit the staged allowed type from the newly created stored schema.
|
|
90
|
-
* 2. {@link TreeView.upgradeSchema} will omit the staged allowed type from the the upgraded stored schema.
|
|
91
|
-
* 3. When evaluating {@link TreeView.compatibility}, it will be viewable even if the staged allowed type is not present in the stored schema's corresponding allowed types.
|
|
92
|
-
* 4. Because of the above, it is possible to get errors when inserting content which uses the staged allowed type into a tree whose stored schema does not permit it.
|
|
93
|
-
*
|
|
94
|
-
* Currently, `staged` is not supported in the recursive type APIs: this is a known limitation which future versions of the API will address.
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* A full code example of the schema migration process can be found in our {@link https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/src/test/simple-tree/api/stagedSchemaUpgrade.spec.ts | tests}.
|
|
98
|
-
*
|
|
99
|
-
* @privateRemarks
|
|
100
|
-
* TODO:#44317 staged allowed types rely on schema validation of stored schema to output errors, these errors are not very
|
|
101
|
-
* user friendly and should be improved, particularly in the case of staged allowed types
|
|
102
|
-
*
|
|
103
|
-
* TODO: AB#45711: Update the docs above when recursive type support is added.
|
|
104
|
-
*/
|
|
105
|
-
readonly staged: <const T extends LazyItem<TreeNodeSchema>>(
|
|
106
|
-
t: T | AnnotatedAllowedType<T>,
|
|
107
|
-
) => AnnotatedAllowedType<T>;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Normalize information about a set of {@link AllowedTypes} into an {@link AllowedTypesFull}.
|
|
111
|
-
* @remarks
|
|
112
|
-
* This can take in {@link AnnotatedAllowedType} to preserve their annotations.
|
|
113
|
-
*/
|
|
114
|
-
readonly types: <
|
|
115
|
-
const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[],
|
|
116
|
-
>(
|
|
117
|
-
t: T,
|
|
118
|
-
metadata?: AllowedTypesMetadata,
|
|
119
|
-
) => AllowedTypesFullFromMixed<T>;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* {@link SchemaStaticsAlpha.staged} except tweaked to work better for recursive types.
|
|
123
|
-
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
124
|
-
* @remarks
|
|
125
|
-
* This version of {@link SchemaStaticsAlpha.staged} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
126
|
-
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
127
|
-
*/
|
|
128
|
-
stagedRecursive: <
|
|
129
|
-
const T extends Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>,
|
|
130
|
-
>(
|
|
131
|
-
t: T,
|
|
132
|
-
) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* {@link SchemaStaticsAlpha.types} except tweaked to work better for recursive types.
|
|
136
|
-
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
137
|
-
* @remarks
|
|
138
|
-
* This version of {@link SchemaStaticsAlpha.types} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
139
|
-
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
140
|
-
* @privateRemarks
|
|
141
|
-
* If all inputs (at least recursive ones) were required to be annotated, this could be typed more strongly.
|
|
142
|
-
* In that case it could use `T extends readonly (AnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>)[]`.
|
|
143
|
-
*/
|
|
144
|
-
readonly typesRecursive: <
|
|
145
|
-
const T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],
|
|
146
|
-
>(
|
|
147
|
-
t: T,
|
|
148
|
-
metadata?: AllowedTypesMetadata,
|
|
149
|
-
) => AllowedTypesFullFromMixedUnsafe<T>;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const staged = <const T extends LazyItem<TreeNodeSchema>>(
|
|
153
|
-
t: T | AnnotatedAllowedType<T>,
|
|
154
|
-
): AnnotatedAllowedType<T> => {
|
|
155
|
-
const annotatedType = normalizeToAnnotatedAllowedType(t);
|
|
156
|
-
return {
|
|
157
|
-
type: annotatedType.type,
|
|
158
|
-
metadata: {
|
|
159
|
-
...annotatedType.metadata,
|
|
160
|
-
stagedSchemaUpgrade: createSchemaUpgrade(),
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const types = <const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]>(
|
|
166
|
-
t: T,
|
|
167
|
-
metadata: AllowedTypesMetadata = {},
|
|
168
|
-
): AllowedTypesFullFromMixed<T> => {
|
|
169
|
-
return AnnotatedAllowedTypesInternal.createMixed<T>(t, metadata);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const schemaStaticsAlpha: SchemaStaticsAlpha = {
|
|
173
|
-
staged,
|
|
174
|
-
types,
|
|
175
|
-
|
|
176
|
-
stagedRecursive: staged as SchemaStaticsAlpha["stagedRecursive"],
|
|
177
|
-
typesRecursive: types as unknown as SchemaStaticsAlpha["typesRecursive"],
|
|
178
|
-
};
|
|
52
|
+
/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */
|
|
179
53
|
|
|
180
54
|
/**
|
|
181
55
|
* {@link SchemaFactory} with additional alpha APIs.
|
|
@@ -335,46 +209,6 @@ export class SchemaFactoryAlpha<
|
|
|
335
209
|
*/
|
|
336
210
|
public override readonly requiredRecursive = schemaStatics.requiredRecursive;
|
|
337
211
|
|
|
338
|
-
/**
|
|
339
|
-
* {@inheritDoc SchemaStaticsAlpha.staged}
|
|
340
|
-
*/
|
|
341
|
-
public static staged = schemaStaticsAlpha.staged;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* {@inheritDoc SchemaStaticsAlpha.staged}
|
|
345
|
-
*/
|
|
346
|
-
public staged = schemaStaticsAlpha.staged;
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* {@inheritDoc SchemaStaticsAlpha.stagedRecursive}
|
|
350
|
-
*/
|
|
351
|
-
public static stagedRecursive = schemaStaticsAlpha.stagedRecursive;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* {@inheritDoc SchemaStaticsAlpha.stagedRecursive}
|
|
355
|
-
*/
|
|
356
|
-
public stagedRecursive = schemaStaticsAlpha.stagedRecursive;
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* {@inheritDoc SchemaStaticsAlpha.types}
|
|
360
|
-
*/
|
|
361
|
-
public static types = schemaStaticsAlpha.types;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* {@inheritDoc SchemaStaticsAlpha.types}
|
|
365
|
-
*/
|
|
366
|
-
public types = schemaStaticsAlpha.types;
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* {@inheritDoc SchemaStaticsAlpha.typesRecursive}
|
|
370
|
-
*/
|
|
371
|
-
public static typesRecursive = schemaStaticsAlpha.typesRecursive;
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* {@inheritDoc SchemaStaticsAlpha.typesRecursive}
|
|
375
|
-
*/
|
|
376
|
-
public typesRecursive = schemaStaticsAlpha.typesRecursive;
|
|
377
|
-
|
|
378
212
|
/**
|
|
379
213
|
* Define a {@link TreeNodeSchema} for a {@link TreeMapNode}.
|
|
380
214
|
*
|
|
@@ -3,14 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
import {
|
|
7
|
+
AnnotatedAllowedTypesInternal,
|
|
8
|
+
createSchemaUpgrade,
|
|
9
|
+
normalizeToAnnotatedAllowedType,
|
|
10
|
+
type AllowedTypesFullFromMixed,
|
|
11
|
+
type AllowedTypesMetadata,
|
|
12
|
+
type AnnotatedAllowedType,
|
|
13
|
+
type ImplicitAllowedTypes,
|
|
14
|
+
type LazyItem,
|
|
15
|
+
type NodeKind,
|
|
16
|
+
type TreeNodeSchema,
|
|
17
|
+
type TreeNodeSchemaBoth,
|
|
18
|
+
type TreeNodeSchemaClass,
|
|
19
|
+
type TreeNodeSchemaNonClass,
|
|
20
|
+
type WithType,
|
|
14
21
|
} from "../core/index.js";
|
|
15
22
|
|
|
16
23
|
import {
|
|
@@ -30,10 +37,17 @@ import {
|
|
|
30
37
|
type ObjectSchemaOptions,
|
|
31
38
|
type ScopedSchemaName,
|
|
32
39
|
} from "./schemaFactory.js";
|
|
33
|
-
import type {
|
|
40
|
+
import type {
|
|
41
|
+
AllowedTypesFullFromMixedUnsafe,
|
|
42
|
+
AnnotatedAllowedTypeUnsafe,
|
|
43
|
+
System_Unsafe,
|
|
44
|
+
TreeRecordNodeUnsafe,
|
|
45
|
+
UnannotateAllowedTypeUnsafe,
|
|
46
|
+
Unenforced,
|
|
47
|
+
} from "./typesUnsafe.js";
|
|
34
48
|
|
|
35
49
|
// These imports prevent a large number of type references in the API reports from showing up as *_2.
|
|
36
|
-
/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import/no-duplicates */
|
|
50
|
+
/* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */
|
|
37
51
|
import type {
|
|
38
52
|
FieldProps,
|
|
39
53
|
FieldSchemaAlpha,
|
|
@@ -44,7 +58,119 @@ import type {
|
|
|
44
58
|
import type { LeafSchema } from "../leafNodeSchema.js";
|
|
45
59
|
import type { SimpleLeafNodeSchema } from "../simpleSchema.js";
|
|
46
60
|
import type { RestrictiveStringRecord } from "../../util/index.js";
|
|
47
|
-
/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import/no-duplicates */
|
|
61
|
+
/* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Stateless APIs exposed via {@link SchemaFactoryBeta} as both instance properties and as statics.
|
|
65
|
+
* @see {@link SchemaStatics} for why this is useful.
|
|
66
|
+
* @system @sealed @beta
|
|
67
|
+
*/
|
|
68
|
+
export interface SchemaStaticsBeta {
|
|
69
|
+
/**
|
|
70
|
+
* Declares a staged type in a set of {@link AllowedTypes}.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* Staged allowed types add support for loading documents which may contain that type at the declared location.
|
|
74
|
+
* This allows for an incremental rollout of a schema change to add a {@link TreeNodeSchema} to an {@link AllowedTypes} without breaking cross version collaboration.
|
|
75
|
+
* A guide on this process can be found here: https://fluidframework.com/docs/data-structures/tree/schema-evolution/allowed-types-rollout
|
|
76
|
+
*
|
|
77
|
+
* Once enough clients have the type staged (and thus can read documents which allow it), documents can start being created and upgraded to allow the staged type.
|
|
78
|
+
* This is done by deploying a new version of the app which removes the `staged` wrapper around the allowed type in the the schema definition.
|
|
79
|
+
* This will also require {@link TreeView.upgradeSchema|upgrading the schema} for existing documents.
|
|
80
|
+
*
|
|
81
|
+
* Using a staged allowed type in a schema is just like using the schema as an allowed type with the following exceptions:
|
|
82
|
+
*
|
|
83
|
+
* 1. {@link TreeView.initialize} will omit the staged allowed type from the newly created stored schema.
|
|
84
|
+
* 2. {@link TreeView.upgradeSchema} will omit the staged allowed type from the the upgraded stored schema.
|
|
85
|
+
* 3. When evaluating {@link TreeView.compatibility}, it will be viewable even if the staged allowed type is not present in the stored schema's corresponding allowed types.
|
|
86
|
+
* 4. Because of the above, it is possible to get errors when inserting content which uses the staged allowed type into a tree whose stored schema does not permit it.
|
|
87
|
+
*
|
|
88
|
+
* For recursive schemas, use {@link SchemaStaticsBeta.stagedRecursive} instead.
|
|
89
|
+
* It offers equivalent runtime behavior with relaxed compile-time typing for recursive type.
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* A full code example of the schema migration process can be found in our {@link https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/src/test/simple-tree/api/stagedSchemaUpgrade.spec.ts | tests}.
|
|
93
|
+
*
|
|
94
|
+
* @privateRemarks
|
|
95
|
+
* TODO:#44317 staged allowed types rely on schema validation of stored schema to output errors, these errors are not very
|
|
96
|
+
* user friendly and should be improved, particularly in the case of staged allowed types
|
|
97
|
+
*
|
|
98
|
+
* TODO: AB#45711: Update the docs above when recursive type support is added.
|
|
99
|
+
*/
|
|
100
|
+
readonly staged: <const T extends LazyItem<TreeNodeSchema>>(
|
|
101
|
+
t: T | AnnotatedAllowedType<T>,
|
|
102
|
+
) => AnnotatedAllowedType<T>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Normalize information about a set of {@link AllowedTypes} into an {@link AllowedTypesFull}.
|
|
106
|
+
* @remarks
|
|
107
|
+
* This can take in {@link AnnotatedAllowedType} to preserve their annotations.
|
|
108
|
+
*/
|
|
109
|
+
readonly types: <
|
|
110
|
+
const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[],
|
|
111
|
+
>(
|
|
112
|
+
t: T,
|
|
113
|
+
metadata?: AllowedTypesMetadata,
|
|
114
|
+
) => AllowedTypesFullFromMixed<T>;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* {@link SchemaStaticsBeta.staged} except tweaked to work better for recursive types.
|
|
118
|
+
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
119
|
+
* @remarks
|
|
120
|
+
* This version of {@link SchemaStaticsBeta.staged} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
121
|
+
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
122
|
+
*/
|
|
123
|
+
stagedRecursive: <
|
|
124
|
+
const T extends Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>,
|
|
125
|
+
>(
|
|
126
|
+
t: T,
|
|
127
|
+
) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* {@link SchemaStaticsBeta.types} except tweaked to work better for recursive types.
|
|
131
|
+
* Use with {@link ValidateRecursiveSchema} for improved type safety.
|
|
132
|
+
* @remarks
|
|
133
|
+
* This version of {@link SchemaStaticsBeta.types} has fewer type constraints to work around TypeScript limitations, see {@link Unenforced}.
|
|
134
|
+
* See {@link ValidateRecursiveSchema} for additional information about using recursive schema.
|
|
135
|
+
* @privateRemarks
|
|
136
|
+
* If all inputs (at least recursive ones) were required to be annotated, this could be typed more strongly.
|
|
137
|
+
* In that case it could use `T extends readonly (AnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>)[]`.
|
|
138
|
+
*/
|
|
139
|
+
readonly typesRecursive: <
|
|
140
|
+
const T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[],
|
|
141
|
+
>(
|
|
142
|
+
t: T,
|
|
143
|
+
metadata?: AllowedTypesMetadata,
|
|
144
|
+
) => AllowedTypesFullFromMixedUnsafe<T>;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const staged = <const T extends LazyItem<TreeNodeSchema>>(
|
|
148
|
+
t: T | AnnotatedAllowedType<T>,
|
|
149
|
+
): AnnotatedAllowedType<T> => {
|
|
150
|
+
const annotatedType = normalizeToAnnotatedAllowedType(t);
|
|
151
|
+
return {
|
|
152
|
+
type: annotatedType.type,
|
|
153
|
+
metadata: {
|
|
154
|
+
...annotatedType.metadata,
|
|
155
|
+
stagedSchemaUpgrade: createSchemaUpgrade(),
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const types = <const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]>(
|
|
161
|
+
t: T,
|
|
162
|
+
metadata: AllowedTypesMetadata = {},
|
|
163
|
+
): AllowedTypesFullFromMixed<T> => {
|
|
164
|
+
return AnnotatedAllowedTypesInternal.createMixed<T>(t, metadata);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const schemaStaticsBeta: SchemaStaticsBeta = {
|
|
168
|
+
staged,
|
|
169
|
+
types,
|
|
170
|
+
|
|
171
|
+
stagedRecursive: staged as SchemaStaticsBeta["stagedRecursive"],
|
|
172
|
+
typesRecursive: types as unknown as SchemaStaticsBeta["typesRecursive"],
|
|
173
|
+
};
|
|
48
174
|
|
|
49
175
|
/**
|
|
50
176
|
* {@link SchemaFactory} with additional beta APIs.
|
|
@@ -55,6 +181,46 @@ export class SchemaFactoryBeta<
|
|
|
55
181
|
out TScope extends string | undefined = string | undefined,
|
|
56
182
|
TName extends number | string = string,
|
|
57
183
|
> extends SchemaFactory<TScope, TName> {
|
|
184
|
+
/**
|
|
185
|
+
* {@inheritDoc SchemaStaticsBeta.staged}
|
|
186
|
+
*/
|
|
187
|
+
public static staged = schemaStaticsBeta.staged;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* {@inheritDoc SchemaStaticsBeta.staged}
|
|
191
|
+
*/
|
|
192
|
+
public staged = schemaStaticsBeta.staged;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* {@inheritDoc SchemaStaticsBeta.stagedRecursive}
|
|
196
|
+
*/
|
|
197
|
+
public static stagedRecursive = schemaStaticsBeta.stagedRecursive;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* {@inheritDoc SchemaStaticsBeta.stagedRecursive}
|
|
201
|
+
*/
|
|
202
|
+
public stagedRecursive = schemaStaticsBeta.stagedRecursive;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* {@inheritDoc SchemaStaticsBeta.types}
|
|
206
|
+
*/
|
|
207
|
+
public static types = schemaStaticsBeta.types;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* {@inheritDoc SchemaStaticsBeta.types}
|
|
211
|
+
*/
|
|
212
|
+
public types = schemaStaticsBeta.types;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* {@inheritDoc SchemaStaticsBeta.typesRecursive}
|
|
216
|
+
*/
|
|
217
|
+
public static typesRecursive = schemaStaticsBeta.typesRecursive;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* {@inheritDoc SchemaStaticsBeta.typesRecursive}
|
|
221
|
+
*/
|
|
222
|
+
public typesRecursive = schemaStaticsBeta.typesRecursive;
|
|
223
|
+
|
|
58
224
|
/**
|
|
59
225
|
* Create a {@link SchemaFactory} with a {@link SchemaFactory.scope|scope} which is a combination of this factory's scope and the provided name.
|
|
60
226
|
* @remarks
|
|
@@ -250,9 +416,9 @@ export class SchemaFactoryBeta<
|
|
|
250
416
|
/* Info */ T
|
|
251
417
|
> {
|
|
252
418
|
if (maybeAllowedTypes === undefined) {
|
|
253
|
-
const
|
|
254
|
-
const fullName = structuralName("Record",
|
|
255
|
-
return this.getStructuralType(fullName,
|
|
419
|
+
const nodeTypes = nameOrAllowedTypes as (T & TreeNodeSchema) | readonly TreeNodeSchema[];
|
|
420
|
+
const fullName = structuralName("Record", nodeTypes);
|
|
421
|
+
return this.getStructuralType(fullName, nodeTypes, () =>
|
|
256
422
|
this.namedRecord(
|
|
257
423
|
fullName,
|
|
258
424
|
nameOrAllowedTypes as T,
|
|
@@ -106,9 +106,12 @@ function generateNode(
|
|
|
106
106
|
for (const [key, field] of schema.fields) {
|
|
107
107
|
fields[key] = generateFieldSchema(field, context, field.storedKey);
|
|
108
108
|
}
|
|
109
|
-
// Here allowUnknownOptionalFields is implicitly defaulting
|
|
110
|
-
// users of this code are expected to handle what ever choice this code makes for cases like this.
|
|
111
|
-
return factory.objectAlpha(id, fields, {
|
|
109
|
+
// Here allowUnknownOptionalFields is implicitly defaulting in the case where the input schema does not explicitly specify the value.
|
|
110
|
+
// This is a subjective policy choice: users of this code are expected to handle what ever choice this code makes for cases like this.
|
|
111
|
+
return factory.objectAlpha(id, fields, {
|
|
112
|
+
metadata: schema.metadata,
|
|
113
|
+
allowUnknownOptionalFields: schema.allowUnknownOptionalFields ?? false,
|
|
114
|
+
});
|
|
112
115
|
}
|
|
113
116
|
case NodeKind.Array:
|
|
114
117
|
return factory.arrayAlpha(id, generateAllowedTypes(schema.simpleAllowedTypes, context), {
|