@fluidframework/tree 2.2.0 → 2.3.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/.dependency-cruiser-known-violations.json +28 -40
- package/.vscode/Tree.code-workspace +0 -2
- package/CHANGELOG.md +92 -0
- package/README.md +6 -0
- package/alpha.d.ts +11 -0
- package/api-extractor/api-extractor-lint-alpha.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-alpha.esm.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-legacy.esm.json +5 -0
- package/api-extractor/api-extractor.current.json +8 -0
- package/api-extractor/api-extractor.legacy.json +4 -0
- package/api-extractor.json +1 -1
- package/api-report/tree.alpha.api.md +21 -6
- package/api-report/tree.beta.api.md +21 -6
- package/api-report/tree.legacy.alpha.api.md +562 -0
- package/api-report/tree.legacy.public.api.md +559 -0
- package/api-report/tree.public.api.md +6 -6
- package/dist/alpha.d.ts +102 -0
- package/dist/beta.d.ts +6 -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/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/dist/core/revertible.d.ts.map +1 -0
- package/dist/core/revertible.js.map +1 -0
- package/dist/core/schema-stored/format.d.ts +3 -3
- package/dist/core/schema-stored/format.js +1 -1
- package/dist/core/schema-stored/format.js.map +1 -1
- package/dist/core/schema-stored/schema.d.ts +2 -7
- package/dist/core/schema-stored/schema.d.ts.map +1 -1
- package/dist/core/schema-stored/schema.js +4 -6
- package/dist/core/schema-stored/schema.js.map +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/dist/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.d.ts +4 -6
- package/dist/core/tree/anchorSet.d.ts.map +1 -1
- package/dist/core/tree/anchorSet.js +15 -1
- package/dist/core/tree/anchorSet.js.map +1 -1
- package/dist/core/tree/detachedFieldIndex.d.ts +0 -1
- package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/dist/core/tree/detachedFieldIndex.js +1 -0
- package/dist/core/tree/detachedFieldIndex.js.map +1 -1
- package/dist/core/tree/visitDelta.d.ts +7 -2
- package/dist/core/tree/visitDelta.d.ts.map +1 -1
- package/dist/core/tree/visitDelta.js.map +1 -1
- package/dist/events/emitter.d.ts +127 -0
- package/dist/events/emitter.d.ts.map +1 -0
- package/dist/events/{events.js → emitter.js} +49 -28
- package/dist/events/emitter.js.map +1 -0
- package/dist/events/index.d.ts +2 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +4 -5
- package/dist/events/index.js.map +1 -1
- package/dist/events/interop.d.ts +36 -0
- package/dist/events/interop.d.ts.map +1 -0
- package/dist/{core/revertible/index.d.ts → events/interop.js} +3 -2
- package/dist/events/interop.js.map +1 -0
- package/dist/events/listeners.d.ts +65 -0
- package/dist/events/listeners.d.ts.map +1 -0
- package/{lib/core/revertible/index.d.ts → dist/events/listeners.js} +3 -2
- package/dist/events/listeners.js.map +1 -0
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkTree.js +36 -15
- package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/dist/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/dist/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/dist/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/dist/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/index.js +2 -1
- package/dist/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js +82 -115
- package/dist/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/context.d.ts +30 -14
- package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/context.js +10 -7
- package/dist/feature-libraries/flex-tree/context.js.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
- package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js +15 -32
- package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/dist/feature-libraries/flex-tree/index.d.ts +2 -3
- package/dist/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/index.js +1 -3
- package/dist/feature-libraries/flex-tree/index.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/dist/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/dist/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.d.ts +26 -29
- package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyField.js +11 -17
- package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/dist/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/lazyNode.js +23 -159
- package/dist/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/dist/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/unboxed.js +7 -41
- package/dist/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/dist/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/dist/feature-libraries/flex-tree/utilities.js +3 -6
- package/dist/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/dist/feature-libraries/index.d.ts +3 -5
- package/dist/feature-libraries/index.d.ts.map +1 -1
- package/dist/feature-libraries/index.js +5 -13
- package/dist/feature-libraries/index.js.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/comparison.js +3 -6
- package/dist/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/dist/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/dist/feature-libraries/schema-index/format.d.ts +3 -3
- package/dist/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/dist/feature-libraries/storedToViewSchema.js +2 -4
- package/dist/feature-libraries/storedToViewSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/dist/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/dist/feature-libraries/typed-schema/index.d.ts +2 -2
- package/dist/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/index.js +2 -2
- package/dist/feature-libraries/typed-schema/index.js.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/schemaCollection.js +8 -10
- package/dist/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/dist/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js +5 -37
- package/dist/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/dist/feature-libraries/typed-schema/view.d.ts +4 -6
- package/dist/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/dist/feature-libraries/typed-schema/view.js +5 -4
- package/dist/feature-libraries/typed-schema/view.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +83 -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/checkoutFlexTreeView.d.ts +53 -0
- package/dist/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/dist/shared-tree/{treeView.js → checkoutFlexTreeView.js} +28 -6
- package/dist/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/dist/shared-tree/index.d.ts +3 -3
- package/dist/shared-tree/index.d.ts.map +1 -1
- package/dist/shared-tree/index.js +2 -2
- package/dist/shared-tree/index.js.map +1 -1
- package/dist/shared-tree/schematizeTree.d.ts +15 -4
- package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
- package/dist/shared-tree/schematizeTree.js +7 -8
- package/dist/shared-tree/schematizeTree.js.map +1 -1
- package/dist/shared-tree/schematizingTreeView.d.ts +9 -4
- package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/dist/shared-tree/schematizingTreeView.js +25 -12
- package/dist/shared-tree/schematizingTreeView.js.map +1 -1
- package/dist/shared-tree/sharedTree.d.ts.map +1 -1
- package/dist/shared-tree/sharedTree.js +2 -2
- package/dist/shared-tree/sharedTree.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/dist/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/dist/shared-tree/treeApi.d.ts +1 -3
- package/dist/shared-tree/treeApi.d.ts.map +1 -1
- package/dist/shared-tree/treeApi.js +6 -4
- package/dist/shared-tree/treeApi.js.map +1 -1
- package/dist/shared-tree/treeCheckout.d.ts +2 -13
- package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
- package/dist/shared-tree/treeCheckout.js +17 -1
- package/dist/shared-tree/treeCheckout.js.map +1 -1
- package/dist/shared-tree-core/branch.js +1 -1
- package/dist/shared-tree-core/branch.js.map +1 -1
- package/dist/simple-tree/api/create.d.ts.map +1 -1
- package/dist/simple-tree/api/create.js +1 -1
- package/dist/simple-tree/api/create.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/dist/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{lib/simple-tree → dist/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/dist/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/dist/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/dist/simple-tree/api/index.d.ts +5 -0
- package/dist/simple-tree/api/index.d.ts.map +1 -1
- package/dist/simple-tree/api/index.js +7 -1
- package/dist/simple-tree/api/index.js.map +1 -1
- package/{lib/simple-tree → dist/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/dist/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/jsonSchema.js.map +1 -0
- package/dist/simple-tree/api/schemaFactory.d.ts +45 -14
- package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/dist/simple-tree/api/schemaFactory.js +43 -12
- package/dist/simple-tree/api/schemaFactory.js.map +1 -1
- package/dist/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/dist/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/api/simpleSchema.js.map +1 -0
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/dist/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/dist/simple-tree/api/tree.d.ts +1 -21
- package/dist/simple-tree/api/tree.d.ts.map +1 -1
- package/dist/simple-tree/api/tree.js +3 -38
- package/dist/simple-tree/api/tree.js.map +1 -1
- package/dist/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/dist/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/dist/simple-tree/api/treeApiBeta.js +26 -0
- package/dist/simple-tree/api/treeApiBeta.js.map +1 -0
- package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/dist/simple-tree/api/treeNodeApi.js +51 -21
- package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
- package/dist/simple-tree/api/verboseTree.js +2 -2
- package/dist/simple-tree/api/verboseTree.js.map +1 -1
- package/dist/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/dist/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/dist/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/{lib/simple-tree → dist/simple-tree/api}/viewSchemaToSimpleSchema.js.map +1 -1
- package/dist/simple-tree/arrayNode.d.ts +2 -2
- package/dist/simple-tree/arrayNode.d.ts.map +1 -1
- package/dist/simple-tree/arrayNode.js +33 -38
- package/dist/simple-tree/arrayNode.js.map +1 -1
- package/dist/simple-tree/core/index.d.ts +2 -2
- package/dist/simple-tree/core/index.d.ts.map +1 -1
- package/dist/simple-tree/core/index.js +4 -1
- package/dist/simple-tree/core/index.js.map +1 -1
- package/dist/simple-tree/core/schemaCaching.d.ts +5 -0
- package/dist/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/dist/simple-tree/core/schemaCaching.js +10 -1
- package/dist/simple-tree/core/schemaCaching.js.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.d.ts +78 -7
- package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/dist/simple-tree/core/treeNodeKernel.js +219 -30
- package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/dist/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/dist/simple-tree/core/types.d.ts +23 -8
- package/dist/simple-tree/core/types.d.ts.map +1 -1
- package/dist/simple-tree/core/types.js.map +1 -1
- package/dist/simple-tree/core/withType.d.ts +3 -2
- package/dist/simple-tree/core/withType.d.ts.map +1 -1
- package/dist/simple-tree/core/withType.js.map +1 -1
- package/dist/simple-tree/index.d.ts +7 -9
- package/dist/simple-tree/index.d.ts.map +1 -1
- package/dist/simple-tree/index.js +15 -6
- package/dist/simple-tree/index.js.map +1 -1
- package/dist/simple-tree/leafNodeSchema.d.ts +7 -9
- package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/dist/simple-tree/leafNodeSchema.js +13 -11
- package/dist/simple-tree/leafNodeSchema.js.map +1 -1
- package/dist/simple-tree/mapNode.d.ts +1 -1
- package/dist/simple-tree/mapNode.d.ts.map +1 -1
- package/dist/simple-tree/mapNode.js +38 -29
- package/dist/simple-tree/mapNode.js.map +1 -1
- package/dist/simple-tree/objectNode.d.ts +9 -7
- package/dist/simple-tree/objectNode.d.ts.map +1 -1
- package/dist/simple-tree/objectNode.js +37 -31
- package/dist/simple-tree/objectNode.js.map +1 -1
- package/dist/simple-tree/proxies.d.ts +1 -14
- package/dist/simple-tree/proxies.d.ts.map +1 -1
- package/dist/simple-tree/proxies.js +12 -15
- package/dist/simple-tree/proxies.js.map +1 -1
- package/dist/simple-tree/proxyBinding.d.ts +2 -62
- package/dist/simple-tree/proxyBinding.d.ts.map +1 -1
- package/dist/simple-tree/proxyBinding.js +8 -181
- package/dist/simple-tree/proxyBinding.js.map +1 -1
- package/dist/simple-tree/schemaTypes.d.ts +7 -7
- package/dist/simple-tree/schemaTypes.d.ts.map +1 -1
- package/dist/simple-tree/schemaTypes.js +4 -4
- package/dist/simple-tree/schemaTypes.js.map +1 -1
- package/dist/simple-tree/toFlexSchema.d.ts +11 -1
- package/dist/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/dist/simple-tree/toFlexSchema.js +54 -31
- package/dist/simple-tree/toFlexSchema.js.map +1 -1
- package/dist/simple-tree/toMapTree.d.ts +25 -37
- package/dist/simple-tree/toMapTree.d.ts.map +1 -1
- package/dist/simple-tree/toMapTree.js +53 -16
- package/dist/simple-tree/toMapTree.js.map +1 -1
- package/dist/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/dist/simple-tree/treeNodeValid.js +7 -10
- package/dist/simple-tree/treeNodeValid.js.map +1 -1
- package/dist/simple-tree/typesUnsafe.d.ts +13 -13
- package/dist/simple-tree/typesUnsafe.js.map +1 -1
- package/dist/simple-tree/walkSchema.d.ts +26 -0
- package/dist/simple-tree/walkSchema.d.ts.map +1 -0
- package/dist/simple-tree/walkSchema.js +49 -0
- package/dist/simple-tree/walkSchema.js.map +1 -0
- package/dist/treeFactory.d.ts +2 -1
- package/dist/treeFactory.d.ts.map +1 -1
- package/dist/treeFactory.js +2 -1
- package/dist/treeFactory.js.map +1 -1
- package/dist/util/typeUtils.d.ts +2 -2
- package/dist/util/typeUtils.js.map +1 -1
- package/legacy.d.ts +11 -0
- package/lib/alpha.d.ts +102 -0
- package/lib/beta.d.ts +6 -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/{revertible/revertible.d.ts → revertible.d.ts} +12 -0
- package/lib/core/revertible.d.ts.map +1 -0
- package/lib/core/revertible.js.map +1 -0
- package/lib/core/schema-stored/format.d.ts +3 -3
- package/lib/core/schema-stored/format.js +1 -1
- package/lib/core/schema-stored/format.js.map +1 -1
- package/lib/core/schema-stored/schema.d.ts +2 -7
- package/lib/core/schema-stored/schema.d.ts.map +1 -1
- package/lib/core/schema-stored/schema.js +4 -6
- package/lib/core/schema-stored/schema.js.map +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts +1 -1
- package/lib/core/schema-stored/storedSchemaRepository.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.d.ts +4 -6
- package/lib/core/tree/anchorSet.d.ts.map +1 -1
- package/lib/core/tree/anchorSet.js +15 -1
- package/lib/core/tree/anchorSet.js.map +1 -1
- package/lib/core/tree/detachedFieldIndex.d.ts +0 -1
- package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
- package/lib/core/tree/detachedFieldIndex.js +1 -0
- package/lib/core/tree/detachedFieldIndex.js.map +1 -1
- package/lib/core/tree/visitDelta.d.ts +7 -2
- package/lib/core/tree/visitDelta.d.ts.map +1 -1
- package/lib/core/tree/visitDelta.js.map +1 -1
- package/lib/events/emitter.d.ts +127 -0
- package/lib/events/emitter.d.ts.map +1 -0
- package/lib/events/{events.js → emitter.js} +49 -27
- package/lib/events/emitter.js.map +1 -0
- package/lib/events/index.d.ts +2 -1
- package/lib/events/index.d.ts.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/interop.d.ts +36 -0
- package/lib/events/interop.d.ts.map +1 -0
- package/{src/core/revertible/index.ts → lib/events/interop.js} +2 -2
- package/lib/events/interop.js.map +1 -0
- package/lib/events/listeners.d.ts +65 -0
- package/lib/events/listeners.d.ts.map +1 -0
- package/lib/{core/revertible/index.js → events/listeners.js} +2 -2
- package/lib/events/listeners.js.map +1 -0
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +25 -7
- package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkTree.js +37 -16
- package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts +4 -2
- package/lib/feature-libraries/chunked-forest/chunkedForest.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/chunkedForest.js +12 -5
- package/lib/feature-libraries/chunked-forest/chunkedForest.js.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +15 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
- package/lib/feature-libraries/chunked-forest/uniformChunk.js +28 -2
- package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +3 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js +5 -4
- package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts +1 -1
- package/lib/feature-libraries/flex-map-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js +1 -1
- package/lib/feature-libraries/flex-map-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts +35 -35
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js +83 -116
- package/lib/feature-libraries/flex-map-tree/mapTreeNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/context.d.ts +30 -14
- package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/context.js +10 -7
- package/lib/feature-libraries/flex-tree/context.js.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +57 -281
- package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js +15 -31
- package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
- package/lib/feature-libraries/flex-tree/index.d.ts +2 -3
- package/lib/feature-libraries/flex-tree/index.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/index.js +2 -2
- package/lib/feature-libraries/flex-tree/index.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts +3 -3
- package/lib/feature-libraries/flex-tree/lazyEntity.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyEntity.js +2 -10
- package/lib/feature-libraries/flex-tree/lazyEntity.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.d.ts +26 -29
- package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyField.js +11 -16
- package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts +6 -34
- package/lib/feature-libraries/flex-tree/lazyNode.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/lazyNode.js +24 -156
- package/lib/feature-libraries/flex-tree/lazyNode.js.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.d.ts +4 -16
- package/lib/feature-libraries/flex-tree/unboxed.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/unboxed.js +5 -37
- package/lib/feature-libraries/flex-tree/unboxed.js.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.d.ts +2 -2
- package/lib/feature-libraries/flex-tree/utilities.d.ts.map +1 -1
- package/lib/feature-libraries/flex-tree/utilities.js +3 -6
- package/lib/feature-libraries/flex-tree/utilities.js.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js +4 -1
- package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
- package/lib/feature-libraries/index.d.ts +3 -5
- package/lib/feature-libraries/index.d.ts.map +1 -1
- package/lib/feature-libraries/index.js +5 -5
- package/lib/feature-libraries/index.js.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/comparison.js +3 -6
- package/lib/feature-libraries/modular-schema/comparison.js.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/discrepancies.js +3 -13
- package/lib/feature-libraries/modular-schema/discrepancies.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +4 -1
- package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +2 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js +12 -5
- package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
- package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts +6 -6
- package/lib/feature-libraries/schema-index/format.d.ts +3 -3
- package/lib/feature-libraries/storedToViewSchema.d.ts.map +1 -1
- package/lib/feature-libraries/storedToViewSchema.js +3 -5
- package/lib/feature-libraries/storedToViewSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/flexList.d.ts +3 -3
- package/lib/feature-libraries/typed-schema/flexList.js.map +1 -1
- package/lib/feature-libraries/typed-schema/index.d.ts +2 -2
- package/lib/feature-libraries/typed-schema/index.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/index.js +2 -2
- package/lib/feature-libraries/typed-schema/index.js.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/schemaCollection.js +9 -11
- package/lib/feature-libraries/typed-schema/schemaCollection.js.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts +17 -48
- package/lib/feature-libraries/typed-schema/typedTreeSchema.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js +5 -36
- package/lib/feature-libraries/typed-schema/typedTreeSchema.js.map +1 -1
- package/lib/feature-libraries/typed-schema/view.d.ts +4 -6
- package/lib/feature-libraries/typed-schema/view.d.ts.map +1 -1
- package/lib/feature-libraries/typed-schema/view.js +5 -4
- package/lib/feature-libraries/typed-schema/view.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +83 -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/checkoutFlexTreeView.d.ts +53 -0
- package/lib/shared-tree/checkoutFlexTreeView.d.ts.map +1 -0
- package/lib/shared-tree/{treeView.js → checkoutFlexTreeView.js} +26 -5
- package/lib/shared-tree/checkoutFlexTreeView.js.map +1 -0
- package/lib/shared-tree/index.d.ts +3 -3
- package/lib/shared-tree/index.d.ts.map +1 -1
- package/lib/shared-tree/index.js +1 -1
- package/lib/shared-tree/index.js.map +1 -1
- package/lib/shared-tree/schematizeTree.d.ts +15 -4
- package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
- package/lib/shared-tree/schematizeTree.js +8 -9
- package/lib/shared-tree/schematizeTree.js.map +1 -1
- package/lib/shared-tree/schematizingTreeView.d.ts +9 -4
- package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
- package/lib/shared-tree/schematizingTreeView.js +26 -13
- package/lib/shared-tree/schematizingTreeView.js.map +1 -1
- package/lib/shared-tree/sharedTree.d.ts.map +1 -1
- package/lib/shared-tree/sharedTree.js +2 -2
- package/lib/shared-tree/sharedTree.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeEnricher.js +6 -2
- package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts +3 -1
- package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeChangeFamily.js +3 -2
- package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts +2 -1
- package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
- package/lib/shared-tree/sharedTreeEditBuilder.js +2 -2
- package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
- package/lib/shared-tree/treeApi.d.ts +1 -3
- package/lib/shared-tree/treeApi.d.ts.map +1 -1
- package/lib/shared-tree/treeApi.js +7 -5
- package/lib/shared-tree/treeApi.js.map +1 -1
- package/lib/shared-tree/treeCheckout.d.ts +2 -13
- package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
- package/lib/shared-tree/treeCheckout.js +18 -2
- package/lib/shared-tree/treeCheckout.js.map +1 -1
- package/lib/shared-tree-core/branch.js +1 -1
- package/lib/shared-tree-core/branch.js.map +1 -1
- package/lib/simple-tree/api/create.d.ts.map +1 -1
- package/lib/simple-tree/api/create.js +2 -2
- package/lib/simple-tree/api/create.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/getJsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getJsonSchema.js → api/getJsonSchema.js} +1 -1
- package/lib/simple-tree/api/getJsonSchema.js.map +1 -0
- package/{dist/simple-tree → lib/simple-tree/api}/getSimpleSchema.d.ts +1 -1
- package/lib/simple-tree/api/getSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{getSimpleSchema.js → api/getSimpleSchema.js} +1 -1
- package/lib/simple-tree/api/getSimpleSchema.js.map +1 -0
- package/lib/simple-tree/api/index.d.ts +5 -0
- package/lib/simple-tree/api/index.d.ts.map +1 -1
- package/lib/simple-tree/api/index.js +3 -0
- package/lib/simple-tree/api/index.js.map +1 -1
- package/{dist/simple-tree → lib/simple-tree/api}/jsonSchema.d.ts +1 -1
- package/lib/simple-tree/api/jsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/jsonSchema.js.map +1 -0
- package/lib/simple-tree/api/schemaFactory.d.ts +45 -14
- package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
- package/lib/simple-tree/api/schemaFactory.js +43 -12
- package/lib/simple-tree/api/schemaFactory.js.map +1 -1
- package/lib/simple-tree/{simpleSchema.d.ts → api/simpleSchema.d.ts} +4 -4
- package/lib/simple-tree/api/simpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/api/simpleSchema.js.map +1 -0
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -0
- package/lib/simple-tree/{simpleSchemaToJsonSchema.js → api/simpleSchemaToJsonSchema.js} +4 -4
- package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -0
- package/lib/simple-tree/api/tree.d.ts +1 -21
- package/lib/simple-tree/api/tree.d.ts.map +1 -1
- package/lib/simple-tree/api/tree.js +2 -34
- package/lib/simple-tree/api/tree.js.map +1 -1
- package/lib/simple-tree/api/treeApiBeta.d.ts +79 -0
- package/lib/simple-tree/api/treeApiBeta.d.ts.map +1 -0
- package/lib/simple-tree/api/treeApiBeta.js +23 -0
- package/lib/simple-tree/api/treeApiBeta.js.map +1 -0
- package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
- package/lib/simple-tree/api/treeNodeApi.js +53 -23
- package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
- package/lib/simple-tree/api/verboseTree.js +1 -1
- package/lib/simple-tree/api/verboseTree.js.map +1 -1
- package/lib/simple-tree/{viewSchemaToSimpleSchema.d.ts → api/viewSchemaToSimpleSchema.d.ts} +1 -1
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.d.ts.map +1 -0
- package/lib/simple-tree/{viewSchemaToSimpleSchema.js → api/viewSchemaToSimpleSchema.js} +4 -4
- package/lib/simple-tree/api/viewSchemaToSimpleSchema.js.map +1 -0
- package/lib/simple-tree/arrayNode.d.ts +2 -2
- package/lib/simple-tree/arrayNode.d.ts.map +1 -1
- package/lib/simple-tree/arrayNode.js +36 -41
- package/lib/simple-tree/arrayNode.js.map +1 -1
- package/lib/simple-tree/core/index.d.ts +2 -2
- package/lib/simple-tree/core/index.d.ts.map +1 -1
- package/lib/simple-tree/core/index.js +2 -2
- package/lib/simple-tree/core/index.js.map +1 -1
- package/lib/simple-tree/core/schemaCaching.d.ts +5 -0
- package/lib/simple-tree/core/schemaCaching.d.ts.map +1 -1
- package/lib/simple-tree/core/schemaCaching.js +8 -0
- package/lib/simple-tree/core/schemaCaching.js.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.d.ts +78 -7
- package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
- package/lib/simple-tree/core/treeNodeKernel.js +211 -24
- package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
- package/lib/simple-tree/core/treeNodeSchema.d.ts +1 -1
- package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
- package/lib/simple-tree/core/types.d.ts +23 -8
- package/lib/simple-tree/core/types.d.ts.map +1 -1
- package/lib/simple-tree/core/types.js.map +1 -1
- package/lib/simple-tree/core/withType.d.ts +3 -2
- package/lib/simple-tree/core/withType.d.ts.map +1 -1
- package/lib/simple-tree/core/withType.js.map +1 -1
- package/lib/simple-tree/index.d.ts +7 -9
- package/lib/simple-tree/index.d.ts.map +1 -1
- package/lib/simple-tree/index.js +5 -5
- package/lib/simple-tree/index.js.map +1 -1
- package/lib/simple-tree/leafNodeSchema.d.ts +7 -9
- package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
- package/lib/simple-tree/leafNodeSchema.js +14 -12
- package/lib/simple-tree/leafNodeSchema.js.map +1 -1
- package/lib/simple-tree/mapNode.d.ts +1 -1
- package/lib/simple-tree/mapNode.d.ts.map +1 -1
- package/lib/simple-tree/mapNode.js +38 -29
- package/lib/simple-tree/mapNode.js.map +1 -1
- package/lib/simple-tree/objectNode.d.ts +9 -7
- package/lib/simple-tree/objectNode.d.ts.map +1 -1
- package/lib/simple-tree/objectNode.js +40 -34
- package/lib/simple-tree/objectNode.js.map +1 -1
- package/lib/simple-tree/proxies.d.ts +1 -14
- package/lib/simple-tree/proxies.d.ts.map +1 -1
- package/lib/simple-tree/proxies.js +11 -14
- package/lib/simple-tree/proxies.js.map +1 -1
- package/lib/simple-tree/proxyBinding.d.ts +2 -62
- package/lib/simple-tree/proxyBinding.d.ts.map +1 -1
- package/lib/simple-tree/proxyBinding.js +6 -174
- package/lib/simple-tree/proxyBinding.js.map +1 -1
- package/lib/simple-tree/schemaTypes.d.ts +7 -7
- package/lib/simple-tree/schemaTypes.d.ts.map +1 -1
- package/lib/simple-tree/schemaTypes.js +4 -4
- package/lib/simple-tree/schemaTypes.js.map +1 -1
- package/lib/simple-tree/toFlexSchema.d.ts +11 -1
- package/lib/simple-tree/toFlexSchema.d.ts.map +1 -1
- package/lib/simple-tree/toFlexSchema.js +29 -8
- package/lib/simple-tree/toFlexSchema.js.map +1 -1
- package/lib/simple-tree/toMapTree.d.ts +25 -37
- package/lib/simple-tree/toMapTree.d.ts.map +1 -1
- package/lib/simple-tree/toMapTree.js +54 -17
- package/lib/simple-tree/toMapTree.js.map +1 -1
- package/lib/simple-tree/treeNodeValid.d.ts.map +1 -1
- package/lib/simple-tree/treeNodeValid.js +8 -11
- package/lib/simple-tree/treeNodeValid.js.map +1 -1
- package/lib/simple-tree/typesUnsafe.d.ts +13 -13
- package/lib/simple-tree/typesUnsafe.js.map +1 -1
- package/lib/simple-tree/walkSchema.d.ts +26 -0
- package/lib/simple-tree/walkSchema.d.ts.map +1 -0
- package/lib/simple-tree/walkSchema.js +43 -0
- package/lib/simple-tree/walkSchema.js.map +1 -0
- package/lib/treeFactory.d.ts +2 -1
- package/lib/treeFactory.d.ts.map +1 -1
- package/lib/treeFactory.js +2 -1
- package/lib/treeFactory.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/util/typeUtils.d.ts +2 -2
- package/lib/util/typeUtils.js.map +1 -1
- package/package.json +58 -36
- package/src/core/index.ts +1 -1
- package/src/core/{revertible/revertible.ts → revertible.ts} +15 -0
- package/src/core/schema-stored/format.ts +1 -1
- package/src/core/schema-stored/schema.ts +6 -13
- package/src/core/tree/anchorSet.ts +35 -9
- package/src/core/tree/detachedFieldIndex.ts +6 -5
- package/src/core/tree/visitDelta.ts +7 -2
- package/src/events/{events.ts → emitter.ts} +55 -134
- package/src/events/index.ts +7 -7
- package/src/events/interop.ts +49 -0
- package/src/events/listeners.ts +68 -0
- package/src/feature-libraries/chunked-forest/chunkTree.ts +63 -18
- package/src/feature-libraries/chunked-forest/chunkedForest.ts +18 -4
- package/src/feature-libraries/chunked-forest/uniformChunk.ts +33 -0
- package/src/feature-libraries/default-schema/defaultEditBuilder.ts +5 -3
- package/src/feature-libraries/flex-map-tree/index.ts +1 -0
- package/src/feature-libraries/flex-map-tree/mapTreeNode.ts +135 -231
- package/src/feature-libraries/flex-tree/README.md +4 -75
- package/src/feature-libraries/flex-tree/context.ts +37 -16
- package/src/feature-libraries/flex-tree/flexTreeTypes.ts +69 -458
- package/src/feature-libraries/flex-tree/index.ts +7 -29
- package/src/feature-libraries/flex-tree/lazyEntity.ts +2 -11
- package/src/feature-libraries/flex-tree/lazyField.ts +49 -79
- package/src/feature-libraries/flex-tree/lazyNode.ts +26 -306
- package/src/feature-libraries/flex-tree/unboxed.ts +9 -68
- package/src/feature-libraries/flex-tree/utilities.ts +4 -8
- package/src/feature-libraries/forest-summary/forestSummarizer.ts +4 -1
- package/src/feature-libraries/index.ts +2 -41
- package/src/feature-libraries/modular-schema/comparison.ts +4 -6
- package/src/feature-libraries/modular-schema/discrepancies.ts +7 -16
- package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +4 -1
- package/src/feature-libraries/modular-schema/modularChangeFamily.ts +14 -4
- package/src/feature-libraries/storedToViewSchema.ts +5 -6
- package/src/feature-libraries/typed-schema/flexList.ts +3 -3
- package/src/feature-libraries/typed-schema/index.ts +1 -3
- package/src/feature-libraries/typed-schema/schemaCollection.ts +15 -17
- package/src/feature-libraries/typed-schema/typedTreeSchema.ts +35 -127
- package/src/feature-libraries/typed-schema/view.ts +4 -13
- package/src/index.ts +5 -1
- package/src/packageVersion.ts +1 -1
- package/src/shared-tree/checkoutFlexTreeView.ts +89 -0
- package/src/shared-tree/index.ts +2 -7
- package/src/shared-tree/schematizeTree.ts +23 -12
- package/src/shared-tree/schematizingTreeView.ts +34 -24
- package/src/shared-tree/sharedTree.ts +6 -1
- package/src/shared-tree/sharedTreeChangeEnricher.ts +6 -1
- package/src/shared-tree/sharedTreeChangeFamily.ts +7 -1
- package/src/shared-tree/sharedTreeEditBuilder.ts +9 -4
- package/src/shared-tree/treeApi.ts +10 -10
- package/src/shared-tree/treeCheckout.ts +26 -15
- package/src/shared-tree-core/branch.ts +1 -1
- package/src/simple-tree/ProxyBinding.md +23 -23
- package/src/simple-tree/api/create.ts +8 -3
- package/src/simple-tree/{getJsonSchema.ts → api/getJsonSchema.ts} +3 -3
- package/src/simple-tree/{getSimpleSchema.ts → api/getSimpleSchema.ts} +3 -3
- package/src/simple-tree/api/index.ts +20 -0
- package/src/simple-tree/{jsonSchema.ts → api/jsonSchema.ts} +1 -1
- package/src/simple-tree/api/schemaFactory.ts +44 -13
- package/src/simple-tree/{simpleSchema.ts → api/simpleSchema.ts} +4 -4
- package/src/simple-tree/{simpleSchemaToJsonSchema.ts → api/simpleSchemaToJsonSchema.ts} +4 -4
- package/src/simple-tree/api/tree.ts +2 -71
- package/src/simple-tree/api/treeApiBeta.ts +101 -0
- package/src/simple-tree/api/treeNodeApi.ts +63 -22
- package/src/simple-tree/api/verboseTree.ts +1 -1
- package/src/simple-tree/{viewSchemaToSimpleSchema.ts → api/viewSchemaToSimpleSchema.ts} +5 -5
- package/src/simple-tree/arrayNode.ts +38 -41
- package/src/simple-tree/core/index.ts +4 -0
- package/src/simple-tree/core/schemaCaching.ts +10 -0
- package/src/simple-tree/core/treeNodeKernel.ts +279 -27
- package/src/simple-tree/core/treeNodeSchema.ts +1 -1
- package/src/simple-tree/core/types.ts +23 -8
- package/src/simple-tree/core/withType.ts +3 -1
- package/src/simple-tree/index.ts +29 -20
- package/src/simple-tree/leafNodeSchema.ts +24 -28
- package/src/simple-tree/mapNode.ts +47 -29
- package/src/simple-tree/objectNode.ts +51 -46
- package/src/simple-tree/proxies.ts +22 -51
- package/src/simple-tree/proxyBinding.ts +3 -254
- package/src/simple-tree/schemaTypes.ts +8 -8
- package/src/simple-tree/toFlexSchema.ts +40 -7
- package/src/simple-tree/toMapTree.ts +113 -79
- package/src/simple-tree/treeNodeValid.ts +10 -13
- package/src/simple-tree/typesUnsafe.ts +13 -13
- package/src/simple-tree/walkSchema.ts +81 -0
- package/src/treeFactory.ts +2 -1
- package/src/util/typeUtils.ts +2 -2
- package/dist/core/revertible/index.d.ts.map +0 -1
- package/dist/core/revertible/index.js +0 -10
- package/dist/core/revertible/index.js.map +0 -1
- package/dist/core/revertible/revertible.d.ts.map +0 -1
- package/dist/core/revertible/revertible.js.map +0 -1
- package/dist/domains/index.d.ts +0 -8
- package/dist/domains/index.d.ts.map +0 -1
- package/dist/domains/index.js +0 -20
- package/dist/domains/index.js.map +0 -1
- package/dist/domains/json/index.d.ts +0 -7
- package/dist/domains/json/index.d.ts.map +0 -1
- package/dist/domains/json/index.js +0 -17
- package/dist/domains/json/index.js.map +0 -1
- package/dist/domains/json/jsonCursor.d.ts +0 -52
- package/dist/domains/json/jsonCursor.d.ts.map +0 -1
- package/dist/domains/json/jsonCursor.js +0 -197
- package/dist/domains/json/jsonCursor.js.map +0 -1
- package/dist/domains/json/jsonDomainSchema.d.ts +0 -24
- package/dist/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/dist/domains/json/jsonDomainSchema.js +0 -32
- package/dist/domains/json/jsonDomainSchema.js.map +0 -1
- package/dist/domains/leafDomain.d.ts +0 -72
- package/dist/domains/leafDomain.d.ts.map +0 -1
- package/dist/domains/leafDomain.js +0 -88
- package/dist/domains/leafDomain.js.map +0 -1
- package/dist/domains/schemaBuilder.d.ts +0 -103
- package/dist/domains/schemaBuilder.d.ts.map +0 -1
- package/dist/domains/schemaBuilder.js +0 -121
- package/dist/domains/schemaBuilder.js.map +0 -1
- package/dist/domains/testRecursiveDomain.d.ts +0 -17
- package/dist/domains/testRecursiveDomain.d.ts.map +0 -1
- package/dist/domains/testRecursiveDomain.js +0 -35
- package/dist/domains/testRecursiveDomain.js.map +0 -1
- package/dist/events/events.d.ts +0 -201
- package/dist/events/events.d.ts.map +0 -1
- package/dist/events/events.js.map +0 -1
- package/dist/feature-libraries/schemaBuilder.d.ts +0 -31
- package/dist/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilder.js +0 -40
- package/dist/feature-libraries/schemaBuilder.js.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/dist/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/dist/feature-libraries/schemaBuilderBase.js +0 -201
- package/dist/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/dist/shared-tree/treeView.d.ts +0 -73
- package/dist/shared-tree/treeView.d.ts.map +0 -1
- package/dist/shared-tree/treeView.js.map +0 -1
- package/dist/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/getJsonSchema.js.map +0 -1
- package/dist/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/getSimpleSchema.js.map +0 -1
- package/dist/simple-tree/jsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/jsonSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchema.js.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/dist/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/dist/simple-tree/viewSchemaToSimpleSchema.js.map +0 -1
- package/lib/core/revertible/index.d.ts.map +0 -1
- package/lib/core/revertible/index.js.map +0 -1
- package/lib/core/revertible/revertible.d.ts.map +0 -1
- package/lib/core/revertible/revertible.js.map +0 -1
- package/lib/domains/index.d.ts +0 -8
- package/lib/domains/index.d.ts.map +0 -1
- package/lib/domains/index.js +0 -8
- package/lib/domains/index.js.map +0 -1
- package/lib/domains/json/index.d.ts +0 -7
- package/lib/domains/json/index.d.ts.map +0 -1
- package/lib/domains/json/index.js +0 -7
- package/lib/domains/json/index.js.map +0 -1
- package/lib/domains/json/jsonCursor.d.ts +0 -52
- package/lib/domains/json/jsonCursor.d.ts.map +0 -1
- package/lib/domains/json/jsonCursor.js +0 -192
- package/lib/domains/json/jsonCursor.js.map +0 -1
- package/lib/domains/json/jsonDomainSchema.d.ts +0 -24
- package/lib/domains/json/jsonDomainSchema.d.ts.map +0 -1
- package/lib/domains/json/jsonDomainSchema.js +0 -29
- package/lib/domains/json/jsonDomainSchema.js.map +0 -1
- package/lib/domains/leafDomain.d.ts +0 -72
- package/lib/domains/leafDomain.d.ts.map +0 -1
- package/lib/domains/leafDomain.js +0 -85
- package/lib/domains/leafDomain.js.map +0 -1
- package/lib/domains/schemaBuilder.d.ts +0 -103
- package/lib/domains/schemaBuilder.d.ts.map +0 -1
- package/lib/domains/schemaBuilder.js +0 -117
- package/lib/domains/schemaBuilder.js.map +0 -1
- package/lib/domains/testRecursiveDomain.d.ts +0 -17
- package/lib/domains/testRecursiveDomain.d.ts.map +0 -1
- package/lib/domains/testRecursiveDomain.js +0 -32
- package/lib/domains/testRecursiveDomain.js.map +0 -1
- package/lib/events/events.d.ts +0 -201
- package/lib/events/events.d.ts.map +0 -1
- package/lib/events/events.js.map +0 -1
- package/lib/feature-libraries/schemaBuilder.d.ts +0 -31
- package/lib/feature-libraries/schemaBuilder.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilder.js +0 -36
- package/lib/feature-libraries/schemaBuilder.js.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.d.ts +0 -191
- package/lib/feature-libraries/schemaBuilderBase.d.ts.map +0 -1
- package/lib/feature-libraries/schemaBuilderBase.js +0 -195
- package/lib/feature-libraries/schemaBuilderBase.js.map +0 -1
- package/lib/shared-tree/treeView.d.ts +0 -73
- package/lib/shared-tree/treeView.d.ts.map +0 -1
- package/lib/shared-tree/treeView.js.map +0 -1
- package/lib/simple-tree/getJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/getJsonSchema.js.map +0 -1
- package/lib/simple-tree/getSimpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/getSimpleSchema.js.map +0 -1
- package/lib/simple-tree/jsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/jsonSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchema.js.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.d.ts.map +0 -1
- package/lib/simple-tree/simpleSchemaToJsonSchema.js.map +0 -1
- package/lib/simple-tree/viewSchemaToSimpleSchema.d.ts.map +0 -1
- package/src/domains/README.md +0 -6
- package/src/domains/fence.json +0 -5
- package/src/domains/index.ts +0 -19
- package/src/domains/json/fence.json +0 -5
- package/src/domains/json/index.ts +0 -13
- package/src/domains/json/jsonCursor.ts +0 -247
- package/src/domains/json/jsonDomainSchema.ts +0 -47
- package/src/domains/leafDomain.ts +0 -97
- package/src/domains/schemaBuilder.ts +0 -153
- package/src/domains/testRecursiveDomain.ts +0 -38
- package/src/events/fence.json +0 -5
- package/src/feature-libraries/schemaBuilder.ts +0 -45
- package/src/feature-libraries/schemaBuilderBase.ts +0 -393
- package/src/shared-tree/treeView.ts +0 -113
- /package/dist/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/dist/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/dist/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
- /package/lib/core/{revertible/revertible.js → revertible.js} +0 -0
- /package/lib/simple-tree/{jsonSchema.js → api/jsonSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchema.js → api/simpleSchema.js} +0 -0
- /package/lib/simple-tree/{simpleSchemaToJsonSchema.d.ts → api/simpleSchemaToJsonSchema.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAE7B,yDAAqE;AACrE;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,aAA4B;IACvE,OAAO,aAAa,KAAK,oBAAS,CAAC,CAAC,CAAC,6BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,6BAAU,CAAC,OAAO,CAAC;AACjF,CAAC;AAFD,kEAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CAAC,UAAsB;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,CAAC,CAAC;IACtD,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,kGAAkG;QAClG,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;SAAM,CAAC;QACP,wFAAwF;QACxF,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,EAAE,CAAC;YACjD,OAAO,2BAA2B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACzD,CAAC;QACD,kHAAkH;QAClH,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;AACF,CAAC;AAlBD,8DAkBC;AAED;;GAEG;AACH,SAAS,6BAA6B,CACrC,UAAsB,EACtB,gBAAwB;IAExB,MAAM,aAAa,GAAG,IAAA,yCAA8B,EAAC,UAAU,CAAC,CAAC;IACjE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,EAAE;QACvC,gBAAgB;QAChB,aAAa;KACb,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACtB,CAAC;AAEY,QAAA,iBAAiB,GAAG,IAAA,qBAAU,GAAsB,CAAC;AAOlE;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,WAA2B;IAC7D,
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/utilities.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kDAO6B;AAE7B,yDAAqE;AACrE;;;;GAIG;AACH,SAAgB,2BAA2B,CAAC,aAA4B;IACvE,OAAO,aAAa,KAAK,oBAAS,CAAC,CAAC,CAAC,6BAAU,CAAC,UAAU,CAAC,CAAC,CAAC,6BAAU,CAAC,OAAO,CAAC;AACjF,CAAC;AAFD,kEAEC;AAED;;;;;;;;;GASG;AACH,SAAgB,yBAAyB,CAAC,UAAsB;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,CAAC,CAAC;IACtD,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACzB,kGAAkG;QAClG,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;SAAM,CAAC;QACP,wFAAwF;QACxF,IAAI,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,EAAE,CAAC;YACjD,OAAO,2BAA2B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QACzD,CAAC;QACD,kHAAkH;QAClH,OAAO,2BAA2B,CACjC,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAC3D,CAAC;IACH,CAAC;AACF,CAAC;AAlBD,8DAkBC;AAED;;GAEG;AACH,SAAS,6BAA6B,CACrC,UAAsB,EACtB,gBAAwB;IAExB,MAAM,aAAa,GAAG,IAAA,yCAA8B,EAAC,UAAU,CAAC,CAAC;IACjE,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,yBAAiB,EAAE;QACvC,gBAAgB;QAChB,aAAa;KACb,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACtB,CAAC;AAEY,QAAA,iBAAiB,GAAG,IAAA,qBAAU,GAAsB,CAAC;AAOlE;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,WAA2B;IAC7D,OAAO;QACN,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM;QAClC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM;KAC7C,CAAC;AACH,CAAC;AALD,gDAKC;AAED;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,KAAa,EAAE,MAAc;IACvD,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QACvB,UAAU,GAAG,CAAC,CAAC;IAChB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,MAAM,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;QAClD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACpB,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAClC,CAAC;IACD,OAAO,UAAU,CAAC;AACnB,CAAC;AAZD,gCAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype AnchorNode,\n\ttype DetachedField,\n\tanchorSlot,\n\tgetDetachedFieldContainingPath,\n\trootField,\n\ttype SchemaAndPolicy,\n} from \"../../core/index.js\";\n\nimport { TreeStatus, type FlexTreeEntity } from \"./flexTreeTypes.js\";\n/**\n * Checks the detached field and returns the TreeStatus based on whether or not the detached field is a root field.\n * @param detachedField - the detached field you want to check.\n * @returns the {@link TreeStatus} from the detached field provided.\n */\nexport function treeStatusFromDetachedField(detachedField: DetachedField): TreeStatus {\n\treturn detachedField === rootField ? TreeStatus.InDocument : TreeStatus.Removed;\n}\n\n/**\n * Determines the tree status based on the anchor cache.\n *\n * Checks the anchorNode's cache to get the tree status.\n * If the cache is undefined or stale, it is updated and the treeStatus based on its detachedField is returned.\n *\n * @param anchors - the {@link AnchorSet} to compare your anchorNode cache to.\n * @param anchorNode - the {@link AnchorNode} to get the {@link TreeStatus} of.\n * @returns - the {@link TreeStatus} of the anchorNode provided.\n */\nexport function treeStatusFromAnchorCache(anchorNode: AnchorNode): TreeStatus {\n\tconst cache = anchorNode.slots.get(detachedFieldSlot);\n\tconst { generationNumber } = anchorNode.anchorSet;\n\tif (cache === undefined) {\n\t\t// If the cache is undefined, set the cache and return the treeStatus based on the detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t} else {\n\t\t// If the cache is up to date, return the treeStatus based on the cached detached field.\n\t\tif (cache.generationNumber === generationNumber) {\n\t\t\treturn treeStatusFromDetachedField(cache.detachedField);\n\t\t}\n\t\t// If the cache is not up to date, update the cache and return the treeStatus based on the updated detached field.\n\t\treturn treeStatusFromDetachedField(\n\t\t\tgetCachedUpdatedDetachedField(anchorNode, generationNumber),\n\t\t);\n\t}\n}\n\n/**\n * Updates the anchorNode cache with the provided generation number, and returns its detachedField.\n */\nfunction getCachedUpdatedDetachedField(\n\tanchorNode: AnchorNode,\n\tgenerationNumber: number,\n): DetachedField {\n\tconst detachedField = getDetachedFieldContainingPath(anchorNode);\n\tanchorNode.slots.set(detachedFieldSlot, {\n\t\tgenerationNumber,\n\t\tdetachedField,\n\t});\n\treturn detachedField;\n}\n\nexport const detachedFieldSlot = anchorSlot<DetachedFieldCache>();\n\nexport interface DetachedFieldCache {\n\tgenerationNumber: number;\n\tdetachedField: DetachedField;\n}\n\n/**\n * Utility function to get a {@link SchemaAndPolicy} object from a {@link FlexTreeNode} or {@link FlexTreeField}.\n * @param nodeOrField - {@link FlexTreeNode} or {@link FlexTreeField} to get the schema and policy from.\n * @returns A {@link SchemaAndPolicy} object with the stored schema and policy from the node or field provided.\n * For {@link Unhydrated} nodes this schema may only describe the types allowed subtree for this particular entity.\n */\nexport function getSchemaAndPolicy(nodeOrField: FlexTreeEntity): SchemaAndPolicy {\n\treturn {\n\t\tschema: nodeOrField.context.schema,\n\t\tpolicy: nodeOrField.context.flexSchema.policy,\n\t};\n}\n\n/**\n * Indexing for {@link FlexTreeField.boxedAt} and {@link FlexTreeSequenceField.at} supports the\n * usage of negative indices, which regular indexing using `[` and `]` does not.\n *\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at\n * for additional context on the semantics.\n *\n * @returns A positive index that can be used in regular indexing. Returns\n * undefined if that index would be out-of-bounds.\n */\nexport function indexForAt(index: number, length: number): number | undefined {\n\tlet finalIndex = Math.trunc(+index);\n\tif (isNaN(finalIndex)) {\n\t\tfinalIndex = 0;\n\t}\n\tif (finalIndex < -length || finalIndex >= length) {\n\t\treturn undefined;\n\t}\n\tif (finalIndex < 0) {\n\t\tfinalIndex = finalIndex + length;\n\t}\n\treturn finalIndex;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forestSummarizer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EACX,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AAGtD,OAAO,EAAE,KAAK,aAAa,EAAiB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAIN,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EAMrB,MA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AE,yBAAyB,EACpC,QAAQ,CAAC,EAAE,OAAO,EAClB,UAAU,CAAC,EAAE,OAAO,EACpB,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,OAAO,CAAC,qBAAqB,CAAC;IAI1B,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,sBAAsB;IAU7C,IAAI,CAChB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,EAAE,oBAAoB,GACzB,OAAO,CAAC,IAAI,CAAC;CAwChB"}
|
|
@@ -81,7 +81,10 @@ class ForestSummarizer {
|
|
|
81
81
|
const fieldChanges = [];
|
|
82
82
|
const build = [];
|
|
83
83
|
for (const [fieldKey, field] of fields) {
|
|
84
|
-
const chunked = (0, chunkTree_js_1.chunkField)(field,
|
|
84
|
+
const chunked = (0, chunkTree_js_1.chunkField)(field, {
|
|
85
|
+
policy: chunkTree_js_1.defaultChunkPolicy,
|
|
86
|
+
idCompressor: this.idCompressor,
|
|
87
|
+
});
|
|
85
88
|
const nodeCursors = chunked.flatMap((chunk) => (0, index_js_2.mapCursorField)(chunk.cursor(), (cursor) => cursor.fork()));
|
|
86
89
|
const buildId = { minor: allocator.allocate(nodeCursors.length) };
|
|
87
90
|
build.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forestSummarizer.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAA8D;AAC9D,kEAA6D;AAO7D,0EAAsF;AAEtF,mDAAyE;AACzE,kDAa6B;AAM7B,kDAA2D;AAC3D,sDAAsD;AACtD,iEAAgF;AAGhF,yCAAyE;AAGzE;;GAEG;AACH,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAa,gBAAgB;IAK5B;;OAEG;IACH,YACkB,MAAuB,EACvB,gBAAkC,EACnD,eAAgC,EACf,cAAyC,EAC1D,UAAyB,EAAE,aAAa,EAAE,wBAAa,EAAE,EAC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xE,CAAC;QACH,CAAC;IACF,CAAC;CACD;AAtHD,4CAsHC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IChannelStorageService } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { createSingleBlobSummary } from \"@fluidframework/shared-object-base/internal\";\n\nimport { type ICodecOptions, noopValidator } from \"../../codec/index.js\";\nimport {\n\ttype DeltaDetachedNodeBuild,\n\ttype DeltaFieldChanges,\n\ttype FieldKey,\n\ttype IEditableForest,\n\ttype ITreeCursorSynchronous,\n\ttype ITreeSubscriptionCursor,\n\ttype RevisionTagCodec,\n\tTreeNavigationResult,\n\tapplyDelta,\n\tforEachField,\n\tmakeDetachedFieldIndex,\n\tmapCursorField,\n} from \"../../core/index.js\";\nimport type {\n\tSummarizable,\n\tSummaryElementParser,\n\tSummaryElementStringifier,\n} from \"../../shared-tree-core/index.js\";\nimport { idAllocatorFromMaxId } from \"../../util/index.js\";\n// eslint-disable-next-line import/no-internal-modules\nimport { chunkField, defaultChunkPolicy } from \"../chunked-forest/chunkTree.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport { type ForestCodec, makeForestSummarizerCodec } from \"./codec.js\";\nimport type { Format } from \"./format.js\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n/**\n * The storage key for the blob in the summary containing tree data\n */\nconst treeBlobKey = \"ForestTree\";\n\n/**\n * Provides methods for summarizing and loading a forest.\n */\nexport class ForestSummarizer implements Summarizable {\n\tpublic readonly key = \"Forest\";\n\n\tprivate readonly codec: ForestCodec;\n\n\t/**\n\t * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.\n\t */\n\tpublic constructor(\n\t\tprivate readonly forest: IEditableForest,\n\t\tprivate readonly revisionTagCodec: RevisionTagCodec,\n\t\tfieldBatchCodec: FieldBatchCodec,\n\t\tprivate readonly encoderContext: FieldBatchEncodingContext,\n\t\toptions: ICodecOptions = { jsonValidator: noopValidator },\n\t\tprivate readonly idCompressor: IIdCompressor,\n\t) {\n\t\tthis.codec = makeForestSummarizerCodec(options, fieldBatchCodec);\n\t}\n\n\t/**\n\t * Synchronous monolithic summarization of tree content.\n\t *\n\t * TODO: when perf matters, this should be replaced with a chunked async version using a binary format.\n\t *\n\t * @returns a snapshot of the forest's tree as a string.\n\t */\n\tprivate getTreeString(stringify: SummaryElementStringifier): string {\n\t\tconst rootCursor = this.forest.getCursorAboveDetachedFields();\n\t\tconst fieldMap: Map<FieldKey, ITreeCursorSynchronous & ITreeSubscriptionCursor> =\n\t\t\tnew Map();\n\t\t// TODO: Encode all detached fields in one operation for better performance and compression\n\t\tforEachField(rootCursor, (cursor) => {\n\t\t\tconst key = cursor.getFieldKey();\n\t\t\tconst innerCursor = this.forest.allocateCursor(\"getTreeString\");\n\t\t\tassert(\n\t\t\t\tthis.forest.tryMoveCursorToField({ fieldKey: key, parent: undefined }, innerCursor) ===\n\t\t\t\t\tTreeNavigationResult.Ok,\n\t\t\t\t0x892 /* failed to navigate to field */,\n\t\t\t);\n\t\t\tfieldMap.set(key, innerCursor as ITreeCursorSynchronous & ITreeSubscriptionCursor);\n\t\t});\n\t\tconst encoded = this.codec.encode(fieldMap, this.encoderContext);\n\n\t\tfieldMap.forEach((value) => value.free());\n\t\treturn stringify(encoded);\n\t}\n\n\tpublic getAttachSummary(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats {\n\t\treturn createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));\n\t}\n\n\tpublic async summarize(\n\t\tstringify: SummaryElementStringifier,\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\treturn createSingleBlobSummary(treeBlobKey, this.getTreeString(stringify));\n\t}\n\n\tpublic getGCData(fullGC?: boolean): IGarbageCollectionData {\n\t\t// TODO: Properly implement garbage collection. Right now, garbage collection is performed automatically\n\t\t// by the code in SharedObject (from which SharedTreeCore extends). The `runtime.uploadBlob` API delegates\n\t\t// to the `BlobManager`, which automatically populates the summary with ISummaryAttachment entries for each\n\t\t// blob.\n\t\treturn {\n\t\t\tgcNodes: {},\n\t\t};\n\t}\n\n\tpublic async load(\n\t\tservices: IChannelStorageService,\n\t\tparse: SummaryElementParser,\n\t): Promise<void> {\n\t\tif (await services.contains(treeBlobKey)) {\n\t\t\tconst treeBuffer = await services.readBlob(treeBlobKey);\n\t\t\tconst treeBufferString = bufferToString(treeBuffer, \"utf8\");\n\t\t\t// TODO: this code is parsing data without an optional validator, this should be defined in a typebox schema as part of the\n\t\t\t// forest summary format.\n\t\t\tconst fields = this.codec.decode(parse(treeBufferString) as Format, this.encoderContext);\n\t\t\tconst allocator = idAllocatorFromMaxId();\n\t\t\tconst fieldChanges: [FieldKey, DeltaFieldChanges][] = [];\n\t\t\tconst build: DeltaDetachedNodeBuild[] = [];\n\t\t\tfor (const [fieldKey, field] of fields) {\n\t\t\t\tconst chunked = chunkField(field, {\n\t\t\t\t\tpolicy: defaultChunkPolicy,\n\t\t\t\t\tidCompressor: this.idCompressor,\n\t\t\t\t});\n\t\t\t\tconst nodeCursors = chunked.flatMap((chunk) =>\n\t\t\t\t\tmapCursorField(chunk.cursor(), (cursor) => cursor.fork()),\n\t\t\t\t);\n\t\t\t\tconst buildId = { minor: allocator.allocate(nodeCursors.length) };\n\t\t\t\tbuild.push({\n\t\t\t\t\tid: buildId,\n\t\t\t\t\ttrees: nodeCursors,\n\t\t\t\t});\n\t\t\t\tfieldChanges.push([\n\t\t\t\t\tfieldKey,\n\t\t\t\t\t{\n\t\t\t\t\t\tlocal: [{ count: nodeCursors.length, attach: buildId }],\n\t\t\t\t\t},\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tassert(this.forest.isEmpty, 0x797 /* forest must be empty */);\n\t\t\tapplyDelta(\n\t\t\t\t{ build, fields: new Map(fieldChanges) },\n\t\t\t\tundefined,\n\t\t\t\tthis.forest,\n\t\t\t\tmakeDetachedFieldIndex(\"init\", this.revisionTagCodec, this.idCompressor),\n\t\t\t);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -15,19 +15,17 @@ export { cursorForJsonableTreeNode, cursorForJsonableTreeField, jsonableTreeFrom
|
|
|
15
15
|
import * as SequenceField from "./sequence-field/index.js";
|
|
16
16
|
export { SequenceField };
|
|
17
17
|
export { isNeverField, ModularEditBuilder, type FieldEditDescription as EditDescription, type FieldChangeHandler, type FieldChangeRebaser, type FieldEditor, type FieldChangeMap, type FieldChange, type FieldChangeset, type ToDelta, type ModularChangeset, makeModularChangeCodecFamily, type NodeChangeComposer, type NodeChangeInverter, type NodeChangeRebaser, type NodeChangePruner, type CrossFieldManager, CrossFieldTarget, FlexFieldKind, type FullSchemaPolicy, allowsRepoSuperset, type GenericChangeset, genericFieldKind, type HasFieldChanges, type NodeExistsConstraint, FieldKindWithEditor, ModularChangeFamily, type RelevantRemovedRootsFromChild, EncodedModularChangeset, updateRefreshers, type NodeId, type FieldChangeEncodingContext, type FieldKindConfiguration, type FieldKindConfigurationEntry, getAllowedContentIncompatibilities, isRepoSuperset, } from "./modular-schema/index.js";
|
|
18
|
-
export { type FlexTreeNodeSchema, type FlexAllowedTypes, FlexFieldSchema, type FlexTreeSchema,
|
|
19
|
-
export { SchemaBuilderBase, type SchemaLibrary, type FlexImplicitFieldSchema, type NormalizeField, type FlexImplicitAllowedTypes, type NormalizeAllowedTypes, type SchemaBuilderOptions, normalizeAllowedTypes, normalizeField, } from "./schemaBuilderBase.js";
|
|
20
|
-
export { SchemaBuilderInternal } from "./schemaBuilder.js";
|
|
18
|
+
export { type FlexTreeNodeSchema, type FlexAllowedTypes, FlexFieldSchema, type FlexTreeSchema, type SchemaLibraryData, type LazyTreeNodeSchema, ViewSchema, type SchemaLintConfiguration, LeafNodeSchema, FlexMapNodeSchema, FlexObjectNodeSchema, schemaIsLeaf, schemaIsMap, schemaIsObjectNode, type Unenforced, type AllowedTypeSet, markEager, type FlexMapFieldSchema, type SchemaCollection, TreeNodeSchemaBase, type LazyItem, type FlexListToUnion, type ExtractItemType, isLazy, type FlexObjectNodeFields, intoStoredSchema, intoStoredSchemaCollection, type NormalizeLazyItem, type FlexList, } from "./typed-schema/index.js";
|
|
21
19
|
export { mapRootChanges } from "./deltaUtils.js";
|
|
22
20
|
export { type TreeChunk, chunkTree, chunkFieldSingle, buildChunkedForest, defaultChunkPolicy, type FieldBatch, type FieldBatchCodec, makeTreeChunker, makeFieldBatchCodec, type FieldBatchEncodingContext, } from "./chunked-forest/index.js";
|
|
23
21
|
export { compareLocalNodeKeys, createNodeKeyManager, isStableNodeKey, type LocalNodeKey, MockNodeKeyManager, type NodeKeyManager, nodeKeyTreeIdentifier, type StableNodeKey, } from "./node-key/index.js";
|
|
24
22
|
export { FieldKinds, type Required, type Optional, type Sequence, type Identifier, type Forbidden, type DefaultChangeset, DefaultChangeFamily, DefaultEditBuilder, type IDefaultEditBuilder, type ValueFieldEditBuilder, type OptionalFieldEditBuilder, type SequenceFieldEditBuilder, defaultSchemaPolicy, fieldKinds, fieldKindConfigurations, intoDelta, relevantRemovedRoots, SchemaValidationErrors, isNodeInSchema, isFieldInSchema, } from "./default-schema/index.js";
|
|
25
|
-
export { type
|
|
23
|
+
export { type FlexTreeOptionalField, type FlexTreeRequiredField, type FlexTreeSequenceField, Skip, type FlexTreeContext, type FlexTreeHydratedContext, type FlexTreeTypedField, type FlexTreeEntity, type FlexTreeField, type FlexTreeNode, getTreeContext, TreeStatus, Context, type FlexTreeNodeEvents, type FlexTreeUnknownUnboxed, isFlexTreeNode, ContextSlot, flexTreeMarker, assertFlexTreeEntityNotFreed, flexTreeSlot, getSchemaAndPolicy, isFreedSymbol, LazyEntity, treeStatusFromAnchorCache, } from "./flex-tree/index.js";
|
|
26
24
|
export { treeSchemaFromStoredSchema } from "./storedToViewSchema.js";
|
|
27
25
|
export { TreeCompressionStrategy } from "./treeCompressionUtils.js";
|
|
28
26
|
export { valueSchemaAllows } from "./valueUtilities.js";
|
|
29
27
|
export { DetachedFieldIndexSummarizer } from "./detachedFieldIndexSummarizer.js";
|
|
30
28
|
export { type SchemaChange, makeSchemaChangeCodecs, EncodedSchemaChange, } from "./schema-edits/index.js";
|
|
31
29
|
export { makeMitigatedChangeFamily } from "./mitigatedChangeFamily.js";
|
|
32
|
-
export { type MapTreeNode, type MapTreeSequenceField, isMapTreeNode, isMapTreeSequenceField, getOrCreateMapTreeNode, tryGetMapTreeNode, } from "./flex-map-tree/index.js";
|
|
30
|
+
export { type MapTreeNode, type MapTreeSequenceField, isMapTreeNode, isMapTreeSequenceField, getOrCreateMapTreeNode, tryGetMapTreeNode, UnhydratedContext, } from "./flex-map-tree/index.js";
|
|
33
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,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cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,aAAa,EACb,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,6BAA6B,EAClC,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,MAAM,EACX,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,kCAAkC,EAClC,cAAc,GACd,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,cAAc,EACnB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,4BAA4B,EAC5B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,WAAW,EACX,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,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yB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,0BAA0B,CAAC"}
|
|
@@ -27,9 +27,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.tryGetMapTreeNode = exports.getOrCreateMapTreeNode = exports.isMapTreeSequenceField = exports.isMapTreeNode = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange =
|
|
30
|
+
exports.FlexMapNodeSchema = exports.LeafNodeSchema = exports.ViewSchema = exports.FlexFieldSchema = exports.isRepoSuperset = exports.getAllowedContentIncompatibilities = exports.updateRefreshers = exports.EncodedModularChangeset = exports.ModularChangeFamily = exports.FieldKindWithEditor = exports.genericFieldKind = exports.allowsRepoSuperset = exports.FlexFieldKind = exports.CrossFieldTarget = exports.makeModularChangeCodecFamily = exports.ModularEditBuilder = exports.isNeverField = exports.SequenceField = exports.jsonableTreeFromForest = exports.jsonableTreeFromFieldCursor = exports.jsonableTreeFromCursor = exports.cursorForJsonableTreeField = exports.cursorForJsonableTreeNode = exports.stackTreeFieldCursor = exports.prefixFieldPath = exports.prefixPath = exports.stackTreeNodeCursor = exports.makeSchemaCodec = exports.encodeTreeSchema = exports.SchemaSummarizer = exports.buildForest = exports.MemoizedIdRangeAllocator = exports.mapTreeFieldFromCursor = exports.mapTreeFromCursor = exports.cursorForMapTreeNode = exports.cursorForMapTreeField = exports.ForestSummarizer = exports.isTreeValue = exports.assertAllowedValue = exports.allowsValue = exports.compileSyntaxTree = exports.comparePipeline = exports.toDownPath = exports.BindingType = exports.indexSymbol = exports.createFlushableBinderOptions = exports.createBinderOptions = exports.createDataBinderInvalidating = exports.createDataBinderDirect = exports.createDataBinderBuffering = void 0;
|
|
31
|
+
exports.makeSchemaChangeCodecs = exports.DetachedFieldIndexSummarizer = exports.valueSchemaAllows = exports.TreeCompressionStrategy = exports.treeSchemaFromStoredSchema = exports.treeStatusFromAnchorCache = exports.LazyEntity = exports.isFreedSymbol = exports.getSchemaAndPolicy = exports.flexTreeSlot = exports.assertFlexTreeEntityNotFreed = exports.flexTreeMarker = exports.ContextSlot = exports.isFlexTreeNode = exports.Context = exports.TreeStatus = exports.getTreeContext = exports.Skip = exports.isFieldInSchema = exports.isNodeInSchema = exports.SchemaValidationErrors = exports.relevantRemovedRoots = exports.intoDelta = exports.fieldKindConfigurations = exports.fieldKinds = exports.defaultSchemaPolicy = exports.DefaultEditBuilder = exports.DefaultChangeFamily = exports.FieldKinds = exports.nodeKeyTreeIdentifier = exports.MockNodeKeyManager = exports.isStableNodeKey = exports.createNodeKeyManager = exports.compareLocalNodeKeys = exports.makeFieldBatchCodec = exports.makeTreeChunker = exports.defaultChunkPolicy = exports.buildChunkedForest = exports.chunkFieldSingle = exports.chunkTree = exports.mapRootChanges = exports.intoStoredSchemaCollection = exports.intoStoredSchema = exports.isLazy = exports.TreeNodeSchemaBase = exports.markEager = exports.schemaIsObjectNode = exports.schemaIsMap = exports.schemaIsLeaf = exports.FlexObjectNodeSchema = void 0;
|
|
32
|
+
exports.UnhydratedContext = exports.tryGetMapTreeNode = exports.getOrCreateMapTreeNode = exports.isMapTreeSequenceField = exports.isMapTreeNode = exports.makeMitigatedChangeFamily = exports.EncodedSchemaChange = void 0;
|
|
33
33
|
var editableTreeBinder_js_1 = require("./editableTreeBinder.js");
|
|
34
34
|
Object.defineProperty(exports, "createDataBinderBuffering", { enumerable: true, get: function () { return editableTreeBinder_js_1.createDataBinderBuffering; } });
|
|
35
35
|
Object.defineProperty(exports, "createDataBinderDirect", { enumerable: true, get: function () { return editableTreeBinder_js_1.createDataBinderDirect; } });
|
|
@@ -90,7 +90,6 @@ Object.defineProperty(exports, "getAllowedContentIncompatibilities", { enumerabl
|
|
|
90
90
|
Object.defineProperty(exports, "isRepoSuperset", { enumerable: true, get: function () { return index_js_4.isRepoSuperset; } });
|
|
91
91
|
var index_js_5 = require("./typed-schema/index.js");
|
|
92
92
|
Object.defineProperty(exports, "FlexFieldSchema", { enumerable: true, get: function () { return index_js_5.FlexFieldSchema; } });
|
|
93
|
-
Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_js_5.Any; } });
|
|
94
93
|
Object.defineProperty(exports, "ViewSchema", { enumerable: true, get: function () { return index_js_5.ViewSchema; } });
|
|
95
94
|
Object.defineProperty(exports, "LeafNodeSchema", { enumerable: true, get: function () { return index_js_5.LeafNodeSchema; } });
|
|
96
95
|
Object.defineProperty(exports, "FlexMapNodeSchema", { enumerable: true, get: function () { return index_js_5.FlexMapNodeSchema; } });
|
|
@@ -103,12 +102,6 @@ Object.defineProperty(exports, "TreeNodeSchemaBase", { enumerable: true, get: fu
|
|
|
103
102
|
Object.defineProperty(exports, "isLazy", { enumerable: true, get: function () { return index_js_5.isLazy; } });
|
|
104
103
|
Object.defineProperty(exports, "intoStoredSchema", { enumerable: true, get: function () { return index_js_5.intoStoredSchema; } });
|
|
105
104
|
Object.defineProperty(exports, "intoStoredSchemaCollection", { enumerable: true, get: function () { return index_js_5.intoStoredSchemaCollection; } });
|
|
106
|
-
var schemaBuilderBase_js_1 = require("./schemaBuilderBase.js");
|
|
107
|
-
Object.defineProperty(exports, "SchemaBuilderBase", { enumerable: true, get: function () { return schemaBuilderBase_js_1.SchemaBuilderBase; } });
|
|
108
|
-
Object.defineProperty(exports, "normalizeAllowedTypes", { enumerable: true, get: function () { return schemaBuilderBase_js_1.normalizeAllowedTypes; } });
|
|
109
|
-
Object.defineProperty(exports, "normalizeField", { enumerable: true, get: function () { return schemaBuilderBase_js_1.normalizeField; } });
|
|
110
|
-
var schemaBuilder_js_1 = require("./schemaBuilder.js");
|
|
111
|
-
Object.defineProperty(exports, "SchemaBuilderInternal", { enumerable: true, get: function () { return schemaBuilder_js_1.SchemaBuilderInternal; } });
|
|
112
105
|
var deltaUtils_js_1 = require("./deltaUtils.js");
|
|
113
106
|
Object.defineProperty(exports, "mapRootChanges", { enumerable: true, get: function () { return deltaUtils_js_1.mapRootChanges; } });
|
|
114
107
|
var index_js_6 = require("./chunked-forest/index.js");
|
|
@@ -143,10 +136,8 @@ Object.defineProperty(exports, "TreeStatus", { enumerable: true, get: function (
|
|
|
143
136
|
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return index_js_9.Context; } });
|
|
144
137
|
Object.defineProperty(exports, "isFlexTreeNode", { enumerable: true, get: function () { return index_js_9.isFlexTreeNode; } });
|
|
145
138
|
Object.defineProperty(exports, "ContextSlot", { enumerable: true, get: function () { return index_js_9.ContextSlot; } });
|
|
139
|
+
// Internal
|
|
146
140
|
Object.defineProperty(exports, "flexTreeMarker", { enumerable: true, get: function () { return index_js_9.flexTreeMarker; } });
|
|
147
|
-
Object.defineProperty(exports, "FlexTreeEntityKind", { enumerable: true, get: function () { return index_js_9.FlexTreeEntityKind; } });
|
|
148
|
-
Object.defineProperty(exports, "reservedObjectNodeFieldPropertyNames", { enumerable: true, get: function () { return index_js_9.reservedObjectNodeFieldPropertyNames; } });
|
|
149
|
-
Object.defineProperty(exports, "reservedObjectNodeFieldPropertyNamePrefixes", { enumerable: true, get: function () { return index_js_9.reservedObjectNodeFieldPropertyNamePrefixes; } });
|
|
150
141
|
Object.defineProperty(exports, "assertFlexTreeEntityNotFreed", { enumerable: true, get: function () { return index_js_9.assertFlexTreeEntityNotFreed; } });
|
|
151
142
|
Object.defineProperty(exports, "flexTreeSlot", { enumerable: true, get: function () { return index_js_9.flexTreeSlot; } });
|
|
152
143
|
Object.defineProperty(exports, "getSchemaAndPolicy", { enumerable: true, get: function () { return index_js_9.getSchemaAndPolicy; } });
|
|
@@ -171,4 +162,5 @@ Object.defineProperty(exports, "isMapTreeNode", { enumerable: true, get: functio
|
|
|
171
162
|
Object.defineProperty(exports, "isMapTreeSequenceField", { enumerable: true, get: function () { return index_js_11.isMapTreeSequenceField; } });
|
|
172
163
|
Object.defineProperty(exports, "getOrCreateMapTreeNode", { enumerable: true, get: function () { return index_js_11.getOrCreateMapTreeNode; } });
|
|
173
164
|
Object.defineProperty(exports, "tryGetMapTreeNode", { enumerable: true, get: function () { return index_js_11.tryGetMapTreeNode; } });
|
|
165
|
+
Object.defineProperty(exports, "UnhydratedContext", { enumerable: true, get: function () { return index_js_11.UnhydratedContext; } });
|
|
174
166
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAqCiC;AApChC,kIAAA,yBAAyB,OAAA;AACzB,+HAAA,sBAAsB,OAAA;AACtB,qIAAA,4BAA4B,OAAA;AAC5B,4HAAA,mBAAmB,OAAA;AACnB,qIAAA,4BAA4B,OAAA;AAS5B,oHAAA,WAAW,OAAA;AAOX,oHAAA,WAAW,OAAA;AAaX,mHAAA,UAAU,OAAA;AACV,wHAAA,eAAe,OAAA;AACf,0HAAA,iBAAiB,OAAA;AAGlB,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAIrD,sDAA6D;AAApD,4GAAA,gBAAgB,OAAA;AACzB,uDAK4B;AAJ3B,yHAAA,qBAAqB,OAAA;AACrB,wHAAA,oBAAoB,OAAA;AACpB,qHAAA,iBAAiB,OAAA;AACjB,0HAAA,sBAAsB,OAAA;AAEvB,6EAAuF;AAA9E,uIAAA,wBAAwB,OAAA;AACjC,qDAAuD;AAA9C,uGAAA,WAAW,OAAA;AACpB,oDAA8F;AAArF,4GAAA,gBAAgB,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAAE,2GAAA,eAAe,OAAA;AAC5D,2DAO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E1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,qDAIiC;AAFhC,mHAAA,sBAAsB,OAAA;AACtB,gHAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,sDAOkC;AAJjC,0GAAA,aAAa,OAAA;AACb,mHAAA,sBAAsB,OAAA;AACtB,mHAAA,sBAAsB,OAAA;AACtB,8GAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateDataBinderBuffering,\n\tcreateDataBinderDirect,\n\tcreateDataBinderInvalidating,\n\tcreateBinderOptions,\n\tcreateFlushableBinderOptions,\n\ttype DataBinder,\n\ttype BinderOptions,\n\ttype Flushable,\n\ttype FlushableBinderOptions,\n\ttype FlushableDataBinder,\n\ttype MatchPolicy,\n\ttype SubtreePolicy,\n\ttype BindSyntaxTree,\n\tindexSymbol,\n\ttype BindPolicy,\n\ttype BindTree,\n\ttype BindTreeDefault,\n\ttype DownPath,\n\ttype BindPath,\n\ttype PathStep,\n\tBindingType,\n\ttype BindingContextType,\n\ttype BindingContext,\n\ttype VisitorBindingContext,\n\ttype RemoveBindingContext,\n\ttype InsertBindingContext,\n\ttype BatchBindingContext,\n\ttype InvalidationBindingContext,\n\ttype OperationBinderEvents,\n\ttype InvalidationBinderEvents,\n\ttype CompareFunction,\n\ttype BinderEventsCompare,\n\ttype AnchorsCompare,\n\ttoDownPath,\n\tcomparePipeline,\n\tcompileSyntaxTree,\n} from \"./editableTreeBinder.js\";\n\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport type { FieldGenerator, TreeDataContext } from \"./fieldGenerator.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n} from \"./mapTreeCursor.js\";\nexport { MemoizedIdRangeAllocator, type IdRange } from \"./memoizedIdRangeAllocator.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec } from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tgetAllowedContentIncompatibilities,\n\tisRepoSuperset,\n} from \"./modular-schema/index.js\";\n\nexport {\n\ttype FlexTreeNodeSchema,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexTreeSchema,\n\tAny,\n\ttype SchemaLibraryData,\n\ttype LazyTreeNodeSchema,\n\tViewSchema,\n\ttype SchemaLintConfiguration,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\ttype Unenforced,\n\ttype AllowedTypeSet,\n\tmarkEager,\n\ttype FlexMapFieldSchema,\n\ttype SchemaCollection,\n\tTreeNodeSchemaBase,\n\ttype LazyItem,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\tisLazy,\n\ttype NormalizeObjectNodeFields,\n\ttype NormalizeField as NormalizeFieldSchema,\n\ttype FlexObjectNodeFields,\n\tintoStoredSchema,\n\tintoStoredSchemaCollection,\n\ttype NormalizeLazyItem,\n\ttype FlexList,\n} from \"./typed-schema/index.js\";\n\nexport {\n\tSchemaBuilderBase,\n\ttype SchemaLibrary,\n\ttype FlexImplicitFieldSchema,\n\ttype NormalizeField,\n\ttype FlexImplicitAllowedTypes,\n\ttype NormalizeAllowedTypes,\n\ttype SchemaBuilderOptions,\n\tnormalizeAllowedTypes,\n\tnormalizeField,\n} from \"./schemaBuilderBase.js\";\nexport { SchemaBuilderInternal } from \"./schemaBuilder.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeKeys,\n\tcreateNodeKeyManager,\n\tisStableNodeKey,\n\ttype LocalNodeKey,\n\tMockNodeKeyManager,\n\ttype NodeKeyManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeKey,\n} from \"./node-key/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationErrors,\n\tisNodeInSchema,\n\tisFieldInSchema,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype AssignableFieldKinds,\n\ttype FlexibleFieldContent,\n\ttype FlexibleNodeContent,\n\ttype FlexTreeLeafNode,\n\ttype FlexTreeMapNode,\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tSkip,\n\ttype FlexTreeObjectNode,\n\ttype FlexTreeObjectNodeTyped,\n\ttype FlexTreeContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeTypedNode,\n\ttype FlexTreeTypedNodeUnion,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tgetTreeContext,\n\ttype CheckTypesOverlap,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\ttype FlexTreeTypedFieldInner,\n\ttype FlexTreeUnboxFieldInner,\n\ttype FlexTreeObjectNodeFields,\n\ttype FlexTreeUnboxField,\n\ttype FlexTreeUnboxNode,\n\ttype FlexTreeUnboxNodeUnion,\n\ttype IsArrayOfOne,\n\ttype FlexibleNodeSubSequence,\n\tflexTreeMarker,\n\tFlexTreeEntityKind,\n\ttype PropertyNameFromFieldKey,\n\ttype ReservedObjectNodeFieldPropertyNames,\n\ttype ReservedObjectNodeFieldPropertyNamePrefixes,\n\treservedObjectNodeFieldPropertyNames,\n\treservedObjectNodeFieldPropertyNamePrefixes,\n\ttype FlexTreeObjectNodeFieldsInner,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tisFreedSymbol,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n} from \"./flex-tree/index.js\";\n\nexport { treeSchemaFromStoredSchema } from \"./storedToViewSchema.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype MapTreeNode,\n\ttype MapTreeSequenceField,\n\tisMapTreeNode,\n\tisMapTreeSequenceField,\n\tgetOrCreateMapTreeNode,\n\ttryGetMapTreeNode,\n} from \"./flex-map-tree/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-libraries/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iEAqCiC;AApChC,kIAAA,yBAAyB,OAAA;AACzB,+HAAA,sBAAsB,OAAA;AACtB,qIAAA,4BAA4B,OAAA;AAC5B,4HAAA,mBAAmB,OAAA;AACnB,qIAAA,4BAA4B,OAAA;AAS5B,oHAAA,WAAW,OAAA;AAOX,oHAAA,WAAW,OAAA;AAaX,mHAAA,UAAU,OAAA;AACV,wHAAA,eAAe,OAAA;AACf,0HAAA,iBAAiB,OAAA;AAGlB,yDAAmF;AAA1E,gHAAA,WAAW,OAAA;AAAE,uHAAA,kBAAkB,OAAA;AAAE,gHAAA,WAAW,OAAA;AAIrD,sDAA6D;AAApD,4GAAA,gBAAgB,OAAA;AACz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3D,kIAAA,uBAAuB,OAAA;AAEhC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAE1B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AAErC,qDAIiC;AAFhC,mHAAA,sBAAsB,OAAA;AACtB,gHAAA,mBAAmB,OAAA;AAGpB,uEAAuE;AAA9D,qIAAA,yBAAyB,OAAA;AAElC,sDAQkC;AALjC,0GAAA,aAAa,OAAA;AACb,mHAAA,sBAAsB,OAAA;AACtB,mHAAA,sBAAsB,OAAA;AACtB,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateDataBinderBuffering,\n\tcreateDataBinderDirect,\n\tcreateDataBinderInvalidating,\n\tcreateBinderOptions,\n\tcreateFlushableBinderOptions,\n\ttype DataBinder,\n\ttype BinderOptions,\n\ttype Flushable,\n\ttype FlushableBinderOptions,\n\ttype FlushableDataBinder,\n\ttype MatchPolicy,\n\ttype SubtreePolicy,\n\ttype BindSyntaxTree,\n\tindexSymbol,\n\ttype BindPolicy,\n\ttype BindTree,\n\ttype BindTreeDefault,\n\ttype DownPath,\n\ttype BindPath,\n\ttype PathStep,\n\tBindingType,\n\ttype BindingContextType,\n\ttype BindingContext,\n\ttype VisitorBindingContext,\n\ttype RemoveBindingContext,\n\ttype InsertBindingContext,\n\ttype BatchBindingContext,\n\ttype InvalidationBindingContext,\n\ttype OperationBinderEvents,\n\ttype InvalidationBinderEvents,\n\ttype CompareFunction,\n\ttype BinderEventsCompare,\n\ttype AnchorsCompare,\n\ttoDownPath,\n\tcomparePipeline,\n\tcompileSyntaxTree,\n} from \"./editableTreeBinder.js\";\n\nexport { allowsValue, assertAllowedValue, isTreeValue } from \"./valueUtilities.js\";\n\nexport type { FieldGenerator, TreeDataContext } from \"./fieldGenerator.js\";\n\nexport { ForestSummarizer } from \"./forest-summary/index.js\";\nexport {\n\tcursorForMapTreeField,\n\tcursorForMapTreeNode,\n\tmapTreeFromCursor,\n\tmapTreeFieldFromCursor,\n} from \"./mapTreeCursor.js\";\nexport { MemoizedIdRangeAllocator, type IdRange } from \"./memoizedIdRangeAllocator.js\";\nexport { buildForest } from \"./object-forest/index.js\";\nexport { SchemaSummarizer, encodeTreeSchema, makeSchemaCodec } from \"./schema-index/index.js\";\nexport {\n\tstackTreeNodeCursor,\n\ttype CursorAdapter,\n\tprefixPath,\n\tprefixFieldPath,\n\ttype CursorWithNode,\n\tstackTreeFieldCursor,\n} from \"./treeCursorUtils.js\";\nexport {\n\tcursorForJsonableTreeNode,\n\tcursorForJsonableTreeField,\n\tjsonableTreeFromCursor,\n\tjsonableTreeFromFieldCursor,\n\tjsonableTreeFromForest,\n} from \"./treeTextCursor.js\";\n\n// Split this up into separate import and export for compatibility with API-Extractor.\nimport * as SequenceField from \"./sequence-field/index.js\";\nexport { SequenceField };\n\nexport {\n\tisNeverField,\n\tModularEditBuilder,\n\ttype FieldEditDescription as EditDescription,\n\ttype FieldChangeHandler,\n\ttype FieldChangeRebaser,\n\ttype FieldEditor,\n\ttype FieldChangeMap,\n\ttype FieldChange,\n\ttype FieldChangeset,\n\ttype ToDelta,\n\ttype ModularChangeset,\n\tmakeModularChangeCodecFamily,\n\ttype NodeChangeComposer,\n\ttype NodeChangeInverter,\n\ttype NodeChangeRebaser,\n\ttype NodeChangePruner,\n\ttype CrossFieldManager,\n\tCrossFieldTarget,\n\tFlexFieldKind,\n\ttype FullSchemaPolicy,\n\tallowsRepoSuperset,\n\ttype GenericChangeset,\n\tgenericFieldKind,\n\ttype HasFieldChanges,\n\ttype NodeExistsConstraint,\n\tFieldKindWithEditor,\n\tModularChangeFamily,\n\ttype RelevantRemovedRootsFromChild,\n\tEncodedModularChangeset,\n\tupdateRefreshers,\n\ttype NodeId,\n\ttype FieldChangeEncodingContext,\n\ttype FieldKindConfiguration,\n\ttype FieldKindConfigurationEntry,\n\tgetAllowedContentIncompatibilities,\n\tisRepoSuperset,\n} from \"./modular-schema/index.js\";\n\nexport {\n\ttype FlexTreeNodeSchema,\n\ttype FlexAllowedTypes,\n\tFlexFieldSchema,\n\ttype FlexTreeSchema,\n\ttype SchemaLibraryData,\n\ttype LazyTreeNodeSchema,\n\tViewSchema,\n\ttype SchemaLintConfiguration,\n\tLeafNodeSchema,\n\tFlexMapNodeSchema,\n\tFlexObjectNodeSchema,\n\tschemaIsLeaf,\n\tschemaIsMap,\n\tschemaIsObjectNode,\n\ttype Unenforced,\n\ttype AllowedTypeSet,\n\tmarkEager,\n\ttype FlexMapFieldSchema,\n\ttype SchemaCollection,\n\tTreeNodeSchemaBase,\n\ttype LazyItem,\n\ttype FlexListToUnion,\n\ttype ExtractItemType,\n\tisLazy,\n\ttype FlexObjectNodeFields,\n\tintoStoredSchema,\n\tintoStoredSchemaCollection,\n\ttype NormalizeLazyItem,\n\ttype FlexList,\n} from \"./typed-schema/index.js\";\n\nexport { mapRootChanges } from \"./deltaUtils.js\";\n\nexport {\n\ttype TreeChunk,\n\tchunkTree,\n\tchunkFieldSingle,\n\tbuildChunkedForest,\n\tdefaultChunkPolicy,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeTreeChunker,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n} from \"./chunked-forest/index.js\";\n\nexport {\n\tcompareLocalNodeKeys,\n\tcreateNodeKeyManager,\n\tisStableNodeKey,\n\ttype LocalNodeKey,\n\tMockNodeKeyManager,\n\ttype NodeKeyManager,\n\tnodeKeyTreeIdentifier,\n\ttype StableNodeKey,\n} from \"./node-key/index.js\";\n\nexport {\n\tFieldKinds,\n\ttype Required,\n\ttype Optional,\n\ttype Sequence,\n\ttype Identifier,\n\ttype Forbidden,\n\ttype DefaultChangeset,\n\tDefaultChangeFamily,\n\tDefaultEditBuilder,\n\ttype IDefaultEditBuilder,\n\ttype ValueFieldEditBuilder,\n\ttype OptionalFieldEditBuilder,\n\ttype SequenceFieldEditBuilder,\n\tdefaultSchemaPolicy,\n\tfieldKinds,\n\tfieldKindConfigurations,\n\tintoDelta,\n\trelevantRemovedRoots,\n\tSchemaValidationErrors,\n\tisNodeInSchema,\n\tisFieldInSchema,\n} from \"./default-schema/index.js\";\n\nexport {\n\ttype FlexTreeOptionalField,\n\ttype FlexTreeRequiredField,\n\ttype FlexTreeSequenceField,\n\tSkip,\n\ttype FlexTreeContext,\n\ttype FlexTreeHydratedContext,\n\ttype FlexTreeTypedField,\n\ttype FlexTreeEntity,\n\ttype FlexTreeField,\n\ttype FlexTreeNode,\n\tgetTreeContext,\n\tTreeStatus,\n\tContext,\n\ttype FlexTreeNodeEvents,\n\ttype FlexTreeUnknownUnboxed,\n\tisFlexTreeNode,\n\tContextSlot,\n\t// Internal\n\tflexTreeMarker,\n\tassertFlexTreeEntityNotFreed,\n\tflexTreeSlot,\n\tgetSchemaAndPolicy,\n\tisFreedSymbol,\n\tLazyEntity,\n\ttreeStatusFromAnchorCache,\n} from \"./flex-tree/index.js\";\n\nexport { treeSchemaFromStoredSchema } from \"./storedToViewSchema.js\";\n\nexport { TreeCompressionStrategy } from \"./treeCompressionUtils.js\";\n\nexport { valueSchemaAllows } from \"./valueUtilities.js\";\n\nexport { DetachedFieldIndexSummarizer } from \"./detachedFieldIndexSummarizer.js\";\n\nexport {\n\ttype SchemaChange,\n\tmakeSchemaChangeCodecs,\n\tEncodedSchemaChange,\n} from \"./schema-edits/index.js\";\n\nexport { makeMitigatedChangeFamily } from \"./mitigatedChangeFamily.js\";\n\nexport {\n\ttype MapTreeNode,\n\ttype MapTreeSequenceField,\n\tisMapTreeNode,\n\tisMapTreeSequenceField,\n\tgetOrCreateMapTreeNode,\n\ttryGetMapTreeNode,\n\tUnhydratedContext,\n} from \"./flex-map-tree/index.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"comparison.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAIN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQvD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,QAAQ,EAAE,oBAAoB,GAAG,SAAS,GACxC,OAAO,CAgFT;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,QAAQ,EAAE,WAAW,GAAG,SAAS,GAC/B,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,qBAAqB,EAC/B,QAAQ,EAAE,qBAAqB,GAC7B,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,WAAW,GACnB,OAAO,CAOT;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GACxB,OAAO,CAqBT;AAED,wBAAgB,cAAc,CAC7B,MAAM,EAAE,qBAAqB,GAAG,SAAS,GACvC,qBAAqB,CAEvB"}
|
|
@@ -10,6 +10,9 @@ const index_js_1 = require("../../core/index.js");
|
|
|
10
10
|
const index_js_2 = require("../../util/index.js");
|
|
11
11
|
const fieldKindWithEditor_js_1 = require("./fieldKindWithEditor.js");
|
|
12
12
|
const isNeverTree_js_1 = require("./isNeverTree.js");
|
|
13
|
+
// TODO:
|
|
14
|
+
// The comparisons in this file seem redundant with those in discrepancies.ts.
|
|
15
|
+
// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.
|
|
13
16
|
/**
|
|
14
17
|
* @returns true iff `superset` is a superset of `original`.
|
|
15
18
|
*
|
|
@@ -83,12 +86,6 @@ exports.allowsFieldSuperset = allowsFieldSuperset;
|
|
|
83
86
|
* This does not require a strict (aka proper) superset: equivalent schema will return true.
|
|
84
87
|
*/
|
|
85
88
|
function allowsTreeSchemaIdentifierSuperset(original, superset) {
|
|
86
|
-
if (superset === undefined) {
|
|
87
|
-
return true;
|
|
88
|
-
}
|
|
89
|
-
if (original === undefined) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
89
|
for (const originalType of original) {
|
|
93
90
|
if (!superset.has(originalType)) {
|
|
94
91
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAU6B;AAC7B,kDAAwD;AAGxD,qEAAsD;AACtD,qDAA+C;AAE/C;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;Q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AC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAzBD,gDAyBC;AAED,SAAgB,cAAc,CAC7B,MAAyC;IAEzC,OAAO,MAAM,IAAI,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets, fail } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ?? fail(\"missing expected field\"),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ?? fail(\"missing expected field\"),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(\"missing expected field\"),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(\"missing expected field\"),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(\"missing kind\"),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tif (superset === undefined) {\n\t\treturn true;\n\t}\n\tif (original === undefined) {\n\t\treturn false;\n\t}\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"comparison.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/comparison.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAU6B;AAC7B,kDAAwD;AAGxD,qEAAsD;AACtD,qDAA+C;AAE/C,QAAQ;AACR,8EAA8E;AAC9E,mLAAmL;AAEnL;;;;;;GAMG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,YAA8B,EAC9B,QAA0C,EAC1C,QAA0C;IAE1C,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,IAAA,4BAAW,EAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAA,iBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,4CAA4C,CAAC,CAAC;IACnF,IAAA,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AAQ,CAAC,IAAI,CAAC,IAAI,IAAA,eAAI,EAAC,cAAc,CAAC,CAC5D,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC;AATD,kDASC;AAED;;;;GAIG;AACH,SAAgB,kCAAkC,CACjD,QAAqB,EACrB,QAAqB;IAErB,KAAK,MAAM,YAAY,IAAI,QAAQ,EAAE,CAAC;QACrC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAVD,gFAUC;AAED;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CACjC,MAAwB,EACxB,QAA0B,EAC1B,QAA0B;IAE1B,CAAC;QACA,0GAA0G;QAC1G,IACC,CAAC,mBAAmB,CACnB,MAAM,EACN,QAAQ,EACR,QAAQ,CAAC,eAAe,EACxB,QAAQ,CAAC,eAAe,CACxB,EACA,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;QACjD,yGAAyG;QACzG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjF,OAAO,KAAK,CAAC;QACd,CAAC;IACF,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAzBD,gDAyBC;AAED,SAAgB,cAAc,CAC7B,MAAyC;IAEzC,OAAO,MAAM,IAAI,iCAAsB,CAAC;AACzC,CAAC;AAJD,wCAIC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeStoredSchema,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n\tstoredEmptyFieldSchema,\n} from \"../../core/index.js\";\nimport { compareSets, fail } from \"../../util/index.js\";\n\nimport type { FullSchemaPolicy } from \"./fieldKind.js\";\nimport { withEditor } from \"./fieldKindWithEditor.js\";\nimport { isNeverTree } from \"./isNeverTree.js\";\n\n// TODO:\n// The comparisons in this file seem redundant with those in discrepancies.ts.\n// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * `undefined` TreeNodeStoredSchema means the schema is not present (and thus treated as a NeverTree).\n */\nexport function allowsTreeSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeNodeStoredSchema | undefined,\n\tsuperset: TreeNodeStoredSchema | undefined,\n): boolean {\n\tif (isNeverTree(policy, originalData, original)) {\n\t\treturn true;\n\t}\n\tif (isNeverTree(policy, originalData, superset)) {\n\t\treturn false;\n\t}\n\tassert(original !== undefined, 0x716 /* only never trees have undefined schema */);\n\tassert(superset !== undefined, 0x717 /* only never trees have undefined schema */);\n\tif (original instanceof LeafNodeStoredSchema) {\n\t\tif (superset instanceof LeafNodeStoredSchema) {\n\t\t\treturn allowsValueSuperset(original.leafValue, superset.leafValue);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(\n\t\toriginal instanceof MapNodeStoredSchema || original instanceof ObjectNodeStoredSchema,\n\t\t0x893 /* unsupported node kind */,\n\t);\n\tassert(\n\t\tsuperset instanceof MapNodeStoredSchema || superset instanceof ObjectNodeStoredSchema,\n\t\t0x894 /* unsupported node kind */,\n\t);\n\n\tif (original instanceof MapNodeStoredSchema) {\n\t\tif (superset instanceof MapNodeStoredSchema) {\n\t\t\treturn allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(original.mapFields),\n\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t);\n\t\t}\n\t\treturn false;\n\t}\n\n\tassert(original instanceof ObjectNodeStoredSchema, 0x895 /* unsupported node kind */);\n\tif (superset instanceof MapNodeStoredSchema) {\n\t\tfor (const [_key, field] of original.objectNodeFields) {\n\t\t\tif (\n\t\t\t\t!allowsFieldSuperset(\n\t\t\t\t\tpolicy,\n\t\t\t\t\toriginalData,\n\t\t\t\t\tnormalizeField(field),\n\t\t\t\t\tnormalizeField(superset.mapFields),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\tassert(superset instanceof ObjectNodeStoredSchema, 0x896 /* unsupported node kind */);\n\n\treturn compareSets({\n\t\ta: original.objectNodeFields,\n\t\tb: superset.objectNodeFields,\n\t\taExtra: (originalField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(originalField) ?? fail(\"missing expected field\"),\n\t\t\t\tnormalizeField(undefined),\n\t\t\t),\n\t\tbExtra: (supersetField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\tnormalizeField(undefined),\n\t\t\t\tsuperset.objectNodeFields.get(supersetField) ?? fail(\"missing expected field\"),\n\t\t\t),\n\t\tsame: (sameField) =>\n\t\t\tallowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginalData,\n\t\t\t\toriginal.objectNodeFields.get(sameField) ?? fail(\"missing expected field\"),\n\t\t\t\tsuperset.objectNodeFields.get(sameField) ?? fail(\"missing expected field\"),\n\t\t\t),\n\t});\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsValueSuperset(\n\toriginal: ValueSchema | undefined,\n\tsuperset: ValueSchema | undefined,\n): boolean {\n\treturn original === superset;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsFieldSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginalData: TreeStoredSchema,\n\toriginal: TreeFieldStoredSchema,\n\tsuperset: TreeFieldStoredSchema,\n): boolean {\n\treturn withEditor(\n\t\tpolicy.fieldKinds.get(original.kind) ?? fail(\"missing kind\"),\n\t).allowsFieldSuperset(policy, originalData, original.types, superset);\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n */\nexport function allowsTreeSchemaIdentifierSuperset(\n\toriginal: TreeTypeSet,\n\tsuperset: TreeTypeSet,\n): boolean {\n\tfor (const originalType of original) {\n\t\tif (!superset.has(originalType)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\n/**\n * @returns true iff `superset` is a superset of `original`.\n *\n * This does not require a strict (aka proper) superset: equivalent schema will return true.\n *\n * A version of this that assumes a specific root field could be slightly more permissive in some simple cases,\n * however if any extra fields and fields with unconstrained types are reachable,\n * it would have to compare everything anyway.\n */\nexport function allowsRepoSuperset(\n\tpolicy: FullSchemaPolicy,\n\toriginal: TreeStoredSchema,\n\tsuperset: TreeStoredSchema,\n): boolean {\n\t{\n\t\t// TODO: I think its ok to use the field from superset here, but I should confirm it is, and document why.\n\t\tif (\n\t\t\t!allowsFieldSuperset(\n\t\t\t\tpolicy,\n\t\t\t\toriginal,\n\t\t\t\toriginal.rootFieldSchema,\n\t\t\t\tsuperset.rootFieldSchema,\n\t\t\t)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\tfor (const [key, schema] of original.nodeSchema) {\n\t\t// TODO: I think its ok to use the tree from superset here, but I should confirm it is, and document why.\n\t\tif (!allowsTreeSuperset(policy, original, schema, superset.nodeSchema.get(key))) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nexport function normalizeField(\n\tschema: TreeFieldStoredSchema | undefined,\n): TreeFieldStoredSchema {\n\treturn schema ?? storedEmptyFieldSchema;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discrepancies.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,mBAAmB,EAMxB,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"discrepancies.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/discrepancies.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAEN,KAAK,mBAAmB,EAMxB,KAAK,gBAAgB,EAErB,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,mBAAmB,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GAAG,yBAAyB,CAAC;AAEtF,MAAM,MAAM,oBAAoB,GAC7B,0BAA0B,GAC1B,wBAAwB,GACxB,0BAA0B,CAAC;AAE9B,MAAM,WAAW,0BAA0B;IAC1C,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACxC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,EAAE,WAAW,CAAC;IACtB,IAAI,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACtC,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;CACxC;AAED,MAAM,WAAW,0BAA0B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9B,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACxC,MAAM,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,WAAW,yBAAyB;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACpC;AAED,KAAK,qBAAqB,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kCAAkC,CACjD,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,gBAAgB,GACtB,eAAe,EAAE,CA8JnB;AAkGD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CA8BxF"}
|
|
@@ -185,19 +185,9 @@ function trackFieldDiscrepancies(view, stored, keyOrRoot) {
|
|
|
185
185
|
const differences = [];
|
|
186
186
|
// Only track the symmetric differences of two sets.
|
|
187
187
|
const findSetDiscrepancies = (a, b) => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (a !== undefined && b !== undefined) {
|
|
192
|
-
const aDiff = [...a].filter((value) => !b.has(value));
|
|
193
|
-
const bDiff = [...b].filter((value) => !a.has(value));
|
|
194
|
-
return [aDiff, bDiff];
|
|
195
|
-
}
|
|
196
|
-
if (a !== undefined) {
|
|
197
|
-
return [[...a], []];
|
|
198
|
-
}
|
|
199
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
200
|
-
return [[], [...b]];
|
|
188
|
+
const aDiff = [...a].filter((value) => !b.has(value));
|
|
189
|
+
const bDiff = [...b].filter((value) => !a.has(value));
|
|
190
|
+
return [aDiff, bDiff];
|
|
201
191
|
};
|
|
202
192
|
const allowedTypesDiscrepancies = findSetDiscrepancies(view.types, stored.types);
|
|
203
193
|
if (allowedTypesDiscrepancies[0].length > 0 || allowedTypesDiscrepancies[1].length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discrepancies.js","sourceRoot":"","sources":["../../../src/feature-libraries/modular-schema/discrepancies.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D,kDAW6B;AAqF7B;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,kCAAkC,CACjD,IAAsB,EACtB,MAAwB;IAExB,MAAM,iBAAiB,GAAsB,EAAE,CAAC;IAEhD,kCAAkC;IAClC,iBAAiB,CAAC,IAAI,CACrB,GAAG,uBAAuB,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,eAAe,CAAC,CACxE,CAAC;IAEF,+FAA+F;IAC/F,qCAAqC;IACrC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;IACzD,KAAK,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACrD,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEtB,IAAI,cAAc,YAAY,iCAAsB,EAAE,CAAC;YACtD,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,iBAAiB,CAAC,IAAI,CAAC;oBACtB,UAAU,EAAE,GAAG;oBACf,QAAQ,EAAE,UAAU;oB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K,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAA8B;IACjD,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,4IAA4I;CAC5I,CAAC;AAEF,SAAS,gBAAgB,CACxB,KAAsC,EACtC,KAAsC;IAEtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACd,CAAC;IAED,oEAAoE;IACpE,OAAO,cAAc,CAAC,KAAK,CAAE,IAAI,cAAc,CAAC,KAAK,CAAE,CAAC;AACzD,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC7C,MAAM,IAAI,SAAS,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\n\n/**\n * @remarks\n *\n * 1. FieldIncompatibility\n *\n * `FieldIncompatibility` represents the differences between two `TreeFieldStoredSchema` objects. It consists of\n * three types of incompatibilities:\n *\n * - FieldKindIncompatibility: Indicates the differences in `FieldKindIdentifier` between two `TreeFieldStoredSchema`\n * objects (e.g., optional, required, sequence, etc.).\n * - AllowedTypesIncompatibility: Indicates the differences in the allowed child types between the two schemas.\n * - ValueSchemaIncompatibility: Specifically indicates the differences in the `ValueSchema` of two\n * `LeafNodeStoredSchema` objects.\n *\n * 2. NodeIncompatibility\n *\n * `NodeIncompatibility` represents the differences between two `TreeNodeStoredSchema` objects and includes:\n *\n * - NodeKindIncompatibility: Indicates the differences in the types of `TreeNodeStoredSchema` (currently supports\n * `ObjectNodeStoredSchema`, `MapNodeStoredSchema`, and `LeafNodeStoredSchema`).\n * - NodeFieldsIncompatibility: Indicates the `FieldIncompatibility` of `TreeFieldStoredSchema` within two\n * `TreeNodeStoredSchema`. It includes an array of `FieldIncompatibility` instances in the `differences` field.\n *\n * When comparing two nodes for compatibility, it only makes sense to compare their fields if the nodes are of\n * the same kind (map, object, leaf).\n *\n * 3. Incompatibility\n *\n * Incompatibility consists of both `NodeIncompatibility` and `FieldIncompatibility`, representing any kind of\n * schema differences. See {@link getAllowedContentIncompatibilities} for more details about how we process it\n * and the ordering.\n */\nexport type Incompatibility = FieldIncompatibility | NodeIncompatibility;\n\nexport type NodeIncompatibility = NodeKindIncompatibility | NodeFieldsIncompatibility;\n\nexport type FieldIncompatibility =\n\t| AllowedTypeIncompatibility\n\t| FieldKindIncompatibility\n\t| ValueSchemaIncompatibility;\n\nexport interface AllowedTypeIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"allowedTypes\";\n\t/**\n\t * List of allowed type identifiers in viewed schema\n\t */\n\tview: string[];\n\t/**\n\t * List of allowed type identifiers in stored schema\n\t */\n\tstored: string[];\n}\n\nexport interface FieldKindIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"fieldKind\";\n\tview: FieldKindIdentifier | undefined;\n\tstored: FieldKindIdentifier | undefined;\n}\n\nexport interface ValueSchemaIncompatibility {\n\tidentifier: string;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\nexport interface NodeKindIncompatibility {\n\tidentifier: string;\n\tmismatch: \"nodeKind\";\n\tview: SchemaFactoryNodeKind | undefined;\n\tstored: SchemaFactoryNodeKind | undefined;\n}\n\nexport interface NodeFieldsIncompatibility {\n\tidentifier: string;\n\tmismatch: \"fields\";\n\tdifferences: FieldIncompatibility[];\n}\n\ntype SchemaFactoryNodeKind = \"object\" | \"leaf\" | \"map\";\n\n/**\n * @remarks\n *\n * The workflow for finding schema incompatibilities:\n * 1. Compare the two root schemas to identify any `FieldIncompatibility`.\n *\n * 2. For each node schema in the `view`:\n * - Verify if the node schema exists in the stored. If it does, ensure that the `SchemaFactoryNodeKind` are\n * consistent. Otherwise this difference is treated as `NodeKindIncompatibility`\n * - If a node schema with the same identifier exists in both view and stored, and their `SchemaFactoryNodeKind`\n * are consistent, perform a exhaustive validation to identify all `FieldIncompatibility`.\n *\n * 3. For each node schema in the stored, verify if it exists in the view. The overlapping parts were already\n * addressed in the previous step.\n *\n * @returns the discrepancies between two TreeStoredSchema objects\n */\nexport function getAllowedContentIncompatibilities(\n\tview: TreeStoredSchema,\n\tstored: TreeStoredSchema,\n): Incompatibility[] {\n\tconst incompatibilities: Incompatibility[] = [];\n\n\t// check root schema discrepancies\n\tincompatibilities.push(\n\t\t...trackFieldDiscrepancies(view.rootFieldSchema, stored.rootFieldSchema),\n\t);\n\n\t// Verify the existence and type of a node schema given its identifier (key), then determine if\n\t// an exhaustive search is necessary.\n\tconst viewNodeKeys = new Set<TreeNodeSchemaIdentifier>();\n\tfor (const [key, viewNodeSchema] of view.nodeSchema) {\n\t\tviewNodeKeys.add(key);\n\n\t\tif (viewNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"object\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9be /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tconst differences = trackObjectNodeDiscrepancies(viewNodeSchema, storedNodeSchema);\n\t\t\t\t\tif (differences.length > 0) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"fields\",\n\t\t\t\t\t\t\tdifferences,\n\t\t\t\t\t\t} satisfies NodeFieldsIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"map\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9bf /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push(\n\t\t\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\t\t\tviewNodeSchema.mapFields,\n\t\t\t\t\t\t\tstoredNodeSchema.mapFields,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9c0 /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tif (viewNodeSchema.leafValue !== storedNodeSchema.leafValue) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\t\t\tview: viewNodeSchema.leafValue,\n\t\t\t\t\t\t\tstored: storedNodeSchema.leafValue,\n\t\t\t\t\t\t} satisfies ValueSchemaIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrowUnsupportedNodeType(viewNodeSchema.constructor.name);\n\t\t}\n\t}\n\n\tfor (const [key, storedNodeSchema] of stored.nodeSchema) {\n\t\tif (!viewNodeKeys.has(key)) {\n\t\t\tincompatibilities.push({\n\t\t\t\tidentifier: key,\n\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\tview: undefined,\n\t\t\t\tstored:\n\t\t\t\t\tstoredNodeSchema instanceof MapNodeStoredSchema\n\t\t\t\t\t\t? \"map\"\n\t\t\t\t\t\t: storedNodeSchema instanceof ObjectNodeStoredSchema\n\t\t\t\t\t\t\t? \"object\"\n\t\t\t\t\t\t\t: \"leaf\",\n\t\t\t} satisfies NodeKindIncompatibility);\n\t\t}\n\t}\n\n\treturn incompatibilities;\n}\n\n/**\n * The function to track the discrepancies between two field stored schemas.\n *\n * @param keyOrRoot - If the key is missing, it indicates that this is the root field schema.\n */\nfunction trackFieldDiscrepancies(\n\tview: TreeFieldStoredSchema,\n\tstored: TreeFieldStoredSchema,\n\tkeyOrRoot?: string,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\n\t// Only track the symmetric differences of two sets.\n\tconst findSetDiscrepancies = (\n\t\ta: TreeTypeSet,\n\t\tb: TreeTypeSet,\n\t): [TreeNodeSchemaIdentifier[], TreeNodeSchemaIdentifier[]] => {\n\t\tif (a === undefined && b === undefined) {\n\t\t\treturn [[], []];\n\t\t}\n\n\t\tif (a !== undefined && b !== undefined) {\n\t\t\tconst aDiff = [...a].filter((value) => !b.has(value));\n\t\t\tconst bDiff = [...b].filter((value) => !a.has(value));\n\t\t\treturn [aDiff, bDiff];\n\t\t}\n\n\t\tif (a !== undefined) {\n\t\t\treturn [[...a], []];\n\t\t}\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\treturn [[], [...b!]];\n\t};\n\n\tconst allowedTypesDiscrepancies = findSetDiscrepancies(view.types, stored.types);\n\tif (allowedTypesDiscrepancies[0].length > 0 || allowedTypesDiscrepancies[1].length > 0) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t\tview: allowedTypesDiscrepancies[0],\n\t\t\tstored: allowedTypesDiscrepancies[1],\n\t\t} satisfies AllowedTypeIncompatibility);\n\t}\n\n\tif (view.kind !== stored.kind) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\nfunction trackObjectNodeDiscrepancies(\n\tview: ObjectNodeStoredSchema,\n\tstored: ObjectNodeStoredSchema,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\tconst viewFieldKeys = new Set<FieldKey>();\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tfor (const [fieldKey, fieldStoredSchema] of view.objectNodeFields) {\n\t\tviewFieldKeys.add(fieldKey);\n\t\tif (!stored.objectNodeFields.has(fieldKey)) {\n\t\t\tdifferences.push({\n\t\t\t\tidentifier: fieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: fieldStoredSchema.kind,\n\t\t\t\tstored: undefined,\n\t\t\t} satisfies FieldKindIncompatibility);\n\t\t} else {\n\t\t\tdifferences.push(\n\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\tview.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tstored.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tfieldKey,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, fieldStoredSchema] of stored.objectNodeFields) {\n\t\tif (viewFieldKeys.has(fieldKey)) {\n\t\t\tcontinue;\n\t\t}\n\t\tdifferences.push({\n\t\t\tidentifier: fieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: undefined,\n\t\t\tstored: fieldStoredSchema.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\n/**\n * @remarks\n *\n * This function uses incompatibilities to determine if changes to a document schema are backward-compatible, i.e., it determines\n * whether the `view` schema allows a superset of the documents that the `stored` schema allows.\n * According to the policy of schema evolution, `isRepoSuperset` supports three types of changes:\n * 1. Adding an optional field to an object node.\n * 2. Expanding the set of allowed types for a field.\n * 3. Relaxing a field kind to a more general field kind.\n *\n * Notes: We expect isRepoSuperset to return consistent results with allowsRepoSuperset. However, currently there are some scenarios\n * where the inconsistency will occur:\n *\n * - Different Node Kinds: If a and b have different node kinds (e.g., a is an objectNodeSchema and b is a mapNodeSchema),\n * `isRepoSuperset` will determine that a can never be the superset of b. In contrast, `allowsRepoSuperset` will continue\n * validating internal fields.\n */\nexport function isRepoSuperset(view: TreeStoredSchema, stored: TreeStoredSchema): boolean {\n\tconst incompatibilities = getAllowedContentIncompatibilities(view, stored);\n\n\tfor (const incompatibility of incompatibilities) {\n\t\tswitch (incompatibility.mismatch) {\n\t\t\tcase \"nodeKind\": {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcase \"valueSchema\":\n\t\t\tcase \"allowedTypes\":\n\t\t\tcase \"fieldKind\": {\n\t\t\t\tif (!validateFieldIncompatibility(incompatibility)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\": {\n\t\t\t\tif (\n\t\t\t\t\tincompatibility.differences.some(\n\t\t\t\t\t\t(difference) => !validateFieldIncompatibility(difference),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction validateFieldIncompatibility(incompatibility: FieldIncompatibility): boolean {\n\tswitch (incompatibility.mismatch) {\n\t\tcase \"allowedTypes\": {\n\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t// stored schema.\n\t\t\treturn incompatibility.stored.length === 0;\n\t\t}\n\t\tcase \"fieldKind\": {\n\t\t\tif (incompatibility.stored === undefined) {\n\t\t\t\t// Add an optional field\n\t\t\t\tif (incompatibility.view === \"Optional\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Relax the field to make it more general\n\t\t\t\treturn compareFieldKind(incompatibility.stored, incompatibility.view);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase \"valueSchema\": {\n\t\t\treturn false;\n\t\t}\n\t\t// No default\n\t}\n\treturn false;\n}\n\n/**\n * A mapping that defines the order of field kinds for comparison purposes.\n * The numeric values indicate the hierarchy or \"strength\" of each field kind, where lower numbers are more restrictive.\n * This is used to determine if one field kind can be considered a superset of another.\n *\n * - \"Forbidden\": The most restrictive, represented by 1. Indicates a forbidden field.\n * - \"Value\": Represented by 2. Indicates a required field with a specific value.\n * - \"Optional\": Represented by 3. Indicates an optional field.\n *\n * Note:\n * - \"Sequence\": (Currently commented out) was intended to represent a sequence field kind with a value of 4.\n * Relaxing non-sequence fields to sequences is not currently supported but may be considered in the future.\n *\n * TODO: We may need more coverage in realm to prove the correctness of the Forbidden -\\> Value transaction\n */\nconst fieldKindOrder: { [key: string]: number } = {\n\t\"Forbidden\": 1,\n\t\"Value\": 2,\n\t\"Optional\": 3,\n\t// \"Sequence\": 4, // Relaxing non-sequence fields to sequences is not currently supported, though we could consider doing so in the future.\n};\n\nfunction compareFieldKind(\n\taKind: FieldKindIdentifier | undefined,\n\tbKind: FieldKindIdentifier | undefined,\n): boolean {\n\tif (aKind === undefined || bKind === undefined) {\n\t\treturn false;\n\t}\n\n\tif (!(aKind in fieldKindOrder) || !(bKind in fieldKindOrder)) {\n\t\treturn false;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\treturn fieldKindOrder[aKind]! <= fieldKindOrder[bKind]!;\n}\n\nfunction throwUnsupportedNodeType(type: string): never {\n\tthrow new TypeError(`Unsupported node stored schema type: ${type}`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"discrepancies.js","sourceRoot":"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BAC1C,wBAAwB;gBACxB,IAAI,eAAe,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;oBACzC,OAAO,IAAI,CAAC;gBACb,CAAC;YACF,CAAC;iBAAM,CAAC;gBACP,0CAA0C;gBAC1C,OAAO,gBAAgB,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;YACvE,CAAC;YAED,MAAM;QACP,CAAC;QACD,KAAK,aAAa,CAAC,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,aAAa;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,cAAc,GAA8B;IACjD,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,4IAA4I;CAC5I,CAAC;AAEF,SAAS,gBAAgB,CACxB,KAAsC,EACtC,KAAsC;IAEtC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACd,CAAC;IAED,oEAAoE;IACpE,OAAO,cAAc,CAAC,KAAK,CAAE,IAAI,cAAc,CAAC,KAAK,CAAE,CAAC;AACzD,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC7C,MAAM,IAAI,SAAS,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\nimport {\n\ttype FieldKey,\n\ttype FieldKindIdentifier,\n\tLeafNodeStoredSchema,\n\tMapNodeStoredSchema,\n\tObjectNodeStoredSchema,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype TreeStoredSchema,\n\ttype TreeTypeSet,\n\ttype ValueSchema,\n} from \"../../core/index.js\";\n\n// TODO:\n// The comparisons in this file seem redundant with those in comparison.ts.\n// Rather than both existing, one of which just returns boolean and the other which returns additional details, a simple comparison which returns everything needed should be used.\n\n/**\n * @remarks\n *\n * 1. FieldIncompatibility\n *\n * `FieldIncompatibility` represents the differences between two `TreeFieldStoredSchema` objects. It consists of\n * three types of incompatibilities:\n *\n * - FieldKindIncompatibility: Indicates the differences in `FieldKindIdentifier` between two `TreeFieldStoredSchema`\n * objects (e.g., optional, required, sequence, etc.).\n * - AllowedTypesIncompatibility: Indicates the differences in the allowed child types between the two schemas.\n * - ValueSchemaIncompatibility: Specifically indicates the differences in the `ValueSchema` of two\n * `LeafNodeStoredSchema` objects.\n *\n * 2. NodeIncompatibility\n *\n * `NodeIncompatibility` represents the differences between two `TreeNodeStoredSchema` objects and includes:\n *\n * - NodeKindIncompatibility: Indicates the differences in the types of `TreeNodeStoredSchema` (currently supports\n * `ObjectNodeStoredSchema`, `MapNodeStoredSchema`, and `LeafNodeStoredSchema`).\n * - NodeFieldsIncompatibility: Indicates the `FieldIncompatibility` of `TreeFieldStoredSchema` within two\n * `TreeNodeStoredSchema`. It includes an array of `FieldIncompatibility` instances in the `differences` field.\n *\n * When comparing two nodes for compatibility, it only makes sense to compare their fields if the nodes are of\n * the same kind (map, object, leaf).\n *\n * 3. Incompatibility\n *\n * Incompatibility consists of both `NodeIncompatibility` and `FieldIncompatibility`, representing any kind of\n * schema differences. See {@link getAllowedContentIncompatibilities} for more details about how we process it\n * and the ordering.\n */\nexport type Incompatibility = FieldIncompatibility | NodeIncompatibility;\n\nexport type NodeIncompatibility = NodeKindIncompatibility | NodeFieldsIncompatibility;\n\nexport type FieldIncompatibility =\n\t| AllowedTypeIncompatibility\n\t| FieldKindIncompatibility\n\t| ValueSchemaIncompatibility;\n\nexport interface AllowedTypeIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"allowedTypes\";\n\t/**\n\t * List of allowed type identifiers in viewed schema\n\t */\n\tview: string[];\n\t/**\n\t * List of allowed type identifiers in stored schema\n\t */\n\tstored: string[];\n}\n\nexport interface FieldKindIncompatibility {\n\tidentifier: string | undefined; // undefined indicates root field schema\n\tmismatch: \"fieldKind\";\n\tview: FieldKindIdentifier | undefined;\n\tstored: FieldKindIdentifier | undefined;\n}\n\nexport interface ValueSchemaIncompatibility {\n\tidentifier: string;\n\tmismatch: \"valueSchema\";\n\tview: ValueSchema | undefined;\n\tstored: ValueSchema | undefined;\n}\n\nexport interface NodeKindIncompatibility {\n\tidentifier: string;\n\tmismatch: \"nodeKind\";\n\tview: SchemaFactoryNodeKind | undefined;\n\tstored: SchemaFactoryNodeKind | undefined;\n}\n\nexport interface NodeFieldsIncompatibility {\n\tidentifier: string;\n\tmismatch: \"fields\";\n\tdifferences: FieldIncompatibility[];\n}\n\ntype SchemaFactoryNodeKind = \"object\" | \"leaf\" | \"map\";\n\n/**\n * @remarks\n *\n * The workflow for finding schema incompatibilities:\n * 1. Compare the two root schemas to identify any `FieldIncompatibility`.\n *\n * 2. For each node schema in the `view`:\n * - Verify if the node schema exists in the stored. If it does, ensure that the `SchemaFactoryNodeKind` are\n * consistent. Otherwise this difference is treated as `NodeKindIncompatibility`\n * - If a node schema with the same identifier exists in both view and stored, and their `SchemaFactoryNodeKind`\n * are consistent, perform a exhaustive validation to identify all `FieldIncompatibility`.\n *\n * 3. For each node schema in the stored, verify if it exists in the view. The overlapping parts were already\n * addressed in the previous step.\n *\n * @returns the discrepancies between two TreeStoredSchema objects\n */\nexport function getAllowedContentIncompatibilities(\n\tview: TreeStoredSchema,\n\tstored: TreeStoredSchema,\n): Incompatibility[] {\n\tconst incompatibilities: Incompatibility[] = [];\n\n\t// check root schema discrepancies\n\tincompatibilities.push(\n\t\t...trackFieldDiscrepancies(view.rootFieldSchema, stored.rootFieldSchema),\n\t);\n\n\t// Verify the existence and type of a node schema given its identifier (key), then determine if\n\t// an exhaustive search is necessary.\n\tconst viewNodeKeys = new Set<TreeNodeSchemaIdentifier>();\n\tfor (const [key, viewNodeSchema] of view.nodeSchema) {\n\t\tviewNodeKeys.add(key);\n\n\t\tif (viewNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"object\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9be /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"object\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tconst differences = trackObjectNodeDiscrepancies(viewNodeSchema, storedNodeSchema);\n\t\t\t\t\tif (differences.length > 0) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"fields\",\n\t\t\t\t\t\t\tdifferences,\n\t\t\t\t\t\t} satisfies NodeFieldsIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"map\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9bf /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"map\",\n\t\t\t\t\t\tstored: \"leaf\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push(\n\t\t\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\t\t\tviewNodeSchema.mapFields,\n\t\t\t\t\t\t\tstoredNodeSchema.mapFields,\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (viewNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\tif (!stored.nodeSchema.has(key)) {\n\t\t\t\tincompatibilities.push({\n\t\t\t\t\tidentifier: key,\n\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\tstored: undefined,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tconst storedNodeSchema = stored.nodeSchema.get(key);\n\t\t\t\tassert(\n\t\t\t\t\tstoredNodeSchema !== undefined,\n\t\t\t\t\t0x9c0 /* The storedNodeSchema in stored.nodeSchema should not be undefined */,\n\t\t\t\t);\n\t\t\t\tif (storedNodeSchema instanceof MapNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"map\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof ObjectNodeStoredSchema) {\n\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\t\t\tview: \"leaf\",\n\t\t\t\t\t\tstored: \"object\",\n\t\t\t\t\t} satisfies NodeKindIncompatibility);\n\t\t\t\t} else if (storedNodeSchema instanceof LeafNodeStoredSchema) {\n\t\t\t\t\tif (viewNodeSchema.leafValue !== storedNodeSchema.leafValue) {\n\t\t\t\t\t\tincompatibilities.push({\n\t\t\t\t\t\t\tidentifier: key,\n\t\t\t\t\t\t\tmismatch: \"valueSchema\",\n\t\t\t\t\t\t\tview: viewNodeSchema.leafValue,\n\t\t\t\t\t\t\tstored: storedNodeSchema.leafValue,\n\t\t\t\t\t\t} satisfies ValueSchemaIncompatibility);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrowUnsupportedNodeType(storedNodeSchema.constructor.name);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrowUnsupportedNodeType(viewNodeSchema.constructor.name);\n\t\t}\n\t}\n\n\tfor (const [key, storedNodeSchema] of stored.nodeSchema) {\n\t\tif (!viewNodeKeys.has(key)) {\n\t\t\tincompatibilities.push({\n\t\t\t\tidentifier: key,\n\t\t\t\tmismatch: \"nodeKind\",\n\t\t\t\tview: undefined,\n\t\t\t\tstored:\n\t\t\t\t\tstoredNodeSchema instanceof MapNodeStoredSchema\n\t\t\t\t\t\t? \"map\"\n\t\t\t\t\t\t: storedNodeSchema instanceof ObjectNodeStoredSchema\n\t\t\t\t\t\t\t? \"object\"\n\t\t\t\t\t\t\t: \"leaf\",\n\t\t\t} satisfies NodeKindIncompatibility);\n\t\t}\n\t}\n\n\treturn incompatibilities;\n}\n\n/**\n * The function to track the discrepancies between two field stored schemas.\n *\n * @param keyOrRoot - If the key is missing, it indicates that this is the root field schema.\n */\nfunction trackFieldDiscrepancies(\n\tview: TreeFieldStoredSchema,\n\tstored: TreeFieldStoredSchema,\n\tkeyOrRoot?: string,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\n\t// Only track the symmetric differences of two sets.\n\tconst findSetDiscrepancies = (\n\t\ta: TreeTypeSet,\n\t\tb: TreeTypeSet,\n\t): [TreeNodeSchemaIdentifier[], TreeNodeSchemaIdentifier[]] => {\n\t\tconst aDiff = [...a].filter((value) => !b.has(value));\n\t\tconst bDiff = [...b].filter((value) => !a.has(value));\n\t\treturn [aDiff, bDiff];\n\t};\n\n\tconst allowedTypesDiscrepancies = findSetDiscrepancies(view.types, stored.types);\n\tif (allowedTypesDiscrepancies[0].length > 0 || allowedTypesDiscrepancies[1].length > 0) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"allowedTypes\",\n\t\t\tview: allowedTypesDiscrepancies[0],\n\t\t\tstored: allowedTypesDiscrepancies[1],\n\t\t} satisfies AllowedTypeIncompatibility);\n\t}\n\n\tif (view.kind !== stored.kind) {\n\t\tdifferences.push({\n\t\t\tidentifier: keyOrRoot,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: view.kind,\n\t\t\tstored: stored.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\nfunction trackObjectNodeDiscrepancies(\n\tview: ObjectNodeStoredSchema,\n\tstored: ObjectNodeStoredSchema,\n): FieldIncompatibility[] {\n\tconst differences: FieldIncompatibility[] = [];\n\tconst viewFieldKeys = new Set<FieldKey>();\n\t/**\n\t * Similar to the logic used for tracking discrepancies between two node schemas, we will identify\n\t * three types of differences:\n\t * 1. Fields that exist in the view schema but not in the stored schema.\n\t * 2. Fields that exist in both schemas but have different contents.\n\t * 3. Fields that exist in the stored schema but not in the view schema.\n\t *\n\t * First, the view schema is iterated to track the first two types of differences.\n\t * Then, the stored schema is iterated to find the third type.\n\t */\n\n\tfor (const [fieldKey, fieldStoredSchema] of view.objectNodeFields) {\n\t\tviewFieldKeys.add(fieldKey);\n\t\tif (!stored.objectNodeFields.has(fieldKey)) {\n\t\t\tdifferences.push({\n\t\t\t\tidentifier: fieldKey,\n\t\t\t\tmismatch: \"fieldKind\",\n\t\t\t\tview: fieldStoredSchema.kind,\n\t\t\t\tstored: undefined,\n\t\t\t} satisfies FieldKindIncompatibility);\n\t\t} else {\n\t\t\tdifferences.push(\n\t\t\t\t...trackFieldDiscrepancies(\n\t\t\t\t\tview.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tstored.objectNodeFields.get(fieldKey) as TreeFieldStoredSchema,\n\t\t\t\t\tfieldKey,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}\n\n\tfor (const [fieldKey, fieldStoredSchema] of stored.objectNodeFields) {\n\t\tif (viewFieldKeys.has(fieldKey)) {\n\t\t\tcontinue;\n\t\t}\n\t\tdifferences.push({\n\t\t\tidentifier: fieldKey,\n\t\t\tmismatch: \"fieldKind\",\n\t\t\tview: undefined,\n\t\t\tstored: fieldStoredSchema.kind,\n\t\t} satisfies FieldKindIncompatibility);\n\t}\n\n\treturn differences;\n}\n\n/**\n * @remarks\n *\n * This function uses incompatibilities to determine if changes to a document schema are backward-compatible, i.e., it determines\n * whether the `view` schema allows a superset of the documents that the `stored` schema allows.\n * According to the policy of schema evolution, `isRepoSuperset` supports three types of changes:\n * 1. Adding an optional field to an object node.\n * 2. Expanding the set of allowed types for a field.\n * 3. Relaxing a field kind to a more general field kind.\n *\n * Notes: We expect isRepoSuperset to return consistent results with allowsRepoSuperset. However, currently there are some scenarios\n * where the inconsistency will occur:\n *\n * - Different Node Kinds: If a and b have different node kinds (e.g., a is an objectNodeSchema and b is a mapNodeSchema),\n * `isRepoSuperset` will determine that a can never be the superset of b. In contrast, `allowsRepoSuperset` will continue\n * validating internal fields.\n */\nexport function isRepoSuperset(view: TreeStoredSchema, stored: TreeStoredSchema): boolean {\n\tconst incompatibilities = getAllowedContentIncompatibilities(view, stored);\n\n\tfor (const incompatibility of incompatibilities) {\n\t\tswitch (incompatibility.mismatch) {\n\t\t\tcase \"nodeKind\": {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tcase \"valueSchema\":\n\t\t\tcase \"allowedTypes\":\n\t\t\tcase \"fieldKind\": {\n\t\t\t\tif (!validateFieldIncompatibility(incompatibility)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"fields\": {\n\t\t\t\tif (\n\t\t\t\t\tincompatibility.differences.some(\n\t\t\t\t\t\t(difference) => !validateFieldIncompatibility(difference),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction validateFieldIncompatibility(incompatibility: FieldIncompatibility): boolean {\n\tswitch (incompatibility.mismatch) {\n\t\tcase \"allowedTypes\": {\n\t\t\t// Since we only track the symmetric difference between the allowed types in the view and\n\t\t\t// stored schemas, it's sufficient to check if any extra allowed types still exist in the\n\t\t\t// stored schema.\n\t\t\treturn incompatibility.stored.length === 0;\n\t\t}\n\t\tcase \"fieldKind\": {\n\t\t\tif (incompatibility.stored === undefined) {\n\t\t\t\t// Add an optional field\n\t\t\t\tif (incompatibility.view === \"Optional\") {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Relax the field to make it more general\n\t\t\t\treturn compareFieldKind(incompatibility.stored, incompatibility.view);\n\t\t\t}\n\n\t\t\tbreak;\n\t\t}\n\t\tcase \"valueSchema\": {\n\t\t\treturn false;\n\t\t}\n\t\t// No default\n\t}\n\treturn false;\n}\n\n/**\n * A mapping that defines the order of field kinds for comparison purposes.\n * The numeric values indicate the hierarchy or \"strength\" of each field kind, where lower numbers are more restrictive.\n * This is used to determine if one field kind can be considered a superset of another.\n *\n * - \"Forbidden\": The most restrictive, represented by 1. Indicates a forbidden field.\n * - \"Value\": Represented by 2. Indicates a required field with a specific value.\n * - \"Optional\": Represented by 3. Indicates an optional field.\n *\n * Note:\n * - \"Sequence\": (Currently commented out) was intended to represent a sequence field kind with a value of 4.\n * Relaxing non-sequence fields to sequences is not currently supported but may be considered in the future.\n *\n * TODO: We may need more coverage in realm to prove the correctness of the Forbidden -\\> Value transaction\n */\nconst fieldKindOrder: { [key: string]: number } = {\n\t\"Forbidden\": 1,\n\t\"Value\": 2,\n\t\"Optional\": 3,\n\t// \"Sequence\": 4, // Relaxing non-sequence fields to sequences is not currently supported, though we could consider doing so in the future.\n};\n\nfunction compareFieldKind(\n\taKind: FieldKindIdentifier | undefined,\n\tbKind: FieldKindIdentifier | undefined,\n): boolean {\n\tif (aKind === undefined || bKind === undefined) {\n\t\treturn false;\n\t}\n\n\tif (!(aKind in fieldKindOrder) || !(bKind in fieldKindOrder)) {\n\t\treturn false;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\treturn fieldKindOrder[aKind]! <= fieldKindOrder[bKind]!;\n}\n\nfunction throwUnsupportedNodeType(type: string): never {\n\tthrow new TypeError(`Unsupported node stored schema type: ${type}`);\n}\n"]}
|
|
@@ -184,7 +184,10 @@ function makeModularChangeCodec(fieldKinds, revisionTagCodec, fieldsCodec, { jso
|
|
|
184
184
|
});
|
|
185
185
|
const getChunk = (index) => {
|
|
186
186
|
(0, internal_1.assert)(index < chunks.length, 0x898 /* out of bounds index for build chunk */);
|
|
187
|
-
return (0, index_js_3.chunkFieldSingle)(chunks[index] ?? (0, internal_1.oob)(),
|
|
187
|
+
return (0, index_js_3.chunkFieldSingle)(chunks[index] ?? (0, internal_1.oob)(), {
|
|
188
|
+
policy: index_js_3.defaultChunkPolicy,
|
|
189
|
+
idCompressor: context.idCompressor,
|
|
190
|
+
});
|
|
188
191
|
};
|
|
189
192
|
const map = (0, modularChangeFamily_js_1.newTupleBTree)();
|
|
190
193
|
encoded.builds.forEach((build) => {
|