@fluidframework/tree 2.70.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 +84 -40
- package/api-report/tree.alpha.api.md +52 -22
- package/api-report/tree.beta.api.md +45 -0
- package/api-report/tree.legacy.beta.api.md +45 -0
- package/dist/alpha.d.ts +12 -7
- package/dist/api.js +1 -1
- package/dist/api.js.map +1 -1
- package/dist/beta.d.ts +8 -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/codec/discriminatedUnions.d.ts +1 -1
- package/dist/codec/discriminatedUnions.js +1 -1
- package/dist/codec/discriminatedUnions.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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +8 -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 +75 -6
- package/dist/shared-tree/independentView.d.ts.map +1 -1
- package/dist/shared-tree/independentView.js +116 -43
- package/dist/shared-tree/independentView.js.map +1 -1
- package/dist/shared-tree/index.d.ts +2 -1
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +6 -1
- package/dist/shared-tree/index.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 +105 -130
- 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/schemaFactory.d.ts +2 -2
- package/dist/simple-tree/api/schemaFactory.js +2 -2
- package/dist/simple-tree/api/schemaFactory.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/schemaFactoryRecursive.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactoryRecursive.js +1 -0
- package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFromSimple.js +15 -8
- 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/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +4 -2
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- 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 +17 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js +71 -7
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/core/allowedTypes.d.ts +12 -7
- package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/dist/simple-tree/core/allowedTypes.js +18 -5
- 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/fieldSchema.d.ts +2 -1
- package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
- package/dist/simple-tree/fieldSchema.js +10 -0
- package/dist/simple-tree/fieldSchema.js.map +1 -1
- package/dist/simple-tree/index.d.ts +3 -2
- 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.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.js +7 -1
- package/dist/simple-tree/node-kinds/array/arrayNode.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 +7 -1
- package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts +17 -0
- package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/object/objectNode.js +21 -8
- 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 +8 -2
- package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +16 -0
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/dist/simple-tree/simpleSchema.d.ts +30 -6
- 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/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/dist/simple-tree/toStoredSchema.js +6 -3
- package/dist/simple-tree/toStoredSchema.js.map +1 -1
- 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/dist/util/referenceCounting.d.ts.map +1 -1
- package/dist/util/referenceCounting.js +1 -0
- package/dist/util/referenceCounting.js.map +1 -1
- package/lib/alpha.d.ts +12 -7
- package/lib/api.js +2 -2
- package/lib/api.js.map +1 -1
- package/lib/beta.d.ts +8 -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/codec/discriminatedUnions.d.ts +1 -1
- package/lib/codec/discriminatedUnions.js +1 -1
- package/lib/codec/discriminatedUnions.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 +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +8 -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 +75 -6
- package/lib/shared-tree/independentView.d.ts.map +1 -1
- package/lib/shared-tree/independentView.js +111 -39
- package/lib/shared-tree/independentView.js.map +1 -1
- package/lib/shared-tree/index.d.ts +2 -1
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +2 -1
- package/lib/shared-tree/index.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 +108 -133
- 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/schemaFactory.d.ts +2 -2
- package/lib/simple-tree/api/schemaFactory.js +2 -2
- package/lib/simple-tree/api/schemaFactory.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/schemaFactoryRecursive.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactoryRecursive.js +1 -0
- package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFromSimple.js +15 -8
- 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/simpleSchemaToJsonSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +4 -2
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
- 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 +17 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js +69 -7
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -1
- package/lib/simple-tree/core/allowedTypes.d.ts +12 -7
- package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
- package/lib/simple-tree/core/allowedTypes.js +19 -6
- 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/fieldSchema.d.ts +2 -1
- package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
- package/lib/simple-tree/fieldSchema.js +10 -0
- package/lib/simple-tree/fieldSchema.js.map +1 -1
- package/lib/simple-tree/index.d.ts +3 -2
- 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.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/array/arrayNode.js +9 -3
- package/lib/simple-tree/node-kinds/array/arrayNode.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 +9 -3
- package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts +17 -0
- package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/object/objectNode.js +22 -9
- 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 +10 -4
- package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +16 -0
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
- package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
- package/lib/simple-tree/simpleSchema.d.ts +30 -6
- 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/simple-tree/toStoredSchema.d.ts.map +1 -1
- package/lib/simple-tree/toStoredSchema.js +6 -3
- package/lib/simple-tree/toStoredSchema.js.map +1 -1
- 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/lib/util/referenceCounting.d.ts.map +1 -1
- package/lib/util/referenceCounting.js +1 -0
- package/lib/util/referenceCounting.js.map +1 -1
- package/package.json +26 -26
- package/src/api.ts +2 -2
- package/src/codec/codec.ts +17 -3
- package/src/codec/discriminatedUnions.ts +1 -1
- 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 +6 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/independentView.ts +161 -75
- package/src/shared-tree/index.ts +4 -0
- package/src/shared-tree/sharedTree.ts +137 -175
- 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/schemaFactory.ts +2 -2
- package/src/simple-tree/api/schemaFactoryAlpha.ts +2 -168
- package/src/simple-tree/api/schemaFactoryBeta.ts +180 -14
- package/src/simple-tree/api/schemaFactoryRecursive.ts +2 -0
- package/src/simple-tree/api/schemaFromSimple.ts +23 -17
- package/src/simple-tree/api/simpleSchemaCodec.ts +360 -0
- package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +8 -2
- 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 +76 -7
- package/src/simple-tree/core/allowedTypes.ts +29 -16
- package/src/simple-tree/core/treeNode.ts +2 -2
- package/src/simple-tree/fieldSchema.ts +14 -1
- package/src/simple-tree/index.ts +6 -1
- package/src/simple-tree/node-kinds/array/arrayNode.ts +11 -2
- package/src/simple-tree/node-kinds/map/mapNode.ts +11 -2
- package/src/simple-tree/node-kinds/object/objectNode.ts +57 -21
- package/src/simple-tree/node-kinds/record/recordNode.ts +12 -3
- package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +16 -0
- package/src/simple-tree/simpleSchema.ts +32 -6
- package/src/simple-tree/simpleSchemaFormatV1.ts +179 -0
- package/src/simple-tree/toStoredSchema.ts +12 -3
- 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
- package/src/util/referenceCounting.ts +1 -0
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
type CodecTree,
|
|
11
|
+
type CodecWriteOptions,
|
|
10
12
|
type ICodecFamily,
|
|
11
|
-
type ICodecOptions,
|
|
12
13
|
type IJsonCodec,
|
|
13
14
|
makeCodecFamily,
|
|
14
15
|
makeVersionDispatchingCodec,
|
|
@@ -18,32 +19,31 @@ import { getCodecTreeForSchemaFormat, makeSchemaCodec } from "../schema-index/in
|
|
|
18
19
|
|
|
19
20
|
import { EncodedSchemaChange } from "./schemaChangeFormat.js";
|
|
20
21
|
import type { SchemaChange } from "./schemaChangeTypes.js";
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
22
|
+
import { SchemaFormatVersion } from "../../core/index.js";
|
|
23
|
+
import { brand } from "../../util/index.js";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Create a family of schema change codecs.
|
|
26
27
|
* @param options - Specifies common codec options, including which `validator` to use.
|
|
27
28
|
* @returns The composed codec family.
|
|
28
29
|
*/
|
|
29
|
-
export function makeSchemaChangeCodecs(
|
|
30
|
+
export function makeSchemaChangeCodecs(
|
|
31
|
+
options: CodecWriteOptions,
|
|
32
|
+
): ICodecFamily<SchemaChange> {
|
|
30
33
|
return makeCodecFamily([
|
|
31
|
-
[
|
|
32
|
-
[
|
|
34
|
+
[SchemaFormatVersion.v1, makeSchemaChangeCodecV1(options, brand(SchemaFormatVersion.v1))],
|
|
35
|
+
[SchemaFormatVersion.v2, makeSchemaChangeCodecV1(options, brand(SchemaFormatVersion.v2))],
|
|
33
36
|
]);
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
export type SchemaChangeFormatVersion = Brand<
|
|
37
|
-
SchemaVersion.v1 | SchemaVersion.v2,
|
|
38
|
-
"SchemaChangeFormatVersion"
|
|
39
|
-
>;
|
|
40
39
|
export function getCodecTreeForSchemaChangeFormat(
|
|
41
|
-
version:
|
|
40
|
+
version: SchemaFormatVersion,
|
|
41
|
+
clientVersion: MinimumVersionForCollab,
|
|
42
42
|
): CodecTree {
|
|
43
43
|
return {
|
|
44
44
|
name: "SchemaChange",
|
|
45
45
|
version,
|
|
46
|
-
children: [getCodecTreeForSchemaFormat(
|
|
46
|
+
children: [getCodecTreeForSchemaFormat(clientVersion)],
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -54,8 +54,8 @@ export function getCodecTreeForSchemaChangeFormat(
|
|
|
54
54
|
* @returns The composed codec.
|
|
55
55
|
*/
|
|
56
56
|
export function makeSchemaChangeCodec(
|
|
57
|
-
options:
|
|
58
|
-
writeVersion:
|
|
57
|
+
options: CodecWriteOptions,
|
|
58
|
+
writeVersion: SchemaFormatVersion,
|
|
59
59
|
): IJsonCodec<SchemaChange> {
|
|
60
60
|
const family = makeSchemaChangeCodecs(options);
|
|
61
61
|
return makeVersionDispatchingCodec(family, { ...options, writeVersion });
|
|
@@ -68,8 +68,8 @@ export function makeSchemaChangeCodec(
|
|
|
68
68
|
* @returns The composed schema change codec.
|
|
69
69
|
*/
|
|
70
70
|
function makeSchemaChangeCodecV1(
|
|
71
|
-
options:
|
|
72
|
-
schemaWriteVersion:
|
|
71
|
+
options: CodecWriteOptions,
|
|
72
|
+
schemaWriteVersion: SchemaFormatVersion,
|
|
73
73
|
): IJsonCodec<SchemaChange, EncodedSchemaChange> {
|
|
74
74
|
const schemaCodec = makeSchemaCodec(options, schemaWriteVersion);
|
|
75
75
|
const schemaChangeCodec: IJsonCodec<SchemaChange, EncodedSchemaChange> = {
|
|
@@ -7,6 +7,8 @@ import { fail, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
type CodecTree,
|
|
10
|
+
type CodecWriteOptions,
|
|
11
|
+
FluidClientVersion,
|
|
10
12
|
type ICodecFamily,
|
|
11
13
|
type ICodecOptions,
|
|
12
14
|
type IJsonCodec,
|
|
@@ -15,7 +17,7 @@ import {
|
|
|
15
17
|
makeVersionedValidatedCodec,
|
|
16
18
|
} from "../../codec/index.js";
|
|
17
19
|
import {
|
|
18
|
-
|
|
20
|
+
SchemaFormatVersion,
|
|
19
21
|
type TreeNodeSchemaIdentifier,
|
|
20
22
|
type TreeNodeStoredSchema,
|
|
21
23
|
type TreeStoredSchema,
|
|
@@ -31,35 +33,42 @@ import { Format as FormatV2 } from "./formatV2.js";
|
|
|
31
33
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
32
34
|
|
|
33
35
|
/**
|
|
34
|
-
* Convert a MinimumVersionForCollab to a
|
|
36
|
+
* Convert a MinimumVersionForCollab to a SchemaFormatVersion.
|
|
35
37
|
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
36
|
-
* @returns The
|
|
38
|
+
* @returns The SchemaFormatVersion that corresponds to the provided MinimumVersionForCollab.
|
|
37
39
|
*/
|
|
38
40
|
export function clientVersionToSchemaVersion(
|
|
39
41
|
clientVersion: MinimumVersionForCollab,
|
|
40
|
-
):
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
): SchemaFormatVersion {
|
|
43
|
+
return clientVersion < FluidClientVersion.v2_43
|
|
44
|
+
? brand(SchemaFormatVersion.v1)
|
|
45
|
+
: brand(SchemaFormatVersion.v2);
|
|
43
46
|
}
|
|
44
47
|
|
|
45
|
-
export function getCodecTreeForSchemaFormat(
|
|
46
|
-
|
|
48
|
+
export function getCodecTreeForSchemaFormat(
|
|
49
|
+
clientVersion: MinimumVersionForCollab,
|
|
50
|
+
): CodecTree {
|
|
51
|
+
return { name: "Schema", version: clientVersionToSchemaVersion(clientVersion) };
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
/**
|
|
50
55
|
* Create a schema codec.
|
|
51
|
-
* @param options - Specifies common codec options, including which `validator` to use.
|
|
52
|
-
* @param
|
|
56
|
+
* @param options - Specifies common codec options, including `minVersionForCollab` and which `validator` to use.
|
|
57
|
+
* @param writeVersionOverride - The schema version to write. If not provided, the version will be derived from `minVersionForCollab`.
|
|
53
58
|
* @returns The composed codec.
|
|
54
59
|
*
|
|
55
60
|
* @privateRemarks We should consider using the Shared Tree format version instead as it may be more valuable for application authors than the schema version.
|
|
56
61
|
*/
|
|
57
62
|
export function makeSchemaCodec(
|
|
58
|
-
options:
|
|
59
|
-
|
|
63
|
+
options: CodecWriteOptions,
|
|
64
|
+
writeVersionOverride?: SchemaFormatVersion,
|
|
60
65
|
): IJsonCodec<TreeStoredSchema> {
|
|
61
66
|
const family = makeSchemaCodecs(options);
|
|
62
|
-
return makeVersionDispatchingCodec(family, {
|
|
67
|
+
return makeVersionDispatchingCodec(family, {
|
|
68
|
+
...options,
|
|
69
|
+
writeVersion:
|
|
70
|
+
writeVersionOverride ?? clientVersionToSchemaVersion(options.minVersionForCollab),
|
|
71
|
+
});
|
|
63
72
|
}
|
|
64
73
|
|
|
65
74
|
/**
|
|
@@ -69,8 +78,8 @@ export function makeSchemaCodec(
|
|
|
69
78
|
*/
|
|
70
79
|
export function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<TreeStoredSchema> {
|
|
71
80
|
return makeCodecFamily([
|
|
72
|
-
[
|
|
73
|
-
[
|
|
81
|
+
[SchemaFormatVersion.v1, makeSchemaCodecV1(options)],
|
|
82
|
+
[SchemaFormatVersion.v2, makeSchemaCodecV2(options)],
|
|
74
83
|
]);
|
|
75
84
|
}
|
|
76
85
|
|
|
@@ -80,11 +89,14 @@ export function makeSchemaCodecs(options: ICodecOptions): ICodecFamily<TreeStore
|
|
|
80
89
|
* @param version - The schema write version.
|
|
81
90
|
* @returns The encoded schema.
|
|
82
91
|
*/
|
|
83
|
-
export function encodeRepo(
|
|
92
|
+
export function encodeRepo(
|
|
93
|
+
repo: TreeStoredSchema,
|
|
94
|
+
version: SchemaFormatVersion,
|
|
95
|
+
): JsonCompatible {
|
|
84
96
|
switch (version) {
|
|
85
|
-
case
|
|
97
|
+
case SchemaFormatVersion.v1:
|
|
86
98
|
return encodeRepoV1(repo) as JsonCompatible;
|
|
87
|
-
case
|
|
99
|
+
case SchemaFormatVersion.v2:
|
|
88
100
|
return encodeRepoV2(repo) as JsonCompatible;
|
|
89
101
|
default:
|
|
90
102
|
unreachableCase(version);
|
|
@@ -95,7 +107,7 @@ function encodeRepoV1(repo: TreeStoredSchema): FormatV1 {
|
|
|
95
107
|
const nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV1());
|
|
96
108
|
const rootFieldSchema = encodeFieldSchemaV1(repo.rootFieldSchema);
|
|
97
109
|
return {
|
|
98
|
-
version:
|
|
110
|
+
version: SchemaFormatVersion.v1,
|
|
99
111
|
nodes: nodeSchema,
|
|
100
112
|
root: rootFieldSchema,
|
|
101
113
|
};
|
|
@@ -105,7 +117,7 @@ function encodeRepoV2(repo: TreeStoredSchema): FormatV2 {
|
|
|
105
117
|
const nodeSchema = encodeNodeSchema(repo, (schema) => schema.encodeV2());
|
|
106
118
|
const rootFieldSchema = encodeFieldSchemaV2(repo.rootFieldSchema);
|
|
107
119
|
return {
|
|
108
|
-
version:
|
|
120
|
+
version: SchemaFormatVersion.v2,
|
|
109
121
|
nodes: nodeSchema,
|
|
110
122
|
root: rootFieldSchema,
|
|
111
123
|
};
|
|
@@ -169,7 +181,7 @@ function decodeV2(f: FormatV2): TreeStoredSchema {
|
|
|
169
181
|
* @returns The codec.
|
|
170
182
|
*/
|
|
171
183
|
function makeSchemaCodecV1(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV1> {
|
|
172
|
-
return makeVersionedValidatedCodec(options, new Set([
|
|
184
|
+
return makeVersionedValidatedCodec(options, new Set([SchemaFormatVersion.v1]), FormatV1, {
|
|
173
185
|
encode: (data: TreeStoredSchema) => encodeRepoV1(data),
|
|
174
186
|
decode: (data: FormatV1) => decodeV1(data),
|
|
175
187
|
});
|
|
@@ -181,7 +193,7 @@ function makeSchemaCodecV1(options: ICodecOptions): IJsonCodec<TreeStoredSchema,
|
|
|
181
193
|
* @returns The codec.
|
|
182
194
|
*/
|
|
183
195
|
function makeSchemaCodecV2(options: ICodecOptions): IJsonCodec<TreeStoredSchema, FormatV2> {
|
|
184
|
-
return makeVersionedValidatedCodec(options, new Set([
|
|
196
|
+
return makeVersionedValidatedCodec(options, new Set([SchemaFormatVersion.v2]), FormatV2, {
|
|
185
197
|
encode: (data: TreeStoredSchema) => encodeRepoV2(data),
|
|
186
198
|
decode: (data: FormatV2) => decodeV2(data),
|
|
187
199
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { type ObjectOptions, type Static, Type } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { SchemaFormatVersion, schemaFormatV1 } from "../../core/index.js";
|
|
9
9
|
|
|
10
10
|
const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
|
21
21
|
*/
|
|
22
22
|
export const Format = Type.Object(
|
|
23
23
|
{
|
|
24
|
-
version: Type.Literal(
|
|
24
|
+
version: Type.Literal(SchemaFormatVersion.v1),
|
|
25
25
|
nodes: Type.Record(Type.String(), schemaFormatV1.TreeNodeSchemaDataFormat),
|
|
26
26
|
root: schemaFormatV1.FieldSchemaFormat,
|
|
27
27
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { type ObjectOptions, type Static, Type } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { SchemaFormatVersion, schemaFormatV2 } from "../../core/index.js";
|
|
9
9
|
|
|
10
10
|
const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ const noAdditionalProps: ObjectOptions = { additionalProperties: false };
|
|
|
21
21
|
*/
|
|
22
22
|
export const Format = Type.Object(
|
|
23
23
|
{
|
|
24
|
-
version: Type.Literal(
|
|
24
|
+
version: Type.Literal(SchemaFormatVersion.v2),
|
|
25
25
|
nodes: Type.Record(Type.String(), schemaFormatV2.TreeNodeSchemaDataFormat),
|
|
26
26
|
root: schemaFormatV2.FieldSchemaFormat,
|
|
27
27
|
},
|
|
@@ -17,6 +17,7 @@ import { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal";
|
|
|
17
17
|
import type { IJsonCodec } from "../../codec/index.js";
|
|
18
18
|
import {
|
|
19
19
|
type MutableTreeStoredSchema,
|
|
20
|
+
type SchemaFormatVersion,
|
|
20
21
|
type TreeStoredSchema,
|
|
21
22
|
schemaDataIsEmpty,
|
|
22
23
|
} from "../../core/index.js";
|
|
@@ -108,7 +109,7 @@ export class SchemaSummarizer implements Summarizable {
|
|
|
108
109
|
*/
|
|
109
110
|
export function encodeTreeSchema(
|
|
110
111
|
schema: TreeStoredSchema,
|
|
111
|
-
writeVersion:
|
|
112
|
+
writeVersion: SchemaFormatVersion,
|
|
112
113
|
): JsonCompatible {
|
|
113
114
|
return encodeRepo(schema, writeVersion);
|
|
114
115
|
}
|
package/src/index.ts
CHANGED
|
@@ -73,6 +73,8 @@ export {
|
|
|
73
73
|
type ObservationResults,
|
|
74
74
|
type TreeIdentifierUtils,
|
|
75
75
|
independentView,
|
|
76
|
+
createIndependentTreeBeta,
|
|
77
|
+
createIndependentTreeAlpha,
|
|
76
78
|
ForestTypeOptimized,
|
|
77
79
|
ForestTypeExpensiveDebug,
|
|
78
80
|
ForestTypeReference,
|
|
@@ -93,6 +95,7 @@ export {
|
|
|
93
95
|
type TreeViewEvents,
|
|
94
96
|
SchemaFactory,
|
|
95
97
|
SchemaFactoryBeta,
|
|
98
|
+
type SchemaStaticsBeta,
|
|
96
99
|
SchemaFactoryAlpha,
|
|
97
100
|
type ObjectSchemaOptionsAlpha,
|
|
98
101
|
type ObjectSchemaOptions,
|
|
@@ -179,7 +182,6 @@ export {
|
|
|
179
182
|
type AllowedTypeMetadata,
|
|
180
183
|
type AllowedTypesMetadata,
|
|
181
184
|
type UnannotateAllowedTypesList,
|
|
182
|
-
type SchemaStaticsAlpha,
|
|
183
185
|
type AnnotateAllowedTypesList,
|
|
184
186
|
type AllowedTypesFull,
|
|
185
187
|
type AllowedTypesFullFromMixed,
|
|
@@ -280,6 +282,9 @@ export {
|
|
|
280
282
|
type TreeParsingOptions,
|
|
281
283
|
type SchemaFactory_base,
|
|
282
284
|
type NumberKeys,
|
|
285
|
+
type SimpleAllowedTypeAttributes,
|
|
286
|
+
encodeSimpleSchema,
|
|
287
|
+
decodeSimpleSchema,
|
|
283
288
|
} from "./simple-tree/index.js";
|
|
284
289
|
export {
|
|
285
290
|
SharedTree,
|
package/src/packageVersion.ts
CHANGED
|
@@ -10,13 +10,15 @@ import {
|
|
|
10
10
|
createIdCompressor,
|
|
11
11
|
} from "@fluidframework/id-compressor/internal";
|
|
12
12
|
|
|
13
|
-
import type { ICodecOptions } from "../codec/index.js";
|
|
14
13
|
import {
|
|
15
|
-
|
|
14
|
+
FluidClientVersion,
|
|
15
|
+
type CodecWriteOptions,
|
|
16
|
+
type ICodecOptions,
|
|
17
|
+
} from "../codec/index.js";
|
|
18
|
+
import {
|
|
16
19
|
type RevisionTag,
|
|
17
20
|
RevisionTagCodec,
|
|
18
|
-
|
|
19
|
-
type TreeStoredSchema,
|
|
21
|
+
SchemaFormatVersion,
|
|
20
22
|
TreeStoredSchemaRepository,
|
|
21
23
|
} from "../core/index.js";
|
|
22
24
|
import {
|
|
@@ -28,17 +30,30 @@ import {
|
|
|
28
30
|
TreeCompressionStrategy,
|
|
29
31
|
defaultIncrementalEncodingPolicy,
|
|
30
32
|
} from "../feature-libraries/index.js";
|
|
31
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
33
|
+
// eslint-disable-next-line import-x/no-internal-modules
|
|
32
34
|
import type { Format } from "../feature-libraries/schema-index/formatV1.js";
|
|
33
35
|
import type {
|
|
34
36
|
TreeViewConfiguration,
|
|
35
37
|
ImplicitFieldSchema,
|
|
36
38
|
TreeViewAlpha,
|
|
39
|
+
ITreeAlpha,
|
|
40
|
+
ViewableTree,
|
|
41
|
+
TreeView,
|
|
42
|
+
ReadSchema,
|
|
43
|
+
VerboseTree,
|
|
44
|
+
SimpleTreeSchema,
|
|
37
45
|
} from "../simple-tree/index.js";
|
|
38
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
type JsonCompatibleReadOnly,
|
|
48
|
+
type JsonCompatible,
|
|
49
|
+
Breakable,
|
|
50
|
+
oneFromIterable,
|
|
51
|
+
brand,
|
|
52
|
+
} from "../util/index.js";
|
|
39
53
|
import {
|
|
40
54
|
buildConfiguredForest,
|
|
41
55
|
defaultSharedTreeOptions,
|
|
56
|
+
exportSimpleSchema,
|
|
42
57
|
type ForestOptions,
|
|
43
58
|
} from "./sharedTree.js";
|
|
44
59
|
import { createTreeCheckout } from "./treeCheckout.js";
|
|
@@ -59,30 +74,9 @@ export function independentView<const TSchema extends ImplicitFieldSchema>(
|
|
|
59
74
|
config: TreeViewConfiguration<TSchema>,
|
|
60
75
|
options: ForestOptions & { idCompressor?: IIdCompressor | undefined },
|
|
61
76
|
): TreeViewAlpha<TSchema> {
|
|
62
|
-
|
|
63
|
-
const idCompressor: IIdCompressor = options.idCompressor ?? createIdCompressor();
|
|
64
|
-
const mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();
|
|
65
|
-
const revisionTagCodec = new RevisionTagCodec(idCompressor);
|
|
66
|
-
const schema = new TreeStoredSchemaRepository();
|
|
67
|
-
const forest = buildConfiguredForest(
|
|
68
|
-
breaker,
|
|
69
|
-
options.forest ?? defaultSharedTreeOptions.forest,
|
|
70
|
-
schema,
|
|
71
|
-
idCompressor,
|
|
72
|
-
defaultIncrementalEncodingPolicy,
|
|
73
|
-
);
|
|
74
|
-
const checkout = createTreeCheckout(idCompressor, mintRevisionTag, revisionTagCodec, {
|
|
75
|
-
forest,
|
|
76
|
-
schema,
|
|
77
|
-
breaker,
|
|
78
|
-
});
|
|
79
|
-
const out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(
|
|
80
|
-
checkout,
|
|
81
|
-
config,
|
|
82
|
-
createNodeIdentifierManager(idCompressor),
|
|
83
|
-
);
|
|
84
|
-
return out;
|
|
77
|
+
return createIndependentTreeAlpha(options).viewWith(config) as TreeViewAlpha<TSchema>;
|
|
85
78
|
}
|
|
79
|
+
|
|
86
80
|
/**
|
|
87
81
|
* Create an initialized {@link TreeView} that is not tied to any {@link ITree} instance.
|
|
88
82
|
*
|
|
@@ -99,52 +93,101 @@ export function independentInitializedView<const TSchema extends ImplicitFieldSc
|
|
|
99
93
|
options: ForestOptions & ICodecOptions,
|
|
100
94
|
content: ViewContent,
|
|
101
95
|
): TreeViewAlpha<TSchema> {
|
|
102
|
-
|
|
103
|
-
const fieldBatchCodec = makeFieldBatchCodec(options, 1);
|
|
104
|
-
const schemaCodec = makeSchemaCodec(options, SchemaVersion.v1);
|
|
105
|
-
|
|
106
|
-
const schema = schemaCodec.decode(content.schema as Format);
|
|
107
|
-
const context: FieldBatchEncodingContext = {
|
|
108
|
-
encodeType: TreeCompressionStrategy.Compressed,
|
|
109
|
-
idCompressor,
|
|
110
|
-
originatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?
|
|
111
|
-
schema: { schema, policy: defaultSchemaPolicy },
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const fieldCursors = fieldBatchCodec.decode(content.tree as JsonCompatibleReadOnly, context);
|
|
115
|
-
assert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);
|
|
116
|
-
|
|
117
|
-
return independentInitializedViewInternal(
|
|
96
|
+
return createIndependentTreeAlpha({ ...options, content }).viewWith(
|
|
118
97
|
config,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
98
|
+
) as TreeViewAlpha<TSchema>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Create a {@link ViewableTree} that is not tied to any Fluid runtimes or services.
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* Such a tree can never experience collaboration or be persisted to to a Fluid Container.
|
|
106
|
+
*
|
|
107
|
+
* This can be useful for testing, as well as use-cases like working on local files instead of documents stored in some Fluid service.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const tree = createIndependentTreeBeta();
|
|
112
|
+
*
|
|
113
|
+
* const stagedConfig = new TreeViewConfiguration({
|
|
114
|
+
* schema: SchemaFactoryAlpha.types([
|
|
115
|
+
* SchemaFactory.number,
|
|
116
|
+
* SchemaFactoryAlpha.staged(SchemaFactory.string),
|
|
117
|
+
* ]),
|
|
118
|
+
* });
|
|
119
|
+
* const afterConfig = new TreeViewConfigurationAlpha({
|
|
120
|
+
* schema: [SchemaFactory.number, SchemaFactory.string],
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* // Initialize tree
|
|
124
|
+
* {
|
|
125
|
+
* const view = tree.viewWith(stagedConfig);
|
|
126
|
+
* view.initialize(1);
|
|
127
|
+
* view.dispose();
|
|
128
|
+
* }
|
|
129
|
+
*
|
|
130
|
+
* // Do schema upgrade
|
|
131
|
+
* {
|
|
132
|
+
* const view = tree.viewWith(afterConfig);
|
|
133
|
+
* view.upgradeSchema();
|
|
134
|
+
* view.root = "A";
|
|
135
|
+
* view.dispose();
|
|
136
|
+
* }
|
|
137
|
+
*
|
|
138
|
+
* // Can still view tree with staged schema
|
|
139
|
+
* {
|
|
140
|
+
* const view = tree.viewWith(stagedConfig);
|
|
141
|
+
* assert.equal(view.root, "A");
|
|
142
|
+
* view.dispose();
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
* @privateRemarks
|
|
146
|
+
* Before stabilizing this as public, consider if we can instead just expose a better way to create regular Fluid service based SharedTrees for tests.
|
|
147
|
+
* Something like https://github.com/microsoft/FluidFramework/pull/25422 might be a better long term stable/public solution.
|
|
148
|
+
* @beta
|
|
149
|
+
*/
|
|
150
|
+
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(
|
|
151
|
+
options?: ForestOptions,
|
|
152
|
+
): ViewableTree {
|
|
153
|
+
return createIndependentTreeAlpha<TSchema>(options);
|
|
126
154
|
}
|
|
127
155
|
|
|
128
156
|
/**
|
|
129
|
-
* {@link
|
|
157
|
+
* Alpha extensions to {@link createIndependentTreeBeta}.
|
|
158
|
+
*
|
|
159
|
+
* @param options - Configuration options for the independent tree.
|
|
160
|
+
* This can be used to create an uninitialized tree, or `content` can be provided to create an initialized tree.
|
|
161
|
+
* If content is provided, the idCompressor is a required part of it: otherwise it is optional and provided at the top level.
|
|
162
|
+
*
|
|
163
|
+
* @privateRemarks
|
|
164
|
+
* TODO: Support more of {@link ITreeAlpha}, including branching APIs to allow for merges.
|
|
165
|
+
* TODO: Better unify this logic with SharedTreeKernel and SharedTreeCore.
|
|
166
|
+
*
|
|
167
|
+
* Before further stabilizing: consider better ways to handle initialized vs uninitialized trees.
|
|
168
|
+
* Perhaps it would be better to not allow initialize here at all, but expose the ability to load compressed tree content and stored schema via ITree or TreeView?
|
|
169
|
+
* If keeping the option here, maybe a separate function of overload would be better? Or maybe flatten ViewContent inline to deduplicate the idCompressor options?
|
|
170
|
+
* @alpha
|
|
130
171
|
*/
|
|
131
|
-
export function
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
):
|
|
138
|
-
const breaker = new Breakable("
|
|
139
|
-
const
|
|
172
|
+
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(
|
|
173
|
+
options?: ForestOptions &
|
|
174
|
+
(
|
|
175
|
+
| ({ idCompressor?: IIdCompressor | undefined } & { content?: undefined })
|
|
176
|
+
| (ICodecOptions & { content: ViewContent } & { idCompressor?: undefined })
|
|
177
|
+
),
|
|
178
|
+
): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema"> {
|
|
179
|
+
const breaker = new Breakable("independentView");
|
|
180
|
+
const idCompressor: IIdCompressor =
|
|
181
|
+
options?.idCompressor ?? options?.content?.idCompressor ?? createIdCompressor();
|
|
140
182
|
const mintRevisionTag = (): RevisionTag => idCompressor.generateCompressedId();
|
|
183
|
+
const revisionTagCodec = new RevisionTagCodec(idCompressor);
|
|
141
184
|
|
|
142
185
|
// To ensure the forest is in schema when constructed, start it with an empty schema and set the schema repository content later.
|
|
143
186
|
const schemaRepository = new TreeStoredSchemaRepository();
|
|
144
187
|
|
|
145
188
|
const forest = buildConfiguredForest(
|
|
146
189
|
breaker,
|
|
147
|
-
options
|
|
190
|
+
options?.forest ?? defaultSharedTreeOptions.forest,
|
|
148
191
|
schemaRepository,
|
|
149
192
|
idCompressor,
|
|
150
193
|
defaultIncrementalEncodingPolicy,
|
|
@@ -156,18 +199,61 @@ export function independentInitializedViewInternal<const TSchema extends Implici
|
|
|
156
199
|
breaker,
|
|
157
200
|
});
|
|
158
201
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
202
|
+
if (options?.content !== undefined) {
|
|
203
|
+
// Any version can be passed down to `makeSchemaCodec` and `makeFieldBatchCodec` here.
|
|
204
|
+
// We only use the decode part, which always dispatches to the correct codec based on the version in the data, not `minVersionForCollab`.
|
|
205
|
+
const writeOptions: CodecWriteOptions = {
|
|
206
|
+
...options,
|
|
207
|
+
minVersionForCollab: FluidClientVersion.v2_0,
|
|
208
|
+
};
|
|
209
|
+
const schemaCodec = makeSchemaCodec(writeOptions, brand(SchemaFormatVersion.v1));
|
|
210
|
+
const fieldBatchCodec = makeFieldBatchCodec(writeOptions);
|
|
211
|
+
const newSchema = schemaCodec.decode(options.content.schema as Format);
|
|
212
|
+
|
|
213
|
+
const context: FieldBatchEncodingContext = {
|
|
214
|
+
encodeType: TreeCompressionStrategy.Compressed,
|
|
215
|
+
idCompressor,
|
|
216
|
+
originatorId: idCompressor.localSessionId, // Is this right? If so, why is is needed?
|
|
217
|
+
schema: { schema: newSchema, policy: defaultSchemaPolicy },
|
|
218
|
+
};
|
|
219
|
+
const fieldCursors = fieldBatchCodec.decode(
|
|
220
|
+
options.content.tree as JsonCompatibleReadOnly,
|
|
221
|
+
context,
|
|
222
|
+
);
|
|
223
|
+
assert(fieldCursors.length === 1, 0xa5b /* must have exactly 1 field in batch */);
|
|
224
|
+
|
|
225
|
+
const fieldCursor = oneFromIterable(fieldCursors);
|
|
226
|
+
assert(fieldCursor !== undefined, 0xc94 /* expected exactly one field in batch */);
|
|
227
|
+
|
|
228
|
+
initialize(
|
|
229
|
+
checkout,
|
|
230
|
+
newSchema,
|
|
231
|
+
initializerFromChunk(checkout, () =>
|
|
232
|
+
combineChunks(checkout.forest.chunkField(fieldCursor)),
|
|
233
|
+
),
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return {
|
|
238
|
+
viewWith<TRoot extends ImplicitFieldSchema>(
|
|
239
|
+
config: TreeViewConfiguration<TRoot>,
|
|
240
|
+
): TreeView<TRoot> {
|
|
241
|
+
const out: TreeViewAlpha<TSchema> = new SchematizingSimpleTreeView<TSchema>(
|
|
242
|
+
checkout,
|
|
243
|
+
config as TreeViewConfiguration as TreeViewConfiguration<ReadSchema<TSchema>>,
|
|
244
|
+
createNodeIdentifierManager(idCompressor),
|
|
245
|
+
);
|
|
246
|
+
return out as unknown as TreeView<TRoot>;
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
exportVerbose(): VerboseTree | undefined {
|
|
250
|
+
return checkout.exportVerbose();
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
exportSimpleSchema(): SimpleTreeSchema {
|
|
254
|
+
return exportSimpleSchema(checkout.storedSchema);
|
|
255
|
+
},
|
|
256
|
+
};
|
|
171
257
|
}
|
|
172
258
|
|
|
173
259
|
/**
|
package/src/shared-tree/index.ts
CHANGED
|
@@ -39,6 +39,8 @@ export {
|
|
|
39
39
|
|
|
40
40
|
export { SchematizingSimpleTreeView } from "./schematizingTreeView.js";
|
|
41
41
|
|
|
42
|
+
export { initialize, initializerFromChunk } from "./schematizeTree.js";
|
|
43
|
+
|
|
42
44
|
export type {
|
|
43
45
|
ISharedTreeEditor,
|
|
44
46
|
ISchemaEditor,
|
|
@@ -58,6 +60,8 @@ export {
|
|
|
58
60
|
independentInitializedView,
|
|
59
61
|
type ViewContent,
|
|
60
62
|
independentView,
|
|
63
|
+
createIndependentTreeBeta,
|
|
64
|
+
createIndependentTreeAlpha,
|
|
61
65
|
} from "./independentView.js";
|
|
62
66
|
|
|
63
67
|
export type { SharedTreeChange } from "./sharedTreeChangeTypes.js";
|