@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
|
@@ -14,9 +14,11 @@ import {
|
|
|
14
14
|
RevisionTagSchema,
|
|
15
15
|
} from "../rebase/index.js";
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import type { FormatV1 } from "./detachedFieldIndexFormatV1.js";
|
|
18
18
|
import type { DetachedFieldSummaryData, Major } from "./detachedFieldIndexTypes.js";
|
|
19
19
|
import { makeDetachedFieldIndexCodecFromMajorCodec } from "./detachedFieldIndexCodecCommon.js";
|
|
20
|
+
import { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
21
|
+
import { brand } from "../../util/index.js";
|
|
20
22
|
|
|
21
23
|
class MajorCodec implements IJsonCodec<Major, EncodedRevisionTag> {
|
|
22
24
|
public constructor(
|
|
@@ -74,7 +76,7 @@ export function makeDetachedNodeToFieldCodecV1(
|
|
|
74
76
|
return makeDetachedFieldIndexCodecFromMajorCodec(
|
|
75
77
|
options,
|
|
76
78
|
majorCodec,
|
|
77
|
-
|
|
79
|
+
brand(DetachedFieldIndexFormatVersion.v1),
|
|
78
80
|
RevisionTagSchema,
|
|
79
81
|
);
|
|
80
82
|
}
|
|
@@ -9,14 +9,12 @@ import type { IIdCompressor, StableId } from "@fluidframework/id-compressor";
|
|
|
9
9
|
import type { ICodecOptions, IJsonCodec } from "../../codec/index.js";
|
|
10
10
|
import type { EncodedRevisionTag, RevisionTagCodec, RevisionTag } from "../rebase/index.js";
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
type FormatV2,
|
|
14
|
-
StableOrFinalRevisionTag,
|
|
15
|
-
version2,
|
|
16
|
-
} from "./detachedFieldIndexFormatV2.js";
|
|
12
|
+
import { type FormatV2, StableOrFinalRevisionTag } from "./detachedFieldIndexFormatV2.js";
|
|
17
13
|
import type { DetachedFieldSummaryData, Major } from "./detachedFieldIndexTypes.js";
|
|
18
14
|
import { makeDetachedFieldIndexCodecFromMajorCodec } from "./detachedFieldIndexCodecCommon.js";
|
|
19
15
|
import { isStableId } from "@fluidframework/id-compressor/internal";
|
|
16
|
+
import { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
17
|
+
import { brand } from "../../util/index.js";
|
|
20
18
|
|
|
21
19
|
class MajorCodec implements IJsonCodec<Major> {
|
|
22
20
|
public constructor(
|
|
@@ -66,7 +64,7 @@ export function makeDetachedNodeToFieldCodecV2(
|
|
|
66
64
|
return makeDetachedFieldIndexCodecFromMajorCodec(
|
|
67
65
|
options,
|
|
68
66
|
majorCodec,
|
|
69
|
-
|
|
67
|
+
brand(DetachedFieldIndexFormatVersion.v2),
|
|
70
68
|
StableOrFinalRevisionTag,
|
|
71
69
|
);
|
|
72
70
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
7
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
type CodecTree,
|
|
@@ -16,12 +17,24 @@ import {
|
|
|
16
17
|
} from "../../codec/index.js";
|
|
17
18
|
import type { RevisionTagCodec } from "../rebase/index.js";
|
|
18
19
|
|
|
19
|
-
import { version1 } from "./detachedFieldIndexFormatV1.js";
|
|
20
|
-
import { version2 } from "./detachedFieldIndexFormatV2.js";
|
|
21
20
|
import { makeDetachedNodeToFieldCodecV1 } from "./detachedFieldIndexCodecV1.js";
|
|
22
21
|
import { makeDetachedNodeToFieldCodecV2 } from "./detachedFieldIndexCodecV2.js";
|
|
23
22
|
import type { DetachedFieldSummaryData } from "./detachedFieldIndexTypes.js";
|
|
24
|
-
import
|
|
23
|
+
import { DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
24
|
+
import { brand } from "../../util/index.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Convert a MinimumVersionForCollab to a version for detached field codecs.
|
|
28
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
29
|
+
* @returns The detached field codec version that corresponds to the provided MinimumVersionForCollab.
|
|
30
|
+
*/
|
|
31
|
+
function clientVersionToDetachedFieldVersion(
|
|
32
|
+
clientVersion: MinimumVersionForCollab,
|
|
33
|
+
): DetachedFieldIndexFormatVersion {
|
|
34
|
+
return clientVersion < FluidClientVersion.v2_52
|
|
35
|
+
? brand(DetachedFieldIndexFormatVersion.v1)
|
|
36
|
+
: brand(DetachedFieldIndexFormatVersion.v2);
|
|
37
|
+
}
|
|
25
38
|
|
|
26
39
|
export function makeDetachedFieldIndexCodec(
|
|
27
40
|
revisionTagCodec: RevisionTagCodec,
|
|
@@ -29,9 +42,10 @@ export function makeDetachedFieldIndexCodec(
|
|
|
29
42
|
idCompressor: IIdCompressor,
|
|
30
43
|
): IJsonCodec<DetachedFieldSummaryData> {
|
|
31
44
|
const family = makeDetachedFieldIndexCodecFamily(revisionTagCodec, options, idCompressor);
|
|
32
|
-
|
|
33
|
-
options
|
|
34
|
-
|
|
45
|
+
return makeVersionDispatchingCodec(family, {
|
|
46
|
+
...options,
|
|
47
|
+
writeVersion: clientVersionToDetachedFieldVersion(options.minVersionForCollab),
|
|
48
|
+
});
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
export function makeDetachedFieldIndexCodecFamily(
|
|
@@ -40,14 +54,22 @@ export function makeDetachedFieldIndexCodecFamily(
|
|
|
40
54
|
idCompressor: IIdCompressor,
|
|
41
55
|
): ICodecFamily<DetachedFieldSummaryData> {
|
|
42
56
|
return makeCodecFamily([
|
|
43
|
-
[
|
|
44
|
-
|
|
57
|
+
[
|
|
58
|
+
DetachedFieldIndexFormatVersion.v1,
|
|
59
|
+
makeDetachedNodeToFieldCodecV1(revisionTagCodec, options, idCompressor),
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
DetachedFieldIndexFormatVersion.v2,
|
|
63
|
+
makeDetachedNodeToFieldCodecV2(revisionTagCodec, options, idCompressor),
|
|
64
|
+
],
|
|
45
65
|
]);
|
|
46
66
|
}
|
|
47
67
|
|
|
48
|
-
export type DetachedFieldIndexFormatVersion = Brand<1 | 2, "DetachedFieldIndexFormatVersion">;
|
|
49
68
|
export function getCodecTreeForDetachedFieldIndexFormat(
|
|
50
|
-
|
|
69
|
+
clientVersion: MinimumVersionForCollab,
|
|
51
70
|
): CodecTree {
|
|
52
|
-
return {
|
|
71
|
+
return {
|
|
72
|
+
name: "DetachedFieldIndex",
|
|
73
|
+
version: clientVersionToDetachedFieldVersion(clientVersion),
|
|
74
|
+
};
|
|
53
75
|
}
|
|
@@ -5,10 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
import { type Static, type TSchema, Type } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import { brandedNumberType } from "../../util/index.js";
|
|
8
|
+
import { brandedNumberType, type Brand } from "../../util/index.js";
|
|
9
9
|
|
|
10
10
|
import type { ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The format version for the detached field index.
|
|
14
|
+
*/
|
|
15
|
+
export const DetachedFieldIndexFormatVersion = {
|
|
16
|
+
v1: 1,
|
|
17
|
+
v2: 2,
|
|
18
|
+
} as const;
|
|
19
|
+
export type DetachedFieldIndexFormatVersion = Brand<
|
|
20
|
+
(typeof DetachedFieldIndexFormatVersion)[keyof typeof DetachedFieldIndexFormatVersion],
|
|
21
|
+
"DetachedFieldIndexFormatVersion"
|
|
22
|
+
>;
|
|
23
|
+
|
|
12
24
|
/**
|
|
13
25
|
* The ID of a detached node. Is not globally unique on.
|
|
14
26
|
* A `RevisionTag` + `DetachId` pair is globally unique and eventually consistent across clients.
|
|
@@ -54,7 +66,10 @@ export const EncodedRootsForRevision = <Schema extends TSchema>(tRevisionTag: Sc
|
|
|
54
66
|
]);
|
|
55
67
|
export type EncodedRootsForRevision = Static<ReturnType<typeof EncodedRootsForRevision>>;
|
|
56
68
|
|
|
57
|
-
export const Format = <
|
|
69
|
+
export const Format = <
|
|
70
|
+
TVersion extends DetachedFieldIndexFormatVersion,
|
|
71
|
+
TRevisionTagSchema extends TSchema,
|
|
72
|
+
>(
|
|
58
73
|
tVersion: TVersion,
|
|
59
74
|
tRevisionTag: TRevisionTagSchema,
|
|
60
75
|
// Return type is intentionally derived.
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import type { Static } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import { Format } from "./detachedFieldIndexFormatCommon.js";
|
|
8
|
+
import { DetachedFieldIndexFormatVersion, Format } from "./detachedFieldIndexFormatCommon.js";
|
|
9
9
|
import { RevisionTagSchema } from "../rebase/index.js";
|
|
10
|
+
import { brand } from "../../util/index.js";
|
|
10
11
|
|
|
11
|
-
export const
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
export const FormatV1 = Format(
|
|
13
|
+
brand<DetachedFieldIndexFormatVersion>(DetachedFieldIndexFormatVersion.v1),
|
|
14
|
+
RevisionTagSchema,
|
|
15
|
+
);
|
|
14
16
|
|
|
15
17
|
export type FormatV1 = Static<typeof FormatV1>;
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
import { Type, type Static } from "@sinclair/typebox";
|
|
7
7
|
|
|
8
|
-
import { Format } from "./detachedFieldIndexFormatCommon.js";
|
|
8
|
+
import { DetachedFieldIndexFormatVersion, Format } from "./detachedFieldIndexFormatCommon.js";
|
|
9
9
|
import { RevisionTagSchema, StableIdSchema } from "../rebase/index.js";
|
|
10
|
-
|
|
11
|
-
export const version2 = 2.0;
|
|
10
|
+
import { brand } from "../../util/index.js";
|
|
12
11
|
|
|
13
12
|
export const StableOrFinalRevisionTag = Type.Union([RevisionTagSchema, StableIdSchema]);
|
|
14
13
|
|
|
15
|
-
export const FormatV2 = Format(
|
|
14
|
+
export const FormatV2 = Format(
|
|
15
|
+
brand<DetachedFieldIndexFormatVersion>(DetachedFieldIndexFormatVersion.v2),
|
|
16
|
+
StableOrFinalRevisionTag,
|
|
17
|
+
);
|
|
16
18
|
|
|
17
19
|
export type FormatV2 = Static<typeof FormatV2>;
|
package/src/core/tree/index.ts
CHANGED
|
@@ -119,9 +119,7 @@ export {
|
|
|
119
119
|
|
|
120
120
|
export { DetachedFieldIndex } from "./detachedFieldIndex.js";
|
|
121
121
|
|
|
122
|
-
export {
|
|
123
|
-
|
|
124
|
-
getCodecTreeForDetachedFieldIndexFormat,
|
|
125
|
-
} from "./detachedFieldIndexCodecs.js";
|
|
122
|
+
export { getCodecTreeForDetachedFieldIndexFormat } from "./detachedFieldIndexCodecs.js";
|
|
123
|
+
export { type DetachedFieldIndexFormatVersion } from "./detachedFieldIndexFormatCommon.js";
|
|
126
124
|
|
|
127
125
|
export { type ForestRootId } from "./detachedFieldIndexTypes.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import type { Static, TSchema } from "@sinclair/typebox";
|
|
7
7
|
// This export is documented as supported in typebox's documentation.
|
|
8
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
8
|
+
// eslint-disable-next-line import-x/no-internal-modules
|
|
9
9
|
import { TypeCompiler } from "@sinclair/typebox/compiler";
|
|
10
10
|
|
|
11
11
|
import { toFormatValidator, type JsonValidator } from "../codec/index.js";
|
|
@@ -8,7 +8,7 @@ import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
|
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
type CodecTree,
|
|
11
|
-
type
|
|
11
|
+
type CodecWriteOptions,
|
|
12
12
|
type IJsonCodec,
|
|
13
13
|
makeVersionedValidatedCodec,
|
|
14
14
|
} from "../../../codec/index.js";
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
type TreeChunk,
|
|
20
20
|
} from "../../../core/index.js";
|
|
21
21
|
import {
|
|
22
|
+
brand,
|
|
22
23
|
brandedNumberType,
|
|
23
24
|
type Brand,
|
|
24
25
|
type JsonCompatibleReadOnly,
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
|
|
32
33
|
import { decode } from "./chunkDecoding.js";
|
|
33
34
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
34
|
-
import { EncodedFieldBatch, validVersions,
|
|
35
|
+
import { EncodedFieldBatch, validVersions, FieldBatchFormatVersion } from "./format.js";
|
|
35
36
|
import { schemaCompressedEncode } from "./schemaBasedEncode.js";
|
|
36
37
|
import { uncompressedEncode } from "./uncompressedEncode.js";
|
|
37
38
|
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
@@ -123,17 +124,19 @@ export type FieldBatchCodec = IJsonCodec<
|
|
|
123
124
|
* @privateRemarks
|
|
124
125
|
* TODO: makeFieldBatchCodec (and makeVersionDispatchingCodec transitively) should bake in this versionToFormat logic and the resulting codec can then support use with FluidClientVersion directly.
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.
|
|
129
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
130
|
+
*/
|
|
131
|
+
function clientVersionToFieldBatchVersion(
|
|
132
|
+
clientVersion: MinimumVersionForCollab,
|
|
133
|
+
): FieldBatchFormatVersion {
|
|
134
|
+
// Currently, field batch codec only writes in version 1.
|
|
135
|
+
return brand(FieldBatchFormatVersion.v1);
|
|
131
136
|
}
|
|
132
137
|
|
|
133
|
-
export function makeFieldBatchCodec(
|
|
134
|
-
options
|
|
135
|
-
writeVersion: number,
|
|
136
|
-
): FieldBatchCodec {
|
|
138
|
+
export function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec {
|
|
139
|
+
const writeVersion = clientVersionToFieldBatchVersion(options.minVersionForCollab);
|
|
137
140
|
// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since
|
|
138
141
|
// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if
|
|
139
142
|
// decode is being run on a client that just submitted a schema change, but the op is from another client who has
|
|
@@ -198,6 +201,8 @@ export function makeFieldBatchCodec(
|
|
|
198
201
|
});
|
|
199
202
|
}
|
|
200
203
|
|
|
201
|
-
export function getCodecTreeForFieldBatchFormat(
|
|
202
|
-
|
|
204
|
+
export function getCodecTreeForFieldBatchFormat(
|
|
205
|
+
clientVersion: MinimumVersionForCollab,
|
|
206
|
+
): CodecTree {
|
|
207
|
+
return { name: "FieldBatch", version: clientVersionToFieldBatchVersion(clientVersion) };
|
|
203
208
|
}
|
|
@@ -33,8 +33,8 @@ import {
|
|
|
33
33
|
type EncodedFieldBatch,
|
|
34
34
|
type EncodedNestedArrayShape,
|
|
35
35
|
type EncodedValueShape,
|
|
36
|
+
FieldBatchFormatVersion,
|
|
36
37
|
SpecialField,
|
|
37
|
-
version,
|
|
38
38
|
} from "./format.js";
|
|
39
39
|
import type { IncrementalEncoder } from "./codecs.js";
|
|
40
40
|
|
|
@@ -57,7 +57,7 @@ export function compressedEncode(
|
|
|
57
57
|
anyFieldEncoder.encodeField(cursor, context, buffer);
|
|
58
58
|
batchBuffer.push(buffer);
|
|
59
59
|
}
|
|
60
|
-
return updateShapesAndIdentifiersEncoding(
|
|
60
|
+
return updateShapesAndIdentifiersEncoding(FieldBatchFormatVersion.v1, batchBuffer);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export type BufferFormat = BufferFormatGeneric<EncodedChunkShape>;
|
|
@@ -15,12 +15,20 @@ import {
|
|
|
15
15
|
} from "./formatGeneric.js";
|
|
16
16
|
import type { Brand } from "../../../util/index.js";
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The format version for the field batch.
|
|
20
|
+
*/
|
|
21
|
+
export const FieldBatchFormatVersion = {
|
|
22
|
+
v1: 1,
|
|
23
|
+
} as const;
|
|
24
|
+
export type FieldBatchFormatVersion = Brand<
|
|
25
|
+
(typeof FieldBatchFormatVersion)[keyof typeof FieldBatchFormatVersion],
|
|
26
|
+
"FieldBatchFormatVersion"
|
|
27
|
+
>;
|
|
20
28
|
|
|
21
29
|
// Compatible versions used for format/version validation.
|
|
22
30
|
// TODO: A proper version update policy will need to be documented.
|
|
23
|
-
export const validVersions = new Set([
|
|
31
|
+
export const validVersions = new Set([FieldBatchFormatVersion.v1]);
|
|
24
32
|
|
|
25
33
|
/**
|
|
26
34
|
* Top level length is implied from length of data array.
|
|
@@ -209,5 +217,8 @@ export type EncodedNodeShape = Static<typeof EncodedNodeShape>;
|
|
|
209
217
|
export type EncodedAnyShape = Static<typeof EncodedAnyShape>;
|
|
210
218
|
export type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;
|
|
211
219
|
|
|
212
|
-
export const EncodedFieldBatch = EncodedFieldBatchGeneric(
|
|
220
|
+
export const EncodedFieldBatch = EncodedFieldBatchGeneric(
|
|
221
|
+
FieldBatchFormatVersion.v1,
|
|
222
|
+
EncodedChunkShape,
|
|
223
|
+
);
|
|
213
224
|
export type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
EncodedFieldBatch,
|
|
8
|
+
type FieldBatchFormatVersion,
|
|
9
|
+
} from "./format.js";
|
|
7
10
|
export type { FieldBatch } from "./fieldBatch.js";
|
|
8
11
|
export {
|
|
9
12
|
type FieldBatchCodec,
|
|
10
13
|
makeFieldBatchCodec,
|
|
11
14
|
type FieldBatchEncodingContext,
|
|
12
|
-
fluidVersionToFieldBatchCodecWriteVersion,
|
|
13
15
|
type IncrementalEncoderDecoder,
|
|
14
16
|
type IncrementalEncoder,
|
|
15
17
|
type IncrementalDecoder,
|
|
@@ -12,10 +12,10 @@ import type { FluidSerializableReadOnly } from "../../valueUtilities.js";
|
|
|
12
12
|
|
|
13
13
|
import type { FieldBatch } from "./fieldBatch.js";
|
|
14
14
|
import {
|
|
15
|
+
FieldBatchFormatVersion,
|
|
15
16
|
type EncodedFieldBatch,
|
|
16
17
|
type EncodedNestedArrayShape,
|
|
17
18
|
type EncodedNodeShape,
|
|
18
|
-
version,
|
|
19
19
|
} from "./format.js";
|
|
20
20
|
import type { ShapeIndex } from "./formatGeneric.js";
|
|
21
21
|
|
|
@@ -30,7 +30,7 @@ import type { ShapeIndex } from "./formatGeneric.js";
|
|
|
30
30
|
export function uncompressedEncode(batch: FieldBatch): EncodedFieldBatch {
|
|
31
31
|
const rootFields = batch.map(encodeSequence);
|
|
32
32
|
return {
|
|
33
|
-
version,
|
|
33
|
+
version: FieldBatchFormatVersion.v1,
|
|
34
34
|
identifiers: [],
|
|
35
35
|
// A single shape used to encode all fields.
|
|
36
36
|
shapes: [{ c: anyNodeShape }, { a: anyArray }],
|
|
@@ -107,8 +107,7 @@ export const required = new FieldKindWithEditor(
|
|
|
107
107
|
// Which direction is allowed is a subjective policy choice.
|
|
108
108
|
(other.kind === sequence.identifier ||
|
|
109
109
|
other.kind === requiredIdentifier ||
|
|
110
|
-
other.kind === optional.identifier
|
|
111
|
-
other.kind === nodeKey.identifier) &&
|
|
110
|
+
other.kind === optional.identifier) &&
|
|
112
111
|
allowsTreeSchemaIdentifierSuperset(types, other.types),
|
|
113
112
|
new Set(),
|
|
114
113
|
);
|
|
@@ -129,28 +128,6 @@ export const sequence = new FieldKindWithEditor(
|
|
|
129
128
|
new Set([]),
|
|
130
129
|
);
|
|
131
130
|
|
|
132
|
-
const nodeKeyIdentifier = "NodeKey";
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Exactly one identifier.
|
|
136
|
-
*
|
|
137
|
-
* TODO: this is almost the same as identifier, but apparently unused.
|
|
138
|
-
* Confirm if this is truly unused since before the document format was stabilized, and remove if possible.
|
|
139
|
-
* @deprecated Superseded by {@link identifier}.
|
|
140
|
-
*/
|
|
141
|
-
export const nodeKey = new FieldKindWithEditor(
|
|
142
|
-
nodeKeyIdentifier,
|
|
143
|
-
Multiplicity.Single,
|
|
144
|
-
noChangeHandler,
|
|
145
|
-
(types, other) =>
|
|
146
|
-
(other.kind === sequence.identifier ||
|
|
147
|
-
other.kind === requiredIdentifier ||
|
|
148
|
-
other.kind === optional.identifier ||
|
|
149
|
-
other.kind === nodeKeyIdentifier) &&
|
|
150
|
-
allowsTreeSchemaIdentifierSuperset(types, other.types),
|
|
151
|
-
new Set(),
|
|
152
|
-
);
|
|
153
|
-
|
|
154
131
|
const identifierFieldIdentifier = "Identifier";
|
|
155
132
|
|
|
156
133
|
/**
|
|
@@ -214,7 +191,6 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
214
191
|
[
|
|
215
192
|
brand(1),
|
|
216
193
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
217
|
-
[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],
|
|
218
194
|
[required.identifier, { kind: required, formatVersion: 1 }],
|
|
219
195
|
[optional.identifier, { kind: optional, formatVersion: 1 }],
|
|
220
196
|
[sequence.identifier, { kind: sequence, formatVersion: 1 }],
|
|
@@ -225,7 +201,6 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
225
201
|
[
|
|
226
202
|
brand(2),
|
|
227
203
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
228
|
-
[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],
|
|
229
204
|
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
230
205
|
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
231
206
|
[sequence.identifier, { kind: sequence, formatVersion: 1 }],
|
|
@@ -236,7 +211,6 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
236
211
|
[
|
|
237
212
|
brand(3),
|
|
238
213
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
239
|
-
[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],
|
|
240
214
|
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
241
215
|
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
242
216
|
[sequence.identifier, { kind: sequence, formatVersion: 2 }],
|
|
@@ -247,7 +221,6 @@ export const fieldKindConfigurations: ReadonlyMap<
|
|
|
247
221
|
[
|
|
248
222
|
brand(4),
|
|
249
223
|
new Map<FieldKindIdentifier, FieldKindConfigurationEntry>([
|
|
250
|
-
[nodeKey.identifier, { kind: nodeKey, formatVersion: 1 }],
|
|
251
224
|
[required.identifier, { kind: required, formatVersion: 2 }],
|
|
252
225
|
[optional.identifier, { kind: optional, formatVersion: 2 }],
|
|
253
226
|
[sequence.identifier, { kind: sequence, formatVersion: 3 }],
|
|
@@ -284,7 +257,7 @@ export function getCodecTreeForModularChangeFormat(
|
|
|
284
257
|
* code which uses this should be audited for compatibility considerations.
|
|
285
258
|
*/
|
|
286
259
|
export const fieldKinds: ReadonlyMap<FieldKindIdentifier, FieldKindWithEditor> = new Map(
|
|
287
|
-
[required, optional, sequence,
|
|
260
|
+
[required, optional, sequence, identifier, forbidden].map((s) => [s.identifier, s]),
|
|
288
261
|
);
|
|
289
262
|
|
|
290
263
|
// Create named Aliases for nicer intellisense.
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { assert, oob } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
type CodecTree,
|
|
10
|
-
type
|
|
11
|
+
type CodecWriteOptions,
|
|
11
12
|
type IJsonCodec,
|
|
12
13
|
makeVersionedValidatedCodec,
|
|
13
14
|
} from "../../codec/index.js";
|
|
14
15
|
import type { FieldKey, ITreeCursorSynchronous } from "../../core/index.js";
|
|
15
16
|
import type { FieldBatchCodec, FieldBatchEncodingContext } from "../chunked-forest/index.js";
|
|
16
17
|
|
|
17
|
-
import { Format } from "./format.js";
|
|
18
|
-
import
|
|
18
|
+
import { Format, ForestFormatVersion } from "./format.js";
|
|
19
|
+
import { brand } from "../../util/index.js";
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Uses field cursors
|
|
@@ -23,15 +24,28 @@ import type { Brand } from "../../util/index.js";
|
|
|
23
24
|
export type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;
|
|
24
25
|
export type ForestCodec = IJsonCodec<FieldSet, Format, Format, FieldBatchEncodingContext>;
|
|
25
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Convert a MinimumVersionForCollab to a ForestFormatVersion.
|
|
29
|
+
* @param clientVersion - The MinimumVersionForCollab to convert.
|
|
30
|
+
* @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.
|
|
31
|
+
*/
|
|
32
|
+
function clientVersionToForestSummaryVersion(
|
|
33
|
+
clientVersion: MinimumVersionForCollab,
|
|
34
|
+
): ForestFormatVersion {
|
|
35
|
+
// Currently, forest summary codec only writes in version 1.
|
|
36
|
+
return brand(ForestFormatVersion.v1);
|
|
37
|
+
}
|
|
38
|
+
|
|
26
39
|
export function makeForestSummarizerCodec(
|
|
27
|
-
options:
|
|
40
|
+
options: CodecWriteOptions,
|
|
28
41
|
fieldBatchCodec: FieldBatchCodec,
|
|
29
42
|
): ForestCodec {
|
|
30
43
|
const inner = fieldBatchCodec;
|
|
31
44
|
// TODO: AB#41865
|
|
32
45
|
// This needs to be updated to support multiple versions.
|
|
33
46
|
// The second version will be used to enable incremental summarization.
|
|
34
|
-
|
|
47
|
+
const writeVersion = clientVersionToForestSummaryVersion(options.minVersionForCollab);
|
|
48
|
+
return makeVersionedValidatedCodec(options, new Set([ForestFormatVersion.v1]), Format, {
|
|
35
49
|
encode: (data: FieldSet, context: FieldBatchEncodingContext): Format => {
|
|
36
50
|
const keys: FieldKey[] = [];
|
|
37
51
|
const fields: ITreeCursorSynchronous[] = [];
|
|
@@ -39,7 +53,7 @@ export function makeForestSummarizerCodec(
|
|
|
39
53
|
keys.push(key);
|
|
40
54
|
fields.push(value);
|
|
41
55
|
}
|
|
42
|
-
return { keys, fields: inner.encode(fields, context), version:
|
|
56
|
+
return { keys, fields: inner.encode(fields, context), version: writeVersion };
|
|
43
57
|
},
|
|
44
58
|
decode: (data: Format, context: FieldBatchEncodingContext): FieldSet => {
|
|
45
59
|
const out: Map<FieldKey, ITreeCursorSynchronous> = new Map();
|
|
@@ -53,7 +67,8 @@ export function makeForestSummarizerCodec(
|
|
|
53
67
|
});
|
|
54
68
|
}
|
|
55
69
|
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
70
|
+
export function getCodecTreeForForestFormat(
|
|
71
|
+
clientVersion: MinimumVersionForCollab,
|
|
72
|
+
): CodecTree {
|
|
73
|
+
return { name: "Forest", version: clientVersionToForestSummaryVersion(clientVersion) };
|
|
59
74
|
}
|
|
@@ -33,7 +33,7 @@ import type {
|
|
|
33
33
|
SummaryElementStringifier,
|
|
34
34
|
} from "../../shared-tree-core/index.js";
|
|
35
35
|
import { idAllocatorFromMaxId, type JsonCompatible } from "../../util/index.js";
|
|
36
|
-
// eslint-disable-next-line import/no-internal-modules
|
|
36
|
+
// eslint-disable-next-line import-x/no-internal-modules
|
|
37
37
|
import { chunkFieldSingle, defaultChunkPolicy } from "../chunked-forest/chunkTree.js";
|
|
38
38
|
import {
|
|
39
39
|
defaultIncrementalEncodingPolicy,
|
|
@@ -7,12 +7,22 @@ import { type Static, Type } from "@sinclair/typebox";
|
|
|
7
7
|
|
|
8
8
|
import { Versioned } from "../../codec/index.js";
|
|
9
9
|
import { schemaFormatV1 } from "../../core/index.js";
|
|
10
|
+
import type { Brand } from "../../util/index.js";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The format version for the forest.
|
|
14
|
+
*/
|
|
15
|
+
export const ForestFormatVersion = {
|
|
16
|
+
v1: 1,
|
|
17
|
+
} as const;
|
|
18
|
+
export type ForestFormatVersion = Brand<
|
|
19
|
+
(typeof ForestFormatVersion)[keyof typeof ForestFormatVersion],
|
|
20
|
+
"ForestFormatVersion"
|
|
21
|
+
>;
|
|
12
22
|
|
|
13
23
|
export const Format = Type.Object(
|
|
14
24
|
{
|
|
15
|
-
version: Type.Literal(
|
|
25
|
+
version: Type.Literal(ForestFormatVersion.v1),
|
|
16
26
|
keys: Type.Array(schemaFormatV1.FieldKeySchema),
|
|
17
27
|
fields: Versioned,
|
|
18
28
|
},
|
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { forestSummaryKey, ForestSummarizer } from "./forestSummarizer.js";
|
|
7
|
-
export { getCodecTreeForForestFormat
|
|
7
|
+
export { getCodecTreeForForestFormat } from "./codec.js";
|
|
8
|
+
export { ForestFormatVersion } from "./format.js";
|
|
@@ -33,6 +33,7 @@ export {
|
|
|
33
33
|
makeSchemaCodec,
|
|
34
34
|
makeSchemaCodecs,
|
|
35
35
|
getCodecTreeForSchemaFormat,
|
|
36
|
+
clientVersionToSchemaVersion,
|
|
36
37
|
} from "./schema-index/index.js";
|
|
37
38
|
export {
|
|
38
39
|
stackTreeNodeCursor,
|
|
@@ -107,7 +108,6 @@ export {
|
|
|
107
108
|
getCodecTreeForFieldBatchFormat,
|
|
108
109
|
makeTreeChunker,
|
|
109
110
|
makeFieldBatchCodec,
|
|
110
|
-
fluidVersionToFieldBatchCodecWriteVersion,
|
|
111
111
|
type FieldBatchEncodingContext,
|
|
112
112
|
emptyChunk,
|
|
113
113
|
combineChunks,
|
|
@@ -203,7 +203,6 @@ export {
|
|
|
203
203
|
makeSchemaChangeCodecs,
|
|
204
204
|
EncodedSchemaChange,
|
|
205
205
|
getCodecTreeForSchemaChangeFormat,
|
|
206
|
-
type SchemaChangeFormatVersion,
|
|
207
206
|
} from "./schema-edits/index.js";
|
|
208
207
|
|
|
209
208
|
export { makeMitigatedChangeFamily } from "./mitigatedChangeFamily.js";
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
export {
|
|
7
7
|
makeSchemaChangeCodecs,
|
|
8
8
|
getCodecTreeForSchemaChangeFormat,
|
|
9
|
-
type SchemaChangeFormatVersion,
|
|
10
9
|
} from "./schemaChangeCodecs.js";
|
|
11
10
|
export type { SchemaChange } from "./schemaChangeTypes.js";
|
|
12
11
|
export { EncodedSchemaChange } from "./schemaChangeFormat.js";
|