@contember/binding 2.0.0-alpha.1 → 2.0.0-alpha.10
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/api-extractor.json +3 -0
- package/dist/development/index.cjs +49 -49
- package/dist/development/index.js +49 -49
- package/dist/development/src/BindingError.cjs.map +1 -0
- package/dist/development/src/BindingError.js.map +1 -0
- package/dist/development/src/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/development/src/accessorTree/NormalizedPersistedData.js.map +1 -0
- package/dist/development/src/accessorTree/RuntimeId.cjs +61 -0
- package/dist/development/src/accessorTree/RuntimeId.cjs.map +1 -0
- package/dist/development/src/accessorTree/RuntimeId.js +61 -0
- package/dist/development/src/accessorTree/RuntimeId.js.map +1 -0
- package/dist/development/src/accessors/EntityAccessor.cjs.map +1 -0
- package/dist/development/src/accessors/EntityAccessor.js.map +1 -0
- package/dist/development/src/accessors/EntityListAccessor.cjs.map +1 -0
- package/dist/development/src/accessors/EntityListAccessor.js.map +1 -0
- package/dist/development/src/accessors/ErrorAccessor.cjs.map +1 -0
- package/dist/development/src/accessors/ErrorAccessor.js.map +1 -0
- package/dist/development/src/accessors/FieldAccessor.cjs.map +1 -0
- package/dist/development/src/accessors/FieldAccessor.js.map +1 -0
- package/dist/development/src/accessors/TreeRootAccessor.cjs.map +1 -0
- package/dist/development/src/accessors/TreeRootAccessor.js.map +1 -0
- package/dist/development/src/bindingTypes.cjs.map +1 -0
- package/dist/development/src/bindingTypes.js.map +1 -0
- package/dist/development/src/core/AccessorErrorManager.cjs +204 -0
- package/dist/development/src/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/development/src/core/AccessorErrorManager.js +204 -0
- package/dist/development/src/core/AccessorErrorManager.js.map +1 -0
- package/dist/development/src/core/Config.cjs +29 -0
- package/dist/development/src/core/Config.cjs.map +1 -0
- package/dist/development/src/core/Config.js +29 -0
- package/dist/development/src/core/Config.js.map +1 -0
- package/dist/development/src/core/DataBinding.cjs +348 -0
- package/dist/development/src/core/DataBinding.cjs.map +1 -0
- package/dist/development/src/core/DataBinding.js +348 -0
- package/dist/development/src/core/DataBinding.js.map +1 -0
- package/dist/development/src/core/DirtinessTracker.cjs +26 -0
- package/dist/development/src/core/DirtinessTracker.cjs.map +1 -0
- package/dist/development/src/core/DirtinessTracker.js +26 -0
- package/dist/development/src/core/DirtinessTracker.js.map +1 -0
- package/dist/development/src/core/ErrorsPreprocessor.cjs +180 -0
- package/dist/development/src/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/development/src/core/ErrorsPreprocessor.js +180 -0
- package/dist/development/src/core/ErrorsPreprocessor.js.map +1 -0
- package/dist/development/src/core/EventManager.cjs +434 -0
- package/dist/development/src/core/EventManager.cjs.map +1 -0
- package/dist/development/src/core/EventManager.js +434 -0
- package/dist/development/src/core/EventManager.js.map +1 -0
- package/dist/development/src/core/MarkerComparator.cjs.map +1 -0
- package/dist/development/src/core/MarkerComparator.js.map +1 -0
- package/dist/development/src/core/MarkerMerger.cjs +256 -0
- package/dist/development/src/core/MarkerMerger.cjs.map +1 -0
- package/dist/development/src/core/MarkerMerger.js +256 -0
- package/dist/development/src/core/MarkerMerger.js.map +1 -0
- package/dist/development/src/core/MutationGenerator.cjs +662 -0
- package/dist/development/src/core/MutationGenerator.cjs.map +1 -0
- package/dist/development/src/core/MutationGenerator.js +662 -0
- package/dist/development/src/core/MutationGenerator.js.map +1 -0
- package/dist/development/src/core/QueryGenerator.cjs.map +1 -0
- package/dist/development/src/core/QueryGenerator.js.map +1 -0
- package/dist/development/src/core/RealmKeyGenerator.cjs +42 -0
- package/dist/development/src/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/development/src/core/RealmKeyGenerator.js +42 -0
- package/dist/development/src/core/RealmKeyGenerator.js.map +1 -0
- package/dist/development/src/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/development/src/core/RequestResponseNormalizer.js.map +1 -0
- package/dist/development/src/core/StateInitializer.cjs +387 -0
- package/dist/development/src/core/StateInitializer.cjs.map +1 -0
- package/dist/development/src/core/StateInitializer.js +387 -0
- package/dist/development/src/core/StateInitializer.js.map +1 -0
- package/dist/development/src/core/TreeAugmenter.cjs.map +1 -0
- package/dist/development/src/core/TreeAugmenter.js.map +1 -0
- package/dist/development/src/core/TreeFilterGenerator.cjs +82 -0
- package/dist/development/src/core/TreeFilterGenerator.cjs.map +1 -0
- package/dist/development/src/core/TreeFilterGenerator.js +82 -0
- package/dist/development/src/core/TreeFilterGenerator.js.map +1 -0
- package/dist/development/src/core/TreeParameterMerger.cjs.map +1 -0
- package/dist/development/src/core/TreeParameterMerger.js.map +1 -0
- package/dist/development/src/core/TreeStore.cjs +176 -0
- package/dist/development/src/core/TreeStore.cjs.map +1 -0
- package/dist/development/src/core/TreeStore.js +176 -0
- package/dist/development/src/core/TreeStore.js.map +1 -0
- package/dist/development/src/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/development/src/core/VariableInputTransformer.js.map +1 -0
- package/dist/development/src/core/exceptions/ErrorLocator.cjs +59 -0
- package/dist/development/src/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/development/src/core/exceptions/ErrorLocator.js +59 -0
- package/dist/development/src/core/exceptions/ErrorLocator.js.map +1 -0
- package/dist/development/src/core/exceptions/LocalizedBindingError.cjs.map +1 -0
- package/dist/development/src/core/exceptions/LocalizedBindingError.js.map +1 -0
- package/dist/development/src/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/development/src/core/exceptions/MarkerSugarer.js.map +1 -0
- package/dist/development/src/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/development/src/core/exceptions/TreeParameterSugarer.js.map +1 -0
- package/dist/development/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/development/src/core/factories/createBatchUpdatesOptions.js.map +1 -0
- package/dist/development/src/core/operations/EntityOperations.cjs +232 -0
- package/dist/development/src/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/development/src/core/operations/EntityOperations.js +232 -0
- package/dist/development/src/core/operations/EntityOperations.js.map +1 -0
- package/dist/development/src/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/development/src/core/operations/FieldOperations.js.map +1 -0
- package/dist/development/src/core/operations/ListOperations.cjs +159 -0
- package/dist/development/src/core/operations/ListOperations.cjs.map +1 -0
- package/dist/development/src/core/operations/ListOperations.js +159 -0
- package/dist/development/src/core/operations/ListOperations.js.map +1 -0
- package/dist/development/src/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/development/src/core/operations/OperationsHelpers.js.map +1 -0
- package/dist/development/src/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/development/src/core/requestAliases/MutationAlias.js.map +1 -0
- package/dist/development/src/core/schema/Schema.cjs.map +1 -0
- package/dist/development/src/core/schema/Schema.js.map +1 -0
- package/dist/development/src/core/schema/SchemaLoader.cjs +25 -0
- package/dist/development/src/core/schema/SchemaLoader.cjs.map +1 -0
- package/dist/development/src/core/schema/SchemaLoader.js +25 -0
- package/dist/development/src/core/schema/SchemaLoader.js.map +1 -0
- package/dist/development/src/core/schema/SchemaPreprocessor.cjs.map +1 -0
- package/dist/development/src/core/schema/SchemaPreprocessor.js.map +1 -0
- package/dist/development/src/core/state/StateIterator.cjs.map +1 -0
- package/dist/development/src/core/state/StateIterator.js.map +1 -0
- package/dist/development/src/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/development/src/core/state/getEntityMarker.js.map +1 -0
- package/dist/development/src/core/utils/createQueryBuilder.cjs.map +1 -0
- package/dist/development/src/core/utils/createQueryBuilder.js.map +1 -0
- package/dist/development/src/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/development/src/core/utils/getCombinedSignal.js.map +1 -0
- package/dist/development/src/dao/Environment.cjs.map +1 -0
- package/dist/development/src/dao/Environment.js.map +1 -0
- package/dist/development/src/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
- package/dist/development/src/dao/TreeNodeEnvironmentFactory.js.map +1 -0
- package/dist/development/src/dao/VariableFieldValue.cjs.map +1 -0
- package/dist/development/src/dao/VariableFieldValue.js.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs +14 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.js +14 -0
- package/dist/development/src/fieldHelpers/helpers/FieldHelper.js.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/development/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -0
- package/dist/development/src/markers/EntityFieldMarkersContainer.cjs.map +1 -0
- package/dist/development/src/markers/EntityFieldMarkersContainer.js.map +1 -0
- package/dist/development/src/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
- package/dist/development/src/markers/EntityFieldsWithHoistablesMarker.js.map +1 -0
- package/dist/development/src/markers/EntityListSubTreeMarker.cjs +20 -0
- package/dist/development/src/markers/EntityListSubTreeMarker.cjs.map +1 -0
- package/dist/development/src/markers/EntityListSubTreeMarker.js +20 -0
- package/dist/development/src/markers/EntityListSubTreeMarker.js.map +1 -0
- package/dist/development/src/markers/EntitySubTreeMarker.cjs +20 -0
- package/dist/development/src/markers/EntitySubTreeMarker.cjs.map +1 -0
- package/dist/development/src/markers/EntitySubTreeMarker.js +20 -0
- package/dist/development/src/markers/EntitySubTreeMarker.js.map +1 -0
- package/dist/development/src/markers/FieldMarker.cjs +17 -0
- package/dist/development/src/markers/FieldMarker.cjs.map +1 -0
- package/dist/development/src/markers/FieldMarker.js +17 -0
- package/dist/development/src/markers/FieldMarker.js.map +1 -0
- package/dist/development/src/markers/HasManyRelationMarker.cjs +26 -0
- package/dist/development/src/markers/HasManyRelationMarker.cjs.map +1 -0
- package/dist/development/src/markers/HasManyRelationMarker.js +26 -0
- package/dist/development/src/markers/HasManyRelationMarker.js.map +1 -0
- package/dist/development/src/markers/HasOneRelationMarker.cjs +20 -0
- package/dist/development/src/markers/HasOneRelationMarker.cjs.map +1 -0
- package/dist/development/src/markers/HasOneRelationMarker.js +20 -0
- package/dist/development/src/markers/HasOneRelationMarker.js.map +1 -0
- package/dist/development/src/markers/MarkerTreeRoot.cjs.map +1 -0
- package/dist/development/src/markers/MarkerTreeRoot.js.map +1 -0
- package/dist/development/src/markers/ParentEntityMarker.cjs.map +1 -0
- package/dist/development/src/markers/ParentEntityMarker.js.map +1 -0
- package/dist/development/src/markers/PlaceholderGenerator.cjs.map +1 -0
- package/dist/development/src/markers/PlaceholderGenerator.js.map +1 -0
- package/dist/development/src/markers/PlaceholderParametersGenerator.cjs.map +1 -0
- package/dist/development/src/markers/PlaceholderParametersGenerator.js.map +1 -0
- package/dist/development/src/queryLanguage/CacheStore.cjs +44 -0
- package/dist/development/src/queryLanguage/CacheStore.cjs.map +1 -0
- package/dist/development/src/queryLanguage/CacheStore.js +44 -0
- package/dist/development/src/queryLanguage/CacheStore.js.map +1 -0
- package/dist/development/src/queryLanguage/MarkerFactory.cjs.map +1 -0
- package/dist/development/src/queryLanguage/MarkerFactory.js.map +1 -0
- package/dist/development/src/queryLanguage/Parser.cjs +724 -0
- package/dist/development/src/queryLanguage/Parser.cjs.map +1 -0
- package/dist/development/src/queryLanguage/Parser.js +724 -0
- package/dist/development/src/queryLanguage/Parser.js.map +1 -0
- package/dist/development/src/queryLanguage/QueryLanguage.cjs +543 -0
- package/dist/development/src/queryLanguage/QueryLanguage.cjs.map +1 -0
- package/dist/development/src/queryLanguage/QueryLanguage.js +543 -0
- package/dist/development/src/queryLanguage/QueryLanguage.js.map +1 -0
- package/dist/development/src/queryLanguage/QueryLanguageError.cjs.map +1 -0
- package/dist/development/src/queryLanguage/QueryLanguageError.js.map +1 -0
- package/dist/development/src/queryLanguage/tokenList.cjs +151 -0
- package/dist/development/src/queryLanguage/tokenList.cjs.map +1 -0
- package/dist/development/src/queryLanguage/tokenList.js +152 -0
- package/dist/development/src/queryLanguage/tokenList.js.map +1 -0
- package/dist/development/src/structures/BijectiveIndexedMap.cjs +117 -0
- package/dist/development/src/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/development/src/structures/BijectiveIndexedMap.js +117 -0
- package/dist/development/src/structures/BijectiveIndexedMap.js.map +1 -0
- package/dist/development/src/structures/LRUCache.cjs +32 -0
- package/dist/development/src/structures/LRUCache.cjs.map +1 -0
- package/dist/development/src/structures/LRUCache.js +32 -0
- package/dist/development/src/structures/LRUCache.js.map +1 -0
- package/dist/development/src/structures/WeakIdCache.cjs +30 -0
- package/dist/development/src/structures/WeakIdCache.cjs.map +1 -0
- package/dist/development/src/structures/WeakIdCache.js +30 -0
- package/dist/development/src/structures/WeakIdCache.js.map +1 -0
- package/dist/development/src/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
- package/dist/development/src/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -0
- package/dist/development/src/treeParameters/EntityCreationParameters.cjs.map +1 -0
- package/dist/development/src/treeParameters/EntityCreationParameters.js.map +1 -0
- package/dist/development/src/treeParameters/EntityListPreferences.cjs.map +1 -0
- package/dist/development/src/treeParameters/EntityListPreferences.js.map +1 -0
- package/dist/development/src/treeParameters/EventListenersStore.cjs.map +1 -0
- package/dist/development/src/treeParameters/EventListenersStore.js.map +1 -0
- package/dist/development/src/treeParameters/LeafField.cjs.map +1 -0
- package/dist/development/src/treeParameters/LeafField.js.map +1 -0
- package/dist/development/src/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
- package/dist/development/src/treeParameters/QualifiedEntityParameters.js.map +1 -0
- package/dist/development/src/treeParameters/Relation.cjs.map +1 -0
- package/dist/development/src/treeParameters/Relation.js.map +1 -0
- package/dist/development/src/utils/Hashing.cjs.map +1 -0
- package/dist/development/src/utils/Hashing.js.map +1 -0
- package/dist/development/src/utils/TreeNodeUtils.cjs.map +1 -0
- package/dist/development/src/utils/TreeNodeUtils.js.map +1 -0
- package/dist/development/src/utils/assert.cjs +10 -0
- package/dist/development/src/utils/assert.cjs.map +1 -0
- package/dist/development/src/utils/assert.js +10 -0
- package/dist/development/src/utils/assert.js.map +1 -0
- package/dist/development/src/utils/assertNever.cjs.map +1 -0
- package/dist/development/src/utils/assertNever.js.map +1 -0
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/development/src/utils/generateEnumerabilityPreventingEntropy.js.map +1 -0
- package/dist/development/src/utils/isEmptyObject.cjs.map +1 -0
- package/dist/development/src/utils/isEmptyObject.js.map +1 -0
- package/dist/development/src/utils/ucfirst.cjs.map +1 -0
- package/dist/development/src/utils/ucfirst.js.map +1 -0
- package/dist/production/index.cjs +49 -49
- package/dist/production/index.js +49 -49
- package/dist/production/src/BindingError.cjs.map +1 -0
- package/dist/production/src/BindingError.js.map +1 -0
- package/dist/production/src/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/production/src/accessorTree/NormalizedPersistedData.js.map +1 -0
- package/dist/production/src/accessorTree/RuntimeId.cjs +61 -0
- package/dist/production/src/accessorTree/RuntimeId.cjs.map +1 -0
- package/dist/production/src/accessorTree/RuntimeId.js +61 -0
- package/dist/production/src/accessorTree/RuntimeId.js.map +1 -0
- package/dist/production/src/accessors/EntityAccessor.cjs.map +1 -0
- package/dist/production/src/accessors/EntityAccessor.js.map +1 -0
- package/dist/production/src/accessors/EntityListAccessor.cjs.map +1 -0
- package/dist/production/src/accessors/EntityListAccessor.js.map +1 -0
- package/dist/production/src/accessors/ErrorAccessor.cjs.map +1 -0
- package/dist/production/src/accessors/ErrorAccessor.js.map +1 -0
- package/dist/production/src/accessors/FieldAccessor.cjs.map +1 -0
- package/dist/production/src/accessors/FieldAccessor.js.map +1 -0
- package/dist/production/src/accessors/TreeRootAccessor.cjs.map +1 -0
- package/dist/production/src/accessors/TreeRootAccessor.js.map +1 -0
- package/dist/production/src/bindingTypes.cjs.map +1 -0
- package/dist/production/src/bindingTypes.js.map +1 -0
- package/dist/production/src/core/AccessorErrorManager.cjs +204 -0
- package/dist/production/src/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/production/src/core/AccessorErrorManager.js +204 -0
- package/dist/production/src/core/AccessorErrorManager.js.map +1 -0
- package/dist/production/src/core/Config.cjs +29 -0
- package/dist/production/src/core/Config.cjs.map +1 -0
- package/dist/production/src/core/Config.js +29 -0
- package/dist/production/src/core/Config.js.map +1 -0
- package/dist/production/src/core/DataBinding.cjs +348 -0
- package/dist/production/src/core/DataBinding.cjs.map +1 -0
- package/dist/production/src/core/DataBinding.js +348 -0
- package/dist/production/src/core/DataBinding.js.map +1 -0
- package/dist/production/src/core/DirtinessTracker.cjs +26 -0
- package/dist/production/src/core/DirtinessTracker.cjs.map +1 -0
- package/dist/production/src/core/DirtinessTracker.js +26 -0
- package/dist/production/src/core/DirtinessTracker.js.map +1 -0
- package/dist/production/src/core/ErrorsPreprocessor.cjs +180 -0
- package/dist/production/src/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/production/src/core/ErrorsPreprocessor.js +180 -0
- package/dist/production/src/core/ErrorsPreprocessor.js.map +1 -0
- package/dist/production/src/core/EventManager.cjs +408 -0
- package/dist/production/src/core/EventManager.cjs.map +1 -0
- package/dist/production/src/core/EventManager.js +408 -0
- package/dist/production/src/core/EventManager.js.map +1 -0
- package/dist/production/src/core/MarkerComparator.cjs.map +1 -0
- package/dist/production/src/core/MarkerComparator.js.map +1 -0
- package/dist/production/src/core/MarkerMerger.cjs +256 -0
- package/dist/production/src/core/MarkerMerger.cjs.map +1 -0
- package/dist/production/src/core/MarkerMerger.js +256 -0
- package/dist/production/src/core/MarkerMerger.js.map +1 -0
- package/dist/production/src/core/MutationGenerator.cjs +662 -0
- package/dist/production/src/core/MutationGenerator.cjs.map +1 -0
- package/dist/production/src/core/MutationGenerator.js +662 -0
- package/dist/production/src/core/MutationGenerator.js.map +1 -0
- package/dist/production/src/core/QueryGenerator.cjs.map +1 -0
- package/dist/production/src/core/QueryGenerator.js.map +1 -0
- package/dist/production/src/core/RealmKeyGenerator.cjs +42 -0
- package/dist/production/src/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/production/src/core/RealmKeyGenerator.js +42 -0
- package/dist/production/src/core/RealmKeyGenerator.js.map +1 -0
- package/dist/production/src/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/production/src/core/RequestResponseNormalizer.js.map +1 -0
- package/dist/production/src/core/StateInitializer.cjs +387 -0
- package/dist/production/src/core/StateInitializer.cjs.map +1 -0
- package/dist/production/src/core/StateInitializer.js +387 -0
- package/dist/production/src/core/StateInitializer.js.map +1 -0
- package/dist/production/src/core/TreeAugmenter.cjs.map +1 -0
- package/dist/production/src/core/TreeAugmenter.js.map +1 -0
- package/dist/production/src/core/TreeFilterGenerator.cjs +82 -0
- package/dist/production/src/core/TreeFilterGenerator.cjs.map +1 -0
- package/dist/production/src/core/TreeFilterGenerator.js +82 -0
- package/dist/production/src/core/TreeFilterGenerator.js.map +1 -0
- package/dist/production/src/core/TreeParameterMerger.cjs.map +1 -0
- package/dist/production/src/core/TreeParameterMerger.js.map +1 -0
- package/dist/production/src/core/TreeStore.cjs +176 -0
- package/dist/production/src/core/TreeStore.cjs.map +1 -0
- package/dist/production/src/core/TreeStore.js +176 -0
- package/dist/production/src/core/TreeStore.js.map +1 -0
- package/dist/production/src/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/production/src/core/VariableInputTransformer.js.map +1 -0
- package/dist/production/src/core/exceptions/ErrorLocator.cjs +59 -0
- package/dist/production/src/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/production/src/core/exceptions/ErrorLocator.js +59 -0
- package/dist/production/src/core/exceptions/ErrorLocator.js.map +1 -0
- package/dist/production/src/core/exceptions/LocalizedBindingError.cjs.map +1 -0
- package/dist/production/src/core/exceptions/LocalizedBindingError.js.map +1 -0
- package/dist/production/src/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/production/src/core/exceptions/MarkerSugarer.js.map +1 -0
- package/dist/production/src/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/production/src/core/exceptions/TreeParameterSugarer.js.map +1 -0
- package/dist/production/src/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/production/src/core/factories/createBatchUpdatesOptions.js.map +1 -0
- package/dist/production/src/core/operations/EntityOperations.cjs +232 -0
- package/dist/production/src/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/production/src/core/operations/EntityOperations.js +232 -0
- package/dist/production/src/core/operations/EntityOperations.js.map +1 -0
- package/dist/production/src/core/operations/FieldOperations.cjs +77 -0
- package/dist/production/src/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/production/src/core/operations/FieldOperations.js +77 -0
- package/dist/production/src/core/operations/FieldOperations.js.map +1 -0
- package/dist/production/src/core/operations/ListOperations.cjs +159 -0
- package/dist/production/src/core/operations/ListOperations.cjs.map +1 -0
- package/dist/production/src/core/operations/ListOperations.js +159 -0
- package/dist/production/src/core/operations/ListOperations.js.map +1 -0
- package/dist/production/src/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/production/src/core/operations/OperationsHelpers.js.map +1 -0
- package/dist/production/src/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/production/src/core/requestAliases/MutationAlias.js.map +1 -0
- package/dist/production/src/core/schema/Schema.cjs.map +1 -0
- package/dist/production/src/core/schema/Schema.js.map +1 -0
- package/dist/production/src/core/schema/SchemaLoader.cjs +25 -0
- package/dist/production/src/core/schema/SchemaLoader.cjs.map +1 -0
- package/dist/production/src/core/schema/SchemaLoader.js +25 -0
- package/dist/production/src/core/schema/SchemaLoader.js.map +1 -0
- package/dist/production/src/core/schema/SchemaPreprocessor.cjs.map +1 -0
- package/dist/production/src/core/schema/SchemaPreprocessor.js.map +1 -0
- package/dist/production/src/core/state/StateIterator.cjs.map +1 -0
- package/dist/production/src/core/state/StateIterator.js.map +1 -0
- package/dist/production/src/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/production/src/core/state/getEntityMarker.js.map +1 -0
- package/dist/production/src/core/utils/createQueryBuilder.cjs.map +1 -0
- package/dist/production/src/core/utils/createQueryBuilder.js.map +1 -0
- package/dist/production/src/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/production/src/core/utils/getCombinedSignal.js.map +1 -0
- package/dist/production/src/dao/Environment.cjs.map +1 -0
- package/dist/production/src/dao/Environment.js.map +1 -0
- package/dist/production/src/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
- package/dist/production/src/dao/TreeNodeEnvironmentFactory.js.map +1 -0
- package/dist/production/src/dao/VariableFieldValue.cjs.map +1 -0
- package/dist/production/src/dao/VariableFieldValue.js.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs +14 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.js +14 -0
- package/dist/production/src/fieldHelpers/helpers/FieldHelper.js.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/production/src/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -0
- package/dist/production/src/markers/EntityFieldMarkersContainer.cjs.map +1 -0
- package/dist/production/src/markers/EntityFieldMarkersContainer.js.map +1 -0
- package/dist/production/src/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
- package/dist/production/src/markers/EntityFieldsWithHoistablesMarker.js.map +1 -0
- package/dist/production/src/markers/EntityListSubTreeMarker.cjs +20 -0
- package/dist/production/src/markers/EntityListSubTreeMarker.cjs.map +1 -0
- package/dist/production/src/markers/EntityListSubTreeMarker.js +20 -0
- package/dist/production/src/markers/EntityListSubTreeMarker.js.map +1 -0
- package/dist/production/src/markers/EntitySubTreeMarker.cjs +20 -0
- package/dist/production/src/markers/EntitySubTreeMarker.cjs.map +1 -0
- package/dist/production/src/markers/EntitySubTreeMarker.js +20 -0
- package/dist/production/src/markers/EntitySubTreeMarker.js.map +1 -0
- package/dist/production/src/markers/FieldMarker.cjs +17 -0
- package/dist/production/src/markers/FieldMarker.cjs.map +1 -0
- package/dist/production/src/markers/FieldMarker.js +17 -0
- package/dist/production/src/markers/FieldMarker.js.map +1 -0
- package/dist/production/src/markers/HasManyRelationMarker.cjs +20 -0
- package/dist/production/src/markers/HasManyRelationMarker.cjs.map +1 -0
- package/dist/production/src/markers/HasManyRelationMarker.js +20 -0
- package/dist/production/src/markers/HasManyRelationMarker.js.map +1 -0
- package/dist/production/src/markers/HasOneRelationMarker.cjs +20 -0
- package/dist/production/src/markers/HasOneRelationMarker.cjs.map +1 -0
- package/dist/production/src/markers/HasOneRelationMarker.js +20 -0
- package/dist/production/src/markers/HasOneRelationMarker.js.map +1 -0
- package/dist/production/src/markers/MarkerTreeRoot.cjs.map +1 -0
- package/dist/production/src/markers/MarkerTreeRoot.js.map +1 -0
- package/dist/production/src/markers/ParentEntityMarker.cjs.map +1 -0
- package/dist/production/src/markers/ParentEntityMarker.js.map +1 -0
- package/dist/production/src/markers/PlaceholderGenerator.cjs.map +1 -0
- package/dist/production/src/markers/PlaceholderGenerator.js.map +1 -0
- package/dist/production/src/markers/PlaceholderParametersGenerator.cjs.map +1 -0
- package/dist/production/src/markers/PlaceholderParametersGenerator.js.map +1 -0
- package/dist/production/src/queryLanguage/CacheStore.cjs +44 -0
- package/dist/production/src/queryLanguage/CacheStore.cjs.map +1 -0
- package/dist/production/src/queryLanguage/CacheStore.js +44 -0
- package/dist/production/src/queryLanguage/CacheStore.js.map +1 -0
- package/dist/production/src/queryLanguage/MarkerFactory.cjs.map +1 -0
- package/dist/production/src/queryLanguage/MarkerFactory.js.map +1 -0
- package/dist/production/src/queryLanguage/Parser.cjs +721 -0
- package/dist/production/src/queryLanguage/Parser.cjs.map +1 -0
- package/dist/production/src/queryLanguage/Parser.js +721 -0
- package/dist/production/src/queryLanguage/Parser.js.map +1 -0
- package/dist/production/src/queryLanguage/QueryLanguage.cjs +540 -0
- package/dist/production/src/queryLanguage/QueryLanguage.cjs.map +1 -0
- package/dist/production/src/queryLanguage/QueryLanguage.js +540 -0
- package/dist/production/src/queryLanguage/QueryLanguage.js.map +1 -0
- package/dist/production/src/queryLanguage/QueryLanguageError.cjs.map +1 -0
- package/dist/production/src/queryLanguage/QueryLanguageError.js.map +1 -0
- package/dist/production/src/queryLanguage/tokenList.cjs +151 -0
- package/dist/production/src/queryLanguage/tokenList.cjs.map +1 -0
- package/dist/production/src/queryLanguage/tokenList.js +152 -0
- package/dist/production/src/queryLanguage/tokenList.js.map +1 -0
- package/dist/production/src/structures/BijectiveIndexedMap.cjs +117 -0
- package/dist/production/src/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/production/src/structures/BijectiveIndexedMap.js +117 -0
- package/dist/production/src/structures/BijectiveIndexedMap.js.map +1 -0
- package/dist/production/src/structures/LRUCache.cjs +32 -0
- package/dist/production/src/structures/LRUCache.cjs.map +1 -0
- package/dist/production/src/structures/LRUCache.js +32 -0
- package/dist/production/src/structures/LRUCache.js.map +1 -0
- package/dist/production/src/structures/WeakIdCache.cjs +30 -0
- package/dist/production/src/structures/WeakIdCache.cjs.map +1 -0
- package/dist/production/src/structures/WeakIdCache.js +30 -0
- package/dist/production/src/structures/WeakIdCache.js.map +1 -0
- package/dist/production/src/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
- package/dist/production/src/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -0
- package/dist/production/src/treeParameters/EntityCreationParameters.cjs.map +1 -0
- package/dist/production/src/treeParameters/EntityCreationParameters.js.map +1 -0
- package/dist/production/src/treeParameters/EntityListPreferences.cjs.map +1 -0
- package/dist/production/src/treeParameters/EntityListPreferences.js.map +1 -0
- package/dist/production/src/treeParameters/EventListenersStore.cjs.map +1 -0
- package/dist/production/src/treeParameters/EventListenersStore.js.map +1 -0
- package/dist/production/src/treeParameters/LeafField.cjs.map +1 -0
- package/dist/production/src/treeParameters/LeafField.js.map +1 -0
- package/dist/production/src/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
- package/dist/production/src/treeParameters/QualifiedEntityParameters.js.map +1 -0
- package/dist/production/src/treeParameters/Relation.cjs.map +1 -0
- package/dist/production/src/treeParameters/Relation.js.map +1 -0
- package/dist/production/src/utils/Hashing.cjs.map +1 -0
- package/dist/production/src/utils/Hashing.js.map +1 -0
- package/dist/production/src/utils/TreeNodeUtils.cjs.map +1 -0
- package/dist/production/src/utils/TreeNodeUtils.js.map +1 -0
- package/dist/production/src/utils/assert.cjs +10 -0
- package/dist/production/src/utils/assert.cjs.map +1 -0
- package/dist/production/src/utils/assert.js +10 -0
- package/dist/production/src/utils/assert.js.map +1 -0
- package/dist/production/src/utils/assertNever.cjs.map +1 -0
- package/dist/production/src/utils/assertNever.js.map +1 -0
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/production/src/utils/generateEnumerabilityPreventingEntropy.js.map +1 -0
- package/dist/production/src/utils/isEmptyObject.cjs.map +1 -0
- package/dist/production/src/utils/isEmptyObject.js.map +1 -0
- package/dist/production/src/utils/ucfirst.cjs.map +1 -0
- package/dist/production/src/utils/ucfirst.js.map +1 -0
- package/dist/types/accessorTree/RuntimeId.d.ts.map +1 -1
- package/dist/types/accessors/EntityAccessor.d.ts.map +1 -1
- package/dist/types/accessors/EntityListAccessor.d.ts.map +1 -1
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts.map +1 -1
- package/dist/types/core/EventManager.d.ts.map +1 -1
- package/dist/types/core/MarkerMerger.d.ts.map +1 -1
- package/dist/types/core/MutationGenerator.d.ts.map +1 -1
- package/dist/types/core/TreeStore.d.ts.map +1 -1
- package/dist/types/core/operations/EntityOperations.d.ts.map +1 -1
- package/dist/types/core/state/EntityListState.d.ts.map +1 -1
- package/dist/types/core/utils/getCombinedSignal.d.ts.map +1 -1
- package/dist/types/dao/Environment.d.ts +1 -1
- package/dist/types/dao/Environment.d.ts.map +1 -1
- package/dist/types/fieldHelpers/helpers/TemporalFieldHelper.d.ts.map +1 -1
- package/dist/types/fieldHelpers/helpers/UuidFieldHelper.d.ts.map +1 -1
- package/dist/types/markers/FieldMarker.d.ts.map +1 -1
- package/dist/types/queryLanguage/QueryLanguage.d.ts +5 -4
- package/dist/types/queryLanguage/QueryLanguage.d.ts.map +1 -1
- package/dist/types/queryLanguage/tokenList.d.ts +1 -0
- package/dist/types/queryLanguage/tokenList.d.ts.map +1 -1
- package/dist/types/treeParameters/EntityListEventListeners.d.ts.map +1 -1
- package/dist/types/treeParameters/EventListenersStore.d.ts.map +1 -1
- package/dist/types/treeParameters/HasManyRelation.d.ts.map +1 -1
- package/dist/types/treeParameters/HasOneRelation.d.ts.map +1 -1
- package/dist/types/treeParameters/QualifiedEntityList.d.ts.map +1 -1
- package/dist/types/treeParameters/QualifiedSingleEntity.d.ts.map +1 -1
- package/dist/types/treeParameters/RelativeEntityList.d.ts.map +1 -1
- package/dist/types/treeParameters/SingleEntityEventListeners.d.ts.map +1 -1
- package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts.map +1 -1
- package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -13
- package/src/accessorTree/QueryRequestResponse.ts +1 -1
- package/src/accessors/EntityAccessor.ts +1 -1
- package/src/accessors/EntityListAccessor.ts +1 -1
- package/src/core/AccessorErrorManager.ts +1 -0
- package/src/core/DataBinding.ts +8 -4
- package/src/core/EventManager.ts +6 -6
- package/src/core/MarkerMerger.ts +8 -2
- package/src/core/MutationGenerator.ts +8 -8
- package/src/core/RequestResponseNormalizer.ts +1 -1
- package/src/core/TreeStore.ts +6 -6
- package/src/core/operations/EntityOperations.ts +7 -3
- package/src/core/operations/FieldOperations.ts +2 -2
- package/src/core/operations/ListOperations.ts +1 -1
- package/src/core/state/EntityListState.ts +6 -6
- package/src/queryLanguage/Parser.ts +2 -2
- package/src/queryLanguage/QueryLanguage.ts +54 -25
- package/src/queryLanguage/tokenList.ts +2 -0
- package/src/treeParameters/EntityListEventListeners.ts +2 -2
- package/src/treeParameters/HasManyRelation.ts +3 -3
- package/src/treeParameters/HasOneRelation.ts +2 -2
- package/src/treeParameters/QualifiedEntityList.ts +7 -7
- package/src/treeParameters/QualifiedSingleEntity.ts +9 -9
- package/src/treeParameters/RelativeEntityList.ts +2 -2
- package/src/treeParameters/SingleEntityEventListeners.ts +3 -3
- package/src/treeParameters/UnconstrainedQualifiedEntityList.ts +6 -6
- package/src/treeParameters/UnconstrainedQualifiedSingleEntity.ts +4 -4
- package/src/tsconfig.json +4 -1
- package/src/typings/react-fix.d.ts +1 -1
- package/tests/cases/unit/queryLanguage/filter.spec.tsx +100 -0
- package/tests/cases/unit/queryLanguage/general.spec.tsx +59 -0
- package/tests/cases/unit/queryLanguage/orderBy.spec.tsx +48 -0
- package/tests/cases/unit/queryLanguage/qualifiedEntityList.spec.tsx +30 -0
- package/tests/cases/unit/queryLanguage/qualifiedFieldList.spec.tsx +29 -0
- package/tests/cases/unit/queryLanguage/relativeEntityList.spec.tsx +49 -0
- package/tests/cases/unit/queryLanguage/singleRelativeField.spec.tsx +132 -0
- package/tests/cases/unit/queryLanguage/taggedMap.spec.tsx +41 -0
- package/tests/tsconfig.json +10 -0
- package/tsconfig.json +8 -0
- package/tsdoc.json +6 -0
- package/vitest.config.ts +3 -0
- package/dist/development/BindingError.cjs.map +0 -1
- package/dist/development/BindingError.js.map +0 -1
- package/dist/development/accessorTree/NormalizedPersistedData.cjs.map +0 -1
- package/dist/development/accessorTree/NormalizedPersistedData.js.map +0 -1
- package/dist/development/accessorTree/RuntimeId.cjs +0 -64
- package/dist/development/accessorTree/RuntimeId.cjs.map +0 -1
- package/dist/development/accessorTree/RuntimeId.js +0 -64
- package/dist/development/accessorTree/RuntimeId.js.map +0 -1
- package/dist/development/accessors/EntityAccessor.cjs.map +0 -1
- package/dist/development/accessors/EntityAccessor.js.map +0 -1
- package/dist/development/accessors/EntityListAccessor.cjs.map +0 -1
- package/dist/development/accessors/EntityListAccessor.js.map +0 -1
- package/dist/development/accessors/ErrorAccessor.cjs.map +0 -1
- package/dist/development/accessors/ErrorAccessor.js.map +0 -1
- package/dist/development/accessors/FieldAccessor.cjs.map +0 -1
- package/dist/development/accessors/FieldAccessor.js.map +0 -1
- package/dist/development/accessors/TreeRootAccessor.cjs.map +0 -1
- package/dist/development/accessors/TreeRootAccessor.js.map +0 -1
- package/dist/development/bindingTypes.cjs.map +0 -1
- package/dist/development/bindingTypes.js.map +0 -1
- package/dist/development/core/AccessorErrorManager.cjs +0 -207
- package/dist/development/core/AccessorErrorManager.cjs.map +0 -1
- package/dist/development/core/AccessorErrorManager.js +0 -207
- package/dist/development/core/AccessorErrorManager.js.map +0 -1
- package/dist/development/core/Config.cjs +0 -32
- package/dist/development/core/Config.cjs.map +0 -1
- package/dist/development/core/Config.js +0 -32
- package/dist/development/core/Config.js.map +0 -1
- package/dist/development/core/DataBinding.cjs +0 -353
- package/dist/development/core/DataBinding.cjs.map +0 -1
- package/dist/development/core/DataBinding.js +0 -353
- package/dist/development/core/DataBinding.js.map +0 -1
- package/dist/development/core/DirtinessTracker.cjs +0 -29
- package/dist/development/core/DirtinessTracker.cjs.map +0 -1
- package/dist/development/core/DirtinessTracker.js +0 -29
- package/dist/development/core/DirtinessTracker.js.map +0 -1
- package/dist/development/core/ErrorsPreprocessor.cjs +0 -181
- package/dist/development/core/ErrorsPreprocessor.cjs.map +0 -1
- package/dist/development/core/ErrorsPreprocessor.js +0 -181
- package/dist/development/core/ErrorsPreprocessor.js.map +0 -1
- package/dist/development/core/EventManager.cjs +0 -440
- package/dist/development/core/EventManager.cjs.map +0 -1
- package/dist/development/core/EventManager.js +0 -440
- package/dist/development/core/EventManager.js.map +0 -1
- package/dist/development/core/MarkerComparator.cjs.map +0 -1
- package/dist/development/core/MarkerComparator.js.map +0 -1
- package/dist/development/core/MarkerMerger.cjs +0 -252
- package/dist/development/core/MarkerMerger.cjs.map +0 -1
- package/dist/development/core/MarkerMerger.js +0 -252
- package/dist/development/core/MarkerMerger.js.map +0 -1
- package/dist/development/core/MutationGenerator.cjs +0 -665
- package/dist/development/core/MutationGenerator.cjs.map +0 -1
- package/dist/development/core/MutationGenerator.js +0 -665
- package/dist/development/core/MutationGenerator.js.map +0 -1
- package/dist/development/core/QueryGenerator.cjs.map +0 -1
- package/dist/development/core/QueryGenerator.js.map +0 -1
- package/dist/development/core/RealmKeyGenerator.cjs +0 -47
- package/dist/development/core/RealmKeyGenerator.cjs.map +0 -1
- package/dist/development/core/RealmKeyGenerator.js +0 -47
- package/dist/development/core/RealmKeyGenerator.js.map +0 -1
- package/dist/development/core/RequestResponseNormalizer.cjs.map +0 -1
- package/dist/development/core/RequestResponseNormalizer.js.map +0 -1
- package/dist/development/core/StateInitializer.cjs +0 -390
- package/dist/development/core/StateInitializer.cjs.map +0 -1
- package/dist/development/core/StateInitializer.js +0 -390
- package/dist/development/core/StateInitializer.js.map +0 -1
- package/dist/development/core/TreeAugmenter.cjs.map +0 -1
- package/dist/development/core/TreeAugmenter.js.map +0 -1
- package/dist/development/core/TreeFilterGenerator.cjs +0 -83
- package/dist/development/core/TreeFilterGenerator.cjs.map +0 -1
- package/dist/development/core/TreeFilterGenerator.js +0 -83
- package/dist/development/core/TreeFilterGenerator.js.map +0 -1
- package/dist/development/core/TreeParameterMerger.cjs.map +0 -1
- package/dist/development/core/TreeParameterMerger.js.map +0 -1
- package/dist/development/core/TreeStore.cjs +0 -182
- package/dist/development/core/TreeStore.cjs.map +0 -1
- package/dist/development/core/TreeStore.js +0 -182
- package/dist/development/core/TreeStore.js.map +0 -1
- package/dist/development/core/VariableInputTransformer.cjs.map +0 -1
- package/dist/development/core/VariableInputTransformer.js.map +0 -1
- package/dist/development/core/exceptions/ErrorLocator.cjs +0 -62
- package/dist/development/core/exceptions/ErrorLocator.cjs.map +0 -1
- package/dist/development/core/exceptions/ErrorLocator.js +0 -62
- package/dist/development/core/exceptions/ErrorLocator.js.map +0 -1
- package/dist/development/core/exceptions/LocalizedBindingError.cjs.map +0 -1
- package/dist/development/core/exceptions/LocalizedBindingError.js.map +0 -1
- package/dist/development/core/exceptions/MarkerSugarer.cjs.map +0 -1
- package/dist/development/core/exceptions/MarkerSugarer.js.map +0 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.cjs.map +0 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.js.map +0 -1
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs.map +0 -1
- package/dist/development/core/factories/createBatchUpdatesOptions.js.map +0 -1
- package/dist/development/core/operations/EntityOperations.cjs +0 -230
- package/dist/development/core/operations/EntityOperations.cjs.map +0 -1
- package/dist/development/core/operations/EntityOperations.js +0 -230
- package/dist/development/core/operations/EntityOperations.js.map +0 -1
- package/dist/development/core/operations/FieldOperations.cjs.map +0 -1
- package/dist/development/core/operations/FieldOperations.js.map +0 -1
- package/dist/development/core/operations/ListOperations.cjs +0 -159
- package/dist/development/core/operations/ListOperations.cjs.map +0 -1
- package/dist/development/core/operations/ListOperations.js +0 -159
- package/dist/development/core/operations/ListOperations.js.map +0 -1
- package/dist/development/core/operations/OperationsHelpers.cjs.map +0 -1
- package/dist/development/core/operations/OperationsHelpers.js.map +0 -1
- package/dist/development/core/requestAliases/MutationAlias.cjs.map +0 -1
- package/dist/development/core/requestAliases/MutationAlias.js.map +0 -1
- package/dist/development/core/schema/Schema.cjs.map +0 -1
- package/dist/development/core/schema/Schema.js.map +0 -1
- package/dist/development/core/schema/SchemaLoader.cjs +0 -28
- package/dist/development/core/schema/SchemaLoader.cjs.map +0 -1
- package/dist/development/core/schema/SchemaLoader.js +0 -28
- package/dist/development/core/schema/SchemaLoader.js.map +0 -1
- package/dist/development/core/schema/SchemaPreprocessor.cjs.map +0 -1
- package/dist/development/core/schema/SchemaPreprocessor.js.map +0 -1
- package/dist/development/core/state/StateIterator.cjs.map +0 -1
- package/dist/development/core/state/StateIterator.js.map +0 -1
- package/dist/development/core/state/getEntityMarker.cjs.map +0 -1
- package/dist/development/core/state/getEntityMarker.js.map +0 -1
- package/dist/development/core/utils/createQueryBuilder.cjs.map +0 -1
- package/dist/development/core/utils/createQueryBuilder.js.map +0 -1
- package/dist/development/core/utils/getCombinedSignal.cjs.map +0 -1
- package/dist/development/core/utils/getCombinedSignal.js.map +0 -1
- package/dist/development/dao/Environment.cjs.map +0 -1
- package/dist/development/dao/Environment.js.map +0 -1
- package/dist/development/dao/TreeNodeEnvironmentFactory.cjs.map +0 -1
- package/dist/development/dao/TreeNodeEnvironmentFactory.js.map +0 -1
- package/dist/development/dao/VariableFieldValue.cjs.map +0 -1
- package/dist/development/dao/VariableFieldValue.js.map +0 -1
- package/dist/development/fieldHelpers/helpers/FieldHelper.cjs +0 -17
- package/dist/development/fieldHelpers/helpers/FieldHelper.cjs.map +0 -1
- package/dist/development/fieldHelpers/helpers/FieldHelper.js +0 -17
- package/dist/development/fieldHelpers/helpers/FieldHelper.js.map +0 -1
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +0 -1
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js.map +0 -1
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs.map +0 -1
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js.map +0 -1
- package/dist/development/markers/EntityFieldMarkersContainer.cjs.map +0 -1
- package/dist/development/markers/EntityFieldMarkersContainer.js.map +0 -1
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs.map +0 -1
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.js.map +0 -1
- package/dist/development/markers/EntityListSubTreeMarker.cjs +0 -23
- package/dist/development/markers/EntityListSubTreeMarker.cjs.map +0 -1
- package/dist/development/markers/EntityListSubTreeMarker.js +0 -23
- package/dist/development/markers/EntityListSubTreeMarker.js.map +0 -1
- package/dist/development/markers/EntitySubTreeMarker.cjs +0 -23
- package/dist/development/markers/EntitySubTreeMarker.cjs.map +0 -1
- package/dist/development/markers/EntitySubTreeMarker.js +0 -23
- package/dist/development/markers/EntitySubTreeMarker.js.map +0 -1
- package/dist/development/markers/FieldMarker.cjs +0 -20
- package/dist/development/markers/FieldMarker.cjs.map +0 -1
- package/dist/development/markers/FieldMarker.js +0 -20
- package/dist/development/markers/FieldMarker.js.map +0 -1
- package/dist/development/markers/HasManyRelationMarker.cjs +0 -29
- package/dist/development/markers/HasManyRelationMarker.cjs.map +0 -1
- package/dist/development/markers/HasManyRelationMarker.js +0 -29
- package/dist/development/markers/HasManyRelationMarker.js.map +0 -1
- package/dist/development/markers/HasOneRelationMarker.cjs +0 -23
- package/dist/development/markers/HasOneRelationMarker.cjs.map +0 -1
- package/dist/development/markers/HasOneRelationMarker.js +0 -23
- package/dist/development/markers/HasOneRelationMarker.js.map +0 -1
- package/dist/development/markers/MarkerTreeRoot.cjs.map +0 -1
- package/dist/development/markers/MarkerTreeRoot.js.map +0 -1
- package/dist/development/markers/ParentEntityMarker.cjs.map +0 -1
- package/dist/development/markers/ParentEntityMarker.js.map +0 -1
- package/dist/development/markers/PlaceholderGenerator.cjs.map +0 -1
- package/dist/development/markers/PlaceholderGenerator.js.map +0 -1
- package/dist/development/markers/PlaceholderParametersGenerator.cjs.map +0 -1
- package/dist/development/markers/PlaceholderParametersGenerator.js.map +0 -1
- package/dist/development/queryLanguage/CacheStore.cjs +0 -47
- package/dist/development/queryLanguage/CacheStore.cjs.map +0 -1
- package/dist/development/queryLanguage/CacheStore.js +0 -47
- package/dist/development/queryLanguage/CacheStore.js.map +0 -1
- package/dist/development/queryLanguage/MarkerFactory.cjs.map +0 -1
- package/dist/development/queryLanguage/MarkerFactory.js.map +0 -1
- package/dist/development/queryLanguage/Parser.cjs +0 -728
- package/dist/development/queryLanguage/Parser.cjs.map +0 -1
- package/dist/development/queryLanguage/Parser.js +0 -728
- package/dist/development/queryLanguage/Parser.js.map +0 -1
- package/dist/development/queryLanguage/QueryLanguage.cjs +0 -520
- package/dist/development/queryLanguage/QueryLanguage.cjs.map +0 -1
- package/dist/development/queryLanguage/QueryLanguage.js +0 -520
- package/dist/development/queryLanguage/QueryLanguage.js.map +0 -1
- package/dist/development/queryLanguage/QueryLanguageError.cjs.map +0 -1
- package/dist/development/queryLanguage/QueryLanguageError.js.map +0 -1
- package/dist/development/queryLanguage/tokenList.cjs +0 -150
- package/dist/development/queryLanguage/tokenList.cjs.map +0 -1
- package/dist/development/queryLanguage/tokenList.js +0 -151
- package/dist/development/queryLanguage/tokenList.js.map +0 -1
- package/dist/development/structures/BijectiveIndexedMap.cjs +0 -120
- package/dist/development/structures/BijectiveIndexedMap.cjs.map +0 -1
- package/dist/development/structures/BijectiveIndexedMap.js +0 -120
- package/dist/development/structures/BijectiveIndexedMap.js.map +0 -1
- package/dist/development/structures/LRUCache.cjs +0 -35
- package/dist/development/structures/LRUCache.cjs.map +0 -1
- package/dist/development/structures/LRUCache.js +0 -35
- package/dist/development/structures/LRUCache.js.map +0 -1
- package/dist/development/structures/WeakIdCache.cjs +0 -33
- package/dist/development/structures/WeakIdCache.cjs.map +0 -1
- package/dist/development/structures/WeakIdCache.js +0 -33
- package/dist/development/structures/WeakIdCache.js.map +0 -1
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +0 -1
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js.map +0 -1
- package/dist/development/treeParameters/EntityCreationParameters.cjs.map +0 -1
- package/dist/development/treeParameters/EntityCreationParameters.js.map +0 -1
- package/dist/development/treeParameters/EntityListPreferences.cjs.map +0 -1
- package/dist/development/treeParameters/EntityListPreferences.js.map +0 -1
- package/dist/development/treeParameters/EventListenersStore.cjs.map +0 -1
- package/dist/development/treeParameters/EventListenersStore.js.map +0 -1
- package/dist/development/treeParameters/LeafField.cjs.map +0 -1
- package/dist/development/treeParameters/LeafField.js.map +0 -1
- package/dist/development/treeParameters/QualifiedEntityParameters.cjs.map +0 -1
- package/dist/development/treeParameters/QualifiedEntityParameters.js.map +0 -1
- package/dist/development/treeParameters/Relation.cjs.map +0 -1
- package/dist/development/treeParameters/Relation.js.map +0 -1
- package/dist/development/utils/Hashing.cjs.map +0 -1
- package/dist/development/utils/Hashing.js.map +0 -1
- package/dist/development/utils/TreeNodeUtils.cjs.map +0 -1
- package/dist/development/utils/TreeNodeUtils.js.map +0 -1
- package/dist/development/utils/assert.cjs +0 -11
- package/dist/development/utils/assert.cjs.map +0 -1
- package/dist/development/utils/assert.js +0 -11
- package/dist/development/utils/assert.js.map +0 -1
- package/dist/development/utils/assertNever.cjs.map +0 -1
- package/dist/development/utils/assertNever.js.map +0 -1
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs.map +0 -1
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.js.map +0 -1
- package/dist/development/utils/isEmptyObject.cjs.map +0 -1
- package/dist/development/utils/isEmptyObject.js.map +0 -1
- package/dist/development/utils/ucfirst.cjs.map +0 -1
- package/dist/development/utils/ucfirst.js.map +0 -1
- package/dist/production/BindingError.cjs.map +0 -1
- package/dist/production/BindingError.js.map +0 -1
- package/dist/production/accessorTree/NormalizedPersistedData.cjs.map +0 -1
- package/dist/production/accessorTree/NormalizedPersistedData.js.map +0 -1
- package/dist/production/accessorTree/RuntimeId.cjs +0 -64
- package/dist/production/accessorTree/RuntimeId.cjs.map +0 -1
- package/dist/production/accessorTree/RuntimeId.js +0 -64
- package/dist/production/accessorTree/RuntimeId.js.map +0 -1
- package/dist/production/accessors/EntityAccessor.cjs.map +0 -1
- package/dist/production/accessors/EntityAccessor.js.map +0 -1
- package/dist/production/accessors/EntityListAccessor.cjs.map +0 -1
- package/dist/production/accessors/EntityListAccessor.js.map +0 -1
- package/dist/production/accessors/ErrorAccessor.cjs.map +0 -1
- package/dist/production/accessors/ErrorAccessor.js.map +0 -1
- package/dist/production/accessors/FieldAccessor.cjs.map +0 -1
- package/dist/production/accessors/FieldAccessor.js.map +0 -1
- package/dist/production/accessors/TreeRootAccessor.cjs.map +0 -1
- package/dist/production/accessors/TreeRootAccessor.js.map +0 -1
- package/dist/production/bindingTypes.cjs.map +0 -1
- package/dist/production/bindingTypes.js.map +0 -1
- package/dist/production/core/AccessorErrorManager.cjs +0 -207
- package/dist/production/core/AccessorErrorManager.cjs.map +0 -1
- package/dist/production/core/AccessorErrorManager.js +0 -207
- package/dist/production/core/AccessorErrorManager.js.map +0 -1
- package/dist/production/core/Config.cjs +0 -32
- package/dist/production/core/Config.cjs.map +0 -1
- package/dist/production/core/Config.js +0 -32
- package/dist/production/core/Config.js.map +0 -1
- package/dist/production/core/DataBinding.cjs +0 -353
- package/dist/production/core/DataBinding.cjs.map +0 -1
- package/dist/production/core/DataBinding.js +0 -353
- package/dist/production/core/DataBinding.js.map +0 -1
- package/dist/production/core/DirtinessTracker.cjs +0 -29
- package/dist/production/core/DirtinessTracker.cjs.map +0 -1
- package/dist/production/core/DirtinessTracker.js +0 -29
- package/dist/production/core/DirtinessTracker.js.map +0 -1
- package/dist/production/core/ErrorsPreprocessor.cjs +0 -181
- package/dist/production/core/ErrorsPreprocessor.cjs.map +0 -1
- package/dist/production/core/ErrorsPreprocessor.js +0 -181
- package/dist/production/core/ErrorsPreprocessor.js.map +0 -1
- package/dist/production/core/EventManager.cjs +0 -414
- package/dist/production/core/EventManager.cjs.map +0 -1
- package/dist/production/core/EventManager.js +0 -414
- package/dist/production/core/EventManager.js.map +0 -1
- package/dist/production/core/MarkerComparator.cjs.map +0 -1
- package/dist/production/core/MarkerComparator.js.map +0 -1
- package/dist/production/core/MarkerMerger.cjs +0 -252
- package/dist/production/core/MarkerMerger.cjs.map +0 -1
- package/dist/production/core/MarkerMerger.js +0 -252
- package/dist/production/core/MarkerMerger.js.map +0 -1
- package/dist/production/core/MutationGenerator.cjs +0 -665
- package/dist/production/core/MutationGenerator.cjs.map +0 -1
- package/dist/production/core/MutationGenerator.js +0 -665
- package/dist/production/core/MutationGenerator.js.map +0 -1
- package/dist/production/core/QueryGenerator.cjs.map +0 -1
- package/dist/production/core/QueryGenerator.js.map +0 -1
- package/dist/production/core/RealmKeyGenerator.cjs +0 -47
- package/dist/production/core/RealmKeyGenerator.cjs.map +0 -1
- package/dist/production/core/RealmKeyGenerator.js +0 -47
- package/dist/production/core/RealmKeyGenerator.js.map +0 -1
- package/dist/production/core/RequestResponseNormalizer.cjs.map +0 -1
- package/dist/production/core/RequestResponseNormalizer.js.map +0 -1
- package/dist/production/core/StateInitializer.cjs +0 -390
- package/dist/production/core/StateInitializer.cjs.map +0 -1
- package/dist/production/core/StateInitializer.js +0 -390
- package/dist/production/core/StateInitializer.js.map +0 -1
- package/dist/production/core/TreeAugmenter.cjs.map +0 -1
- package/dist/production/core/TreeAugmenter.js.map +0 -1
- package/dist/production/core/TreeFilterGenerator.cjs +0 -83
- package/dist/production/core/TreeFilterGenerator.cjs.map +0 -1
- package/dist/production/core/TreeFilterGenerator.js +0 -83
- package/dist/production/core/TreeFilterGenerator.js.map +0 -1
- package/dist/production/core/TreeParameterMerger.cjs.map +0 -1
- package/dist/production/core/TreeParameterMerger.js.map +0 -1
- package/dist/production/core/TreeStore.cjs +0 -182
- package/dist/production/core/TreeStore.cjs.map +0 -1
- package/dist/production/core/TreeStore.js +0 -182
- package/dist/production/core/TreeStore.js.map +0 -1
- package/dist/production/core/VariableInputTransformer.cjs.map +0 -1
- package/dist/production/core/VariableInputTransformer.js.map +0 -1
- package/dist/production/core/exceptions/ErrorLocator.cjs +0 -62
- package/dist/production/core/exceptions/ErrorLocator.cjs.map +0 -1
- package/dist/production/core/exceptions/ErrorLocator.js +0 -62
- package/dist/production/core/exceptions/ErrorLocator.js.map +0 -1
- package/dist/production/core/exceptions/LocalizedBindingError.cjs.map +0 -1
- package/dist/production/core/exceptions/LocalizedBindingError.js.map +0 -1
- package/dist/production/core/exceptions/MarkerSugarer.cjs.map +0 -1
- package/dist/production/core/exceptions/MarkerSugarer.js.map +0 -1
- package/dist/production/core/exceptions/TreeParameterSugarer.cjs.map +0 -1
- package/dist/production/core/exceptions/TreeParameterSugarer.js.map +0 -1
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs.map +0 -1
- package/dist/production/core/factories/createBatchUpdatesOptions.js.map +0 -1
- package/dist/production/core/operations/EntityOperations.cjs +0 -230
- package/dist/production/core/operations/EntityOperations.cjs.map +0 -1
- package/dist/production/core/operations/EntityOperations.js +0 -230
- package/dist/production/core/operations/EntityOperations.js.map +0 -1
- package/dist/production/core/operations/FieldOperations.cjs +0 -76
- package/dist/production/core/operations/FieldOperations.cjs.map +0 -1
- package/dist/production/core/operations/FieldOperations.js +0 -76
- package/dist/production/core/operations/FieldOperations.js.map +0 -1
- package/dist/production/core/operations/ListOperations.cjs +0 -159
- package/dist/production/core/operations/ListOperations.cjs.map +0 -1
- package/dist/production/core/operations/ListOperations.js +0 -159
- package/dist/production/core/operations/ListOperations.js.map +0 -1
- package/dist/production/core/operations/OperationsHelpers.cjs.map +0 -1
- package/dist/production/core/operations/OperationsHelpers.js.map +0 -1
- package/dist/production/core/requestAliases/MutationAlias.cjs.map +0 -1
- package/dist/production/core/requestAliases/MutationAlias.js.map +0 -1
- package/dist/production/core/schema/Schema.cjs.map +0 -1
- package/dist/production/core/schema/Schema.js.map +0 -1
- package/dist/production/core/schema/SchemaLoader.cjs +0 -28
- package/dist/production/core/schema/SchemaLoader.cjs.map +0 -1
- package/dist/production/core/schema/SchemaLoader.js +0 -28
- package/dist/production/core/schema/SchemaLoader.js.map +0 -1
- package/dist/production/core/schema/SchemaPreprocessor.cjs.map +0 -1
- package/dist/production/core/schema/SchemaPreprocessor.js.map +0 -1
- package/dist/production/core/state/StateIterator.cjs.map +0 -1
- package/dist/production/core/state/StateIterator.js.map +0 -1
- package/dist/production/core/state/getEntityMarker.cjs.map +0 -1
- package/dist/production/core/state/getEntityMarker.js.map +0 -1
- package/dist/production/core/utils/createQueryBuilder.cjs.map +0 -1
- package/dist/production/core/utils/createQueryBuilder.js.map +0 -1
- package/dist/production/core/utils/getCombinedSignal.cjs.map +0 -1
- package/dist/production/core/utils/getCombinedSignal.js.map +0 -1
- package/dist/production/dao/Environment.cjs.map +0 -1
- package/dist/production/dao/Environment.js.map +0 -1
- package/dist/production/dao/TreeNodeEnvironmentFactory.cjs.map +0 -1
- package/dist/production/dao/TreeNodeEnvironmentFactory.js.map +0 -1
- package/dist/production/dao/VariableFieldValue.cjs.map +0 -1
- package/dist/production/dao/VariableFieldValue.js.map +0 -1
- package/dist/production/fieldHelpers/helpers/FieldHelper.cjs +0 -17
- package/dist/production/fieldHelpers/helpers/FieldHelper.cjs.map +0 -1
- package/dist/production/fieldHelpers/helpers/FieldHelper.js +0 -17
- package/dist/production/fieldHelpers/helpers/FieldHelper.js.map +0 -1
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +0 -1
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js.map +0 -1
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs.map +0 -1
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.js.map +0 -1
- package/dist/production/markers/EntityFieldMarkersContainer.cjs.map +0 -1
- package/dist/production/markers/EntityFieldMarkersContainer.js.map +0 -1
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs.map +0 -1
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.js.map +0 -1
- package/dist/production/markers/EntityListSubTreeMarker.cjs +0 -23
- package/dist/production/markers/EntityListSubTreeMarker.cjs.map +0 -1
- package/dist/production/markers/EntityListSubTreeMarker.js +0 -23
- package/dist/production/markers/EntityListSubTreeMarker.js.map +0 -1
- package/dist/production/markers/EntitySubTreeMarker.cjs +0 -23
- package/dist/production/markers/EntitySubTreeMarker.cjs.map +0 -1
- package/dist/production/markers/EntitySubTreeMarker.js +0 -23
- package/dist/production/markers/EntitySubTreeMarker.js.map +0 -1
- package/dist/production/markers/FieldMarker.cjs +0 -20
- package/dist/production/markers/FieldMarker.cjs.map +0 -1
- package/dist/production/markers/FieldMarker.js +0 -20
- package/dist/production/markers/FieldMarker.js.map +0 -1
- package/dist/production/markers/HasManyRelationMarker.cjs +0 -23
- package/dist/production/markers/HasManyRelationMarker.cjs.map +0 -1
- package/dist/production/markers/HasManyRelationMarker.js +0 -23
- package/dist/production/markers/HasManyRelationMarker.js.map +0 -1
- package/dist/production/markers/HasOneRelationMarker.cjs +0 -23
- package/dist/production/markers/HasOneRelationMarker.cjs.map +0 -1
- package/dist/production/markers/HasOneRelationMarker.js +0 -23
- package/dist/production/markers/HasOneRelationMarker.js.map +0 -1
- package/dist/production/markers/MarkerTreeRoot.cjs.map +0 -1
- package/dist/production/markers/MarkerTreeRoot.js.map +0 -1
- package/dist/production/markers/ParentEntityMarker.cjs.map +0 -1
- package/dist/production/markers/ParentEntityMarker.js.map +0 -1
- package/dist/production/markers/PlaceholderGenerator.cjs.map +0 -1
- package/dist/production/markers/PlaceholderGenerator.js.map +0 -1
- package/dist/production/markers/PlaceholderParametersGenerator.cjs.map +0 -1
- package/dist/production/markers/PlaceholderParametersGenerator.js.map +0 -1
- package/dist/production/queryLanguage/CacheStore.cjs +0 -47
- package/dist/production/queryLanguage/CacheStore.cjs.map +0 -1
- package/dist/production/queryLanguage/CacheStore.js +0 -47
- package/dist/production/queryLanguage/CacheStore.js.map +0 -1
- package/dist/production/queryLanguage/MarkerFactory.cjs.map +0 -1
- package/dist/production/queryLanguage/MarkerFactory.js.map +0 -1
- package/dist/production/queryLanguage/Parser.cjs +0 -725
- package/dist/production/queryLanguage/Parser.cjs.map +0 -1
- package/dist/production/queryLanguage/Parser.js +0 -725
- package/dist/production/queryLanguage/Parser.js.map +0 -1
- package/dist/production/queryLanguage/QueryLanguage.cjs +0 -517
- package/dist/production/queryLanguage/QueryLanguage.cjs.map +0 -1
- package/dist/production/queryLanguage/QueryLanguage.js +0 -517
- package/dist/production/queryLanguage/QueryLanguage.js.map +0 -1
- package/dist/production/queryLanguage/QueryLanguageError.cjs.map +0 -1
- package/dist/production/queryLanguage/QueryLanguageError.js.map +0 -1
- package/dist/production/queryLanguage/tokenList.cjs +0 -150
- package/dist/production/queryLanguage/tokenList.cjs.map +0 -1
- package/dist/production/queryLanguage/tokenList.js +0 -151
- package/dist/production/queryLanguage/tokenList.js.map +0 -1
- package/dist/production/structures/BijectiveIndexedMap.cjs +0 -120
- package/dist/production/structures/BijectiveIndexedMap.cjs.map +0 -1
- package/dist/production/structures/BijectiveIndexedMap.js +0 -120
- package/dist/production/structures/BijectiveIndexedMap.js.map +0 -1
- package/dist/production/structures/LRUCache.cjs +0 -35
- package/dist/production/structures/LRUCache.cjs.map +0 -1
- package/dist/production/structures/LRUCache.js +0 -35
- package/dist/production/structures/LRUCache.js.map +0 -1
- package/dist/production/structures/WeakIdCache.cjs +0 -33
- package/dist/production/structures/WeakIdCache.cjs.map +0 -1
- package/dist/production/structures/WeakIdCache.js +0 -33
- package/dist/production/structures/WeakIdCache.js.map +0 -1
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +0 -1
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.js.map +0 -1
- package/dist/production/treeParameters/EntityCreationParameters.cjs.map +0 -1
- package/dist/production/treeParameters/EntityCreationParameters.js.map +0 -1
- package/dist/production/treeParameters/EntityListPreferences.cjs.map +0 -1
- package/dist/production/treeParameters/EntityListPreferences.js.map +0 -1
- package/dist/production/treeParameters/EventListenersStore.cjs.map +0 -1
- package/dist/production/treeParameters/EventListenersStore.js.map +0 -1
- package/dist/production/treeParameters/LeafField.cjs.map +0 -1
- package/dist/production/treeParameters/LeafField.js.map +0 -1
- package/dist/production/treeParameters/QualifiedEntityParameters.cjs.map +0 -1
- package/dist/production/treeParameters/QualifiedEntityParameters.js.map +0 -1
- package/dist/production/treeParameters/Relation.cjs.map +0 -1
- package/dist/production/treeParameters/Relation.js.map +0 -1
- package/dist/production/utils/Hashing.cjs.map +0 -1
- package/dist/production/utils/Hashing.js.map +0 -1
- package/dist/production/utils/TreeNodeUtils.cjs.map +0 -1
- package/dist/production/utils/TreeNodeUtils.js.map +0 -1
- package/dist/production/utils/assert.cjs +0 -11
- package/dist/production/utils/assert.cjs.map +0 -1
- package/dist/production/utils/assert.js +0 -11
- package/dist/production/utils/assert.js.map +0 -1
- package/dist/production/utils/assertNever.cjs.map +0 -1
- package/dist/production/utils/assertNever.js.map +0 -1
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs.map +0 -1
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.js.map +0 -1
- package/dist/production/utils/isEmptyObject.cjs.map +0 -1
- package/dist/production/utils/isEmptyObject.js.map +0 -1
- package/dist/production/utils/ucfirst.cjs.map +0 -1
- package/dist/production/utils/ucfirst.js.map +0 -1
- /package/dist/development/{BindingError.cjs → src/BindingError.cjs} +0 -0
- /package/dist/development/{BindingError.js → src/BindingError.js} +0 -0
- /package/dist/development/{accessorTree → src/accessorTree}/NormalizedPersistedData.cjs +0 -0
- /package/dist/development/{accessorTree → src/accessorTree}/NormalizedPersistedData.js +0 -0
- /package/dist/development/{accessors → src/accessors}/EntityAccessor.cjs +0 -0
- /package/dist/development/{accessors → src/accessors}/EntityAccessor.js +0 -0
- /package/dist/development/{accessors → src/accessors}/EntityListAccessor.cjs +0 -0
- /package/dist/development/{accessors → src/accessors}/EntityListAccessor.js +0 -0
- /package/dist/development/{accessors → src/accessors}/ErrorAccessor.cjs +0 -0
- /package/dist/development/{accessors → src/accessors}/ErrorAccessor.js +0 -0
- /package/dist/development/{accessors → src/accessors}/FieldAccessor.cjs +0 -0
- /package/dist/development/{accessors → src/accessors}/FieldAccessor.js +0 -0
- /package/dist/development/{accessors → src/accessors}/TreeRootAccessor.cjs +0 -0
- /package/dist/development/{accessors → src/accessors}/TreeRootAccessor.js +0 -0
- /package/dist/development/{bindingTypes.cjs → src/bindingTypes.cjs} +0 -0
- /package/dist/development/{bindingTypes.js → src/bindingTypes.js} +0 -0
- /package/dist/development/{core → src/core}/MarkerComparator.cjs +0 -0
- /package/dist/development/{core → src/core}/MarkerComparator.js +0 -0
- /package/dist/development/{core → src/core}/QueryGenerator.cjs +0 -0
- /package/dist/development/{core → src/core}/QueryGenerator.js +0 -0
- /package/dist/development/{core → src/core}/RequestResponseNormalizer.cjs +0 -0
- /package/dist/development/{core → src/core}/RequestResponseNormalizer.js +0 -0
- /package/dist/development/{core → src/core}/TreeAugmenter.cjs +0 -0
- /package/dist/development/{core → src/core}/TreeAugmenter.js +0 -0
- /package/dist/development/{core → src/core}/TreeParameterMerger.cjs +0 -0
- /package/dist/development/{core → src/core}/TreeParameterMerger.js +0 -0
- /package/dist/development/{core → src/core}/VariableInputTransformer.cjs +0 -0
- /package/dist/development/{core → src/core}/VariableInputTransformer.js +0 -0
- /package/dist/development/{core → src/core}/exceptions/LocalizedBindingError.cjs +0 -0
- /package/dist/development/{core → src/core}/exceptions/LocalizedBindingError.js +0 -0
- /package/dist/development/{core → src/core}/exceptions/MarkerSugarer.cjs +0 -0
- /package/dist/development/{core → src/core}/exceptions/MarkerSugarer.js +0 -0
- /package/dist/development/{core → src/core}/exceptions/TreeParameterSugarer.cjs +0 -0
- /package/dist/development/{core → src/core}/exceptions/TreeParameterSugarer.js +0 -0
- /package/dist/development/{core → src/core}/factories/createBatchUpdatesOptions.cjs +0 -0
- /package/dist/development/{core → src/core}/factories/createBatchUpdatesOptions.js +0 -0
- /package/dist/development/{core → src/core}/operations/FieldOperations.cjs +0 -0
- /package/dist/development/{core → src/core}/operations/FieldOperations.js +0 -0
- /package/dist/development/{core → src/core}/operations/OperationsHelpers.cjs +0 -0
- /package/dist/development/{core → src/core}/operations/OperationsHelpers.js +0 -0
- /package/dist/development/{core → src/core}/requestAliases/MutationAlias.cjs +0 -0
- /package/dist/development/{core → src/core}/requestAliases/MutationAlias.js +0 -0
- /package/dist/development/{core → src/core}/schema/Schema.cjs +0 -0
- /package/dist/development/{core → src/core}/schema/Schema.js +0 -0
- /package/dist/development/{core → src/core}/schema/SchemaPreprocessor.cjs +0 -0
- /package/dist/development/{core → src/core}/schema/SchemaPreprocessor.js +0 -0
- /package/dist/development/{core → src/core}/state/StateIterator.cjs +0 -0
- /package/dist/development/{core → src/core}/state/StateIterator.js +0 -0
- /package/dist/development/{core → src/core}/state/getEntityMarker.cjs +0 -0
- /package/dist/development/{core → src/core}/state/getEntityMarker.js +0 -0
- /package/dist/development/{core → src/core}/utils/createQueryBuilder.cjs +0 -0
- /package/dist/development/{core → src/core}/utils/createQueryBuilder.js +0 -0
- /package/dist/development/{core → src/core}/utils/getCombinedSignal.cjs +0 -0
- /package/dist/development/{core → src/core}/utils/getCombinedSignal.js +0 -0
- /package/dist/development/{dao → src/dao}/Environment.cjs +0 -0
- /package/dist/development/{dao → src/dao}/Environment.js +0 -0
- /package/dist/development/{dao → src/dao}/TreeNodeEnvironmentFactory.cjs +0 -0
- /package/dist/development/{dao → src/dao}/TreeNodeEnvironmentFactory.js +0 -0
- /package/dist/development/{dao → src/dao}/VariableFieldValue.cjs +0 -0
- /package/dist/development/{dao → src/dao}/VariableFieldValue.js +0 -0
- /package/dist/development/{fieldHelpers → src/fieldHelpers}/helpers/TemporalFieldHelper.cjs +0 -0
- /package/dist/development/{fieldHelpers → src/fieldHelpers}/helpers/TemporalFieldHelper.js +0 -0
- /package/dist/development/{fieldHelpers → src/fieldHelpers}/helpers/UuidFieldHelper.cjs +0 -0
- /package/dist/development/{fieldHelpers → src/fieldHelpers}/helpers/UuidFieldHelper.js +0 -0
- /package/dist/development/{markers → src/markers}/EntityFieldMarkersContainer.cjs +0 -0
- /package/dist/development/{markers → src/markers}/EntityFieldMarkersContainer.js +0 -0
- /package/dist/development/{markers → src/markers}/EntityFieldsWithHoistablesMarker.cjs +0 -0
- /package/dist/development/{markers → src/markers}/EntityFieldsWithHoistablesMarker.js +0 -0
- /package/dist/development/{markers → src/markers}/MarkerTreeRoot.cjs +0 -0
- /package/dist/development/{markers → src/markers}/MarkerTreeRoot.js +0 -0
- /package/dist/development/{markers → src/markers}/ParentEntityMarker.cjs +0 -0
- /package/dist/development/{markers → src/markers}/ParentEntityMarker.js +0 -0
- /package/dist/development/{markers → src/markers}/PlaceholderGenerator.cjs +0 -0
- /package/dist/development/{markers → src/markers}/PlaceholderGenerator.js +0 -0
- /package/dist/development/{markers → src/markers}/PlaceholderParametersGenerator.cjs +0 -0
- /package/dist/development/{markers → src/markers}/PlaceholderParametersGenerator.js +0 -0
- /package/dist/development/{queryLanguage → src/queryLanguage}/MarkerFactory.cjs +0 -0
- /package/dist/development/{queryLanguage → src/queryLanguage}/MarkerFactory.js +0 -0
- /package/dist/development/{queryLanguage → src/queryLanguage}/QueryLanguageError.cjs +0 -0
- /package/dist/development/{queryLanguage → src/queryLanguage}/QueryLanguageError.js +0 -0
- /package/dist/development/{treeParameterHelpers → src/treeParameterHelpers}/wrapFilterInHasOnes.cjs +0 -0
- /package/dist/development/{treeParameterHelpers → src/treeParameterHelpers}/wrapFilterInHasOnes.js +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/EntityCreationParameters.cjs +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/EntityCreationParameters.js +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/EntityListPreferences.cjs +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/EntityListPreferences.js +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/EventListenersStore.cjs +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/EventListenersStore.js +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/LeafField.cjs +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/LeafField.js +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/QualifiedEntityParameters.cjs +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/QualifiedEntityParameters.js +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/Relation.cjs +0 -0
- /package/dist/development/{treeParameters → src/treeParameters}/Relation.js +0 -0
- /package/dist/development/{utils → src/utils}/Hashing.cjs +0 -0
- /package/dist/development/{utils → src/utils}/Hashing.js +0 -0
- /package/dist/development/{utils → src/utils}/TreeNodeUtils.cjs +0 -0
- /package/dist/development/{utils → src/utils}/TreeNodeUtils.js +0 -0
- /package/dist/development/{utils → src/utils}/assertNever.cjs +0 -0
- /package/dist/development/{utils → src/utils}/assertNever.js +0 -0
- /package/dist/development/{utils → src/utils}/generateEnumerabilityPreventingEntropy.cjs +0 -0
- /package/dist/development/{utils → src/utils}/generateEnumerabilityPreventingEntropy.js +0 -0
- /package/dist/development/{utils → src/utils}/isEmptyObject.cjs +0 -0
- /package/dist/development/{utils → src/utils}/isEmptyObject.js +0 -0
- /package/dist/development/{utils → src/utils}/ucfirst.cjs +0 -0
- /package/dist/development/{utils → src/utils}/ucfirst.js +0 -0
- /package/dist/production/{BindingError.cjs → src/BindingError.cjs} +0 -0
- /package/dist/production/{BindingError.js → src/BindingError.js} +0 -0
- /package/dist/production/{accessorTree → src/accessorTree}/NormalizedPersistedData.cjs +0 -0
- /package/dist/production/{accessorTree → src/accessorTree}/NormalizedPersistedData.js +0 -0
- /package/dist/production/{accessors → src/accessors}/EntityAccessor.cjs +0 -0
- /package/dist/production/{accessors → src/accessors}/EntityAccessor.js +0 -0
- /package/dist/production/{accessors → src/accessors}/EntityListAccessor.cjs +0 -0
- /package/dist/production/{accessors → src/accessors}/EntityListAccessor.js +0 -0
- /package/dist/production/{accessors → src/accessors}/ErrorAccessor.cjs +0 -0
- /package/dist/production/{accessors → src/accessors}/ErrorAccessor.js +0 -0
- /package/dist/production/{accessors → src/accessors}/FieldAccessor.cjs +0 -0
- /package/dist/production/{accessors → src/accessors}/FieldAccessor.js +0 -0
- /package/dist/production/{accessors → src/accessors}/TreeRootAccessor.cjs +0 -0
- /package/dist/production/{accessors → src/accessors}/TreeRootAccessor.js +0 -0
- /package/dist/production/{bindingTypes.cjs → src/bindingTypes.cjs} +0 -0
- /package/dist/production/{bindingTypes.js → src/bindingTypes.js} +0 -0
- /package/dist/production/{core → src/core}/MarkerComparator.cjs +0 -0
- /package/dist/production/{core → src/core}/MarkerComparator.js +0 -0
- /package/dist/production/{core → src/core}/QueryGenerator.cjs +0 -0
- /package/dist/production/{core → src/core}/QueryGenerator.js +0 -0
- /package/dist/production/{core → src/core}/RequestResponseNormalizer.cjs +0 -0
- /package/dist/production/{core → src/core}/RequestResponseNormalizer.js +0 -0
- /package/dist/production/{core → src/core}/TreeAugmenter.cjs +0 -0
- /package/dist/production/{core → src/core}/TreeAugmenter.js +0 -0
- /package/dist/production/{core → src/core}/TreeParameterMerger.cjs +0 -0
- /package/dist/production/{core → src/core}/TreeParameterMerger.js +0 -0
- /package/dist/production/{core → src/core}/VariableInputTransformer.cjs +0 -0
- /package/dist/production/{core → src/core}/VariableInputTransformer.js +0 -0
- /package/dist/production/{core → src/core}/exceptions/LocalizedBindingError.cjs +0 -0
- /package/dist/production/{core → src/core}/exceptions/LocalizedBindingError.js +0 -0
- /package/dist/production/{core → src/core}/exceptions/MarkerSugarer.cjs +0 -0
- /package/dist/production/{core → src/core}/exceptions/MarkerSugarer.js +0 -0
- /package/dist/production/{core → src/core}/exceptions/TreeParameterSugarer.cjs +0 -0
- /package/dist/production/{core → src/core}/exceptions/TreeParameterSugarer.js +0 -0
- /package/dist/production/{core → src/core}/factories/createBatchUpdatesOptions.cjs +0 -0
- /package/dist/production/{core → src/core}/factories/createBatchUpdatesOptions.js +0 -0
- /package/dist/production/{core → src/core}/operations/OperationsHelpers.cjs +0 -0
- /package/dist/production/{core → src/core}/operations/OperationsHelpers.js +0 -0
- /package/dist/production/{core → src/core}/requestAliases/MutationAlias.cjs +0 -0
- /package/dist/production/{core → src/core}/requestAliases/MutationAlias.js +0 -0
- /package/dist/production/{core → src/core}/schema/Schema.cjs +0 -0
- /package/dist/production/{core → src/core}/schema/Schema.js +0 -0
- /package/dist/production/{core → src/core}/schema/SchemaPreprocessor.cjs +0 -0
- /package/dist/production/{core → src/core}/schema/SchemaPreprocessor.js +0 -0
- /package/dist/production/{core → src/core}/state/StateIterator.cjs +0 -0
- /package/dist/production/{core → src/core}/state/StateIterator.js +0 -0
- /package/dist/production/{core → src/core}/state/getEntityMarker.cjs +0 -0
- /package/dist/production/{core → src/core}/state/getEntityMarker.js +0 -0
- /package/dist/production/{core → src/core}/utils/createQueryBuilder.cjs +0 -0
- /package/dist/production/{core → src/core}/utils/createQueryBuilder.js +0 -0
- /package/dist/production/{core → src/core}/utils/getCombinedSignal.cjs +0 -0
- /package/dist/production/{core → src/core}/utils/getCombinedSignal.js +0 -0
- /package/dist/production/{dao → src/dao}/Environment.cjs +0 -0
- /package/dist/production/{dao → src/dao}/Environment.js +0 -0
- /package/dist/production/{dao → src/dao}/TreeNodeEnvironmentFactory.cjs +0 -0
- /package/dist/production/{dao → src/dao}/TreeNodeEnvironmentFactory.js +0 -0
- /package/dist/production/{dao → src/dao}/VariableFieldValue.cjs +0 -0
- /package/dist/production/{dao → src/dao}/VariableFieldValue.js +0 -0
- /package/dist/production/{fieldHelpers → src/fieldHelpers}/helpers/TemporalFieldHelper.cjs +0 -0
- /package/dist/production/{fieldHelpers → src/fieldHelpers}/helpers/TemporalFieldHelper.js +0 -0
- /package/dist/production/{fieldHelpers → src/fieldHelpers}/helpers/UuidFieldHelper.cjs +0 -0
- /package/dist/production/{fieldHelpers → src/fieldHelpers}/helpers/UuidFieldHelper.js +0 -0
- /package/dist/production/{markers → src/markers}/EntityFieldMarkersContainer.cjs +0 -0
- /package/dist/production/{markers → src/markers}/EntityFieldMarkersContainer.js +0 -0
- /package/dist/production/{markers → src/markers}/EntityFieldsWithHoistablesMarker.cjs +0 -0
- /package/dist/production/{markers → src/markers}/EntityFieldsWithHoistablesMarker.js +0 -0
- /package/dist/production/{markers → src/markers}/MarkerTreeRoot.cjs +0 -0
- /package/dist/production/{markers → src/markers}/MarkerTreeRoot.js +0 -0
- /package/dist/production/{markers → src/markers}/ParentEntityMarker.cjs +0 -0
- /package/dist/production/{markers → src/markers}/ParentEntityMarker.js +0 -0
- /package/dist/production/{markers → src/markers}/PlaceholderGenerator.cjs +0 -0
- /package/dist/production/{markers → src/markers}/PlaceholderGenerator.js +0 -0
- /package/dist/production/{markers → src/markers}/PlaceholderParametersGenerator.cjs +0 -0
- /package/dist/production/{markers → src/markers}/PlaceholderParametersGenerator.js +0 -0
- /package/dist/production/{queryLanguage → src/queryLanguage}/MarkerFactory.cjs +0 -0
- /package/dist/production/{queryLanguage → src/queryLanguage}/MarkerFactory.js +0 -0
- /package/dist/production/{queryLanguage → src/queryLanguage}/QueryLanguageError.cjs +0 -0
- /package/dist/production/{queryLanguage → src/queryLanguage}/QueryLanguageError.js +0 -0
- /package/dist/production/{treeParameterHelpers → src/treeParameterHelpers}/wrapFilterInHasOnes.cjs +0 -0
- /package/dist/production/{treeParameterHelpers → src/treeParameterHelpers}/wrapFilterInHasOnes.js +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/EntityCreationParameters.cjs +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/EntityCreationParameters.js +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/EntityListPreferences.cjs +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/EntityListPreferences.js +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/EventListenersStore.cjs +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/EventListenersStore.js +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/LeafField.cjs +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/LeafField.js +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/QualifiedEntityParameters.cjs +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/QualifiedEntityParameters.js +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/Relation.cjs +0 -0
- /package/dist/production/{treeParameters → src/treeParameters}/Relation.js +0 -0
- /package/dist/production/{utils → src/utils}/Hashing.cjs +0 -0
- /package/dist/production/{utils → src/utils}/Hashing.js +0 -0
- /package/dist/production/{utils → src/utils}/TreeNodeUtils.cjs +0 -0
- /package/dist/production/{utils → src/utils}/TreeNodeUtils.js +0 -0
- /package/dist/production/{utils → src/utils}/assertNever.cjs +0 -0
- /package/dist/production/{utils → src/utils}/assertNever.js +0 -0
- /package/dist/production/{utils → src/utils}/generateEnumerabilityPreventingEntropy.cjs +0 -0
- /package/dist/production/{utils → src/utils}/generateEnumerabilityPreventingEntropy.js +0 -0
- /package/dist/production/{utils → src/utils}/isEmptyObject.cjs +0 -0
- /package/dist/production/{utils → src/utils}/isEmptyObject.js +0 -0
- /package/dist/production/{utils → src/utils}/ucfirst.cjs +0 -0
- /package/dist/production/{utils → src/utils}/ucfirst.js +0 -0
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import { BindingError } from "../BindingError.js";
|
|
8
|
-
import { RealmKeyGenerator } from "./RealmKeyGenerator.js";
|
|
9
|
-
import { TreeParameterMerger } from "./TreeParameterMerger.js";
|
|
10
|
-
import { FieldOperations } from "./operations/FieldOperations.js";
|
|
11
|
-
import { EntityOperations } from "./operations/EntityOperations.js";
|
|
12
|
-
import { ListOperations } from "./operations/ListOperations.js";
|
|
13
|
-
import { EntityAccessor } from "../accessors/EntityAccessor.js";
|
|
14
|
-
import { BijectiveIndexedMap } from "../structures/BijectiveIndexedMap.js";
|
|
15
|
-
import { EntityListAccessor } from "../accessors/EntityListAccessor.js";
|
|
16
|
-
import { EntityListSubTreeMarker } from "../markers/EntityListSubTreeMarker.js";
|
|
17
|
-
import { ServerId, UnpersistedEntityDummyId } from "../accessorTree/RuntimeId.js";
|
|
18
|
-
import { getEntityMarker } from "./state/getEntityMarker.js";
|
|
19
|
-
import { FieldMarker } from "../markers/FieldMarker.js";
|
|
20
|
-
import { HasManyRelationMarker } from "../markers/HasManyRelationMarker.js";
|
|
21
|
-
import { HasOneRelationMarker } from "../markers/HasOneRelationMarker.js";
|
|
22
|
-
import { assertNever } from "../utils/assertNever.js";
|
|
23
|
-
import { FieldAccessor } from "../accessors/FieldAccessor.js";
|
|
24
|
-
import { EventListenersStore } from "../treeParameters/EventListenersStore.js";
|
|
25
|
-
class StateInitializer {
|
|
26
|
-
constructor(accessorErrorManager, batchUpdatesOptions, eventManager, treeStore) {
|
|
27
|
-
__publicField(this, "fieldOperations");
|
|
28
|
-
__publicField(this, "entityOperations");
|
|
29
|
-
__publicField(this, "listOperations");
|
|
30
|
-
this.eventManager = eventManager;
|
|
31
|
-
this.treeStore = treeStore;
|
|
32
|
-
this.fieldOperations = new FieldOperations(accessorErrorManager, this.eventManager, this, this.treeStore);
|
|
33
|
-
this.entityOperations = new EntityOperations(accessorErrorManager, batchUpdatesOptions, this.eventManager, this, this.treeStore);
|
|
34
|
-
this.listOperations = new ListOperations(accessorErrorManager, batchUpdatesOptions, this.eventManager, this, this.treeStore);
|
|
35
|
-
}
|
|
36
|
-
initializeSubTree(tree) {
|
|
37
|
-
let subTreeState;
|
|
38
|
-
const persistedRootData = this.treeStore.subTreePersistedData.get(tree.placeholderName);
|
|
39
|
-
if (tree instanceof EntityListSubTreeMarker) {
|
|
40
|
-
const persistedEntityIds = persistedRootData instanceof Set ? persistedRootData : /* @__PURE__ */ new Set();
|
|
41
|
-
subTreeState = this.initializeEntityListState(
|
|
42
|
-
{ type: "subTree", marker: tree, parent: void 0 },
|
|
43
|
-
tree.entityName,
|
|
44
|
-
persistedEntityIds
|
|
45
|
-
);
|
|
46
|
-
} else {
|
|
47
|
-
subTreeState = this.materializeEntityRealm(
|
|
48
|
-
this.initializeEntityRealm(
|
|
49
|
-
persistedRootData instanceof ServerId ? persistedRootData : new UnpersistedEntityDummyId(),
|
|
50
|
-
tree.entityName,
|
|
51
|
-
{
|
|
52
|
-
type: "subTree",
|
|
53
|
-
marker: tree,
|
|
54
|
-
parent: void 0
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
return subTreeState;
|
|
60
|
-
}
|
|
61
|
-
initializeEntityRealm(id, entityName, blueprint, copyFrom) {
|
|
62
|
-
const entity = this.initializeEntityState(id, entityName);
|
|
63
|
-
const realmKey = RealmKeyGenerator.getRealmKey(id, blueprint);
|
|
64
|
-
const existing = this.treeStore.entityRealmStore.get(realmKey);
|
|
65
|
-
if (existing !== void 0) {
|
|
66
|
-
return existing;
|
|
67
|
-
}
|
|
68
|
-
if (!copyFrom || copyFrom.type !== "entityRealm") {
|
|
69
|
-
const stub = {
|
|
70
|
-
type: "entityRealmStub",
|
|
71
|
-
blueprint,
|
|
72
|
-
entity,
|
|
73
|
-
realmKey,
|
|
74
|
-
getAccessor: () => this.materializeEntityRealm(stub).getAccessor()
|
|
75
|
-
};
|
|
76
|
-
this.registerEntityRealm(stub);
|
|
77
|
-
return stub;
|
|
78
|
-
}
|
|
79
|
-
const realm = this.createEntityRealm(blueprint, realmKey, entity, copyFrom);
|
|
80
|
-
this.registerEntityRealm(realm);
|
|
81
|
-
const marker = getEntityMarker(realm);
|
|
82
|
-
const pathBack = this.treeStore.getPathBackToParent(realm);
|
|
83
|
-
for (const [placeholderName, field] of marker.fields.markers) {
|
|
84
|
-
if (field instanceof FieldMarker) {
|
|
85
|
-
const value = copyFrom.children.get(placeholderName);
|
|
86
|
-
if (!value || value.type !== "field") {
|
|
87
|
-
throw new BindingError();
|
|
88
|
-
}
|
|
89
|
-
this.initializeFromFieldMarker(realm, field, void 0, value);
|
|
90
|
-
} else if (field instanceof HasManyRelationMarker) {
|
|
91
|
-
const value = copyFrom.children.get(placeholderName);
|
|
92
|
-
if (!value || value.type !== "entityList") {
|
|
93
|
-
throw new BindingError();
|
|
94
|
-
}
|
|
95
|
-
this.initializeFromHasManyRelationMarker(realm, field, new Set(value.children.keys()));
|
|
96
|
-
} else if (field instanceof HasOneRelationMarker) {
|
|
97
|
-
let runtimeId;
|
|
98
|
-
let subCopyFrom = void 0;
|
|
99
|
-
if (pathBack?.fieldBackToParent === field.parameters.field) {
|
|
100
|
-
runtimeId = pathBack.parent.entity.id;
|
|
101
|
-
} else {
|
|
102
|
-
const value = copyFrom.children.get(placeholderName);
|
|
103
|
-
if (!value || value.type !== "entityRealm" && value.type !== "entityRealmStub") {
|
|
104
|
-
throw new BindingError();
|
|
105
|
-
}
|
|
106
|
-
runtimeId = !(value.entity.id instanceof UnpersistedEntityDummyId) ? value.entity.id : new UnpersistedEntityDummyId();
|
|
107
|
-
if (value.type === "entityRealm") {
|
|
108
|
-
subCopyFrom = value;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
this.initializeFromHasOneRelationMarker(realm, field, runtimeId, subCopyFrom);
|
|
112
|
-
} else {
|
|
113
|
-
assertNever();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
this.eventManager.registerNewlyInitialized(realm);
|
|
117
|
-
return realm;
|
|
118
|
-
}
|
|
119
|
-
createEntityRealm(blueprint, realmKey, entity, copyFrom) {
|
|
120
|
-
const entityRealm = {
|
|
121
|
-
type: "entityRealm",
|
|
122
|
-
blueprint,
|
|
123
|
-
realmKey,
|
|
124
|
-
entity,
|
|
125
|
-
accessor: void 0,
|
|
126
|
-
children: /* @__PURE__ */ new Map(),
|
|
127
|
-
childrenWithPendingUpdates: void 0,
|
|
128
|
-
errors: void 0,
|
|
129
|
-
eventListeners: this.initializeEntityEventListenerStore(blueprint),
|
|
130
|
-
fieldsWithPendingConnectionUpdates: void 0,
|
|
131
|
-
plannedHasOneDeletions: void 0,
|
|
132
|
-
unpersistedChangesCount: copyFrom?.unpersistedChangesCount ?? 0,
|
|
133
|
-
getAccessor: () => {
|
|
134
|
-
if (entityRealm.accessor === void 0) {
|
|
135
|
-
const entity2 = entityRealm.entity;
|
|
136
|
-
entityRealm.accessor = new EntityAccessor(
|
|
137
|
-
entityRealm,
|
|
138
|
-
this.entityOperations,
|
|
139
|
-
entity2.id,
|
|
140
|
-
entityRealm.realmKey,
|
|
141
|
-
entity2.entityName,
|
|
142
|
-
// We're technically exposing more info in runtime than we'd like but that way we don't have to allocate and
|
|
143
|
-
// keep in sync two copies of the same data. TS hides the extra info anyway.
|
|
144
|
-
entityRealm.children,
|
|
145
|
-
this.treeStore.persistedEntityData.get(entity2.id.uniqueValue),
|
|
146
|
-
entityRealm.unpersistedChangesCount !== 0,
|
|
147
|
-
entityRealm.errors,
|
|
148
|
-
getEntityMarker(entityRealm).environment,
|
|
149
|
-
entityRealm.getAccessor
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
return entityRealm.accessor;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
return entityRealm;
|
|
156
|
-
}
|
|
157
|
-
materializeEntityRealm(state) {
|
|
158
|
-
if (state.type === "entityRealm") {
|
|
159
|
-
return state;
|
|
160
|
-
}
|
|
161
|
-
const { realmKey, entity, blueprint } = state;
|
|
162
|
-
const existing = this.treeStore.entityRealmStore.get(realmKey);
|
|
163
|
-
if (existing !== void 0 && existing.type === "entityRealm") {
|
|
164
|
-
return existing;
|
|
165
|
-
}
|
|
166
|
-
const entityRealm = this.createEntityRealm(blueprint, realmKey, entity);
|
|
167
|
-
this.registerEntityRealm(entityRealm);
|
|
168
|
-
const persistedData = this.treeStore.persistedEntityData.get(entity.id.uniqueValue);
|
|
169
|
-
const marker = getEntityMarker(state);
|
|
170
|
-
const pathBack = this.treeStore.getPathBackToParent(entityRealm);
|
|
171
|
-
for (const [placeholderName, field] of marker.fields.markers) {
|
|
172
|
-
const fieldDatum = persistedData?.get(placeholderName);
|
|
173
|
-
if (field instanceof FieldMarker) {
|
|
174
|
-
this.initializeFromFieldMarker(entityRealm, field, fieldDatum);
|
|
175
|
-
} else if (field instanceof HasManyRelationMarker) {
|
|
176
|
-
this.initializeFromHasManyRelationMarker(entityRealm, field, fieldDatum instanceof Set ? fieldDatum : /* @__PURE__ */ new Set());
|
|
177
|
-
} else if (field instanceof HasOneRelationMarker) {
|
|
178
|
-
let runtimeId;
|
|
179
|
-
if (pathBack?.fieldBackToParent === field.parameters.field) {
|
|
180
|
-
runtimeId = pathBack.parent.entity.id;
|
|
181
|
-
} else {
|
|
182
|
-
runtimeId = fieldDatum instanceof ServerId ? fieldDatum : new UnpersistedEntityDummyId();
|
|
183
|
-
}
|
|
184
|
-
this.initializeFromHasOneRelationMarker(entityRealm, field, runtimeId);
|
|
185
|
-
} else {
|
|
186
|
-
assertNever();
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
this.eventManager.registerNewlyInitialized(entityRealm);
|
|
190
|
-
return entityRealm;
|
|
191
|
-
}
|
|
192
|
-
registerEntityRealm(entityRealm) {
|
|
193
|
-
const { realmKey, blueprint, entity } = entityRealm;
|
|
194
|
-
this.treeStore.entityRealmStore.set(entityRealm.realmKey, entityRealm);
|
|
195
|
-
if (blueprint.type === "listEntity") {
|
|
196
|
-
blueprint.parent.children.set(entity.id.value, entityRealm);
|
|
197
|
-
} else if (blueprint.type === "hasOne") {
|
|
198
|
-
blueprint.parent.children.set(blueprint.marker.placeholderName, entityRealm);
|
|
199
|
-
}
|
|
200
|
-
entity.realms.set(realmKey, entityRealm);
|
|
201
|
-
}
|
|
202
|
-
initializeEntityState(id, entityName) {
|
|
203
|
-
const entityId = id.uniqueValue;
|
|
204
|
-
const existing = this.treeStore.entityStore.get(entityId);
|
|
205
|
-
if (existing !== void 0) {
|
|
206
|
-
return existing;
|
|
207
|
-
}
|
|
208
|
-
const entityState = {
|
|
209
|
-
entityName,
|
|
210
|
-
hasIdSetInStone: id instanceof ServerId,
|
|
211
|
-
id,
|
|
212
|
-
isScheduledForDeletion: false,
|
|
213
|
-
maidenId: id instanceof UnpersistedEntityDummyId ? id : void 0,
|
|
214
|
-
realms: /* @__PURE__ */ new Map()
|
|
215
|
-
};
|
|
216
|
-
this.treeStore.entityStore.set(entityId, entityState);
|
|
217
|
-
return entityState;
|
|
218
|
-
}
|
|
219
|
-
initializeEntityListState(blueprint, entityName, initialEntityIds) {
|
|
220
|
-
const entityListState = {
|
|
221
|
-
type: "entityList",
|
|
222
|
-
accessor: void 0,
|
|
223
|
-
blueprint,
|
|
224
|
-
children: new BijectiveIndexedMap((realm) => realm.entity.id.value),
|
|
225
|
-
childrenWithPendingUpdates: void 0,
|
|
226
|
-
entityName,
|
|
227
|
-
eventListeners: this.initializeEntityListEventListenerStore(blueprint),
|
|
228
|
-
childEventListeners: this.initializeEntityListChildEventListenerStore(blueprint),
|
|
229
|
-
errors: void 0,
|
|
230
|
-
plannedRemovals: void 0,
|
|
231
|
-
unpersistedChangesCount: 0,
|
|
232
|
-
// TODO force creation?
|
|
233
|
-
getAccessor: () => {
|
|
234
|
-
if (entityListState.accessor === void 0) {
|
|
235
|
-
const persistedEntityIds = this.treeStore.getEntityListPersistedIds(entityListState);
|
|
236
|
-
entityListState.accessor = new EntityListAccessor(
|
|
237
|
-
entityListState,
|
|
238
|
-
this.listOperations,
|
|
239
|
-
entityListState.entityName,
|
|
240
|
-
entityListState.children,
|
|
241
|
-
persistedEntityIds,
|
|
242
|
-
entityListState.unpersistedChangesCount !== 0,
|
|
243
|
-
entityListState.errors,
|
|
244
|
-
entityListState.blueprint.marker.environment,
|
|
245
|
-
entityListState.getAccessor
|
|
246
|
-
);
|
|
247
|
-
}
|
|
248
|
-
return entityListState.accessor;
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
const initialData = initialEntityIds.size === 0 ? Array.from({ length: blueprint.marker.parameters.initialEntityCount }) : initialEntityIds;
|
|
252
|
-
for (const entityId of initialData) {
|
|
253
|
-
this.initializeEntityRealm(
|
|
254
|
-
entityId ? new ServerId(entityId, entityName) : new UnpersistedEntityDummyId(),
|
|
255
|
-
entityListState.entityName,
|
|
256
|
-
{
|
|
257
|
-
type: "listEntity",
|
|
258
|
-
parent: entityListState
|
|
259
|
-
}
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
this.eventManager.registerNewlyInitialized(entityListState);
|
|
263
|
-
return entityListState;
|
|
264
|
-
}
|
|
265
|
-
initializeFieldState(parent, placeholderName, fieldMarker, persistedValue, copyFromState) {
|
|
266
|
-
const resolvedFieldValue = copyFromState ? copyFromState.value : persistedValue ?? fieldMarker.defaultValue ?? null;
|
|
267
|
-
const fieldState = {
|
|
268
|
-
type: "field",
|
|
269
|
-
accessor: void 0,
|
|
270
|
-
fieldMarker,
|
|
271
|
-
placeholderName,
|
|
272
|
-
persistedValue,
|
|
273
|
-
parent,
|
|
274
|
-
value: resolvedFieldValue,
|
|
275
|
-
eventListeners: this.initializeFieldEventListenerStore(fieldMarker),
|
|
276
|
-
errors: void 0,
|
|
277
|
-
touchLog: void 0,
|
|
278
|
-
hasUnpersistedChanges: copyFromState?.hasUnpersistedChanges ?? false,
|
|
279
|
-
getAccessor: () => {
|
|
280
|
-
if (fieldState.accessor === void 0) {
|
|
281
|
-
const fieldSchema = this.treeStore.schema.getEntityColumn(parent.entity.entityName, fieldMarker.fieldName);
|
|
282
|
-
fieldState.accessor = new FieldAccessor(
|
|
283
|
-
fieldState,
|
|
284
|
-
this.fieldOperations,
|
|
285
|
-
fieldState.placeholderName,
|
|
286
|
-
fieldState.value,
|
|
287
|
-
fieldState.persistedValue === void 0 ? null : fieldState.persistedValue,
|
|
288
|
-
fieldState.fieldMarker.defaultValue,
|
|
289
|
-
fieldState.errors,
|
|
290
|
-
fieldState.hasUnpersistedChanges,
|
|
291
|
-
fieldState.touchLog,
|
|
292
|
-
fieldState.getAccessor,
|
|
293
|
-
fieldSchema
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
return fieldState.accessor;
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
this.eventManager.registerNewlyInitialized(fieldState);
|
|
300
|
-
return fieldState;
|
|
301
|
-
}
|
|
302
|
-
initializeFromFieldMarker(parent, field, persistedValue, copyFromState) {
|
|
303
|
-
if (persistedValue instanceof Set) {
|
|
304
|
-
throw new BindingError(
|
|
305
|
-
`Received a collection of referenced entities where a single '${field.fieldName}' field was expected. Perhaps you wanted to use a <Repeater />?`
|
|
306
|
-
);
|
|
307
|
-
}
|
|
308
|
-
if (persistedValue instanceof ServerId) {
|
|
309
|
-
throw new BindingError(
|
|
310
|
-
`Received a referenced entity where a single '${field.fieldName}' field was expected. Perhaps you wanted to use <HasOne />?`
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
parent.children.set(
|
|
314
|
-
field.placeholderName,
|
|
315
|
-
this.initializeFieldState(parent, field.placeholderName, field, persistedValue, copyFromState)
|
|
316
|
-
);
|
|
317
|
-
}
|
|
318
|
-
initializeFromHasOneRelationMarker(parent, field, entityId, copyFrom) {
|
|
319
|
-
parent.children.set(
|
|
320
|
-
field.placeholderName,
|
|
321
|
-
this.initializeEntityRealm(entityId, this.getRelationTargetEntityName(parent, field), {
|
|
322
|
-
type: "hasOne",
|
|
323
|
-
parent,
|
|
324
|
-
marker: field
|
|
325
|
-
}, copyFrom)
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
initializeFromHasManyRelationMarker(parent, field, persistedEntityIds) {
|
|
329
|
-
parent.children.set(
|
|
330
|
-
field.placeholderName,
|
|
331
|
-
this.initializeEntityListState(
|
|
332
|
-
{ type: "hasMany", marker: field, parent },
|
|
333
|
-
this.getRelationTargetEntityName(parent, field),
|
|
334
|
-
persistedEntityIds
|
|
335
|
-
)
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
getRelationTargetEntityName(entityRealm, field) {
|
|
339
|
-
const targetField = this.treeStore.schema.getEntityRelation(entityRealm.entity.entityName, field.parameters.field);
|
|
340
|
-
return targetField.targetEntity;
|
|
341
|
-
}
|
|
342
|
-
runImmediateUserInitialization(realm, initialize) {
|
|
343
|
-
if (initialize === void 0) {
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
const entityRealm = this.materializeEntityRealm(realm);
|
|
347
|
-
realm.getAccessor().batchUpdates(initialize);
|
|
348
|
-
const initializeListeners = this.eventManager.getEventListeners(entityRealm, { type: "initialize" });
|
|
349
|
-
if (initializeListeners === void 0 || initializeListeners.size === 0) {
|
|
350
|
-
realm.entity.hasIdSetInStone = true;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
initializeEntityEventListenerStore(blueprint) {
|
|
354
|
-
if (blueprint.type === "listEntity") {
|
|
355
|
-
const blueprintListeners2 = blueprint.parent.blueprint.marker.parameters.childEventListeners;
|
|
356
|
-
const childInitialize = blueprintListeners2?.get({ type: "initialize" });
|
|
357
|
-
const store = new EventListenersStore(() => blueprint.parent.childEventListeners);
|
|
358
|
-
if (childInitialize !== void 0) {
|
|
359
|
-
store.set({ type: "initialize" }, childInitialize);
|
|
360
|
-
}
|
|
361
|
-
return store;
|
|
362
|
-
}
|
|
363
|
-
const blueprintListeners = blueprint.marker.parameters.eventListeners;
|
|
364
|
-
if (blueprintListeners === void 0) {
|
|
365
|
-
return void 0;
|
|
366
|
-
}
|
|
367
|
-
return TreeParameterMerger.cloneSingleEntityEventListeners(blueprintListeners);
|
|
368
|
-
}
|
|
369
|
-
initializeEntityListEventListenerStore(blueprint) {
|
|
370
|
-
const blueprintListeners = blueprint.marker.parameters.eventListeners;
|
|
371
|
-
if (blueprintListeners === void 0) {
|
|
372
|
-
return void 0;
|
|
373
|
-
}
|
|
374
|
-
return TreeParameterMerger.cloneEntityListEventListeners(blueprintListeners);
|
|
375
|
-
}
|
|
376
|
-
initializeEntityListChildEventListenerStore(blueprint) {
|
|
377
|
-
const blueprintListeners = blueprint.marker.parameters.childEventListeners;
|
|
378
|
-
if (blueprintListeners === void 0) {
|
|
379
|
-
return void 0;
|
|
380
|
-
}
|
|
381
|
-
return TreeParameterMerger.cloneSingleEntityEventListeners(blueprintListeners);
|
|
382
|
-
}
|
|
383
|
-
initializeFieldEventListenerStore(marker) {
|
|
384
|
-
return void 0;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
export {
|
|
388
|
-
StateInitializer
|
|
389
|
-
};
|
|
390
|
-
//# sourceMappingURL=StateInitializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StateInitializer.js","sources":["../../../src/core/StateInitializer.ts"],"sourcesContent":["import { BatchUpdatesOptions, EntityAccessor, EntityListAccessor, FieldAccessor } from '../accessors'\nimport { EntityFieldPersistedData, RuntimeId, ServerId, UnpersistedEntityDummyId } from '../accessorTree'\nimport { BindingError } from '../BindingError'\nimport {\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '../markers'\nimport { BijectiveIndexedMap } from '../structures'\nimport type {\n\tEntityEventListenerStore,\n\tEntityId,\n\tEntityListEventListenerStore,\n\tEntityName,\n\tFieldEventListenerStore,\n\tFieldName,\n\tFieldValue,\n} from '../treeParameters'\nimport { EventListenersStore } from '../treeParameters'\nimport { assertNever } from '../utils'\nimport type { AccessorErrorManager } from './AccessorErrorManager'\nimport type { EventManager } from './EventManager'\nimport { EntityOperations, FieldOperations, ListOperations } from './operations'\nimport { RealmKeyGenerator } from './RealmKeyGenerator'\nimport {\n\tEntityListBlueprint,\n\tEntityListState,\n\tEntityRealmBlueprint,\n\tEntityRealmState,\n\tEntityRealmStateStub,\n\tEntityState,\n\tFieldState,\n\tgetEntityMarker,\n\tRootStateNode,\n} from './state'\nimport { TreeParameterMerger } from './TreeParameterMerger'\nimport type { TreeStore } from './TreeStore'\n\nexport class StateInitializer {\n\tprivate readonly fieldOperations: FieldOperations\n\tprivate readonly entityOperations: EntityOperations\n\tprivate readonly listOperations: ListOperations\n\n\tpublic constructor(\n\t\taccessorErrorManager: AccessorErrorManager,\n\t\tbatchUpdatesOptions: BatchUpdatesOptions,\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly treeStore: TreeStore,\n\t) {\n\t\tthis.fieldOperations = new FieldOperations(accessorErrorManager, this.eventManager, this, this.treeStore)\n\t\tthis.entityOperations = new EntityOperations(accessorErrorManager, batchUpdatesOptions, this.eventManager, this, this.treeStore)\n\t\tthis.listOperations = new ListOperations(accessorErrorManager, batchUpdatesOptions, this.eventManager, this, this.treeStore)\n\t}\n\n\tpublic initializeSubTree(tree: EntitySubTreeMarker | EntityListSubTreeMarker): RootStateNode {\n\t\tlet subTreeState: RootStateNode\n\t\tconst persistedRootData = this.treeStore.subTreePersistedData.get(tree.placeholderName)\n\n\t\tif (tree instanceof EntityListSubTreeMarker) {\n\t\t\tconst persistedEntityIds: Set<EntityId> = persistedRootData instanceof Set ? persistedRootData : new Set()\n\t\t\tsubTreeState = this.initializeEntityListState(\n\t\t\t\t{ type: 'subTree', marker: tree, parent: undefined },\n\t\t\t\ttree.entityName,\n\t\t\t\tpersistedEntityIds,\n\t\t\t)\n\t\t} else {\n\t\t\tsubTreeState = this.materializeEntityRealm(\n\t\t\t\tthis.initializeEntityRealm(\n\t\t\t\t\tpersistedRootData instanceof ServerId ? persistedRootData : new UnpersistedEntityDummyId(),\n\t\t\t\t\ttree.entityName,\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'subTree',\n\t\t\t\t\t\tmarker: tree,\n\t\t\t\t\t\tparent: undefined,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\n\t\treturn subTreeState\n\t}\n\n\tpublic initializeEntityRealm(\n\t\tid: RuntimeId,\n\t\tentityName: EntityName,\n\t\tblueprint: EntityRealmBlueprint,\n\t\tcopyFrom?: EntityRealmState | EntityRealmStateStub,\n\t): EntityRealmState | EntityRealmStateStub {\n\t\t// This is counter-intuitive a bit. The method can also return an EntityRealmState, not just a stub.\n\t\t// The reason is so that each call-site can just default to trying to initialize a stub without having to keep\n\t\t// in mind that the realm might have already been initialized.\n\n\t\tconst entity = this.initializeEntityState(id, entityName)\n\t\tconst realmKey = RealmKeyGenerator.getRealmKey(id, blueprint)\n\n\t\tconst existing = this.treeStore.entityRealmStore.get(realmKey)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\n\t\tif (!copyFrom || copyFrom.type !== 'entityRealm') {\n\t\t\tconst stub: EntityRealmStateStub = {\n\t\t\t\ttype: 'entityRealmStub',\n\n\t\t\t\tblueprint,\n\t\t\t\tentity,\n\t\t\t\trealmKey,\n\t\t\t\tgetAccessor: () => this.materializeEntityRealm(stub).getAccessor(),\n\t\t\t}\n\t\t\tthis.registerEntityRealm(stub)\n\n\t\t\treturn stub\n\t\t}\n\t\tconst realm = this.createEntityRealm(blueprint, realmKey, entity, copyFrom)\n\n\t\tthis.registerEntityRealm(realm)\n\n\t\tconst marker = getEntityMarker(realm)\n\t\tconst pathBack = this.treeStore.getPathBackToParent(realm)\n\n\t\tfor (const [placeholderName, field] of marker.fields.markers) {\n\t\t\tif (field instanceof FieldMarker) {\n\t\t\t\tconst value = copyFrom.children.get(placeholderName)\n\t\t\t\tif (!value || value.type !== 'field') {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tthis.initializeFromFieldMarker(realm, field, undefined, value)\n\t\t\t} else if (field instanceof HasManyRelationMarker) {\n\t\t\t\tconst value = copyFrom.children.get(placeholderName)\n\t\t\t\tif (!value || value.type !== 'entityList') {\n\t\t\t\t\tthrow new BindingError()\n\t\t\t\t}\n\t\t\t\tthis.initializeFromHasManyRelationMarker(realm, field, new Set(value.children.keys()))\n\t\t\t} else if (field instanceof HasOneRelationMarker) {\n\t\t\t\tlet runtimeId: RuntimeId\n\t\t\t\tlet subCopyFrom: EntityRealmState | undefined = undefined\n\t\t\t\tif (pathBack?.fieldBackToParent === field.parameters.field) {\n\t\t\t\t\truntimeId = pathBack.parent.entity.id\n\t\t\t\t} else {\n\t\t\t\t\tconst value = copyFrom.children.get(placeholderName)\n\t\t\t\t\tif (!value || (value.type !== 'entityRealm' && value.type !== 'entityRealmStub')) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\truntimeId = !(value.entity.id instanceof UnpersistedEntityDummyId) ? value.entity.id : new UnpersistedEntityDummyId()\n\t\t\t\t\tif (value.type === 'entityRealm') {\n\t\t\t\t\t\tsubCopyFrom = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.initializeFromHasOneRelationMarker(realm, field, runtimeId, subCopyFrom)\n\t\t\t} else {\n\t\t\t\tassertNever(field)\n\t\t\t}\n\t\t}\n\n\t\tthis.eventManager.registerNewlyInitialized(realm)\n\t\treturn realm\n\t}\n\n\tprivate createEntityRealm(\n\t\tblueprint: EntityRealmBlueprint,\n\t\trealmKey: string,\n\t\tentity: EntityState,\n\t\tcopyFrom?: EntityRealmState,\n\t): EntityRealmState {\n\t\tconst entityRealm: EntityRealmState = {\n\t\t\ttype: 'entityRealm',\n\n\t\t\tblueprint,\n\t\t\trealmKey,\n\t\t\tentity,\n\n\t\t\taccessor: undefined,\n\t\t\tchildren: new Map(),\n\t\t\tchildrenWithPendingUpdates: undefined,\n\t\t\terrors: undefined,\n\t\t\teventListeners: this.initializeEntityEventListenerStore(blueprint),\n\t\t\tfieldsWithPendingConnectionUpdates: undefined,\n\t\t\tplannedHasOneDeletions: undefined,\n\t\t\tunpersistedChangesCount: copyFrom?.unpersistedChangesCount ?? 0,\n\t\t\tgetAccessor: () => {\n\t\t\t\tif (entityRealm.accessor === undefined) {\n\t\t\t\t\tconst entity = entityRealm.entity\n\t\t\t\t\tentityRealm.accessor = new EntityAccessor(\n\t\t\t\t\t\tentityRealm,\n\t\t\t\t\t\tthis.entityOperations,\n\t\t\t\t\t\tentity.id,\n\t\t\t\t\t\tentityRealm.realmKey,\n\t\t\t\t\t\tentity.entityName,\n\n\t\t\t\t\t\t// We're technically exposing more info in runtime than we'd like but that way we don't have to allocate and\n\t\t\t\t\t\t// keep in sync two copies of the same data. TS hides the extra info anyway.\n\t\t\t\t\t\tentityRealm.children,\n\t\t\t\t\t\tthis.treeStore.persistedEntityData.get(entity.id.uniqueValue),\n\t\t\t\t\t\tentityRealm.unpersistedChangesCount !== 0,\n\t\t\t\t\t\tentityRealm.errors,\n\t\t\t\t\t\tgetEntityMarker(entityRealm).environment,\n\t\t\t\t\t\tentityRealm.getAccessor,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\treturn entityRealm.accessor\n\t\t\t},\n\t\t}\n\t\treturn entityRealm\n\t}\n\n\tprivate materializeEntityRealm(state: EntityRealmState | EntityRealmStateStub): EntityRealmState {\n\t\tif (state.type === 'entityRealm') {\n\t\t\treturn state\n\t\t}\n\t\tconst { realmKey, entity, blueprint } = state\n\n\t\tconst existing = this.treeStore.entityRealmStore.get(realmKey)\n\t\tif (existing !== undefined && existing.type === 'entityRealm') {\n\t\t\treturn existing\n\t\t}\n\n\t\tconst entityRealm = this.createEntityRealm(blueprint, realmKey, entity)\n\n\t\tthis.registerEntityRealm(entityRealm)\n\n\t\t// if (blueprint.creationParameters.forceCreation && !entity.id.existsOnServer) {\n\t\t// \tentityRealm.unpersistedChangesCount += 1\n\t\t// }\n\n\t\tconst persistedData = this.treeStore.persistedEntityData.get(entity.id.uniqueValue)\n\n\t\tconst marker = getEntityMarker(state)\n\t\tconst pathBack = this.treeStore.getPathBackToParent(entityRealm)\n\n\t\tfor (const [placeholderName, field] of marker.fields.markers) {\n\t\t\tconst fieldDatum = persistedData?.get(placeholderName)\n\n\t\t\tif (field instanceof FieldMarker) {\n\t\t\t\tthis.initializeFromFieldMarker(entityRealm, field, fieldDatum)\n\t\t\t} else if (field instanceof HasManyRelationMarker) {\n\t\t\t\t// if (pathBack?.fieldBackToParent === field.parameters.field) {\n\t\t\t\t// \t// TODO this is probably wrong?\n\t\t\t\t// \tconst ids = pathBack.parent.children.get(field.placeholderName)\n\t\t\t\t// \tconst newData = this.treeStore.persistedEntityData.get(pathBack.parent.entity.id.value)\n\t\t\t\t// \tconsole.log('many?', pathBack, field, entityRealm, fieldDatum, ids)\n\t\t\t\t// }\n\t\t\t\tthis.initializeFromHasManyRelationMarker(entityRealm, field, fieldDatum instanceof Set ? fieldDatum : new Set())\n\t\t\t} else if (field instanceof HasOneRelationMarker) {\n\t\t\t\tlet runtimeId: RuntimeId\n\t\t\t\tif (pathBack?.fieldBackToParent === field.parameters.field) {\n\t\t\t\t\truntimeId = pathBack.parent.entity.id\n\t\t\t\t} else {\n\t\t\t\t\truntimeId = fieldDatum instanceof ServerId ? fieldDatum : new UnpersistedEntityDummyId()\n\t\t\t\t}\n\t\t\t\tthis.initializeFromHasOneRelationMarker(entityRealm, field, runtimeId)\n\t\t\t} else {\n\t\t\t\tassertNever(field)\n\t\t\t}\n\t\t}\n\n\t\tthis.eventManager.registerNewlyInitialized(entityRealm)\n\n\t\treturn entityRealm\n\t}\n\n\tprivate registerEntityRealm(entityRealm: EntityRealmState | EntityRealmStateStub) {\n\t\tconst { realmKey, blueprint, entity } = entityRealm\n\n\t\tthis.treeStore.entityRealmStore.set(entityRealm.realmKey, entityRealm)\n\n\t\tif (blueprint.type === 'listEntity') {\n\t\t\tblueprint.parent.children.set(entity.id.value, entityRealm)\n\t\t} else if (blueprint.type === 'hasOne') {\n\t\t\tblueprint.parent.children.set(blueprint.marker.placeholderName, entityRealm)\n\t\t}\n\t\tentity.realms.set(realmKey, entityRealm)\n\t}\n\n\tpublic initializeEntityState(id: RuntimeId, entityName: EntityName): EntityState {\n\t\tconst entityId = id.uniqueValue\n\n\t\tconst existing = this.treeStore.entityStore.get(entityId)\n\t\tif (existing !== undefined) {\n\t\t\treturn existing\n\t\t}\n\n\t\tconst entityState: EntityState = {\n\t\t\tentityName,\n\t\t\thasIdSetInStone: id instanceof ServerId,\n\t\t\tid,\n\t\t\tisScheduledForDeletion: false,\n\t\t\tmaidenId: id instanceof UnpersistedEntityDummyId ? id : undefined,\n\t\t\trealms: new Map(),\n\t\t}\n\t\tthis.treeStore.entityStore.set(entityId, entityState)\n\n\t\treturn entityState\n\t}\n\n\tprivate initializeEntityListState(\n\t\tblueprint: EntityListBlueprint,\n\t\tentityName: EntityName,\n\t\tinitialEntityIds: Set<EntityId>,\n\t): EntityListState {\n\t\tconst entityListState: EntityListState = {\n\t\t\ttype: 'entityList',\n\t\t\taccessor: undefined,\n\t\t\tblueprint,\n\t\t\tchildren: new BijectiveIndexedMap(realm => realm.entity.id.value),\n\t\t\tchildrenWithPendingUpdates: undefined,\n\t\t\tentityName,\n\t\t\teventListeners: this.initializeEntityListEventListenerStore(blueprint),\n\t\t\tchildEventListeners: this.initializeEntityListChildEventListenerStore(blueprint),\n\t\t\terrors: undefined,\n\t\t\tplannedRemovals: undefined,\n\t\t\tunpersistedChangesCount: 0, // TODO force creation?\n\t\t\tgetAccessor: () => {\n\t\t\t\tif (entityListState.accessor === undefined) {\n\t\t\t\t\tconst persistedEntityIds = this.treeStore.getEntityListPersistedIds(entityListState)\n\t\t\t\t\tentityListState.accessor = new EntityListAccessor(\n\t\t\t\t\t\tentityListState,\n\t\t\t\t\t\tthis.listOperations,\n\t\t\t\t\t\tentityListState.entityName,\n\t\t\t\t\t\tentityListState.children,\n\t\t\t\t\t\tpersistedEntityIds,\n\t\t\t\t\t\tentityListState.unpersistedChangesCount !== 0,\n\t\t\t\t\t\tentityListState.errors,\n\t\t\t\t\t\tentityListState.blueprint.marker.environment,\n\t\t\t\t\t\tentityListState.getAccessor,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\treturn entityListState.accessor\n\t\t\t},\n\t\t}\n\n\t\tconst initialData: Iterable<EntityId | undefined> =\n\t\t\tinitialEntityIds.size === 0\n\t\t\t\t? Array.from({ length: blueprint.marker.parameters.initialEntityCount })\n\t\t\t\t: initialEntityIds\n\t\tfor (const entityId of initialData) {\n\t\t\tthis.initializeEntityRealm(\n\t\t\t\tentityId ? new ServerId(entityId, entityName) : new UnpersistedEntityDummyId(),\n\t\t\t\tentityListState.entityName,\n\t\t\t\t{\n\t\t\t\t\ttype: 'listEntity',\n\t\t\t\t\tparent: entityListState,\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\n\t\tthis.eventManager.registerNewlyInitialized(entityListState)\n\n\t\treturn entityListState\n\t}\n\n\tprivate initializeFieldState(\n\t\tparent: EntityRealmState,\n\t\tplaceholderName: FieldName,\n\t\tfieldMarker: FieldMarker,\n\t\tpersistedValue: FieldValue | undefined,\n\t\tcopyFromState: FieldState | undefined,\n\t): FieldState {\n\t\tconst resolvedFieldValue = copyFromState ? copyFromState.value : (persistedValue ?? fieldMarker.defaultValue ?? null)\n\n\t\tconst fieldState: FieldState = {\n\t\t\ttype: 'field',\n\t\t\taccessor: undefined,\n\t\t\tfieldMarker,\n\t\t\tplaceholderName,\n\t\t\tpersistedValue,\n\t\t\tparent,\n\t\t\tvalue: resolvedFieldValue,\n\t\t\teventListeners: this.initializeFieldEventListenerStore(fieldMarker),\n\t\t\terrors: undefined,\n\t\t\ttouchLog: undefined,\n\t\t\thasUnpersistedChanges: copyFromState?.hasUnpersistedChanges ?? false,\n\n\t\t\tgetAccessor: () => {\n\t\t\t\tif (fieldState.accessor === undefined) {\n\t\t\t\t\tconst fieldSchema = this.treeStore.schema.getEntityColumn(parent.entity.entityName, fieldMarker.fieldName)\n\n\t\t\t\t\tfieldState.accessor = new FieldAccessor(\n\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\tthis.fieldOperations,\n\t\t\t\t\t\tfieldState.placeholderName,\n\t\t\t\t\t\tfieldState.value,\n\t\t\t\t\t\tfieldState.persistedValue === undefined ? null : fieldState.persistedValue,\n\t\t\t\t\t\tfieldState.fieldMarker.defaultValue,\n\t\t\t\t\t\tfieldState.errors,\n\t\t\t\t\t\tfieldState.hasUnpersistedChanges,\n\t\t\t\t\t\tfieldState.touchLog,\n\t\t\t\t\t\tfieldState.getAccessor,\n\t\t\t\t\t\tfieldSchema,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\treturn fieldState.accessor\n\t\t\t},\n\t\t}\n\n\t\tthis.eventManager.registerNewlyInitialized(fieldState)\n\t\treturn fieldState\n\t}\n\n\tprivate initializeFromFieldMarker(\n\t\tparent: EntityRealmState,\n\t\tfield: FieldMarker,\n\t\tpersistedValue: EntityFieldPersistedData | undefined,\n\t\tcopyFromState?: FieldState,\n\t) {\n\t\tif (persistedValue instanceof Set) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Received a collection of referenced entities where a single '${field.fieldName}' field was expected. ` +\n\t\t\t\t\t`Perhaps you wanted to use a <Repeater />?`,\n\t\t\t)\n\t\t}\n\t\tif (persistedValue instanceof ServerId) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Received a referenced entity where a single '${field.fieldName}' field was expected. ` +\n\t\t\t\t\t`Perhaps you wanted to use <HasOne />?`,\n\t\t\t)\n\t\t}\n\t\tparent.children.set(\n\t\t\tfield.placeholderName,\n\t\t\tthis.initializeFieldState(parent, field.placeholderName, field, persistedValue, copyFromState),\n\t\t)\n\t}\n\n\tprivate initializeFromHasOneRelationMarker(\n\t\tparent: EntityRealmState,\n\t\tfield: HasOneRelationMarker,\n\t\tentityId: RuntimeId,\n\t\tcopyFrom?: EntityRealmState | EntityRealmStateStub,\n\t) {\n\t\tparent.children.set(\n\t\t\tfield.placeholderName,\n\t\t\tthis.initializeEntityRealm(entityId, this.getRelationTargetEntityName(parent, field), {\n\t\t\t\ttype: 'hasOne',\n\t\t\t\tparent,\n\t\t\t\tmarker: field,\n\t\t\t}, copyFrom),\n\t\t)\n\t\t// if (fieldDatum instanceof ServerGeneratedUuid || fieldDatum === null || fieldDatum === undefined) {\n\t\t// \tconst entityId = fieldDatum instanceof ServerGeneratedUuid ? fieldDatum : new UnpersistedEntityDummyId()\n\t\t//\n\t\t//\n\t\t// } else if (fieldDatum instanceof Set) {\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Received a collection of entities for field '${relation.field}' where a single entity was expected. ` +\n\t\t// \t\t\t`Perhaps you wanted to use a <Repeater />?`,\n\t\t// \t)\n\t\t// } else {\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Received a scalar value for field '${relation.field}' where a single entity was expected.` +\n\t\t// \t\t\t`Perhaps you meant to use a variant of <Field />?`,\n\t\t// \t)\n\t\t// }\n\t}\n\n\tprivate initializeFromHasManyRelationMarker(\n\t\tparent: EntityRealmState,\n\t\tfield: HasManyRelationMarker,\n\t\tpersistedEntityIds: Set<EntityId>,\n\t) {\n\t\tparent.children.set(\n\t\t\tfield.placeholderName,\n\t\t\tthis.initializeEntityListState(\n\t\t\t\t{ type: 'hasMany', marker: field, parent },\n\t\t\t\tthis.getRelationTargetEntityName(parent, field),\n\t\t\t\tpersistedEntityIds,\n\t\t\t),\n\t\t)\n\t\t// const relation = field.parameters\n\t\t//\n\t\t// if (fieldDatum === undefined || fieldDatum instanceof Set) {\n\t\t//\n\t\t// } else if (typeof fieldDatum === 'object') {\n\t\t// \t// Intentionally allowing `fieldDatum === null` here as well since this should only happen when a *hasOne\n\t\t// \t// relation is unlinked, e.g. a Person does not have a linked Nationality.\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Received a referenced entity for field '${relation.field}' where a collection of entities was expected.` +\n\t\t// \t\t\t`Perhaps you wanted to use a <HasOne />?`,\n\t\t// \t)\n\t\t// } else {\n\t\t// \tthrow new BindingError(\n\t\t// \t\t`Received a scalar value for field '${relation.field}' where a collection of entities was expected.` +\n\t\t// \t\t\t`Perhaps you meant to use a variant of <Field />?`,\n\t\t// \t)\n\t\t// }\n\t}\n\n\tprivate getRelationTargetEntityName(\n\t\tentityRealm: EntityRealmState,\n\t\tfield: HasOneRelationMarker | HasManyRelationMarker,\n\t): EntityName {\n\t\tconst targetField = this.treeStore.schema.getEntityRelation(entityRealm.entity.entityName, field.parameters.field)\n\t\treturn targetField.targetEntity\n\t}\n\n\tpublic runImmediateUserInitialization(\n\t\trealm: EntityRealmState | EntityRealmStateStub,\n\t\tinitialize: EntityAccessor.BatchUpdatesHandler | undefined,\n\t) {\n\t\tif (initialize === undefined) {\n\t\t\treturn\n\t\t}\n\t\tconst entityRealm = this.materializeEntityRealm(realm)\n\n\t\trealm.getAccessor().batchUpdates(initialize)\n\n\t\tconst initializeListeners = this.eventManager.getEventListeners(entityRealm, { type: 'initialize' })\n\t\tif (initializeListeners === undefined || initializeListeners.size === 0) {\n\t\t\trealm.entity.hasIdSetInStone = true\n\t\t}\n\t}\n\n\tpublic initializeEntityEventListenerStore(blueprint: EntityRealmBlueprint): EntityEventListenerStore | undefined {\n\t\tif (blueprint.type === 'listEntity') {\n\t\t\tconst blueprintListeners = blueprint.parent.blueprint.marker.parameters.childEventListeners\n\t\t\tconst childInitialize = blueprintListeners?.get({ type: 'initialize' })\n\t\t\tconst store: EntityEventListenerStore = new EventListenersStore(() => blueprint.parent.childEventListeners)\n\n\t\t\tif (childInitialize !== undefined) {\n\t\t\t\tstore.set({ type: 'initialize' }, childInitialize)\n\t\t\t}\n\t\t\treturn store\n\t\t}\n\n\t\tconst blueprintListeners = blueprint.marker.parameters.eventListeners\n\t\tif (blueprintListeners === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn TreeParameterMerger.cloneSingleEntityEventListeners(blueprintListeners)\n\t}\n\n\tprivate initializeEntityListEventListenerStore(\n\t\tblueprint: EntityListBlueprint,\n\t): EntityListEventListenerStore | undefined {\n\t\tconst blueprintListeners = blueprint.marker.parameters.eventListeners\n\n\t\tif (blueprintListeners === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn TreeParameterMerger.cloneEntityListEventListeners(blueprintListeners)\n\t}\n\n\tprivate initializeEntityListChildEventListenerStore(\n\t\tblueprint: EntityListBlueprint,\n\t): EntityEventListenerStore | undefined {\n\t\tconst blueprintListeners = blueprint.marker.parameters.childEventListeners\n\n\t\tif (blueprintListeners === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn TreeParameterMerger.cloneSingleEntityEventListeners(blueprintListeners)\n\t}\n\n\tprivate initializeFieldEventListenerStore(marker: FieldMarker): FieldEvent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,YAAM,kBAAkBA,qBAAoB,IAAI,EAAE,MAAM,cAAc;AACtE,YAAM,QAAkC,IAAI,oBAAoB,MAAM,UAAU,OAAO,mBAAmB;AAE1G,UAAI,oBAAoB,QAAW;AAClC,cAAM,IAAI,EAAE,MAAM,gBAAgB,eAAe;AAAA,MAClD;AACO,aAAA;AAAA,IACR;AAEM,UAAA,qBAAqB,UAAU,OAAO,WAAW;AACvD,QAAI,uBAAuB,QAAW;AAC9B,aAAA;AAAA,IACR;AACO,WAAA,oBAAoB,gCAAgC,kBAAkB;AAAA,EAC9E;AAAA,EAEQ,uCACP,WAC2C;AACrC,UAAA,qBAAqB,UAAU,OAAO,WAAW;AAEvD,QAAI,uBAAuB,QAAW;AAC9B,aAAA;AAAA,IACR;AACO,WAAA,oBAAoB,8BAA8B,kBAAkB;AAAA,EAC5E;AAAA,EAEQ,4CACP,WACuC;AACjC,UAAA,qBAAqB,UAAU,OAAO,WAAW;AAEvD,QAAI,uBAAuB,QAAW;AAC9B,aAAA;AAAA,IACR;AACO,WAAA,oBAAoB,gCAAgC,kBAAkB;AAAA,EAC9E;AAAA,EAEQ,kCAAkC,QAA0D;AAE5F,WAAA;AAAA,EACR;AACD;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeAugmenter.cjs","sources":["../../../src/core/TreeAugmenter.ts"],"sourcesContent":["import {\n\tClientGeneratedUuid,\n\tEntityListPersistedData,\n\tReceivedDataTree,\n\tRuntimeId,\n\tServerId,\n\tUnpersistedEntityDummyId,\n} from '../accessorTree'\nimport { BindingError } from '../BindingError'\nimport type { MarkerTreeRoot } from '../markers'\nimport type { EntityId, PlaceholderName, TreeRootId } from '../treeParameters'\nimport { assert, assertNever } from '../utils'\nimport { EventManager } from './EventManager'\nimport { OperationsHelpers } from './operations/OperationsHelpers'\nimport type { EntityListState, EntityRealmState, EntityRealmStateStub, RootStateNode } from './state'\nimport type { StateInitializer } from './StateInitializer'\nimport type { TreeStore } from './TreeStore'\nimport { SubMutationOperation } from './MutationGenerator'\n\nexport class TreeAugmenter {\n\tpublic constructor(\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly stateInitializer: StateInitializer,\n\t\tprivate readonly treeStore: TreeStore,\n\t\tprivate readonly skipStateUpdateAfterPersist: boolean = false,\n\t) {}\n\n\tpublic extendPersistedData(newPersistedData: ReceivedDataTree, markerTree: MarkerTreeRoot) {\n\t\t// TODO this doesn't yet handle updates for entities whose persisted data just gets magically changed without notice.\n\t\tthis.treeStore.mergeInQueryResponse(newPersistedData, markerTree)\n\t}\n\n\tpublic extendTreeStates(newTreeId: TreeRootId | undefined, newMarkerTree: MarkerTreeRoot): void {\n\t\tconst subTreeStates: Map<PlaceholderName, RootStateNode> = new Map()\n\n\t\tthis.treeStore.markerTrees.set(newTreeId, newMarkerTree)\n\t\tthis.treeStore.subTreeStatesByRoot.set(newTreeId, subTreeStates)\n\n\t\tfor (const [placeholderName, newSubTreeMarker] of newMarkerTree.subTrees) {\n\t\t\tconst newState = this.stateInitializer.initializeSubTree(newSubTreeMarker)\n\t\t\tsubTreeStates.set(placeholderName, newState)\n\t\t}\n\t}\n\n\tpublic updatePersistedData(response: ReceivedDataTree, operations: SubMutationOperation[]) {\n\t\tthis.treeStore.mergeInMutationResponse(response, operations)\n\t\tif (this.skipStateUpdateAfterPersist) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventManager.syncTransaction(() => {\n\t\t\tfor (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {\n\t\t\t\t// for (const rootPlaceholder in response) {\n\t\t\t\t// \tconst rootState = rootStates.get(rootPlaceholder)\n\t\t\t\t//\n\t\t\t\t// \tif (rootState === undefined) {\n\t\t\t\t// \t\tcontinue\n\t\t\t\t// \t}\n\t\t\t\t// TODO the above would be better, only refreshing roots which participated in the mutation. However, due to\n\t\t\t\t// \thow mutations are currently generated, we cannot assume that only roots present in the response need\n\t\t\t\t// \trefreshed. So we just refresh all.\n\t\t\t\tfor (const [rootPlaceholder, rootState] of rootStates) {\n\t\t\t\t\tconst rootData = this.treeStore.subTreePersistedData.get(rootPlaceholder)\n\n\t\t\t\t\tif (rootState.type === 'entityList') {\n\t\t\t\t\t\tif (!(rootData instanceof Set)) {\n\t\t\t\t\t\t\tcontinue // This should never happen.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.updateEntityListPersistedData(rootState, rootData)\n\t\t\t\t\t} else if (rootState.type === 'entityRealm') {\n\t\t\t\t\t\tif (rootData !== undefined && !(rootData instanceof ServerId)) {\n\t\t\t\t\t\t\tcontinue // This should never happen.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.updateRealmIdIfNecessary(rootState, rootData)\n\t\t\t\t\t\tthis.updateEntityRealmPersistedData(rootState)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn assertNever(rootState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic resetCreatingSubTrees() {\n\t\tfor (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {\n\t\t\tfor (const [rootPlaceholder, rootState] of rootStates) {\n\t\t\t\tif (rootState.type === 'entityList') {\n\t\t\t\t\tassert(rootState.blueprint.parent === undefined)\n\t\t\t\t\tif (!rootState.blueprint.marker.parameters.isCreating) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.treeStore.subTreePersistedData.delete(rootPlaceholder)\n\t\t\t\t\tconst changesCount = rootState.unpersistedChangesCount\n\n\t\t\t\t\t// Just emptying the list. But the list itself can stay.\n\t\t\t\t\tfor (const childState of rootState.children.values()) {\n\t\t\t\t\t\tthis.treeStore.disposeOfRealm(childState)\n\t\t\t\t\t}\n\t\t\t\t\trootState.accessor = undefined\n\t\t\t\t\trootState.children.clear()\n\t\t\t\t\trootState.childrenWithPendingUpdates?.clear()\n\t\t\t\t\trootState.errors = undefined\n\t\t\t\t\trootState.plannedRemovals?.clear()\n\n\t\t\t\t\tthis.eventManager.registerJustUpdated(\n\t\t\t\t\t\trootState,\n\t\t\t\t\t\tchangesCount ? -1 * changesCount : EventManager.NO_CHANGES_DIFFERENCE,\n\t\t\t\t\t)\n\t\t\t\t} else if (rootState.type === 'entityRealm') {\n\t\t\t\t\tassert(rootState.blueprint.parent === undefined)\n\t\t\t\t\tif (!rootState.blueprint.marker.parameters.isCreating) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst presentListeners = rootState.eventListeners\n\t\t\t\t\tthis.treeStore.disposeOfRealm(rootState)\n\n\t\t\t\t\t// It's crucial to delete the persisted data before we re-initialize so that we get a fresh, new entity.\n\t\t\t\t\tthis.treeStore.subTreePersistedData.delete(rootPlaceholder)\n\t\t\t\t\tconst newRootState = this.stateInitializer.initializeSubTree(rootState.blueprint.marker)\n\n\t\t\t\t\t// We preserve the previous listeners but purge some of them.\n\t\t\t\t\tnewRootState.eventListeners = presentListeners\n\t\t\t\t\tOperationsHelpers.purgeStaleListenersAfterIdChange(newRootState as EntityRealmState)\n\n\t\t\t\t\trootStates.set(rootPlaceholder, newRootState)\n\n\t\t\t\t\tthis.eventManager.registerJustUpdated(newRootState, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t\t} else {\n\t\t\t\t\tassertNever(rootState)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateRealmIdIfNecessary(\n\t\trealm: EntityRealmState | EntityRealmStateStub,\n\t\tnewId: ServerId | undefined | null,\n\t) {\n\t\tconst currentId = realm.entity.id\n\t\tlet idToChangeTo: RuntimeId | undefined = undefined\n\n\t\tif (currentId instanceof ServerId) {\n\t\t\tif (newId === undefined || newId === null) {\n\t\t\t\tidToChangeTo = new UnpersistedEntityDummyId()\n\t\t\t} else if (currentId.value !== newId.value) {\n\t\t\t\tidToChangeTo = newId\n\t\t\t}\n\t\t} else if (currentId instanceof ClientGeneratedUuid) {\n\t\t\tidToChangeTo = newId ?? new UnpersistedEntityDummyId()\n\t\t} else if (currentId instanceof UnpersistedEntityDummyId) {\n\t\t\tif (newId) {\n\t\t\t\tidToChangeTo = newId\n\t\t\t}\n\t\t} else {\n\t\t\treturn assertNever(currentId)\n\t\t}\n\t\tif (idToChangeTo) {\n\t\t\tOperationsHelpers.changeRealmId(this.treeStore, this.eventManager, this.stateInitializer, realm, idToChangeTo)\n\t\t}\n\t}\n\n\tprivate updateEntityRealmPersistedData(realm: EntityRealmState) {\n\t\tconst realmId = realm.entity.id\n\t\tconst persistedData = realmId.existsOnServer ? this.treeStore.persistedEntityData.get(realmId.uniqueValue) : undefined\n\n\t\tfor (const [placeholderName, child] of realm.children) {\n\t\t\tconst childData = persistedData?.get(placeholderName)\n\n\t\t\tswitch (child.type) {\n\t\t\t\tcase 'field': {\n\t\t\t\t\tif (childData instanceof ServerId || childData instanceof Set) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\n\t\t\t\t\tif (child.persistedValue !== childData) {\n\t\t\t\t\t\tconst shouldChangeBothValues = child.persistedValue === child.value\n\n\t\t\t\t\t\tchild.persistedValue = childData\n\t\t\t\t\t\tif (shouldChangeBothValues) {\n\t\t\t\t\t\t\tchild.value = childData ?? null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.eventManager.registerJustUpdated(child, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityRealm':\n\t\t\t\tcase 'entityRealmStub': {\n\t\t\t\t\tif (!(childData instanceof ServerId) && childData !== undefined && childData !== null) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tthis.updateRealmIdIfNecessary(child, childData)\n\t\t\t\t\tif (child.type === 'entityRealm') {\n\t\t\t\t\t\tthis.updateEntityRealmPersistedData(child)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tif (childData !== undefined && !(childData instanceof Set)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tthis.updateEntityListPersistedData(child, childData ?? new Set()) // TODO!!\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn assertNever(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateEntityListPersistedData(state: EntityListState, newPersistedIds: EntityListPersistedData) {\n\t\tconst persistedWithoutState: EntityId[] = []\n\n\t\t// TODO This isn't particularly efficient. We should probably use something like diff-sequence here.\n\n\t\tfor (const persistedId of newPersistedIds) {\n\t\t\tif (!state.children.has(persistedId)) {\n\t\t\t\tpersistedWithoutState.push(persistedId)\n\t\t\t}\n\t\t}\n\t\tfor (const [stateId, child] of state.children) {\n\t\t\tconst childRuntimeId = child.entity.id\n\t\t\tif (!newPersistedIds.has(stateId)) {\n\t\t\t\tif (\n\t\t\t\t\t// It's a uuid but it's not among the persisted so either it got deleted/disconnected or the client-side\n\t\t\t\t\t// id generation didn't quite pan out.\n\t\t\t\t\tchildRuntimeId instanceof ServerId ||\n\t\t\t\t\tchildRuntimeId instanceof ClientGeneratedUuid ||\n\t\t\t\t\t// No persisted entity id to allocate to this so that's a goodbye.\n\t\t\t\t\tpersistedWithoutState.length === 0\n\t\t\t\t) {\n\t\t\t\t\tstate.getAccessor().disconnectEntity(child.getAccessor())\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tconst drawnId = persistedWithoutState.shift()!\n\t\t\t\t\tOperationsHelpers.changeRealmId(\n\t\t\t\t\t\tthis.treeStore,\n\t\t\t\t\t\tthis.eventManager,\n\t\t\t\t\t\tthis.stateInitializer,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tnew ServerId(drawnId, child.entity.entityName),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else if (childRuntimeId instanceof ClientGeneratedUuid) {\n\t\t\t\tOperationsHelpers.changeRealmId(\n\t\t\t\t\tthis.treeStore,\n\t\t\t\t\tthis.eventManager,\n\t\t\t\t\tthis.stateInitializer,\n\t\t\t\t\tchild,\n\t\t\t\t\tnew ServerId(childRuntimeId.value, child.entity.entityName),\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (child.type === 'entityRealm') {\n\t\t\t\tthis.updateEntityRealmPersistedData(child)\n\t\t\t}\n\t\t}\n\t\tfor (const unclaimedPersistedId of persistedWithoutState) {\n\t\t\tthis.stateInitializer.initializeEntityRealm(new ServerId(unclaimedPersistedId, state.entityName), state.entityName, {\n\t\t\t\ttype: 'listEntity',\n\t\t\t\tparent: state,\n\t\t\t})\n\t\t}\n\t\t// All that remains now is the order.\n\t\tstate.children.changeKeyOrder(newPersistedIds)\n\t}\n}\n"],"names":["ServerId","assertNever","assert","EventManager","OperationsHelpers","UnpersistedEntityDummyId","ClientGeneratedUuid","BindingError"],"mappings":";;;;;;;;AAmBO,MAAM,cAAc;AAAA,EACnB,YACW,cACA,kBACA,WACA,8BAAuC,OACvD;AAJgB,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,YAAA;AACA,SAAA,8BAAA;AAAA,EACf;AAAA,EAEI,oBAAoB,kBAAoC,YAA4B;AAErF,SAAA,UAAU,qBAAqB,kBAAkB,UAAU;AAAA,EACjE;AAAA,EAEO,iBAAiB,WAAmC,eAAqC;AACzF,UAAA,oCAAyD;AAE/D,SAAK,UAAU,YAAY,IAAI,WAAW,aAAa;AACvD,SAAK,UAAU,oBAAoB,IAAI,WAAW,aAAa;AAE/D,eAAW,CAAC,iBAAiB,gBAAgB,KAAK,cAAc,UAAU;AACzE,YAAM,WAAW,KAAK,iBAAiB,kBAAkB,gBAAgB;AAC3D,oBAAA,IAAI,iBAAiB,QAAQ;AAAA,IAC5C;AAAA,EACD;AAAA,EAEO,oBAAoB,UAA4B,YAAoC;AACrF,SAAA,UAAU,wBAAwB,UAAU,UAAU;AAC3D,QAAI,KAAK,6BAA6B;AACrC;AAAA,IACD;AACK,SAAA,aAAa,gBA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,GAAG;AAClC;AAAA;AAAA;AAAA,UAGC,0BAA0BD,UAAAA,YAC1B,0BAA0BM,UAAA;AAAA,UAE1B,sBAAsB,WAAW;AAAA,UAChC;AACD,gBAAM,YAAY,EAAE,iBAAiB,MAAM,YAAa,CAAA;AACxD;AAAA,QAAA,OACM;AACA,gBAAA,UAAU,sBAAsB;AACpBF,4BAAAA,kBAAA;AAAA,YACjB,KAAK;AAAA,YACL,KAAK;AAAA,YACL,KAAK;AAAA,YACL;AAAA,YACA,IAAIJ,UAAA,SAAS,SAAS,MAAM,OAAO,UAAU;AAAA,UAAA;AAAA,QAE/C;AAAA,MAAA,WACU,0BAA0BM,+BAAqB;AACvCF,0BAAAA,kBAAA;AAAA,UACjB,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,UACL;AAAA,UACA,IAAIJ,UAAAA,SAAS,eAAe,OAAO,MAAM,OAAO,UAAU;AAAA,QAAA;AAAA,MAE5D;AACI,UAAA,MAAM,SAAS,eAAe;AACjC,aAAK,+BAA+B,KAAK;AAAA,MAC1C;AAAA,IACD;AACA,eAAW,wBAAwB,uBAAuB;AACpD,WAAA,iBAAiB,sBAAsB,IAAIA,UAAA,SAAS,sBAAsB,MAAM,UAAU,GAAG,MAAM,YAAY;AAAA,QACnH,MAAM;AAAA,QACN,QAAQ;AAAA,MAAA,CACR;AAAA,IACF;AAEM,UAAA,SAAS,eAAe,eAAe;AAAA,EAC9C;AACD;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeAugmenter.js","sources":["../../../src/core/TreeAugmenter.ts"],"sourcesContent":["import {\n\tClientGeneratedUuid,\n\tEntityListPersistedData,\n\tReceivedDataTree,\n\tRuntimeId,\n\tServerId,\n\tUnpersistedEntityDummyId,\n} from '../accessorTree'\nimport { BindingError } from '../BindingError'\nimport type { MarkerTreeRoot } from '../markers'\nimport type { EntityId, PlaceholderName, TreeRootId } from '../treeParameters'\nimport { assert, assertNever } from '../utils'\nimport { EventManager } from './EventManager'\nimport { OperationsHelpers } from './operations/OperationsHelpers'\nimport type { EntityListState, EntityRealmState, EntityRealmStateStub, RootStateNode } from './state'\nimport type { StateInitializer } from './StateInitializer'\nimport type { TreeStore } from './TreeStore'\nimport { SubMutationOperation } from './MutationGenerator'\n\nexport class TreeAugmenter {\n\tpublic constructor(\n\t\tprivate readonly eventManager: EventManager,\n\t\tprivate readonly stateInitializer: StateInitializer,\n\t\tprivate readonly treeStore: TreeStore,\n\t\tprivate readonly skipStateUpdateAfterPersist: boolean = false,\n\t) {}\n\n\tpublic extendPersistedData(newPersistedData: ReceivedDataTree, markerTree: MarkerTreeRoot) {\n\t\t// TODO this doesn't yet handle updates for entities whose persisted data just gets magically changed without notice.\n\t\tthis.treeStore.mergeInQueryResponse(newPersistedData, markerTree)\n\t}\n\n\tpublic extendTreeStates(newTreeId: TreeRootId | undefined, newMarkerTree: MarkerTreeRoot): void {\n\t\tconst subTreeStates: Map<PlaceholderName, RootStateNode> = new Map()\n\n\t\tthis.treeStore.markerTrees.set(newTreeId, newMarkerTree)\n\t\tthis.treeStore.subTreeStatesByRoot.set(newTreeId, subTreeStates)\n\n\t\tfor (const [placeholderName, newSubTreeMarker] of newMarkerTree.subTrees) {\n\t\t\tconst newState = this.stateInitializer.initializeSubTree(newSubTreeMarker)\n\t\t\tsubTreeStates.set(placeholderName, newState)\n\t\t}\n\t}\n\n\tpublic updatePersistedData(response: ReceivedDataTree, operations: SubMutationOperation[]) {\n\t\tthis.treeStore.mergeInMutationResponse(response, operations)\n\t\tif (this.skipStateUpdateAfterPersist) {\n\t\t\treturn\n\t\t}\n\t\tthis.eventManager.syncTransaction(() => {\n\t\t\tfor (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {\n\t\t\t\t// for (const rootPlaceholder in response) {\n\t\t\t\t// \tconst rootState = rootStates.get(rootPlaceholder)\n\t\t\t\t//\n\t\t\t\t// \tif (rootState === undefined) {\n\t\t\t\t// \t\tcontinue\n\t\t\t\t// \t}\n\t\t\t\t// TODO the above would be better, only refreshing roots which participated in the mutation. However, due to\n\t\t\t\t// \thow mutations are currently generated, we cannot assume that only roots present in the response need\n\t\t\t\t// \trefreshed. So we just refresh all.\n\t\t\t\tfor (const [rootPlaceholder, rootState] of rootStates) {\n\t\t\t\t\tconst rootData = this.treeStore.subTreePersistedData.get(rootPlaceholder)\n\n\t\t\t\t\tif (rootState.type === 'entityList') {\n\t\t\t\t\t\tif (!(rootData instanceof Set)) {\n\t\t\t\t\t\t\tcontinue // This should never happen.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.updateEntityListPersistedData(rootState, rootData)\n\t\t\t\t\t} else if (rootState.type === 'entityRealm') {\n\t\t\t\t\t\tif (rootData !== undefined && !(rootData instanceof ServerId)) {\n\t\t\t\t\t\t\tcontinue // This should never happen.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.updateRealmIdIfNecessary(rootState, rootData)\n\t\t\t\t\t\tthis.updateEntityRealmPersistedData(rootState)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn assertNever(rootState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic resetCreatingSubTrees() {\n\t\tfor (const rootStates of this.treeStore.subTreeStatesByRoot.values()) {\n\t\t\tfor (const [rootPlaceholder, rootState] of rootStates) {\n\t\t\t\tif (rootState.type === 'entityList') {\n\t\t\t\t\tassert(rootState.blueprint.parent === undefined)\n\t\t\t\t\tif (!rootState.blueprint.marker.parameters.isCreating) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.treeStore.subTreePersistedData.delete(rootPlaceholder)\n\t\t\t\t\tconst changesCount = rootState.unpersistedChangesCount\n\n\t\t\t\t\t// Just emptying the list. But the list itself can stay.\n\t\t\t\t\tfor (const childState of rootState.children.values()) {\n\t\t\t\t\t\tthis.treeStore.disposeOfRealm(childState)\n\t\t\t\t\t}\n\t\t\t\t\trootState.accessor = undefined\n\t\t\t\t\trootState.children.clear()\n\t\t\t\t\trootState.childrenWithPendingUpdates?.clear()\n\t\t\t\t\trootState.errors = undefined\n\t\t\t\t\trootState.plannedRemovals?.clear()\n\n\t\t\t\t\tthis.eventManager.registerJustUpdated(\n\t\t\t\t\t\trootState,\n\t\t\t\t\t\tchangesCount ? -1 * changesCount : EventManager.NO_CHANGES_DIFFERENCE,\n\t\t\t\t\t)\n\t\t\t\t} else if (rootState.type === 'entityRealm') {\n\t\t\t\t\tassert(rootState.blueprint.parent === undefined)\n\t\t\t\t\tif (!rootState.blueprint.marker.parameters.isCreating) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst presentListeners = rootState.eventListeners\n\t\t\t\t\tthis.treeStore.disposeOfRealm(rootState)\n\n\t\t\t\t\t// It's crucial to delete the persisted data before we re-initialize so that we get a fresh, new entity.\n\t\t\t\t\tthis.treeStore.subTreePersistedData.delete(rootPlaceholder)\n\t\t\t\t\tconst newRootState = this.stateInitializer.initializeSubTree(rootState.blueprint.marker)\n\n\t\t\t\t\t// We preserve the previous listeners but purge some of them.\n\t\t\t\t\tnewRootState.eventListeners = presentListeners\n\t\t\t\t\tOperationsHelpers.purgeStaleListenersAfterIdChange(newRootState as EntityRealmState)\n\n\t\t\t\t\trootStates.set(rootPlaceholder, newRootState)\n\n\t\t\t\t\tthis.eventManager.registerJustUpdated(newRootState, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t\t} else {\n\t\t\t\t\tassertNever(rootState)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateRealmIdIfNecessary(\n\t\trealm: EntityRealmState | EntityRealmStateStub,\n\t\tnewId: ServerId | undefined | null,\n\t) {\n\t\tconst currentId = realm.entity.id\n\t\tlet idToChangeTo: RuntimeId | undefined = undefined\n\n\t\tif (currentId instanceof ServerId) {\n\t\t\tif (newId === undefined || newId === null) {\n\t\t\t\tidToChangeTo = new UnpersistedEntityDummyId()\n\t\t\t} else if (currentId.value !== newId.value) {\n\t\t\t\tidToChangeTo = newId\n\t\t\t}\n\t\t} else if (currentId instanceof ClientGeneratedUuid) {\n\t\t\tidToChangeTo = newId ?? new UnpersistedEntityDummyId()\n\t\t} else if (currentId instanceof UnpersistedEntityDummyId) {\n\t\t\tif (newId) {\n\t\t\t\tidToChangeTo = newId\n\t\t\t}\n\t\t} else {\n\t\t\treturn assertNever(currentId)\n\t\t}\n\t\tif (idToChangeTo) {\n\t\t\tOperationsHelpers.changeRealmId(this.treeStore, this.eventManager, this.stateInitializer, realm, idToChangeTo)\n\t\t}\n\t}\n\n\tprivate updateEntityRealmPersistedData(realm: EntityRealmState) {\n\t\tconst realmId = realm.entity.id\n\t\tconst persistedData = realmId.existsOnServer ? this.treeStore.persistedEntityData.get(realmId.uniqueValue) : undefined\n\n\t\tfor (const [placeholderName, child] of realm.children) {\n\t\t\tconst childData = persistedData?.get(placeholderName)\n\n\t\t\tswitch (child.type) {\n\t\t\t\tcase 'field': {\n\t\t\t\t\tif (childData instanceof ServerId || childData instanceof Set) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\n\t\t\t\t\tif (child.persistedValue !== childData) {\n\t\t\t\t\t\tconst shouldChangeBothValues = child.persistedValue === child.value\n\n\t\t\t\t\t\tchild.persistedValue = childData\n\t\t\t\t\t\tif (shouldChangeBothValues) {\n\t\t\t\t\t\t\tchild.value = childData ?? null\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.eventManager.registerJustUpdated(child, EventManager.NO_CHANGES_DIFFERENCE)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityRealm':\n\t\t\t\tcase 'entityRealmStub': {\n\t\t\t\t\tif (!(childData instanceof ServerId) && childData !== undefined && childData !== null) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tthis.updateRealmIdIfNecessary(child, childData)\n\t\t\t\t\tif (child.type === 'entityRealm') {\n\t\t\t\t\t\tthis.updateEntityRealmPersistedData(child)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tif (childData !== undefined && !(childData instanceof Set)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tthis.updateEntityListPersistedData(child, childData ?? new Set()) // TODO!!\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\treturn assertNever(child)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate updateEntityListPersistedData(state: EntityListState, newPersistedIds: EntityListPersistedData) {\n\t\tconst persistedWithoutState: EntityId[] = []\n\n\t\t// TODO This isn't particularly efficient. We should probably use something like diff-sequence here.\n\n\t\tfor (const persistedId of newPersistedIds) {\n\t\t\tif (!state.children.has(persistedId)) {\n\t\t\t\tpersistedWithoutState.push(persistedId)\n\t\t\t}\n\t\t}\n\t\tfor (const [stateId, child] of state.children) {\n\t\t\tconst childRuntimeId = child.entity.id\n\t\t\tif (!newPersistedIds.has(stateId)) {\n\t\t\t\tif (\n\t\t\t\t\t// It's a uuid but it's not among the persisted so either it got deleted/disconnected or the client-side\n\t\t\t\t\t// id generation didn't quite pan out.\n\t\t\t\t\tchildRuntimeId instanceof ServerId ||\n\t\t\t\t\tchildRuntimeId instanceof ClientGeneratedUuid ||\n\t\t\t\t\t// No persisted entity id to allocate to this so that's a goodbye.\n\t\t\t\t\tpersistedWithoutState.length === 0\n\t\t\t\t) {\n\t\t\t\t\tstate.getAccessor().disconnectEntity(child.getAccessor())\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tconst drawnId = persistedWithoutState.shift()!\n\t\t\t\t\tOperationsHelpers.changeRealmId(\n\t\t\t\t\t\tthis.treeStore,\n\t\t\t\t\t\tthis.eventManager,\n\t\t\t\t\t\tthis.stateInitializer,\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tnew ServerId(drawnId, child.entity.entityName),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else if (childRuntimeId instanceof ClientGeneratedUuid) {\n\t\t\t\tOperationsHelpers.changeRealmId(\n\t\t\t\t\tthis.treeStore,\n\t\t\t\t\tthis.eventManager,\n\t\t\t\t\tthis.stateInitializer,\n\t\t\t\t\tchild,\n\t\t\t\t\tnew ServerId(childRuntimeId.value, child.entity.entityName),\n\t\t\t\t)\n\t\t\t}\n\t\t\tif (child.type === 'entityRealm') {\n\t\t\t\tthis.updateEntityRealmPersistedData(child)\n\t\t\t}\n\t\t}\n\t\tfor (const unclaimedPersistedId of persistedWithoutState) {\n\t\t\tthis.stateInitializer.initializeEntityRealm(new ServerId(unclaimedPersistedId, state.entityName), state.entityName, {\n\t\t\t\ttype: 'listEntity',\n\t\t\t\tparent: state,\n\t\t\t})\n\t\t}\n\t\t// All that remains now is the order.\n\t\tstate.children.changeKeyOrder(newPersistedIds)\n\t}\n}\n"],"names":[],"mappings":";;;;;;AAmBO,MAAM,cAAc;AAAA,EACnB,YACW,cACA,kBACA,WACA,8BAAuC,OACvD;AAJgB,SAAA,eAAA;AACA,SAAA,mBAAA;AACA,SAAA,YAAA;AACA,SAAA,8BAAA;AAAA,EACf;AAAA,EAEI,oBAAoB,kBAAoC,YAA4B;AAErF,SAAA,UAAU,qBAAqB,kBAAkB,UAAU;AAAA,EACjE;AAAA,EAEO,iBAAiB,WAAmC,eAAqC;AACzF,UAAA,oCAAyD;AAE/D,SAAK,UAAU,YAAY,IAAI,WAAW,aAAa;AACvD,SAAK,UAAU,oBAAoB,IAAI,WAAW,aAAa;AAE/D,eAAW,CAAC,iBAAiB,gBAAgB,KAAK,cAAc,UAAU;AACzE,YAAM,WAAW,KAAK,iBAAiB,kBAAkB,gBAAgB;AAC3D,oBAAA,IAAI,iBAAiB,QAAQ;AAAA,IAC5C;AAAA,EACD;AAAA,EAEO,oBAAoB,UAA4B,YAAoC;AACrF,SAAA,UAAU,wBAA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1B,sBAAsB,WAAW;AAAA,UAChC;AACD,gBAAM,YAAY,EAAE,iBAAiB,MAAM,YAAa,CAAA;AACxD;AAAA,QAAA,OACM;AACA,gBAAA,UAAU,sBAAsB;AACpB,4BAAA;AAAA,YACjB,KAAK;AAAA,YACL,KAAK;AAAA,YACL,KAAK;AAAA,YACL;AAAA,YACA,IAAI,SAAS,SAAS,MAAM,OAAO,UAAU;AAAA,UAAA;AAAA,QAE/C;AAAA,MAAA,WACU,0BAA0B,qBAAqB;AACvC,0BAAA;AAAA,UACjB,KAAK;AAAA,UACL,KAAK;AAAA,UACL,KAAK;AAAA,UACL;AAAA,UACA,IAAI,SAAS,eAAe,OAAO,MAAM,OAAO,UAAU;AAAA,QAAA;AAAA,MAE5D;AACI,UAAA,MAAM,SAAS,eAAe;AACjC,aAAK,+BAA+B,KAAK;AAAA,MAC1C;AAAA,IACD;AACA,eAAW,wBAAwB,uBAAuB;AACpD,WAAA,iBAAiB,sBAAsB,IAAI,SAAS,sBAAsB,MAAM,UAAU,GAAG,MAAM,YAAY;AAAA,QACnH,MAAM;AAAA,QACN,QAAQ;AAAA,MAAA,CACR;AAAA,IACF;AAEM,UAAA,SAAS,eAAe,eAAe;AAAA,EAC9C;AACD;"}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const StateIterator = require("./state/StateIterator.cjs");
|
|
4
|
-
const RuntimeId = require("../accessorTree/RuntimeId.cjs");
|
|
5
|
-
const HasOneRelationMarker = require("../markers/HasOneRelationMarker.cjs");
|
|
6
|
-
const HasManyRelationMarker = require("../markers/HasManyRelationMarker.cjs");
|
|
7
|
-
const assertNever = require("../utils/assertNever.cjs");
|
|
8
|
-
class TreeFilterGenerator {
|
|
9
|
-
constructor(treeStore) {
|
|
10
|
-
this.treeStore = treeStore;
|
|
11
|
-
}
|
|
12
|
-
generateTreeFilter() {
|
|
13
|
-
const filters = [];
|
|
14
|
-
for (const [placeholderName, state] of StateIterator.StateIterator.eachRootState(this.treeStore)) {
|
|
15
|
-
const blueprint = state.blueprint;
|
|
16
|
-
if (blueprint.parent || blueprint.marker.parameters.expectedMutation === "none") {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const marker = blueprint.marker;
|
|
20
|
-
filters.push(this.generateSubTreeFilter(marker, this.treeStore.subTreePersistedData.get(placeholderName)));
|
|
21
|
-
}
|
|
22
|
-
return filters.flat();
|
|
23
|
-
}
|
|
24
|
-
generateSubTreeFilter(subTree, persistedData) {
|
|
25
|
-
const filters = [];
|
|
26
|
-
if (persistedData === void 0) {
|
|
27
|
-
return filters;
|
|
28
|
-
}
|
|
29
|
-
if (persistedData instanceof RuntimeId.ServerId) {
|
|
30
|
-
const filter = this.generateTopLevelEntityFilter(
|
|
31
|
-
persistedData.value,
|
|
32
|
-
subTree.parameters.entityName,
|
|
33
|
-
subTree.fields
|
|
34
|
-
);
|
|
35
|
-
filter && filters.push(filter);
|
|
36
|
-
} else {
|
|
37
|
-
for (const id of persistedData) {
|
|
38
|
-
const filter = this.generateTopLevelEntityFilter(id, subTree.parameters.entityName, subTree.fields);
|
|
39
|
-
filter && filters.push(filter);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return filters;
|
|
43
|
-
}
|
|
44
|
-
generateTopLevelEntityFilter(id, entityName, fields) {
|
|
45
|
-
return {
|
|
46
|
-
entity: entityName,
|
|
47
|
-
id,
|
|
48
|
-
relations: this.generateEntityRelations(fields)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
generateEntityRelations(markers) {
|
|
52
|
-
const rawFilter = this.populateRawRelationFilters(markers);
|
|
53
|
-
return this.normalizeRawRelationFilters(rawFilter);
|
|
54
|
-
}
|
|
55
|
-
normalizeRawRelationFilters(raw) {
|
|
56
|
-
return Array.from(raw, ([fieldName, relations]) => ({
|
|
57
|
-
name: fieldName,
|
|
58
|
-
relations: this.normalizeRawRelationFilters(relations)
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
populateRawRelationFilters(markers, relations = /* @__PURE__ */ new Map()) {
|
|
62
|
-
for (const [, marker] of markers.markers) {
|
|
63
|
-
if (!(marker instanceof HasOneRelationMarker.HasOneRelationMarker) && !(marker instanceof HasManyRelationMarker.HasManyRelationMarker)) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (marker.parameters.expectedMutation === "none" || marker.parameters.expectedMutation === "connectOrDisconnect") {
|
|
67
|
-
continue;
|
|
68
|
-
} else if (marker.parameters.expectedMutation === "anyMutation" || marker.parameters.expectedMutation === "createOrDelete")
|
|
69
|
-
;
|
|
70
|
-
else {
|
|
71
|
-
return assertNever.assertNever(marker.parameters.expectedMutation);
|
|
72
|
-
}
|
|
73
|
-
let existingRelation = relations.get(marker.parameters.field);
|
|
74
|
-
if (existingRelation === void 0) {
|
|
75
|
-
relations.set(marker.parameters.field, existingRelation = /* @__PURE__ */ new Map());
|
|
76
|
-
}
|
|
77
|
-
this.populateRawRelationFilters(marker.fields, existingRelation);
|
|
78
|
-
}
|
|
79
|
-
return relations;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.TreeFilterGenerator = TreeFilterGenerator;
|
|
83
|
-
//# sourceMappingURL=TreeFilterGenerator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TreeFilterGenerator.cjs","sources":["../../../src/core/TreeFilterGenerator.ts"],"sourcesContent":["import type { RelationFilter, TreeFilter } from '@contember/client'\nimport { EntityListPersistedData, ServerId } from '../accessorTree'\nimport {\n\tEntityFieldMarkersContainer,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n} from '../markers'\nimport type { EntityId, EntityName } from '../treeParameters'\nimport { assertNever } from '../utils'\nimport { StateIterator } from './state'\nimport type { TreeStore } from './TreeStore'\n\ntype RawRelationFilters = Map<string, RawRelationFilters>\n\nexport class TreeFilterGenerator {\n\tpublic constructor(private readonly treeStore: TreeStore) {}\n\n\tpublic generateTreeFilter(): TreeFilter[] {\n\t\tconst filters: TreeFilter[][] = []\n\n\t\tfor (const [placeholderName, state] of StateIterator.eachRootState(this.treeStore)) {\n\t\t\tconst blueprint = state.blueprint\n\n\t\t\tif (blueprint.parent || blueprint.marker.parameters.expectedMutation === 'none') {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst marker = blueprint.marker\n\t\t\tfilters.push(this.generateSubTreeFilter(marker, this.treeStore.subTreePersistedData.get(placeholderName)))\n\t\t}\n\t\treturn filters.flat()\n\t}\n\n\tprivate generateSubTreeFilter(\n\t\tsubTree: EntitySubTreeMarker | EntityListSubTreeMarker,\n\t\tpersistedData: ServerId | EntityListPersistedData | undefined,\n\t): TreeFilter[] {\n\t\tconst filters: TreeFilter[] = []\n\n\t\tif (persistedData === undefined) {\n\t\t\treturn filters // Do nothing\n\t\t}\n\n\t\tif (persistedData instanceof ServerId) {\n\t\t\tconst filter = this.generateTopLevelEntityFilter(\n\t\t\t\tpersistedData.value,\n\t\t\t\tsubTree.parameters.entityName,\n\t\t\t\tsubTree.fields,\n\t\t\t)\n\t\t\tfilter && filters.push(filter)\n\t\t} else {\n\t\t\tfor (const id of persistedData) {\n\t\t\t\tconst filter = this.generateTopLevelEntityFilter(id, subTree.parameters.entityName, subTree.fields)\n\t\t\t\tfilter && filters.push(filter)\n\t\t\t}\n\t\t}\n\n\t\treturn filters\n\t}\n\n\tprivate generateTopLevelEntityFilter(\n\t\tid: EntityId,\n\t\tentityName: EntityName,\n\t\tfields: EntityFieldMarkersContainer,\n\t): TreeFilter | undefined {\n\t\treturn {\n\t\t\tentity: entityName,\n\t\t\tid: id,\n\t\t\trelations: this.generateEntityRelations(fields),\n\t\t}\n\t}\n\n\tprivate generateEntityRelations(markers: EntityFieldMarkersContainer): RelationFilter[] {\n\t\tconst rawFilter = this.populateRawRelationFilters(markers)\n\t\treturn this.normalizeRawRelationFilters(rawFilter)\n\t}\n\n\tprivate normalizeRawRelationFilters(raw: RawRelationFilters): RelationFilter[] {\n\t\treturn Array.from(raw, ([fieldName, relations]) => ({\n\t\t\tname: fieldName,\n\t\t\trelations: this.normalizeRawRelationFilters(relations),\n\t\t}))\n\t}\n\n\tprivate populateRawRelationFilters(\n\t\tmarkers: EntityFieldMarkersContainer,\n\t\trelations: RawRelationFilters = new Map(),\n\t): RawRelationFilters {\n\t\tfor (const [, marker] of markers.markers) {\n\t\t\tif (!(marker instanceof HasOneRelationMarker) && !(marker instanceof HasManyRelationMarker)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (\n\t\t\t\tmarker.parameters.expectedMutation === 'none' ||\n\t\t\t\tmarker.parameters.expectedMutation === 'connectOrDisconnect'\n\t\t\t) {\n\t\t\t\tcontinue\n\t\t\t} else if (\n\t\t\t\tmarker.parameters.expectedMutation === 'anyMutation' ||\n\t\t\t\tmarker.parameters.expectedMutation === 'createOrDelete'\n\t\t\t) {\n\t\t\t} else {\n\t\t\t\treturn assertNever(marker.parameters.expectedMutation)\n\t\t\t}\n\t\t\tlet existingRelation = relations.get(marker.parameters.field)\n\n\t\t\tif (existingRelation === undefined) {\n\t\t\t\trelations.set(marker.parameters.field, (existingRelation = new Map()))\n\t\t\t}\n\t\t\tthis.populateRawRelationFilters(marker.fields, existingRelation)\n\t\t}\n\n\t\treturn relations\n\t}\n}\n"],"names":["StateIterator","ServerId","HasOneRelationMarker","HasManyRelationMarker","assertNever"],"mappings":";;;;;;;AAgBO,MAAM,oBAAoB;AAAA,EACzB,YAA6B,WAAsB;AAAtB,SAAA,YAAA;AAAA,EAAuB;AAAA,EAEpD,qBAAmC;AACzC,UAAM,UAA0B,CAAA;AAErB,eAAA,CAAC,iBAAiB,KAAK,KAAKA,4BAAc,cAAc,KAAK,SAAS,GAAG;AACnF,YAAM,YAAY,MAAM;AAExB,UAAI,UAAU,UAAU,UAAU,OAAO,WAAW,qBAAqB,Q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