@contember/binding 1.2.6 → 1.3.0-alpha.2
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/dist/development/BindingError.cjs +10 -0
- package/dist/development/BindingError.cjs.map +1 -0
- package/dist/development/accessorTree/NormalizedPersistedData.cjs +10 -0
- package/dist/development/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/development/accessorTree/RuntimeId.cjs +64 -0
- package/dist/development/accessorTree/RuntimeId.cjs.map +1 -0
- package/dist/development/accessors/EntityAccessor.cjs +169 -0
- package/dist/development/accessors/EntityAccessor.cjs.map +1 -0
- package/dist/development/accessors/EntityAccessor.js +1 -1
- package/dist/development/accessors/EntityListAccessor.cjs +101 -0
- package/dist/development/accessors/EntityListAccessor.cjs.map +1 -0
- package/dist/development/accessors/ErrorAccessor.cjs +16 -0
- package/dist/development/accessors/ErrorAccessor.cjs.map +1 -0
- package/dist/development/accessors/FieldAccessor.cjs +59 -0
- package/dist/development/accessors/FieldAccessor.cjs.map +1 -0
- package/dist/development/accessors/TreeRootAccessor.cjs +14 -0
- package/dist/development/accessors/TreeRootAccessor.cjs.map +1 -0
- package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/development/bindingTypes.cjs +9 -0
- package/dist/development/bindingTypes.cjs.map +1 -0
- package/dist/development/core/AccessorErrorManager.cjs +207 -0
- package/dist/development/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/development/core/AccessorErrorManager.js +5 -4
- package/dist/development/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/core/Config.cjs +32 -0
- package/dist/development/core/Config.cjs.map +1 -0
- package/dist/development/core/DataBinding.cjs +352 -0
- package/dist/development/core/DataBinding.cjs.map +1 -0
- package/dist/development/core/DataBinding.js +53 -46
- package/dist/development/core/DataBinding.js.map +1 -1
- package/dist/development/core/DirtinessTracker.cjs +29 -0
- package/dist/development/core/DirtinessTracker.cjs.map +1 -0
- package/dist/development/core/ErrorsPreprocessor.cjs +181 -0
- package/dist/development/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/development/core/ErrorsPreprocessor.js +16 -16
- package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/core/EventManager.cjs +440 -0
- package/dist/development/core/EventManager.cjs.map +1 -0
- package/dist/development/core/EventManager.js +7 -5
- package/dist/development/core/EventManager.js.map +1 -1
- package/dist/development/core/MarkerComparator.cjs +79 -0
- package/dist/development/core/MarkerComparator.cjs.map +1 -0
- package/dist/development/core/MarkerMerger.cjs +252 -0
- package/dist/development/core/MarkerMerger.cjs.map +1 -0
- package/dist/development/core/MarkerMerger.js +2 -2
- package/dist/development/core/MutationGenerator.cjs +635 -0
- package/dist/development/core/MutationGenerator.cjs.map +1 -0
- package/dist/development/core/MutationGenerator.js +341 -294
- package/dist/development/core/MutationGenerator.js.map +1 -1
- package/dist/development/core/QueryGenerator.cjs +113 -0
- package/dist/development/core/QueryGenerator.cjs.map +1 -0
- package/dist/development/core/QueryGenerator.js +62 -75
- package/dist/development/core/QueryGenerator.js.map +1 -1
- package/dist/development/core/RealmKeyGenerator.cjs +47 -0
- package/dist/development/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/development/core/RequestResponseNormalizer.cjs +125 -0
- package/dist/development/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/development/core/StateInitializer.cjs +389 -0
- package/dist/development/core/StateInitializer.cjs.map +1 -0
- package/dist/development/core/StateInitializer.js +2 -2
- package/dist/development/core/StateInitializer.js.map +1 -1
- package/dist/development/core/TreeAugmenter.cjs +213 -0
- package/dist/development/core/TreeAugmenter.cjs.map +1 -0
- package/dist/development/core/TreeFilterGenerator.cjs +83 -0
- package/dist/development/core/TreeFilterGenerator.cjs.map +1 -0
- package/dist/development/core/TreeParameterMerger.cjs +304 -0
- package/dist/development/core/TreeParameterMerger.cjs.map +1 -0
- package/dist/development/core/TreeParameterMerger.js +8 -0
- package/dist/development/core/TreeParameterMerger.js.map +1 -1
- package/dist/development/core/TreeStore.cjs +182 -0
- package/dist/development/core/TreeStore.cjs.map +1 -0
- package/dist/development/core/TreeStore.js +1 -1
- package/dist/development/core/VariableInputTransformer.cjs +24 -0
- package/dist/development/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/development/core/exceptions/ErrorLocator.cjs +62 -0
- package/dist/development/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/development/core/exceptions/LocalizedBindingError.cjs +14 -0
- package/dist/development/core/exceptions/LocalizedBindingError.cjs.map +1 -0
- package/dist/development/core/exceptions/MarkerSugarer.cjs +56 -0
- package/dist/development/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/development/core/exceptions/TreeParameterSugarer.cjs +33 -0
- package/dist/development/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs +20 -0
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/development/core/operations/EntityOperations.cjs +238 -0
- package/dist/development/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/development/core/operations/EntityOperations.js +1 -1
- package/dist/development/core/operations/FieldOperations.cjs +96 -0
- package/dist/development/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/development/core/operations/FieldOperations.js +1 -1
- package/dist/development/core/operations/ListOperations.cjs +159 -0
- package/dist/development/core/operations/ListOperations.cjs.map +1 -0
- package/dist/development/core/operations/OperationsHelpers.cjs +85 -0
- package/dist/development/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/development/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/development/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/development/core/schema/Schema.cjs +39 -0
- package/dist/development/core/schema/Schema.cjs.map +1 -0
- package/dist/development/core/schema/SchemaLoader.cjs +28 -0
- package/dist/development/core/schema/SchemaLoader.cjs.map +1 -0
- package/dist/development/core/schema/SchemaLoader.js +2 -2
- package/dist/development/core/schema/SchemaLoader.js.map +1 -1
- package/dist/development/core/schema/SchemaPreprocessor.cjs +38 -0
- package/dist/development/core/schema/SchemaPreprocessor.cjs.map +1 -0
- package/dist/development/core/state/StateIterator.cjs +100 -0
- package/dist/development/core/state/StateIterator.cjs.map +1 -0
- package/dist/development/core/state/getEntityMarker.cjs +5 -0
- package/dist/development/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/development/core/utils/createQueryBuilder.cjs +32 -0
- package/dist/development/core/utils/createQueryBuilder.cjs.map +1 -0
- package/dist/development/core/utils/createQueryBuilder.js +32 -0
- package/dist/development/core/utils/createQueryBuilder.js.map +1 -0
- package/dist/development/core/utils/getCombinedSignal.cjs +33 -0
- package/dist/development/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/development/dao/Environment.cjs +213 -0
- package/dist/development/dao/Environment.cjs.map +1 -0
- package/dist/development/dao/Environment.js.map +1 -1
- package/dist/development/dao/TreeNodeEnvironmentFactory.cjs +89 -0
- package/dist/development/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
- package/dist/development/dao/VariableFieldValue.cjs +9 -0
- package/dist/development/dao/VariableFieldValue.cjs.map +1 -0
- package/dist/development/fieldHelpers/helpers/FieldHelper.cjs +17 -0
- package/dist/development/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/development/index.cjs +124 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +18 -135
- package/dist/development/index.js.map +1 -1
- package/dist/development/markers/EntityFieldMarkersContainer.cjs +41 -0
- package/dist/development/markers/EntityFieldMarkersContainer.cjs.map +1 -0
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs +11 -0
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
- package/dist/development/markers/EntityListSubTreeMarker.cjs +23 -0
- package/dist/development/markers/EntityListSubTreeMarker.cjs.map +1 -0
- package/dist/development/markers/EntitySubTreeMarker.cjs +23 -0
- package/dist/development/markers/EntitySubTreeMarker.cjs.map +1 -0
- package/dist/development/markers/FieldMarker.cjs +20 -0
- package/dist/development/markers/FieldMarker.cjs.map +1 -0
- package/dist/development/markers/HasManyRelationMarker.cjs +29 -0
- package/dist/development/markers/HasManyRelationMarker.cjs.map +1 -0
- package/dist/development/markers/HasOneRelationMarker.cjs +23 -0
- package/dist/development/markers/HasOneRelationMarker.cjs.map +1 -0
- package/dist/development/markers/MarkerTreeRoot.cjs +10 -0
- package/dist/development/markers/MarkerTreeRoot.cjs.map +1 -0
- package/dist/development/markers/ParentEntityMarker.cjs +10 -0
- package/dist/development/markers/ParentEntityMarker.cjs.map +1 -0
- package/dist/development/markers/PlaceholderGenerator.cjs +23 -0
- package/dist/development/markers/PlaceholderGenerator.cjs.map +1 -0
- package/dist/development/markers/PlaceholderParametersGenerator.cjs +62 -0
- package/dist/development/markers/PlaceholderParametersGenerator.cjs.map +1 -0
- package/dist/development/queryLanguage/CacheStore.cjs +47 -0
- package/dist/development/queryLanguage/CacheStore.cjs.map +1 -0
- package/dist/development/queryLanguage/CacheStore.js +2 -1
- package/dist/development/queryLanguage/CacheStore.js.map +1 -1
- package/dist/development/queryLanguage/MarkerFactory.cjs +200 -0
- package/dist/development/queryLanguage/MarkerFactory.cjs.map +1 -0
- package/dist/development/queryLanguage/MarkerFactory.js +1 -1
- package/dist/development/queryLanguage/Parser.cjs +728 -0
- package/dist/development/queryLanguage/Parser.cjs.map +1 -0
- package/dist/development/queryLanguage/Parser.js +64 -23
- package/dist/development/queryLanguage/Parser.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguage.cjs +520 -0
- package/dist/development/queryLanguage/QueryLanguage.cjs.map +1 -0
- package/dist/development/queryLanguage/QueryLanguage.js +3 -1
- package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguageError.cjs +6 -0
- package/dist/development/queryLanguage/QueryLanguageError.cjs.map +1 -0
- package/dist/development/queryLanguage/tokenList.cjs +150 -0
- package/dist/development/queryLanguage/tokenList.cjs.map +1 -0
- package/dist/development/queryLanguage/tokenList.js +1 -1
- package/dist/development/queryLanguage/tokenList.js.map +1 -1
- package/dist/development/structures/BijectiveIndexedMap.cjs +120 -0
- package/dist/development/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/development/structures/LRUCache.cjs +35 -0
- package/dist/development/structures/LRUCache.cjs.map +1 -0
- package/dist/development/structures/WeakIdCache.cjs +33 -0
- package/dist/development/structures/WeakIdCache.cjs.map +1 -0
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs +22 -0
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
- package/dist/development/treeParameters/EntityCreationParameters.cjs +8 -0
- package/dist/development/treeParameters/EntityCreationParameters.cjs.map +1 -0
- package/dist/development/treeParameters/EntityListPreferences.cjs +7 -0
- package/dist/development/treeParameters/EntityListPreferences.cjs.map +1 -0
- package/dist/development/treeParameters/EventListenersStore.cjs +70 -0
- package/dist/development/treeParameters/EventListenersStore.cjs.map +1 -0
- package/dist/development/treeParameters/LeafField.cjs +7 -0
- package/dist/development/treeParameters/LeafField.cjs.map +1 -0
- package/dist/development/treeParameters/QualifiedEntityParameters.cjs +7 -0
- package/dist/development/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
- package/dist/development/treeParameters/Relation.cjs +7 -0
- package/dist/development/treeParameters/Relation.cjs.map +1 -0
- package/dist/development/utils/Hashing.cjs +22 -0
- package/dist/development/utils/Hashing.cjs.map +1 -0
- package/dist/development/utils/TreeNodeUtils.cjs +77 -0
- package/dist/development/utils/TreeNodeUtils.cjs.map +1 -0
- package/dist/development/utils/assert.cjs +11 -0
- package/dist/development/utils/assert.cjs.map +1 -0
- package/dist/development/utils/assertNever.cjs +10 -0
- package/dist/development/utils/assertNever.cjs.map +1 -0
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/development/utils/isEmptyObject.cjs +12 -0
- package/dist/development/utils/isEmptyObject.cjs.map +1 -0
- package/dist/development/utils/ucfirst.cjs +5 -0
- package/dist/development/utils/ucfirst.cjs.map +1 -0
- package/dist/production/BindingError.cjs +10 -0
- package/dist/production/BindingError.cjs.map +1 -0
- package/dist/production/accessorTree/NormalizedPersistedData.cjs +10 -0
- package/dist/production/accessorTree/NormalizedPersistedData.cjs.map +1 -0
- package/dist/production/accessorTree/RuntimeId.cjs +64 -0
- package/dist/production/accessorTree/RuntimeId.cjs.map +1 -0
- package/dist/production/accessors/EntityAccessor.cjs +169 -0
- package/dist/production/accessors/EntityAccessor.cjs.map +1 -0
- package/dist/production/accessors/EntityAccessor.js +1 -1
- package/dist/production/accessors/EntityListAccessor.cjs +101 -0
- package/dist/production/accessors/EntityListAccessor.cjs.map +1 -0
- package/dist/production/accessors/ErrorAccessor.cjs +16 -0
- package/dist/production/accessors/ErrorAccessor.cjs.map +1 -0
- package/dist/production/accessors/FieldAccessor.cjs +59 -0
- package/dist/production/accessors/FieldAccessor.cjs.map +1 -0
- package/dist/production/accessors/TreeRootAccessor.cjs +14 -0
- package/dist/production/accessors/TreeRootAccessor.cjs.map +1 -0
- package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/production/bindingTypes.cjs +9 -0
- package/dist/production/bindingTypes.cjs.map +1 -0
- package/dist/production/core/AccessorErrorManager.cjs +207 -0
- package/dist/production/core/AccessorErrorManager.cjs.map +1 -0
- package/dist/production/core/AccessorErrorManager.js +5 -4
- package/dist/production/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/core/Config.cjs +32 -0
- package/dist/production/core/Config.cjs.map +1 -0
- package/dist/production/core/DataBinding.cjs +352 -0
- package/dist/production/core/DataBinding.cjs.map +1 -0
- package/dist/production/core/DataBinding.js +53 -46
- package/dist/production/core/DataBinding.js.map +1 -1
- package/dist/production/core/DirtinessTracker.cjs +29 -0
- package/dist/production/core/DirtinessTracker.cjs.map +1 -0
- package/dist/production/core/ErrorsPreprocessor.cjs +181 -0
- package/dist/production/core/ErrorsPreprocessor.cjs.map +1 -0
- package/dist/production/core/ErrorsPreprocessor.js +16 -16
- package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/core/EventManager.cjs +414 -0
- package/dist/production/core/EventManager.cjs.map +1 -0
- package/dist/production/core/EventManager.js +7 -5
- package/dist/production/core/EventManager.js.map +1 -1
- package/dist/production/core/MarkerComparator.cjs +79 -0
- package/dist/production/core/MarkerComparator.cjs.map +1 -0
- package/dist/production/core/MarkerMerger.cjs +252 -0
- package/dist/production/core/MarkerMerger.cjs.map +1 -0
- package/dist/production/core/MarkerMerger.js +2 -2
- package/dist/production/core/MutationGenerator.cjs +635 -0
- package/dist/production/core/MutationGenerator.cjs.map +1 -0
- package/dist/production/core/MutationGenerator.js +341 -294
- package/dist/production/core/MutationGenerator.js.map +1 -1
- package/dist/production/core/QueryGenerator.cjs +113 -0
- package/dist/production/core/QueryGenerator.cjs.map +1 -0
- package/dist/production/core/QueryGenerator.js +62 -75
- package/dist/production/core/QueryGenerator.js.map +1 -1
- package/dist/production/core/RealmKeyGenerator.cjs +47 -0
- package/dist/production/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/production/core/RequestResponseNormalizer.cjs +125 -0
- package/dist/production/core/RequestResponseNormalizer.cjs.map +1 -0
- package/dist/production/core/StateInitializer.cjs +389 -0
- package/dist/production/core/StateInitializer.cjs.map +1 -0
- package/dist/production/core/StateInitializer.js +2 -2
- package/dist/production/core/StateInitializer.js.map +1 -1
- package/dist/production/core/TreeAugmenter.cjs +213 -0
- package/dist/production/core/TreeAugmenter.cjs.map +1 -0
- package/dist/production/core/TreeFilterGenerator.cjs +83 -0
- package/dist/production/core/TreeFilterGenerator.cjs.map +1 -0
- package/dist/production/core/TreeParameterMerger.cjs +304 -0
- package/dist/production/core/TreeParameterMerger.cjs.map +1 -0
- package/dist/production/core/TreeParameterMerger.js +8 -0
- package/dist/production/core/TreeParameterMerger.js.map +1 -1
- package/dist/production/core/TreeStore.cjs +182 -0
- package/dist/production/core/TreeStore.cjs.map +1 -0
- package/dist/production/core/TreeStore.js +1 -1
- package/dist/production/core/VariableInputTransformer.cjs +24 -0
- package/dist/production/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/production/core/exceptions/ErrorLocator.cjs +62 -0
- package/dist/production/core/exceptions/ErrorLocator.cjs.map +1 -0
- package/dist/production/core/exceptions/LocalizedBindingError.cjs +14 -0
- package/dist/production/core/exceptions/LocalizedBindingError.cjs.map +1 -0
- package/dist/production/core/exceptions/MarkerSugarer.cjs +56 -0
- package/dist/production/core/exceptions/MarkerSugarer.cjs.map +1 -0
- package/dist/production/core/exceptions/TreeParameterSugarer.cjs +33 -0
- package/dist/production/core/exceptions/TreeParameterSugarer.cjs.map +1 -0
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs +20 -0
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/production/core/operations/EntityOperations.cjs +238 -0
- package/dist/production/core/operations/EntityOperations.cjs.map +1 -0
- package/dist/production/core/operations/EntityOperations.js +1 -1
- package/dist/production/core/operations/FieldOperations.cjs +76 -0
- package/dist/production/core/operations/FieldOperations.cjs.map +1 -0
- package/dist/production/core/operations/FieldOperations.js +1 -1
- package/dist/production/core/operations/ListOperations.cjs +159 -0
- package/dist/production/core/operations/ListOperations.cjs.map +1 -0
- package/dist/production/core/operations/OperationsHelpers.cjs +85 -0
- package/dist/production/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/production/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/production/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/production/core/schema/Schema.cjs +39 -0
- package/dist/production/core/schema/Schema.cjs.map +1 -0
- package/dist/production/core/schema/SchemaLoader.cjs +28 -0
- package/dist/production/core/schema/SchemaLoader.cjs.map +1 -0
- package/dist/production/core/schema/SchemaLoader.js +2 -2
- package/dist/production/core/schema/SchemaLoader.js.map +1 -1
- package/dist/production/core/schema/SchemaPreprocessor.cjs +38 -0
- package/dist/production/core/schema/SchemaPreprocessor.cjs.map +1 -0
- package/dist/production/core/state/StateIterator.cjs +100 -0
- package/dist/production/core/state/StateIterator.cjs.map +1 -0
- package/dist/production/core/state/getEntityMarker.cjs +5 -0
- package/dist/production/core/state/getEntityMarker.cjs.map +1 -0
- package/dist/production/core/utils/createQueryBuilder.cjs +32 -0
- package/dist/production/core/utils/createQueryBuilder.cjs.map +1 -0
- package/dist/production/core/utils/createQueryBuilder.js +32 -0
- package/dist/production/core/utils/createQueryBuilder.js.map +1 -0
- package/dist/production/core/utils/getCombinedSignal.cjs +33 -0
- package/dist/production/core/utils/getCombinedSignal.cjs.map +1 -0
- package/dist/production/dao/Environment.cjs +213 -0
- package/dist/production/dao/Environment.cjs.map +1 -0
- package/dist/production/dao/Environment.js.map +1 -1
- package/dist/production/dao/TreeNodeEnvironmentFactory.cjs +89 -0
- package/dist/production/dao/TreeNodeEnvironmentFactory.cjs.map +1 -0
- package/dist/production/dao/VariableFieldValue.cjs +9 -0
- package/dist/production/dao/VariableFieldValue.cjs.map +1 -0
- package/dist/production/fieldHelpers/helpers/FieldHelper.cjs +17 -0
- package/dist/production/fieldHelpers/helpers/FieldHelper.cjs.map +1 -0
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs +18 -0
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.cjs.map +1 -0
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs +16 -0
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.cjs.map +1 -0
- package/dist/production/index.cjs +124 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +18 -135
- package/dist/production/index.js.map +1 -1
- package/dist/production/markers/EntityFieldMarkersContainer.cjs +41 -0
- package/dist/production/markers/EntityFieldMarkersContainer.cjs.map +1 -0
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs +11 -0
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.cjs.map +1 -0
- package/dist/production/markers/EntityListSubTreeMarker.cjs +23 -0
- package/dist/production/markers/EntityListSubTreeMarker.cjs.map +1 -0
- package/dist/production/markers/EntitySubTreeMarker.cjs +23 -0
- package/dist/production/markers/EntitySubTreeMarker.cjs.map +1 -0
- package/dist/production/markers/FieldMarker.cjs +20 -0
- package/dist/production/markers/FieldMarker.cjs.map +1 -0
- package/dist/production/markers/HasManyRelationMarker.cjs +23 -0
- package/dist/production/markers/HasManyRelationMarker.cjs.map +1 -0
- package/dist/production/markers/HasOneRelationMarker.cjs +23 -0
- package/dist/production/markers/HasOneRelationMarker.cjs.map +1 -0
- package/dist/production/markers/MarkerTreeRoot.cjs +10 -0
- package/dist/production/markers/MarkerTreeRoot.cjs.map +1 -0
- package/dist/production/markers/ParentEntityMarker.cjs +10 -0
- package/dist/production/markers/ParentEntityMarker.cjs.map +1 -0
- package/dist/production/markers/PlaceholderGenerator.cjs +23 -0
- package/dist/production/markers/PlaceholderGenerator.cjs.map +1 -0
- package/dist/production/markers/PlaceholderParametersGenerator.cjs +62 -0
- package/dist/production/markers/PlaceholderParametersGenerator.cjs.map +1 -0
- package/dist/production/queryLanguage/CacheStore.cjs +47 -0
- package/dist/production/queryLanguage/CacheStore.cjs.map +1 -0
- package/dist/production/queryLanguage/CacheStore.js +2 -1
- package/dist/production/queryLanguage/CacheStore.js.map +1 -1
- package/dist/production/queryLanguage/MarkerFactory.cjs +200 -0
- package/dist/production/queryLanguage/MarkerFactory.cjs.map +1 -0
- package/dist/production/queryLanguage/MarkerFactory.js +1 -1
- package/dist/production/queryLanguage/Parser.cjs +725 -0
- package/dist/production/queryLanguage/Parser.cjs.map +1 -0
- package/dist/production/queryLanguage/Parser.js +64 -23
- package/dist/production/queryLanguage/Parser.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguage.cjs +517 -0
- package/dist/production/queryLanguage/QueryLanguage.cjs.map +1 -0
- package/dist/production/queryLanguage/QueryLanguage.js +3 -1
- package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguageError.cjs +6 -0
- package/dist/production/queryLanguage/QueryLanguageError.cjs.map +1 -0
- package/dist/production/queryLanguage/tokenList.cjs +150 -0
- package/dist/production/queryLanguage/tokenList.cjs.map +1 -0
- package/dist/production/queryLanguage/tokenList.js +1 -1
- package/dist/production/queryLanguage/tokenList.js.map +1 -1
- package/dist/production/structures/BijectiveIndexedMap.cjs +120 -0
- package/dist/production/structures/BijectiveIndexedMap.cjs.map +1 -0
- package/dist/production/structures/LRUCache.cjs +35 -0
- package/dist/production/structures/LRUCache.cjs.map +1 -0
- package/dist/production/structures/WeakIdCache.cjs +33 -0
- package/dist/production/structures/WeakIdCache.cjs.map +1 -0
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs +22 -0
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.cjs.map +1 -0
- package/dist/production/treeParameters/EntityCreationParameters.cjs +8 -0
- package/dist/production/treeParameters/EntityCreationParameters.cjs.map +1 -0
- package/dist/production/treeParameters/EntityListPreferences.cjs +7 -0
- package/dist/production/treeParameters/EntityListPreferences.cjs.map +1 -0
- package/dist/production/treeParameters/EventListenersStore.cjs +70 -0
- package/dist/production/treeParameters/EventListenersStore.cjs.map +1 -0
- package/dist/production/treeParameters/LeafField.cjs +7 -0
- package/dist/production/treeParameters/LeafField.cjs.map +1 -0
- package/dist/production/treeParameters/QualifiedEntityParameters.cjs +7 -0
- package/dist/production/treeParameters/QualifiedEntityParameters.cjs.map +1 -0
- package/dist/production/treeParameters/Relation.cjs +7 -0
- package/dist/production/treeParameters/Relation.cjs.map +1 -0
- package/dist/production/utils/Hashing.cjs +22 -0
- package/dist/production/utils/Hashing.cjs.map +1 -0
- package/dist/production/utils/TreeNodeUtils.cjs +77 -0
- package/dist/production/utils/TreeNodeUtils.cjs.map +1 -0
- package/dist/production/utils/assert.cjs +11 -0
- package/dist/production/utils/assert.cjs.map +1 -0
- package/dist/production/utils/assertNever.cjs +10 -0
- package/dist/production/utils/assertNever.cjs.map +1 -0
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs +7 -0
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.cjs.map +1 -0
- package/dist/production/utils/isEmptyObject.cjs +12 -0
- package/dist/production/utils/isEmptyObject.cjs.map +1 -0
- package/dist/production/utils/ucfirst.cjs +5 -0
- package/dist/production/utils/ucfirst.cjs.map +1 -0
- package/dist/types/accessorTree/PersistResult.d.ts +1 -2
- package/dist/types/accessorTree/PersistResult.d.ts.map +1 -1
- package/dist/types/accessorTree/index.d.ts +0 -15
- package/dist/types/accessorTree/index.d.ts.map +1 -1
- package/dist/types/accessors/BindingOperations.d.ts +2 -2
- package/dist/types/accessors/BindingOperations.d.ts.map +1 -1
- package/dist/types/accessors/ExtendTree.d.ts +1 -2
- package/dist/types/accessors/ExtendTree.d.ts.map +1 -1
- package/dist/types/accessors/TreeRootAccessor.d.ts +3 -3
- package/dist/types/accessors/TreeRootAccessor.d.ts.map +1 -1
- package/dist/types/core/AccessorErrorManager.d.ts +2 -2
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts +11 -6
- package/dist/types/core/DataBinding.d.ts.map +1 -1
- package/dist/types/core/ErrorsPreprocessor.d.ts +2 -2
- package/dist/types/core/ErrorsPreprocessor.d.ts.map +1 -1
- package/dist/types/core/EventManager.d.ts +2 -1
- package/dist/types/core/EventManager.d.ts.map +1 -1
- package/dist/types/core/MutationGenerator.d.ts +16 -13
- package/dist/types/core/MutationGenerator.d.ts.map +1 -1
- package/dist/types/core/QueryGenerator.d.ts +6 -8
- package/dist/types/core/QueryGenerator.d.ts.map +1 -1
- package/dist/types/core/TreeParameterMerger.d.ts.map +1 -1
- package/dist/types/core/index.d.ts +7 -1
- package/dist/types/core/index.d.ts.map +1 -1
- package/dist/types/core/schema/index.d.ts +2 -0
- package/dist/types/core/schema/index.d.ts.map +1 -1
- package/dist/types/core/state/EntityListState.d.ts +2 -0
- package/dist/types/core/state/EntityListState.d.ts.map +1 -1
- package/dist/types/core/utils/createQueryBuilder.d.ts +4 -0
- package/dist/types/core/utils/createQueryBuilder.d.ts.map +1 -0
- package/dist/types/dao/Environment.d.ts +5 -2
- package/dist/types/dao/Environment.d.ts.map +1 -1
- package/dist/types/dao/index.d.ts +1 -0
- package/dist/types/dao/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/queryLanguage/CacheStore.d.ts.map +1 -1
- package/dist/types/queryLanguage/Parser.d.ts +3 -2
- package/dist/types/queryLanguage/Parser.d.ts.map +1 -1
- package/dist/types/queryLanguage/QueryLanguage.d.ts.map +1 -1
- package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts +2 -0
- package/dist/types/treeParameters/UnconstrainedQualifiedEntityList.d.ts.map +1 -1
- package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts +2 -0
- package/dist/types/treeParameters/UnconstrainedQualifiedSingleEntity.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -13
- package/src/accessorTree/PersistResult.ts +1 -2
- package/src/accessorTree/index.ts +0 -15
- package/src/accessors/BindingOperations.ts +2 -2
- package/src/accessors/ExtendTree.ts +1 -2
- package/src/accessors/TreeRootAccessor.ts +2 -2
- package/src/core/AccessorErrorManager.ts +11 -9
- package/src/core/DataBinding.ts +76 -75
- package/src/core/ErrorsPreprocessor.ts +24 -23
- package/src/core/EventManager.ts +6 -3
- package/src/core/MutationGenerator.ts +411 -412
- package/src/core/QueryGenerator.ts +66 -117
- package/src/core/StateInitializer.ts +2 -2
- package/src/core/TreeParameterMerger.ts +8 -0
- package/src/core/index.ts +7 -1
- package/src/core/schema/SchemaLoader.ts +2 -2
- package/src/core/schema/index.ts +2 -0
- package/src/core/state/EntityListState.ts +2 -0
- package/src/core/utils/createQueryBuilder.ts +31 -0
- package/src/dao/Environment.ts +6 -2
- package/src/dao/index.ts +1 -0
- package/src/index.ts +0 -5
- package/src/queryLanguage/CacheStore.ts +1 -0
- package/src/queryLanguage/Parser.ts +76 -37
- package/src/queryLanguage/QueryLanguage.ts +4 -1
- package/src/queryLanguage/tokenList.ts +1 -1
- package/src/treeParameters/UnconstrainedQualifiedEntityList.ts +2 -0
- package/src/treeParameters/UnconstrainedQualifiedSingleEntity.ts +2 -0
- package/src/tsconfig.json +1 -4
- package/dist/development/accessorPropagation/AccessorProvider.js +0 -18
- package/dist/development/accessorPropagation/AccessorProvider.js.map +0 -1
- package/dist/development/accessorPropagation/BindingOperationsContext.js +0 -31
- package/dist/development/accessorPropagation/BindingOperationsContext.js.map +0 -1
- package/dist/development/accessorPropagation/BindingOperationsProvider.js +0 -13
- package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +0 -1
- package/dist/development/accessorPropagation/EntityKeyContext.js +0 -7
- package/dist/development/accessorPropagation/EntityKeyContext.js.map +0 -1
- package/dist/development/accessorPropagation/EntityKeyProvider.js +0 -13
- package/dist/development/accessorPropagation/EntityKeyProvider.js.map +0 -1
- package/dist/development/accessorPropagation/EnvironmentContext.js +0 -53
- package/dist/development/accessorPropagation/EnvironmentContext.js.map +0 -1
- package/dist/development/accessorPropagation/TreeRootIdContext.js +0 -7
- package/dist/development/accessorPropagation/TreeRootIdContext.js.map +0 -1
- package/dist/development/accessorPropagation/TreeRootIdProvider.js +0 -13
- package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +0 -1
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js +0 -55
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js.map +0 -1
- package/dist/development/accessorPropagation/useBindingOperations.js +0 -7
- package/dist/development/accessorPropagation/useBindingOperations.js.map +0 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +0 -47
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +0 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +0 -35
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +0 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +0 -35
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +0 -1
- package/dist/development/accessorPropagation/useEntity.js +0 -38
- package/dist/development/accessorPropagation/useEntity.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityKey.js +0 -16
- package/dist/development/accessorPropagation/useEntityKey.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityList.js +0 -36
- package/dist/development/accessorPropagation/useEntityList.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityListSubTree.js +0 -19
- package/dist/development/accessorPropagation/useEntityListSubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js +0 -69
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js.map +0 -1
- package/dist/development/accessorPropagation/useEntitySubTree.js +0 -19
- package/dist/development/accessorPropagation/useEntitySubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js +0 -47
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js.map +0 -1
- package/dist/development/accessorPropagation/useEnvironment.js +0 -9
- package/dist/development/accessorPropagation/useEnvironment.js.map +0 -1
- package/dist/development/accessorPropagation/useExtendTree.js +0 -32
- package/dist/development/accessorPropagation/useExtendTree.js.map +0 -1
- package/dist/development/accessorPropagation/useField.js +0 -36
- package/dist/development/accessorPropagation/useField.js.map +0 -1
- package/dist/development/accessorPropagation/useGetEntityByKey.js +0 -6
- package/dist/development/accessorPropagation/useGetEntityByKey.js.map +0 -1
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js +0 -17
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useGetEntitySubTree.js +0 -17
- package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +0 -1
- package/dist/development/accessorPropagation/useGetTreeFilters.js +0 -6
- package/dist/development/accessorPropagation/useGetTreeFilters.js.map +0 -1
- package/dist/development/accessorPropagation/useHasEntity.js +0 -9
- package/dist/development/accessorPropagation/useHasEntity.js.map +0 -1
- package/dist/development/accessorPropagation/usePersist.js +0 -6
- package/dist/development/accessorPropagation/usePersist.js.map +0 -1
- package/dist/development/accessorPropagation/useTreeRootId.js +0 -7
- package/dist/development/accessorPropagation/useTreeRootId.js.map +0 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +0 -118
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +0 -1
- package/dist/development/accessorSorting/addEntityAtIndex.js +0 -18
- package/dist/development/accessorSorting/addEntityAtIndex.js.map +0 -1
- package/dist/development/accessorSorting/errors.js +0 -10
- package/dist/development/accessorSorting/errors.js.map +0 -1
- package/dist/development/accessorSorting/moveEntity.js +0 -42
- package/dist/development/accessorSorting/moveEntity.js.map +0 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js +0 -13
- package/dist/development/accessorSorting/repairEntitiesOrder.js.map +0 -1
- package/dist/development/accessorSorting/sortEntities.js +0 -17
- package/dist/development/accessorSorting/sortEntities.js.map +0 -1
- package/dist/development/accessorSorting/useSortedEntities.js +0 -80
- package/dist/development/accessorSorting/useSortedEntities.js.map +0 -1
- package/dist/development/accessorTree/AccessorTree.js +0 -39
- package/dist/development/accessorTree/AccessorTree.js.map +0 -1
- package/dist/development/accessorTree/AccessorTreeStateContext.js +0 -6
- package/dist/development/accessorTree/AccessorTreeStateContext.js.map +0 -1
- package/dist/development/accessorTree/DirtinessContext.js +0 -7
- package/dist/development/accessorTree/DirtinessContext.js.map +0 -1
- package/dist/development/accessorTree/MutationStateContext.js +0 -7
- package/dist/development/accessorTree/MutationStateContext.js.map +0 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js +0 -34
- package/dist/development/accessorTree/accessorTreeStateReducer.js.map +0 -1
- package/dist/development/accessorTree/metadataToRequestError.js +0 -15
- package/dist/development/accessorTree/metadataToRequestError.js.map +0 -1
- package/dist/development/accessorTree/useAccessorTreeState.js +0 -14
- package/dist/development/accessorTree/useAccessorTreeState.js.map +0 -1
- package/dist/development/accessorTree/useDataBinding.js +0 -84
- package/dist/development/accessorTree/useDataBinding.js.map +0 -1
- package/dist/development/accessorTree/useDirtinessState.js +0 -7
- package/dist/development/accessorTree/useDirtinessState.js.map +0 -1
- package/dist/development/accessorTree/useMutationState.js +0 -7
- package/dist/development/accessorTree/useMutationState.js.map +0 -1
- package/dist/development/core/IncrementalMarkerBuilder.js +0 -70
- package/dist/development/core/IncrementalMarkerBuilder.js.map +0 -1
- package/dist/development/core/MarkerTreeGenerator.js +0 -95
- package/dist/development/core/MarkerTreeGenerator.js.map +0 -1
- package/dist/development/coreComponents/Component.js +0 -33
- package/dist/development/coreComponents/Component.js.map +0 -1
- package/dist/development/coreComponents/DataBindingProvider.js +0 -24
- package/dist/development/coreComponents/DataBindingProvider.js.map +0 -1
- package/dist/development/coreComponents/Entity.js +0 -20
- package/dist/development/coreComponents/Entity.js.map +0 -1
- package/dist/development/coreComponents/EntityList.js +0 -45
- package/dist/development/coreComponents/EntityList.js.map +0 -1
- package/dist/development/coreComponents/EntityListSubTree.js +0 -58
- package/dist/development/coreComponents/EntityListSubTree.js.map +0 -1
- package/dist/development/coreComponents/EntitySubTree.js +0 -81
- package/dist/development/coreComponents/EntitySubTree.js.map +0 -1
- package/dist/development/coreComponents/Field.js +0 -37
- package/dist/development/coreComponents/Field.js.map +0 -1
- package/dist/development/coreComponents/HasMany.js +0 -42
- package/dist/development/coreComponents/HasMany.js.map +0 -1
- package/dist/development/coreComponents/HasOne.js +0 -42
- package/dist/development/coreComponents/HasOne.js.map +0 -1
- package/dist/development/coreComponents/ParentEntity.js +0 -18
- package/dist/development/coreComponents/ParentEntity.js.map +0 -1
- package/dist/development/entityEvents/useDerivedField.js +0 -42
- package/dist/development/entityEvents/useDerivedField.js.map +0 -1
- package/dist/development/entityEvents/useEntityBeforePersist.js +0 -8
- package/dist/development/entityEvents/useEntityBeforePersist.js.map +0 -1
- package/dist/development/entityEvents/useEntityBeforeUpdate.js +0 -8
- package/dist/development/entityEvents/useEntityBeforeUpdate.js.map +0 -1
- package/dist/development/entityEvents/useEntityEvent.js +0 -32
- package/dist/development/entityEvents/useEntityEvent.js.map +0 -1
- package/dist/development/entityEvents/useEntityPersistError.js +0 -8
- package/dist/development/entityEvents/useEntityPersistError.js.map +0 -1
- package/dist/development/entityEvents/useEntityPersistSuccess.js +0 -8
- package/dist/development/entityEvents/useEntityPersistSuccess.js.map +0 -1
- package/dist/development/entityEvents/useOnConnectionUpdate.js +0 -8
- package/dist/development/entityEvents/useOnConnectionUpdate.js.map +0 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +0 -105
- package/dist/development/helperComponents/DeferredSubTrees.js.map +0 -1
- package/dist/development/helperComponents/EntityView.js +0 -14
- package/dist/development/helperComponents/EntityView.js.map +0 -1
- package/dist/development/helperComponents/FieldView.js +0 -61
- package/dist/development/helperComponents/FieldView.js.map +0 -1
- package/dist/development/helperComponents/If.js +0 -84
- package/dist/development/helperComponents/If.js.map +0 -1
- package/dist/development/helperComponents/StaticRender.js +0 -15
- package/dist/development/helperComponents/StaticRender.js.map +0 -1
- package/dist/development/helperComponents/SugaredField.js +0 -21
- package/dist/development/helperComponents/SugaredField.js.map +0 -1
- package/dist/development/helperComponents/helpers/FilterEvaluator.js +0 -37
- package/dist/development/helperComponents/helpers/FilterEvaluator.js.map +0 -1
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js +0 -40
- package/dist/development/helperComponents/helpers/FilterFieldsCollector.js.map +0 -1
- package/dist/development/helperComponents/helpers/evaluateCondition.js +0 -49
- package/dist/development/helperComponents/helpers/evaluateCondition.js.map +0 -1
- package/dist/production/accessorPropagation/AccessorProvider.js +0 -10
- package/dist/production/accessorPropagation/AccessorProvider.js.map +0 -1
- package/dist/production/accessorPropagation/BindingOperationsContext.js +0 -31
- package/dist/production/accessorPropagation/BindingOperationsContext.js.map +0 -1
- package/dist/production/accessorPropagation/BindingOperationsProvider.js +0 -9
- package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +0 -1
- package/dist/production/accessorPropagation/EntityKeyContext.js +0 -7
- package/dist/production/accessorPropagation/EntityKeyContext.js.map +0 -1
- package/dist/production/accessorPropagation/EntityKeyProvider.js +0 -9
- package/dist/production/accessorPropagation/EntityKeyProvider.js.map +0 -1
- package/dist/production/accessorPropagation/EnvironmentContext.js +0 -37
- package/dist/production/accessorPropagation/EnvironmentContext.js.map +0 -1
- package/dist/production/accessorPropagation/TreeRootIdContext.js +0 -7
- package/dist/production/accessorPropagation/TreeRootIdContext.js.map +0 -1
- package/dist/production/accessorPropagation/TreeRootIdProvider.js +0 -9
- package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +0 -1
- package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js +0 -55
- package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js.map +0 -1
- package/dist/production/accessorPropagation/useBindingOperations.js +0 -7
- package/dist/production/accessorPropagation/useBindingOperations.js.map +0 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js +0 -47
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +0 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js +0 -35
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +0 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js +0 -35
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +0 -1
- package/dist/production/accessorPropagation/useEntity.js +0 -38
- package/dist/production/accessorPropagation/useEntity.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityKey.js +0 -16
- package/dist/production/accessorPropagation/useEntityKey.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityList.js +0 -36
- package/dist/production/accessorPropagation/useEntityList.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityListSubTree.js +0 -19
- package/dist/production/accessorPropagation/useEntityListSubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js +0 -69
- package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js.map +0 -1
- package/dist/production/accessorPropagation/useEntitySubTree.js +0 -19
- package/dist/production/accessorPropagation/useEntitySubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useEntitySubTreeParameters.js +0 -47
- package/dist/production/accessorPropagation/useEntitySubTreeParameters.js.map +0 -1
- package/dist/production/accessorPropagation/useEnvironment.js +0 -9
- package/dist/production/accessorPropagation/useEnvironment.js.map +0 -1
- package/dist/production/accessorPropagation/useExtendTree.js +0 -32
- package/dist/production/accessorPropagation/useExtendTree.js.map +0 -1
- package/dist/production/accessorPropagation/useField.js +0 -36
- package/dist/production/accessorPropagation/useField.js.map +0 -1
- package/dist/production/accessorPropagation/useGetEntityByKey.js +0 -6
- package/dist/production/accessorPropagation/useGetEntityByKey.js.map +0 -1
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js +0 -17
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useGetEntitySubTree.js +0 -17
- package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +0 -1
- package/dist/production/accessorPropagation/useGetTreeFilters.js +0 -6
- package/dist/production/accessorPropagation/useGetTreeFilters.js.map +0 -1
- package/dist/production/accessorPropagation/useHasEntity.js +0 -9
- package/dist/production/accessorPropagation/useHasEntity.js.map +0 -1
- package/dist/production/accessorPropagation/usePersist.js +0 -6
- package/dist/production/accessorPropagation/usePersist.js.map +0 -1
- package/dist/production/accessorPropagation/useTreeRootId.js +0 -7
- package/dist/production/accessorPropagation/useTreeRootId.js.map +0 -1
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js +0 -74
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +0 -1
- package/dist/production/accessorSorting/addEntityAtIndex.js +0 -18
- package/dist/production/accessorSorting/addEntityAtIndex.js.map +0 -1
- package/dist/production/accessorSorting/errors.js +0 -10
- package/dist/production/accessorSorting/errors.js.map +0 -1
- package/dist/production/accessorSorting/moveEntity.js +0 -42
- package/dist/production/accessorSorting/moveEntity.js.map +0 -1
- package/dist/production/accessorSorting/repairEntitiesOrder.js +0 -13
- package/dist/production/accessorSorting/repairEntitiesOrder.js.map +0 -1
- package/dist/production/accessorSorting/sortEntities.js +0 -17
- package/dist/production/accessorSorting/sortEntities.js.map +0 -1
- package/dist/production/accessorSorting/useSortedEntities.js +0 -80
- package/dist/production/accessorSorting/useSortedEntities.js.map +0 -1
- package/dist/production/accessorTree/AccessorTree.js +0 -19
- package/dist/production/accessorTree/AccessorTree.js.map +0 -1
- package/dist/production/accessorTree/AccessorTreeStateContext.js +0 -6
- package/dist/production/accessorTree/AccessorTreeStateContext.js.map +0 -1
- package/dist/production/accessorTree/DirtinessContext.js +0 -7
- package/dist/production/accessorTree/DirtinessContext.js.map +0 -1
- package/dist/production/accessorTree/MutationStateContext.js +0 -7
- package/dist/production/accessorTree/MutationStateContext.js.map +0 -1
- package/dist/production/accessorTree/accessorTreeStateReducer.js +0 -34
- package/dist/production/accessorTree/accessorTreeStateReducer.js.map +0 -1
- package/dist/production/accessorTree/metadataToRequestError.js +0 -15
- package/dist/production/accessorTree/metadataToRequestError.js.map +0 -1
- package/dist/production/accessorTree/useAccessorTreeState.js +0 -14
- package/dist/production/accessorTree/useAccessorTreeState.js.map +0 -1
- package/dist/production/accessorTree/useDataBinding.js +0 -84
- package/dist/production/accessorTree/useDataBinding.js.map +0 -1
- package/dist/production/accessorTree/useDirtinessState.js +0 -7
- package/dist/production/accessorTree/useDirtinessState.js.map +0 -1
- package/dist/production/accessorTree/useMutationState.js +0 -7
- package/dist/production/accessorTree/useMutationState.js.map +0 -1
- package/dist/production/core/IncrementalMarkerBuilder.js +0 -70
- package/dist/production/core/IncrementalMarkerBuilder.js.map +0 -1
- package/dist/production/core/MarkerTreeGenerator.js +0 -95
- package/dist/production/core/MarkerTreeGenerator.js.map +0 -1
- package/dist/production/coreComponents/Component.js +0 -33
- package/dist/production/coreComponents/Component.js.map +0 -1
- package/dist/production/coreComponents/DataBindingProvider.js +0 -20
- package/dist/production/coreComponents/DataBindingProvider.js.map +0 -1
- package/dist/production/coreComponents/Entity.js +0 -16
- package/dist/production/coreComponents/Entity.js.map +0 -1
- package/dist/production/coreComponents/EntityList.js +0 -33
- package/dist/production/coreComponents/EntityList.js.map +0 -1
- package/dist/production/coreComponents/EntityListSubTree.js +0 -46
- package/dist/production/coreComponents/EntityListSubTree.js.map +0 -1
- package/dist/production/coreComponents/EntitySubTree.js +0 -57
- package/dist/production/coreComponents/EntitySubTree.js.map +0 -1
- package/dist/production/coreComponents/Field.js +0 -29
- package/dist/production/coreComponents/Field.js.map +0 -1
- package/dist/production/coreComponents/HasMany.js +0 -30
- package/dist/production/coreComponents/HasMany.js.map +0 -1
- package/dist/production/coreComponents/HasOne.js +0 -30
- package/dist/production/coreComponents/HasOne.js.map +0 -1
- package/dist/production/coreComponents/ParentEntity.js +0 -14
- package/dist/production/coreComponents/ParentEntity.js.map +0 -1
- package/dist/production/entityEvents/useDerivedField.js +0 -42
- package/dist/production/entityEvents/useDerivedField.js.map +0 -1
- package/dist/production/entityEvents/useEntityBeforePersist.js +0 -8
- package/dist/production/entityEvents/useEntityBeforePersist.js.map +0 -1
- package/dist/production/entityEvents/useEntityBeforeUpdate.js +0 -8
- package/dist/production/entityEvents/useEntityBeforeUpdate.js.map +0 -1
- package/dist/production/entityEvents/useEntityEvent.js +0 -32
- package/dist/production/entityEvents/useEntityEvent.js.map +0 -1
- package/dist/production/entityEvents/useEntityPersistError.js +0 -8
- package/dist/production/entityEvents/useEntityPersistError.js.map +0 -1
- package/dist/production/entityEvents/useEntityPersistSuccess.js +0 -8
- package/dist/production/entityEvents/useEntityPersistSuccess.js.map +0 -1
- package/dist/production/entityEvents/useOnConnectionUpdate.js +0 -8
- package/dist/production/entityEvents/useOnConnectionUpdate.js.map +0 -1
- package/dist/production/helperComponents/DeferredSubTrees.js +0 -89
- package/dist/production/helperComponents/DeferredSubTrees.js.map +0 -1
- package/dist/production/helperComponents/EntityView.js +0 -10
- package/dist/production/helperComponents/EntityView.js.map +0 -1
- package/dist/production/helperComponents/FieldView.js +0 -49
- package/dist/production/helperComponents/FieldView.js.map +0 -1
- package/dist/production/helperComponents/If.js +0 -52
- package/dist/production/helperComponents/If.js.map +0 -1
- package/dist/production/helperComponents/StaticRender.js +0 -11
- package/dist/production/helperComponents/StaticRender.js.map +0 -1
- package/dist/production/helperComponents/SugaredField.js +0 -13
- package/dist/production/helperComponents/SugaredField.js.map +0 -1
- package/dist/production/helperComponents/helpers/FilterEvaluator.js +0 -37
- package/dist/production/helperComponents/helpers/FilterEvaluator.js.map +0 -1
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js +0 -40
- package/dist/production/helperComponents/helpers/FilterFieldsCollector.js.map +0 -1
- package/dist/production/helperComponents/helpers/evaluateCondition.js +0 -49
- package/dist/production/helperComponents/helpers/evaluateCondition.js.map +0 -1
- package/dist/types/accessorPropagation/AccessorProvider.d.ts +0 -8
- package/dist/types/accessorPropagation/AccessorProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts +0 -4
- package/dist/types/accessorPropagation/BindingOperationsContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts +0 -8
- package/dist/types/accessorPropagation/BindingOperationsProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts +0 -2
- package/dist/types/accessorPropagation/EntityKeyContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts +0 -7
- package/dist/types/accessorPropagation/EntityKeyProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts +0 -15
- package/dist/types/accessorPropagation/EnvironmentContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts +0 -2
- package/dist/types/accessorPropagation/TreeRootIdContext.d.ts.map +0 -1
- package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts +0 -8
- package/dist/types/accessorPropagation/TreeRootIdProvider.d.ts.map +0 -1
- package/dist/types/accessorPropagation/index.d.ts +0 -28
- package/dist/types/accessorPropagation/index.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts +0 -16
- package/dist/types/accessorPropagation/useAccessorUpdateSubscription.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useBindingOperations.d.ts +0 -3
- package/dist/types/accessorPropagation/useBindingOperations.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts +0 -11
- package/dist/types/accessorPropagation/useDesugaredRelativeEntityList.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts +0 -11
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleEntity.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts +0 -11
- package/dist/types/accessorPropagation/useDesugaredRelativeSingleField.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntity.d.ts +0 -7
- package/dist/types/accessorPropagation/useEntity.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityKey.d.ts +0 -2
- package/dist/types/accessorPropagation/useEntityKey.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityList.d.ts +0 -6
- package/dist/types/accessorPropagation/useEntityList.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityListSubTree.d.ts +0 -6
- package/dist/types/accessorPropagation/useEntityListSubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntityListSubTreeParameters.d.ts +0 -5
- package/dist/types/accessorPropagation/useEntityListSubTreeParameters.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts +0 -6
- package/dist/types/accessorPropagation/useEntitySubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEntitySubTreeParameters.d.ts +0 -5
- package/dist/types/accessorPropagation/useEntitySubTreeParameters.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useEnvironment.d.ts +0 -3
- package/dist/types/accessorPropagation/useEnvironment.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useExtendTree.d.ts +0 -5
- package/dist/types/accessorPropagation/useExtendTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useField.d.ts +0 -6
- package/dist/types/accessorPropagation/useField.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetEntityByKey.d.ts +0 -3
- package/dist/types/accessorPropagation/useGetEntityByKey.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts +0 -5
- package/dist/types/accessorPropagation/useGetEntityListSubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts +0 -5
- package/dist/types/accessorPropagation/useGetEntitySubTree.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useGetTreeFilters.d.ts +0 -3
- package/dist/types/accessorPropagation/useGetTreeFilters.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useHasEntity.d.ts +0 -2
- package/dist/types/accessorPropagation/useHasEntity.d.ts.map +0 -1
- package/dist/types/accessorPropagation/usePersist.d.ts +0 -3
- package/dist/types/accessorPropagation/usePersist.d.ts.map +0 -1
- package/dist/types/accessorPropagation/useTreeRootId.d.ts +0 -3
- package/dist/types/accessorPropagation/useTreeRootId.d.ts.map +0 -1
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts +0 -9
- package/dist/types/accessorSorting/SetOrderFieldOnCreate.d.ts.map +0 -1
- package/dist/types/accessorSorting/SortedEntities.d.ts +0 -9
- package/dist/types/accessorSorting/SortedEntities.d.ts.map +0 -1
- package/dist/types/accessorSorting/addEntityAtIndex.d.ts +0 -4
- package/dist/types/accessorSorting/addEntityAtIndex.d.ts.map +0 -1
- package/dist/types/accessorSorting/errors.d.ts +0 -3
- package/dist/types/accessorSorting/errors.d.ts.map +0 -1
- package/dist/types/accessorSorting/index.d.ts +0 -8
- package/dist/types/accessorSorting/index.d.ts.map +0 -1
- package/dist/types/accessorSorting/moveEntity.d.ts +0 -5
- package/dist/types/accessorSorting/moveEntity.d.ts.map +0 -1
- package/dist/types/accessorSorting/repairEntitiesOrder.d.ts +0 -4
- package/dist/types/accessorSorting/repairEntitiesOrder.d.ts.map +0 -1
- package/dist/types/accessorSorting/sortEntities.d.ts +0 -4
- package/dist/types/accessorSorting/sortEntities.d.ts.map +0 -1
- package/dist/types/accessorSorting/useSortedEntities.d.ts +0 -5
- package/dist/types/accessorSorting/useSortedEntities.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTree.d.ts +0 -14
- package/dist/types/accessorTree/AccessorTree.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeState.d.ts +0 -23
- package/dist/types/accessorTree/AccessorTreeState.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateAction.d.ts +0 -18
- package/dist/types/accessorTree/AccessorTreeStateAction.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts +0 -3
- package/dist/types/accessorTree/AccessorTreeStateContext.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateMetadata.d.ts +0 -4
- package/dist/types/accessorTree/AccessorTreeStateMetadata.d.ts.map +0 -1
- package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts +0 -7
- package/dist/types/accessorTree/AccessorTreeStateOptions.d.ts.map +0 -1
- package/dist/types/accessorTree/DirtinessContext.d.ts +0 -2
- package/dist/types/accessorTree/DirtinessContext.d.ts.map +0 -1
- package/dist/types/accessorTree/MutationRequestResponse.d.ts +0 -52
- package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +0 -1
- package/dist/types/accessorTree/MutationStateContext.d.ts +0 -2
- package/dist/types/accessorTree/MutationStateContext.d.ts.map +0 -1
- package/dist/types/accessorTree/RequestError.d.ts +0 -21
- package/dist/types/accessorTree/RequestError.d.ts.map +0 -1
- package/dist/types/accessorTree/accessorTreeStateReducer.d.ts +0 -4
- package/dist/types/accessorTree/accessorTreeStateReducer.d.ts.map +0 -1
- package/dist/types/accessorTree/metadataToRequestError.d.ts +0 -4
- package/dist/types/accessorTree/metadataToRequestError.d.ts.map +0 -1
- package/dist/types/accessorTree/useAccessorTreeState.d.ts +0 -2
- package/dist/types/accessorTree/useAccessorTreeState.d.ts.map +0 -1
- package/dist/types/accessorTree/useDataBinding.d.ts +0 -4
- package/dist/types/accessorTree/useDataBinding.d.ts.map +0 -1
- package/dist/types/accessorTree/useDirtinessState.d.ts +0 -2
- package/dist/types/accessorTree/useDirtinessState.d.ts.map +0 -1
- package/dist/types/accessorTree/useMutationState.d.ts +0 -2
- package/dist/types/accessorTree/useMutationState.d.ts.map +0 -1
- package/dist/types/core/IncrementalMarkerBuilder.d.ts +0 -7
- package/dist/types/core/IncrementalMarkerBuilder.d.ts.map +0 -1
- package/dist/types/core/MarkerTreeGenerator.d.ts +0 -14
- package/dist/types/core/MarkerTreeGenerator.d.ts.map +0 -1
- package/dist/types/coreComponents/Component.d.ts +0 -13
- package/dist/types/coreComponents/Component.d.ts.map +0 -1
- package/dist/types/coreComponents/DataBindingProvider.d.ts +0 -27
- package/dist/types/coreComponents/DataBindingProvider.d.ts.map +0 -1
- package/dist/types/coreComponents/Entity.d.ts +0 -12
- package/dist/types/coreComponents/Entity.d.ts.map +0 -1
- package/dist/types/coreComponents/EntityList.d.ts +0 -15
- package/dist/types/coreComponents/EntityList.d.ts.map +0 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts +0 -26
- package/dist/types/coreComponents/EntityListSubTree.d.ts.map +0 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts +0 -24
- package/dist/types/coreComponents/EntitySubTree.d.ts.map +0 -1
- package/dist/types/coreComponents/Field.d.ts +0 -14
- package/dist/types/coreComponents/Field.d.ts.map +0 -1
- package/dist/types/coreComponents/HasMany.d.ts +0 -16
- package/dist/types/coreComponents/HasMany.d.ts.map +0 -1
- package/dist/types/coreComponents/HasOne.d.ts +0 -12
- package/dist/types/coreComponents/HasOne.d.ts.map +0 -1
- package/dist/types/coreComponents/MarkerProvider.d.ts +0 -21
- package/dist/types/coreComponents/MarkerProvider.d.ts.map +0 -1
- package/dist/types/coreComponents/ParentEntity.d.ts +0 -10
- package/dist/types/coreComponents/ParentEntity.d.ts.map +0 -1
- package/dist/types/coreComponents/index.d.ts +0 -12
- package/dist/types/coreComponents/index.d.ts.map +0 -1
- package/dist/types/entityEvents/index.d.ts +0 -8
- package/dist/types/entityEvents/index.d.ts.map +0 -1
- package/dist/types/entityEvents/useDerivedField.d.ts +0 -9
- package/dist/types/entityEvents/useDerivedField.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityBeforePersist.d.ts +0 -3
- package/dist/types/entityEvents/useEntityBeforePersist.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityBeforeUpdate.d.ts +0 -3
- package/dist/types/entityEvents/useEntityBeforeUpdate.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityEvent.d.ts +0 -9
- package/dist/types/entityEvents/useEntityEvent.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityPersistError.d.ts +0 -3
- package/dist/types/entityEvents/useEntityPersistError.d.ts.map +0 -1
- package/dist/types/entityEvents/useEntityPersistSuccess.d.ts +0 -3
- package/dist/types/entityEvents/useEntityPersistSuccess.d.ts.map +0 -1
- package/dist/types/entityEvents/useOnConnectionUpdate.d.ts +0 -4
- package/dist/types/entityEvents/useOnConnectionUpdate.d.ts.map +0 -1
- package/dist/types/helperComponents/DeferredSubTrees.d.ts +0 -10
- package/dist/types/helperComponents/DeferredSubTrees.d.ts.map +0 -1
- package/dist/types/helperComponents/EntityView.d.ts +0 -12
- package/dist/types/helperComponents/EntityView.d.ts.map +0 -1
- package/dist/types/helperComponents/FieldView.d.ts +0 -59
- package/dist/types/helperComponents/FieldView.d.ts.map +0 -1
- package/dist/types/helperComponents/If.d.ts +0 -17
- package/dist/types/helperComponents/If.d.ts.map +0 -1
- package/dist/types/helperComponents/StaticRender.d.ts +0 -9
- package/dist/types/helperComponents/StaticRender.d.ts.map +0 -1
- package/dist/types/helperComponents/SugaredField.d.ts +0 -12
- package/dist/types/helperComponents/SugaredField.d.ts.map +0 -1
- package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts +0 -9
- package/dist/types/helperComponents/helpers/FilterEvaluator.d.ts.map +0 -1
- package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts +0 -10
- package/dist/types/helperComponents/helpers/FilterFieldsCollector.d.ts.map +0 -1
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts +0 -4
- package/dist/types/helperComponents/helpers/evaluateCondition.d.ts.map +0 -1
- package/dist/types/helperComponents/index.d.ts +0 -7
- package/dist/types/helperComponents/index.d.ts.map +0 -1
- package/src/accessorPropagation/AccessorProvider.tsx +0 -17
- package/src/accessorPropagation/BindingOperationsContext.ts +0 -32
- package/src/accessorPropagation/BindingOperationsProvider.tsx +0 -16
- package/src/accessorPropagation/EntityKeyContext.ts +0 -4
- package/src/accessorPropagation/EntityKeyProvider.tsx +0 -11
- package/src/accessorPropagation/EnvironmentContext.tsx +0 -44
- package/src/accessorPropagation/TreeRootIdContext.ts +0 -5
- package/src/accessorPropagation/TreeRootIdProvider.tsx +0 -12
- package/src/accessorPropagation/index.ts +0 -30
- package/src/accessorPropagation/useAccessorUpdateSubscription.ts +0 -107
- package/src/accessorPropagation/useBindingOperations.ts +0 -5
- package/src/accessorPropagation/useDesugaredRelativeEntityList.ts +0 -70
- package/src/accessorPropagation/useDesugaredRelativeSingleEntity.ts +0 -58
- package/src/accessorPropagation/useDesugaredRelativeSingleField.ts +0 -58
- package/src/accessorPropagation/useEntity.ts +0 -56
- package/src/accessorPropagation/useEntityKey.ts +0 -15
- package/src/accessorPropagation/useEntityList.ts +0 -49
- package/src/accessorPropagation/useEntityListSubTree.ts +0 -27
- package/src/accessorPropagation/useEntityListSubTreeParameters.ts +0 -88
- package/src/accessorPropagation/useEntitySubTree.ts +0 -26
- package/src/accessorPropagation/useEntitySubTreeParameters.ts +0 -66
- package/src/accessorPropagation/useEnvironment.ts +0 -7
- package/src/accessorPropagation/useExtendTree.ts +0 -30
- package/src/accessorPropagation/useField.ts +0 -51
- package/src/accessorPropagation/useGetEntityByKey.ts +0 -4
- package/src/accessorPropagation/useGetEntityListSubTree.ts +0 -28
- package/src/accessorPropagation/useGetEntitySubTree.ts +0 -28
- package/src/accessorPropagation/useGetTreeFilters.ts +0 -4
- package/src/accessorPropagation/useHasEntity.ts +0 -6
- package/src/accessorPropagation/usePersist.ts +0 -4
- package/src/accessorPropagation/useTreeRootId.ts +0 -5
- package/src/accessorSorting/SetOrderFieldOnCreate.tsx +0 -92
- package/src/accessorSorting/SortedEntities.ts +0 -9
- package/src/accessorSorting/addEntityAtIndex.ts +0 -27
- package/src/accessorSorting/errors.ts +0 -9
- package/src/accessorSorting/index.ts +0 -9
- package/src/accessorSorting/moveEntity.ts +0 -66
- package/src/accessorSorting/repairEntitiesOrder.ts +0 -15
- package/src/accessorSorting/sortEntities.ts +0 -20
- package/src/accessorSorting/useSortedEntities.ts +0 -102
- package/src/accessorTree/AccessorTree.tsx +0 -37
- package/src/accessorTree/AccessorTreeState.ts +0 -29
- package/src/accessorTree/AccessorTreeStateAction.ts +0 -21
- package/src/accessorTree/AccessorTreeStateContext.ts +0 -4
- package/src/accessorTree/AccessorTreeStateMetadata.ts +0 -3
- package/src/accessorTree/AccessorTreeStateOptions.ts +0 -7
- package/src/accessorTree/DirtinessContext.ts +0 -4
- package/src/accessorTree/MutationRequestResponse.ts +0 -64
- package/src/accessorTree/MutationStateContext.ts +0 -4
- package/src/accessorTree/RequestError.ts +0 -22
- package/src/accessorTree/accessorTreeStateReducer.ts +0 -36
- package/src/accessorTree/metadataToRequestError.ts +0 -14
- package/src/accessorTree/useAccessorTreeState.ts +0 -11
- package/src/accessorTree/useDataBinding.ts +0 -104
- package/src/accessorTree/useDirtinessState.ts +0 -4
- package/src/accessorTree/useMutationState.ts +0 -4
- package/src/core/IncrementalMarkerBuilder.ts +0 -60
- package/src/core/MarkerTreeGenerator.ts +0 -121
- package/src/coreComponents/Component.tsx +0 -74
- package/src/coreComponents/DataBindingProvider.tsx +0 -54
- package/src/coreComponents/Entity.tsx +0 -26
- package/src/coreComponents/EntityList.tsx +0 -55
- package/src/coreComponents/EntityListSubTree.tsx +0 -83
- package/src/coreComponents/EntitySubTree.tsx +0 -93
- package/src/coreComponents/Field.tsx +0 -46
- package/src/coreComponents/HasMany.tsx +0 -47
- package/src/coreComponents/HasOne.tsx +0 -41
- package/src/coreComponents/MarkerProvider.ts +0 -59
- package/src/coreComponents/ParentEntity.tsx +0 -20
- package/src/coreComponents/index.ts +0 -11
- package/src/entityEvents/index.ts +0 -7
- package/src/entityEvents/useDerivedField.ts +0 -64
- package/src/entityEvents/useEntityBeforePersist.ts +0 -6
- package/src/entityEvents/useEntityBeforeUpdate.ts +0 -6
- package/src/entityEvents/useEntityEvent.ts +0 -57
- package/src/entityEvents/useEntityPersistError.ts +0 -6
- package/src/entityEvents/useEntityPersistSuccess.ts +0 -6
- package/src/entityEvents/useOnConnectionUpdate.ts +0 -10
- package/src/helperComponents/DeferredSubTrees.tsx +0 -126
- package/src/helperComponents/EntityView.tsx +0 -19
- package/src/helperComponents/FieldView.tsx +0 -142
- package/src/helperComponents/If.tsx +0 -74
- package/src/helperComponents/StaticRender.tsx +0 -15
- package/src/helperComponents/SugaredField.tsx +0 -18
- package/src/helperComponents/helpers/FilterEvaluator.ts +0 -46
- package/src/helperComponents/helpers/FilterFieldsCollector.ts +0 -46
- package/src/helperComponents/helpers/evaluateCondition.ts +0 -52
- package/src/helperComponents/index.ts +0 -6
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const client = require("@contember/client");
|
|
4
|
+
const BindingError = require("../BindingError.cjs");
|
|
5
|
+
class TreeParameterMerger {
|
|
6
|
+
static mergeHasOneRelationsWithSamePlaceholders(original, fresh) {
|
|
7
|
+
return {
|
|
8
|
+
// Encoded within the placeholder
|
|
9
|
+
field: original.field,
|
|
10
|
+
filter: original.filter,
|
|
11
|
+
reducedBy: original.reducedBy,
|
|
12
|
+
// Not encoded within the placeholder
|
|
13
|
+
expectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),
|
|
14
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),
|
|
15
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
16
|
+
// forceCreation: original.forceCreation || fresh.forceCreation,
|
|
17
|
+
eventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static mergeHasManyRelationsWithSamePlaceholders(original, fresh) {
|
|
21
|
+
if (original.initialEntityCount !== fresh.initialEntityCount) {
|
|
22
|
+
throw new BindingError.BindingError(
|
|
23
|
+
`Detected hasMany relations on the same field '${original.field}' with different preferred initial entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
// Encoded within the placeholder
|
|
28
|
+
field: original.field,
|
|
29
|
+
filter: original.filter,
|
|
30
|
+
orderBy: original.orderBy,
|
|
31
|
+
offset: original.offset,
|
|
32
|
+
limit: original.limit,
|
|
33
|
+
// Not encoded within the placeholder
|
|
34
|
+
expectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),
|
|
35
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),
|
|
36
|
+
// forceCreation: original.forceCreation || fresh.forceCreation,
|
|
37
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
38
|
+
initialEntityCount: original.initialEntityCount,
|
|
39
|
+
// Handled above
|
|
40
|
+
childEventListeners: this.mergeSingleEntityEventListeners(
|
|
41
|
+
original.childEventListeners,
|
|
42
|
+
fresh.childEventListeners
|
|
43
|
+
),
|
|
44
|
+
eventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static mergeEntitySubTreeParametersWithSamePlaceholders(original, fresh) {
|
|
48
|
+
if (original.isCreating) {
|
|
49
|
+
if (!fresh.isCreating) {
|
|
50
|
+
throw new BindingError.BindingError();
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
// Encoded within the placeholder
|
|
54
|
+
isCreating: original.isCreating,
|
|
55
|
+
isUnpersisted: original.isUnpersisted && fresh.isUnpersisted,
|
|
56
|
+
entityName: original.entityName,
|
|
57
|
+
// Not encoded within the placeholder
|
|
58
|
+
alias: this.mergeSubTreeAliases(original.alias, fresh.alias),
|
|
59
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),
|
|
60
|
+
// forceCreation: original.value.forceCreation || fresh.value.forceCreation,
|
|
61
|
+
expectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),
|
|
62
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
63
|
+
hasOneRelationPath: original.hasOneRelationPath,
|
|
64
|
+
// TODO this is completely wrong.
|
|
65
|
+
eventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners)
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
// Encoded within the placeholder
|
|
70
|
+
isCreating: original.isCreating,
|
|
71
|
+
where: original.where,
|
|
72
|
+
entityName: original.entityName,
|
|
73
|
+
filter: original.filter,
|
|
74
|
+
// Not encoded within the placeholder
|
|
75
|
+
alias: this.mergeSubTreeAliases(original.alias, fresh.alias),
|
|
76
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),
|
|
77
|
+
// forceCreation: original.value.forceCreation || fresh.value.forceCreation,
|
|
78
|
+
expectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),
|
|
79
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
80
|
+
hasOneRelationPath: original.hasOneRelationPath,
|
|
81
|
+
// TODO this is completely wrong.
|
|
82
|
+
eventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
static mergeEntityListSubTreeParametersWithSamePlaceholders(original, fresh) {
|
|
86
|
+
if (original.initialEntityCount !== fresh.initialEntityCount) {
|
|
87
|
+
throw new BindingError.BindingError(
|
|
88
|
+
`Detected sub trees of the same entity '${original.entityName}' with different preferred initial entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
if (original.isCreating) {
|
|
92
|
+
if (!fresh.isCreating) {
|
|
93
|
+
throw new BindingError.BindingError();
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
// Encoded within the placeholder
|
|
97
|
+
isCreating: original.isCreating,
|
|
98
|
+
isUnpersisted: original.isUnpersisted && fresh.isUnpersisted,
|
|
99
|
+
entityName: original.entityName,
|
|
100
|
+
// Not encoded within the placeholder
|
|
101
|
+
alias: this.mergeSubTreeAliases(original.alias, fresh.alias),
|
|
102
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),
|
|
103
|
+
// forceCreation: original.value.forceCreation || fresh.value.forceCreation,
|
|
104
|
+
expectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),
|
|
105
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
106
|
+
hasOneRelationPath: original.hasOneRelationPath,
|
|
107
|
+
// TODO this is completely wrong.
|
|
108
|
+
childEventListeners: this.mergeSingleEntityEventListeners(
|
|
109
|
+
original.childEventListeners,
|
|
110
|
+
fresh.childEventListeners
|
|
111
|
+
),
|
|
112
|
+
eventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),
|
|
113
|
+
initialEntityCount: original.initialEntityCount
|
|
114
|
+
// Handled above
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
// Encoded within the placeholder
|
|
119
|
+
isCreating: original.isCreating,
|
|
120
|
+
entityName: original.entityName,
|
|
121
|
+
filter: original.filter,
|
|
122
|
+
orderBy: original.orderBy,
|
|
123
|
+
offset: original.offset,
|
|
124
|
+
limit: original.limit,
|
|
125
|
+
// Not encoded within the placeholder
|
|
126
|
+
alias: this.mergeSubTreeAliases(original.alias, fresh.alias),
|
|
127
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),
|
|
128
|
+
// forceCreation: original.value.forceCreation || fresh.value.forceCreation,
|
|
129
|
+
expectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),
|
|
130
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
131
|
+
hasOneRelationPath: original.hasOneRelationPath,
|
|
132
|
+
// TODO this is completely wrong.
|
|
133
|
+
childEventListeners: this.mergeSingleEntityEventListeners(
|
|
134
|
+
original.childEventListeners,
|
|
135
|
+
fresh.childEventListeners
|
|
136
|
+
),
|
|
137
|
+
eventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),
|
|
138
|
+
initialEntityCount: original.initialEntityCount
|
|
139
|
+
// Handled above
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
static mergeEntityCreationParameters(original, fresh) {
|
|
143
|
+
return {
|
|
144
|
+
// forceCreation: original.forceCreation || fresh.forceCreation,
|
|
145
|
+
isNonbearing: original.isNonbearing && fresh.isNonbearing,
|
|
146
|
+
setOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate)
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
static mergeSetOnCreate(original, fresh) {
|
|
150
|
+
if (original === void 0 && fresh === void 0) {
|
|
151
|
+
return void 0;
|
|
152
|
+
}
|
|
153
|
+
if (original === void 0) {
|
|
154
|
+
return fresh;
|
|
155
|
+
}
|
|
156
|
+
if (fresh === void 0) {
|
|
157
|
+
return original;
|
|
158
|
+
}
|
|
159
|
+
const originalCopy = { ...original };
|
|
160
|
+
for (const field in fresh) {
|
|
161
|
+
if (field in originalCopy) {
|
|
162
|
+
const fromOriginal = originalCopy[field];
|
|
163
|
+
const fromFresh = fresh[field];
|
|
164
|
+
if (fromOriginal instanceof client.GraphQlBuilder.GraphQlLiteral) {
|
|
165
|
+
if (fromFresh instanceof client.GraphQlBuilder.GraphQlLiteral) {
|
|
166
|
+
if (fromOriginal.value === fromFresh.value) {
|
|
167
|
+
continue;
|
|
168
|
+
} else {
|
|
169
|
+
throw new BindingError.BindingError();
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
throw new BindingError.BindingError();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (typeof fromOriginal === "object") {
|
|
176
|
+
if (fromFresh instanceof client.GraphQlBuilder.GraphQlLiteral) {
|
|
177
|
+
throw new BindingError.BindingError();
|
|
178
|
+
} else if (typeof fromFresh === "object") {
|
|
179
|
+
const merged = this.mergeSetOnCreate(fromOriginal, fromFresh);
|
|
180
|
+
if (merged !== void 0) {
|
|
181
|
+
originalCopy[field] = merged;
|
|
182
|
+
}
|
|
183
|
+
continue;
|
|
184
|
+
} else {
|
|
185
|
+
throw new BindingError.BindingError();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (typeof fromFresh === "string" || typeof fromFresh === "number") {
|
|
189
|
+
if (fromOriginal === fromFresh) {
|
|
190
|
+
continue;
|
|
191
|
+
} else {
|
|
192
|
+
throw new BindingError.BindingError();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
throw new BindingError.BindingError();
|
|
196
|
+
} else {
|
|
197
|
+
originalCopy[field] = fresh[field];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return originalCopy;
|
|
201
|
+
}
|
|
202
|
+
static mergeSets(original, fresh) {
|
|
203
|
+
const combinedSet = new Set(original);
|
|
204
|
+
for (const item of fresh) {
|
|
205
|
+
combinedSet.add(item);
|
|
206
|
+
}
|
|
207
|
+
return combinedSet;
|
|
208
|
+
}
|
|
209
|
+
static mergeParentEntityParameters(original, fresh) {
|
|
210
|
+
if (original === fresh) {
|
|
211
|
+
return original;
|
|
212
|
+
}
|
|
213
|
+
if (original === void 0) {
|
|
214
|
+
return fresh;
|
|
215
|
+
}
|
|
216
|
+
if (fresh === void 0) {
|
|
217
|
+
return original;
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
eventListeners: TreeParameterMerger.mergeSingleEntityEventListeners(
|
|
221
|
+
original.eventListeners,
|
|
222
|
+
fresh.eventListeners
|
|
223
|
+
)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
static mergeInParentEntity(original, key, parentEntity) {
|
|
227
|
+
if (!parentEntity) {
|
|
228
|
+
return original;
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
...original,
|
|
232
|
+
[key]: TreeParameterMerger.mergeSingleEntityEventListeners(original[key], parentEntity.eventListeners)
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
static mergeSingleEntityEventListeners(original, fresh) {
|
|
236
|
+
if (original === void 0) {
|
|
237
|
+
if (fresh === void 0) {
|
|
238
|
+
return void 0;
|
|
239
|
+
}
|
|
240
|
+
return this.cloneSingleEntityEventListeners(fresh);
|
|
241
|
+
}
|
|
242
|
+
if (fresh === void 0) {
|
|
243
|
+
return this.cloneSingleEntityEventListeners(original);
|
|
244
|
+
}
|
|
245
|
+
const store = this.cloneSingleEntityEventListeners(original);
|
|
246
|
+
store.append(fresh);
|
|
247
|
+
return store;
|
|
248
|
+
}
|
|
249
|
+
static mergeEntityListEventListeners(original, fresh) {
|
|
250
|
+
if (original === void 0) {
|
|
251
|
+
if (fresh === void 0) {
|
|
252
|
+
return void 0;
|
|
253
|
+
}
|
|
254
|
+
return this.cloneEntityListEventListeners(fresh);
|
|
255
|
+
}
|
|
256
|
+
if (fresh === void 0) {
|
|
257
|
+
return this.cloneEntityListEventListeners(original);
|
|
258
|
+
}
|
|
259
|
+
const store = this.cloneEntityListEventListeners(original);
|
|
260
|
+
store.append(fresh);
|
|
261
|
+
return store;
|
|
262
|
+
}
|
|
263
|
+
static cloneSingleEntityEventListeners(store) {
|
|
264
|
+
return store.clone();
|
|
265
|
+
}
|
|
266
|
+
static cloneEntityListEventListeners(store) {
|
|
267
|
+
return store.cloneDeep();
|
|
268
|
+
}
|
|
269
|
+
static mergeExpectedRelationMutation(original, fresh) {
|
|
270
|
+
if (original === fresh) {
|
|
271
|
+
return original;
|
|
272
|
+
}
|
|
273
|
+
if (original === "none") {
|
|
274
|
+
return fresh;
|
|
275
|
+
}
|
|
276
|
+
if (fresh === "none") {
|
|
277
|
+
return original;
|
|
278
|
+
}
|
|
279
|
+
return "anyMutation";
|
|
280
|
+
}
|
|
281
|
+
static mergeExpectedQualifiedEntityMutation(original, fresh) {
|
|
282
|
+
if (original === fresh) {
|
|
283
|
+
return original;
|
|
284
|
+
}
|
|
285
|
+
if (original === "none") {
|
|
286
|
+
return fresh;
|
|
287
|
+
}
|
|
288
|
+
if (fresh === "none") {
|
|
289
|
+
return original;
|
|
290
|
+
}
|
|
291
|
+
return "anyMutation";
|
|
292
|
+
}
|
|
293
|
+
static mergeSubTreeAliases(original, fresh) {
|
|
294
|
+
if (original === void 0) {
|
|
295
|
+
return fresh;
|
|
296
|
+
}
|
|
297
|
+
if (fresh === void 0) {
|
|
298
|
+
return original;
|
|
299
|
+
}
|
|
300
|
+
return this.mergeSets(original, fresh);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
exports.TreeParameterMerger = TreeParameterMerger;
|
|
304
|
+
//# sourceMappingURL=TreeParameterMerger.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeParameterMerger.cjs","sources":["../../../src/core/TreeParameterMerger.ts"],"sourcesContent":["import { GraphQlBuilder, Writable } from '@contember/client'\nimport { BindingError } from '../BindingError'\nimport type {\n\tAlias,\n\tEntityCreationParameters,\n\tEntityEventListenerStore,\n\tEntityListEventListenerStore,\n\tExpectedQualifiedEntityMutation,\n\tExpectedRelationMutation,\n\tHasManyRelation,\n\tHasOneRelation,\n\tParentEntityParameters,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tSetOnCreate,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n\tUniqueWhere,\n} from '../treeParameters'\n\nexport class TreeParameterMerger {\n\tpublic static mergeHasOneRelationsWithSamePlaceholders(\n\t\toriginal: HasOneRelation,\n\t\tfresh: HasOneRelation,\n\t): HasOneRelation {\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tfield: original.field,\n\t\t\tfilter: original.filter,\n\t\t\treducedBy: original.reducedBy,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\texpectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeHasManyRelationsWithSamePlaceholders(\n\t\toriginal: HasManyRelation,\n\t\tfresh: HasManyRelation,\n\t): HasManyRelation {\n\t\tif (original.initialEntityCount !== fresh.initialEntityCount) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Detected hasMany relations on the same field '${original.field}' with different preferred initial ` +\n\t\t\t\t\t`entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`,\n\t\t\t)\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tfield: original.field,\n\t\t\tfilter: original.filter,\n\t\t\torderBy: original.orderBy,\n\t\t\toffset: original.offset,\n\t\t\tlimit: original.limit,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\texpectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.childEventListeners,\n\t\t\t\tfresh.childEventListeners,\n\t\t\t),\n\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeEntitySubTreeParametersWithSamePlaceholders(\n\t\toriginal: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tfresh: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t): QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity {\n\t\tif (original.isCreating) {\n\t\t\tif (!fresh.isCreating) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t// Encoded within the placeholder\n\t\t\t\tisCreating: original.isCreating,\n\t\t\t\tisUnpersisted: original.isUnpersisted && fresh.isUnpersisted,\n\t\t\t\tentityName: original.entityName,\n\n\t\t\t\t// Not encoded within the placeholder\n\t\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tisCreating: original.isCreating,\n\t\t\twhere: original.where,\n\t\t\tentityName: original.entityName,\n\t\t\tfilter: original.filter,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeEntityListSubTreeParametersWithSamePlaceholders(\n\t\toriginal: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tfresh: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t): QualifiedEntityList | UnconstrainedQualifiedEntityList {\n\t\tif (original.initialEntityCount !== fresh.initialEntityCount) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Detected sub trees of the same entity '${original.entityName}' with different preferred initial ` +\n\t\t\t\t\t`entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`,\n\t\t\t)\n\t\t}\n\n\t\tif (original.isCreating) {\n\t\t\tif (!fresh.isCreating) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t// Encoded within the placeholder\n\t\t\t\tisCreating: original.isCreating,\n\t\t\t\tisUnpersisted: original.isUnpersisted && fresh.isUnpersisted,\n\t\t\t\tentityName: original.entityName,\n\n\t\t\t\t// Not encoded within the placeholder\n\t\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\t\toriginal.childEventListeners,\n\t\t\t\t\tfresh.childEventListeners,\n\t\t\t\t),\n\t\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tisCreating: original.isCreating,\n\t\t\tentityName: original.entityName,\n\t\t\tfilter: original.filter,\n\t\t\torderBy: original.orderBy,\n\t\t\toffset: original.offset,\n\t\t\tlimit: original.limit,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.childEventListeners,\n\t\t\t\tfresh.childEventListeners,\n\t\t\t),\n\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t}\n\t}\n\n\tpublic static mergeEntityCreationParameters(\n\t\toriginal: EntityCreationParameters,\n\t\tfresh: EntityCreationParameters,\n\t): EntityCreationParameters {\n\t\treturn {\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t}\n\t}\n\n\tpublic static mergeSetOnCreate(original: SetOnCreate, fresh: SetOnCreate): SetOnCreate {\n\t\tif (original === undefined && fresh === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\tconst originalCopy: Writable<UniqueWhere> = { ...original }\n\n\t\tfor (const field in fresh) {\n\t\t\tif (field in originalCopy) {\n\t\t\t\tconst fromOriginal = originalCopy[field]\n\t\t\t\tconst fromFresh = fresh[field]\n\n\t\t\t\tif (fromOriginal instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\tif (fromFresh instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\t\tif (fromOriginal.value === fromFresh.value) {\n\t\t\t\t\t\t\t// Good, do nothing.\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof fromOriginal === 'object') {\n\t\t\t\t\tif (fromFresh instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t} else if (typeof fromFresh === 'object') {\n\t\t\t\t\t\tconst merged = this.mergeSetOnCreate(fromOriginal, fromFresh)\n\t\t\t\t\t\tif (merged !== undefined) {\n\t\t\t\t\t\t\toriginalCopy[field] = merged\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof fromFresh === 'string' || typeof fromFresh === 'number') {\n\t\t\t\t\tif (fromOriginal === fromFresh) {\n\t\t\t\t\t\t// Good, do nothing.\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t} else {\n\t\t\t\toriginalCopy[field] = fresh[field]\n\t\t\t}\n\t\t}\n\n\t\treturn originalCopy\n\t}\n\n\tprivate static mergeSets<T>(original: Set<T>, fresh: Set<T>): Set<T> {\n\t\tconst combinedSet = new Set(original)\n\t\tfor (const item of fresh) {\n\t\t\tcombinedSet.add(item)\n\t\t}\n\t\treturn combinedSet\n\t}\n\n\tpublic static mergeParentEntityParameters(\n\t\toriginal: ParentEntityParameters | undefined,\n\t\tfresh: ParentEntityParameters | undefined,\n\t): ParentEntityParameters | undefined {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\treturn {\n\t\t\teventListeners: TreeParameterMerger.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.eventListeners,\n\t\t\t\tfresh.eventListeners,\n\t\t\t),\n\t\t}\n\t}\n\n\tpublic static mergeInParentEntity<\n\t\tOriginal extends Record<Key, EntityEventListenerStore | undefined>,\n\t\tKey extends keyof Original,\n\t>(original: Original, key: Key, parentEntity: ParentEntityParameters | undefined): Original {\n\t\tif (!parentEntity) {\n\t\t\treturn original\n\t\t}\n\n\t\treturn {\n\t\t\t...original,\n\t\t\t[key]: TreeParameterMerger.mergeSingleEntityEventListeners(original[key], parentEntity.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeSingleEntityEventListeners(\n\t\toriginal: EntityEventListenerStore | undefined,\n\t\tfresh: EntityEventListenerStore | undefined,\n\t): EntityEventListenerStore | undefined {\n\t\tif (original === undefined) {\n\t\t\tif (fresh === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.cloneSingleEntityEventListeners(fresh)\n\t\t}\n\n\t\tif (fresh === undefined) {\n\t\t\treturn this.cloneSingleEntityEventListeners(original)\n\t\t}\n\n\t\tconst store = this.cloneSingleEntityEventListeners(original)\n\t\tstore.append(fresh)\n\t\treturn store\n\t}\n\n\tpublic static mergeEntityListEventListeners(\n\t\toriginal: EntityListEventListenerStore | undefined,\n\t\tfresh: EntityListEventListenerStore | undefined,\n\t): EntityListEventListenerStore | undefined {\n\t\tif (original === undefined) {\n\t\t\tif (fresh === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.cloneEntityListEventListeners(fresh)\n\t\t}\n\n\t\tif (fresh === undefined) {\n\t\t\treturn this.cloneEntityListEventListeners(original)\n\t\t}\n\n\t\tconst store = this.cloneEntityListEventListeners(original)\n\t\tstore.append(fresh)\n\t\treturn store\n\t}\n\n\tpublic static cloneSingleEntityEventListeners(store: EntityEventListenerStore): EntityEventListenerStore {\n\t\t// TODO is intentional, that second clone is deep?\n\t\treturn store.clone()\n\t}\n\n\tpublic static cloneEntityListEventListeners(store: EntityListEventListenerStore): EntityListEventListenerStore {\n\t\treturn store.cloneDeep()\n\t}\n\n\tprivate static mergeExpectedRelationMutation(\n\t\toriginal: ExpectedRelationMutation,\n\t\tfresh: ExpectedRelationMutation,\n\t): ExpectedRelationMutation {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === 'none') {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === 'none') {\n\t\t\treturn original\n\t\t}\n\t\treturn 'anyMutation'\n\t}\n\n\tprivate static mergeExpectedQualifiedEntityMutation(\n\t\toriginal: ExpectedQualifiedEntityMutation,\n\t\tfresh: ExpectedQualifiedEntityMutation,\n\t): ExpectedQualifiedEntityMutation {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === 'none') {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === 'none') {\n\t\t\treturn original\n\t\t}\n\t\treturn 'anyMutation'\n\t}\n\n\tprivate static mergeSubTreeAliases(\n\t\toriginal: Set<Alias> | undefined,\n\t\tfresh: Set<Alias> | undefined,\n\t): Set<Alias> | undefined {\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\treturn this.mergeSets(original, fresh)\n\t}\n}\n"],"names":["BindingError","GraphQlBuilder"],"mappings":";;;;AAoBO,MAAM,oBAAoB;AAAA,EAChC,OAAc,yCACb,UACA,OACiB;AACV,WAAA;AAAA;AAAA,MAEN,OAAO,SAAS;AAAA,MAChB,QAAQ,SAAS;AAAA,MACjB,WAAW,SAAS;AAAA;AAAA,MAGpB,kBAAkB,KAAK,8BAA8B,SAAS,kBAAkB,MAAM,gBAAgB;AAAA,MACtG,aAAa,KAAK,iBAAiB,SAAS,aAAa,MAAM,WAAW;AAAA,MAC1E,cAAc,SAAS,gBAAgB,MAAM;AAAA;AAAA,MAE7C,gBAAgB,KAAK,gCAAgC,SAAS,gBAAgB,MAAM,cAAc;AAAA,IAAA;AAAA,EAEpG;AAAA,EAEA,OAAc,0CACb,UACA,OACkB;AACd,QAAA,SAAS,uBAAuB,MAAM,oBAA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AA;AAAA,IACR;AACA,QAAI,aAAa,QAAQ;AACjB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAQ;AACd,aAAA;AAAA,IACR;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,oBACd,UACA,OACyB;AACzB,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IACR;AACO,WAAA,KAAK,UAAU,UAAU,KAAK;AAAA,EACtC;AACD;;"}
|
|
@@ -44,9 +44,13 @@ class TreeParameterMerger {
|
|
|
44
44
|
}
|
|
45
45
|
static mergeEntitySubTreeParametersWithSamePlaceholders(original, fresh) {
|
|
46
46
|
if (original.isCreating) {
|
|
47
|
+
if (!fresh.isCreating) {
|
|
48
|
+
throw new BindingError();
|
|
49
|
+
}
|
|
47
50
|
return {
|
|
48
51
|
// Encoded within the placeholder
|
|
49
52
|
isCreating: original.isCreating,
|
|
53
|
+
isUnpersisted: original.isUnpersisted && fresh.isUnpersisted,
|
|
50
54
|
entityName: original.entityName,
|
|
51
55
|
// Not encoded within the placeholder
|
|
52
56
|
alias: this.mergeSubTreeAliases(original.alias, fresh.alias),
|
|
@@ -83,9 +87,13 @@ class TreeParameterMerger {
|
|
|
83
87
|
);
|
|
84
88
|
}
|
|
85
89
|
if (original.isCreating) {
|
|
90
|
+
if (!fresh.isCreating) {
|
|
91
|
+
throw new BindingError();
|
|
92
|
+
}
|
|
86
93
|
return {
|
|
87
94
|
// Encoded within the placeholder
|
|
88
95
|
isCreating: original.isCreating,
|
|
96
|
+
isUnpersisted: original.isUnpersisted && fresh.isUnpersisted,
|
|
89
97
|
entityName: original.entityName,
|
|
90
98
|
// Not encoded within the placeholder
|
|
91
99
|
alias: this.mergeSubTreeAliases(original.alias, fresh.alias),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeParameterMerger.js","sources":["../../../src/core/TreeParameterMerger.ts"],"sourcesContent":["import { GraphQlBuilder, Writable } from '@contember/client'\nimport { BindingError } from '../BindingError'\nimport type {\n\tAlias,\n\tEntityCreationParameters,\n\tEntityEventListenerStore,\n\tEntityListEventListenerStore,\n\tExpectedQualifiedEntityMutation,\n\tExpectedRelationMutation,\n\tHasManyRelation,\n\tHasOneRelation,\n\tParentEntityParameters,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tSetOnCreate,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n\tUniqueWhere,\n} from '../treeParameters'\n\nexport class TreeParameterMerger {\n\tpublic static mergeHasOneRelationsWithSamePlaceholders(\n\t\toriginal: HasOneRelation,\n\t\tfresh: HasOneRelation,\n\t): HasOneRelation {\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tfield: original.field,\n\t\t\tfilter: original.filter,\n\t\t\treducedBy: original.reducedBy,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\texpectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeHasManyRelationsWithSamePlaceholders(\n\t\toriginal: HasManyRelation,\n\t\tfresh: HasManyRelation,\n\t): HasManyRelation {\n\t\tif (original.initialEntityCount !== fresh.initialEntityCount) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Detected hasMany relations on the same field '${original.field}' with different preferred initial ` +\n\t\t\t\t\t`entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`,\n\t\t\t)\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tfield: original.field,\n\t\t\tfilter: original.filter,\n\t\t\torderBy: original.orderBy,\n\t\t\toffset: original.offset,\n\t\t\tlimit: original.limit,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\texpectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.childEventListeners,\n\t\t\t\tfresh.childEventListeners,\n\t\t\t),\n\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeEntitySubTreeParametersWithSamePlaceholders(\n\t\toriginal: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tfresh: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t): QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity {\n\t\tif (original.isCreating) {\n\t\t\treturn {\n\t\t\t\t// Encoded within the placeholder\n\t\t\t\tisCreating: original.isCreating,\n\t\t\t\tentityName: original.entityName,\n\n\t\t\t\t// Not encoded within the placeholder\n\t\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tisCreating: original.isCreating,\n\t\t\twhere: original.where,\n\t\t\tentityName: original.entityName,\n\t\t\tfilter: original.filter,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeEntityListSubTreeParametersWithSamePlaceholders(\n\t\toriginal: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tfresh: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t): QualifiedEntityList | UnconstrainedQualifiedEntityList {\n\t\tif (original.initialEntityCount !== fresh.initialEntityCount) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Detected sub trees of the same entity '${original.entityName}' with different preferred initial ` +\n\t\t\t\t\t`entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`,\n\t\t\t)\n\t\t}\n\n\t\tif (original.isCreating) {\n\t\t\treturn {\n\t\t\t\t// Encoded within the placeholder\n\t\t\t\tisCreating: original.isCreating,\n\t\t\t\tentityName: original.entityName,\n\n\t\t\t\t// Not encoded within the placeholder\n\t\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\t\toriginal.childEventListeners,\n\t\t\t\t\tfresh.childEventListeners,\n\t\t\t\t),\n\t\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tisCreating: original.isCreating,\n\t\t\tentityName: original.entityName,\n\t\t\tfilter: original.filter,\n\t\t\torderBy: original.orderBy,\n\t\t\toffset: original.offset,\n\t\t\tlimit: original.limit,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.childEventListeners,\n\t\t\t\tfresh.childEventListeners,\n\t\t\t),\n\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t}\n\t}\n\n\tpublic static mergeEntityCreationParameters(\n\t\toriginal: EntityCreationParameters,\n\t\tfresh: EntityCreationParameters,\n\t): EntityCreationParameters {\n\t\treturn {\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t}\n\t}\n\n\tpublic static mergeSetOnCreate(original: SetOnCreate, fresh: SetOnCreate): SetOnCreate {\n\t\tif (original === undefined && fresh === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\tconst originalCopy: Writable<UniqueWhere> = { ...original }\n\n\t\tfor (const field in fresh) {\n\t\t\tif (field in originalCopy) {\n\t\t\t\tconst fromOriginal = originalCopy[field]\n\t\t\t\tconst fromFresh = fresh[field]\n\n\t\t\t\tif (fromOriginal instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\tif (fromFresh instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\t\tif (fromOriginal.value === fromFresh.value) {\n\t\t\t\t\t\t\t// Good, do nothing.\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof fromOriginal === 'object') {\n\t\t\t\t\tif (fromFresh instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t} else if (typeof fromFresh === 'object') {\n\t\t\t\t\t\tconst merged = this.mergeSetOnCreate(fromOriginal, fromFresh)\n\t\t\t\t\t\tif (merged !== undefined) {\n\t\t\t\t\t\t\toriginalCopy[field] = merged\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof fromFresh === 'string' || typeof fromFresh === 'number') {\n\t\t\t\t\tif (fromOriginal === fromFresh) {\n\t\t\t\t\t\t// Good, do nothing.\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t} else {\n\t\t\t\toriginalCopy[field] = fresh[field]\n\t\t\t}\n\t\t}\n\n\t\treturn originalCopy\n\t}\n\n\tprivate static mergeSets<T>(original: Set<T>, fresh: Set<T>): Set<T> {\n\t\tconst combinedSet = new Set(original)\n\t\tfor (const item of fresh) {\n\t\t\tcombinedSet.add(item)\n\t\t}\n\t\treturn combinedSet\n\t}\n\n\tpublic static mergeParentEntityParameters(\n\t\toriginal: ParentEntityParameters | undefined,\n\t\tfresh: ParentEntityParameters | undefined,\n\t): ParentEntityParameters | undefined {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\treturn {\n\t\t\teventListeners: TreeParameterMerger.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.eventListeners,\n\t\t\t\tfresh.eventListeners,\n\t\t\t),\n\t\t}\n\t}\n\n\tpublic static mergeInParentEntity<\n\t\tOriginal extends Record<Key, EntityEventListenerStore | undefined>,\n\t\tKey extends keyof Original,\n\t>(original: Original, key: Key, parentEntity: ParentEntityParameters | undefined): Original {\n\t\tif (!parentEntity) {\n\t\t\treturn original\n\t\t}\n\n\t\treturn {\n\t\t\t...original,\n\t\t\t[key]: TreeParameterMerger.mergeSingleEntityEventListeners(original[key], parentEntity.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeSingleEntityEventListeners(\n\t\toriginal: EntityEventListenerStore | undefined,\n\t\tfresh: EntityEventListenerStore | undefined,\n\t): EntityEventListenerStore | undefined {\n\t\tif (original === undefined) {\n\t\t\tif (fresh === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.cloneSingleEntityEventListeners(fresh)\n\t\t}\n\n\t\tif (fresh === undefined) {\n\t\t\treturn this.cloneSingleEntityEventListeners(original)\n\t\t}\n\n\t\tconst store = this.cloneSingleEntityEventListeners(original)\n\t\tstore.append(fresh)\n\t\treturn store\n\t}\n\n\tpublic static mergeEntityListEventListeners(\n\t\toriginal: EntityListEventListenerStore | undefined,\n\t\tfresh: EntityListEventListenerStore | undefined,\n\t): EntityListEventListenerStore | undefined {\n\t\tif (original === undefined) {\n\t\t\tif (fresh === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.cloneEntityListEventListeners(fresh)\n\t\t}\n\n\t\tif (fresh === undefined) {\n\t\t\treturn this.cloneEntityListEventListeners(original)\n\t\t}\n\n\t\tconst store = this.cloneEntityListEventListeners(original)\n\t\tstore.append(fresh)\n\t\treturn store\n\t}\n\n\tpublic static cloneSingleEntityEventListeners(store: EntityEventListenerStore): EntityEventListenerStore {\n\t\t// TODO is intentional, that second clone is deep?\n\t\treturn store.clone()\n\t}\n\n\tpublic static cloneEntityListEventListeners(store: EntityListEventListenerStore): EntityListEventListenerStore {\n\t\treturn store.cloneDeep()\n\t}\n\n\tprivate static mergeExpectedRelationMutation(\n\t\toriginal: ExpectedRelationMutation,\n\t\tfresh: ExpectedRelationMutation,\n\t): ExpectedRelationMutation {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === 'none') {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === 'none') {\n\t\t\treturn original\n\t\t}\n\t\treturn 'anyMutation'\n\t}\n\n\tprivate static mergeExpectedQualifiedEntityMutation(\n\t\toriginal: ExpectedQualifiedEntityMutation,\n\t\tfresh: ExpectedQualifiedEntityMutation,\n\t): ExpectedQualifiedEntityMutation {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === 'none') {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === 'none') {\n\t\t\treturn original\n\t\t}\n\t\treturn 'anyMutation'\n\t}\n\n\tprivate static mergeSubTreeAliases(\n\t\toriginal: Set<Alias> | undefined,\n\t\tfresh: Set<Alias> | undefined,\n\t): Set<Alias> | undefined {\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\treturn this.mergeSets(original, fresh)\n\t}\n}\n"],"names":[],"mappings":";;AAoBO,MAAM,oBAAoB;AAAA,EAChC,OAAc,yCACb,UACA,OACiB;AACV,WAAA;AAAA;AAAA,MAEN,OAAO,SAAS;AAAA,MAChB,QAAQ,SAAS;AAAA,MACjB,WAAW,SAAS;AAAA;AAAA,MAGpB,kBAAkB,KAAK,8BAA8B,SAAS,kBAAkB,MAAM,gBAAgB;AAAA,MACtG,aAAa,KAAK,iBAAiB,SAAS,aAAa,MAAM,WAAW;AAAA,MAC1E,cAAc,SAAS,gBAAgB,MAAM;AAAA;AAAA,MAE7C,gBAAgB,KAAK,gCAAgC,SAAS,gBAAgB,MAAM,cAAc;AAAA,IAAA;AAAA,EAEpG;AAAA,EAEA,OAAc,0CACb,UACA,OACkB;AACd,QAAA,SAAS,uBAAuB,MAAM,oBAAoB;AAC7D,YAAM,IAAI;AAAA,QACT,iDAAiD,SAAS,2DACtC,SAAS,4BAA4B,MAAM;AAAA,MAAA;AAAA,IAEjE;AACO,WAAA;AAAA;AAAA,MAEN,OAAO,SAAS;AAAA,MAChB,QAAQ,SAAS;AAAA,MACjB,SAAS,SAAS;AAAA,MAClB,QAAQ,SAAS;AAAA,MACjB,OAAO,SAAS;AAAA;AAAA,MAGhB,kBAAkB,KAAK,8BAA8B,SAAS,kBAAkB,MAAM,gBAAgB;AAAA,MACtG,aAAa,KAAK,iBAAiB,SAAS,aAAa,MAAM,WAAW;AAAA;AAAA,MAE1E,cAAc,SAAS,gBAAgB,MAAM;AAAA,MAC7C,oBAAoB,SAAS;AAAA;AAAA,MAC7B,qBAAqB,KAAK;AAAA,QACzB,SAAS;AAAA,QACT,MAAM;AAA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AAQ;AACzD,UAAM,OAAO,KAAK;AACX,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,gCAAgC,OAA2D;AAExG,WAAO,MAAM;EACd;AAAA,EAEA,OAAc,8BAA8B,OAAmE;AAC9G,WAAO,MAAM;EACd;AAAA,EAEA,OAAe,8BACd,UACA,OAC2B;AAC3B,QAAI,aAAa,OAAO;AAChB,aAAA;AAAA,IACR;AACA,QAAI,aAAa,QAAQ;AACjB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAQ;AACd,aAAA;AAAA,IACR;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,qCACd,UACA,OACkC;AAClC,QAAI,aAAa,OAAO;AAChB,aAAA;AAAA,IACR;AACA,QAAI,aAAa,QAAQ;AACjB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAQ;AACd,aAAA;AAAA,IACR;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,oBACd,UACA,OACyB;AACzB,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IACR;AACO,WAAA,KAAK,UAAU,UAAU,KAAK;AAAA,EACtC;AACD;"}
|
|
1
|
+
{"version":3,"file":"TreeParameterMerger.js","sources":["../../../src/core/TreeParameterMerger.ts"],"sourcesContent":["import { GraphQlBuilder, Writable } from '@contember/client'\nimport { BindingError } from '../BindingError'\nimport type {\n\tAlias,\n\tEntityCreationParameters,\n\tEntityEventListenerStore,\n\tEntityListEventListenerStore,\n\tExpectedQualifiedEntityMutation,\n\tExpectedRelationMutation,\n\tHasManyRelation,\n\tHasOneRelation,\n\tParentEntityParameters,\n\tQualifiedEntityList,\n\tQualifiedSingleEntity,\n\tSetOnCreate,\n\tUnconstrainedQualifiedEntityList,\n\tUnconstrainedQualifiedSingleEntity,\n\tUniqueWhere,\n} from '../treeParameters'\n\nexport class TreeParameterMerger {\n\tpublic static mergeHasOneRelationsWithSamePlaceholders(\n\t\toriginal: HasOneRelation,\n\t\tfresh: HasOneRelation,\n\t): HasOneRelation {\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tfield: original.field,\n\t\t\tfilter: original.filter,\n\t\t\treducedBy: original.reducedBy,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\texpectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeHasManyRelationsWithSamePlaceholders(\n\t\toriginal: HasManyRelation,\n\t\tfresh: HasManyRelation,\n\t): HasManyRelation {\n\t\tif (original.initialEntityCount !== fresh.initialEntityCount) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Detected hasMany relations on the same field '${original.field}' with different preferred initial ` +\n\t\t\t\t\t`entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`,\n\t\t\t)\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tfield: original.field,\n\t\t\tfilter: original.filter,\n\t\t\torderBy: original.orderBy,\n\t\t\toffset: original.offset,\n\t\t\tlimit: original.limit,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\texpectedMutation: this.mergeExpectedRelationMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.childEventListeners,\n\t\t\t\tfresh.childEventListeners,\n\t\t\t),\n\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeEntitySubTreeParametersWithSamePlaceholders(\n\t\toriginal: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t\tfresh: QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity,\n\t): QualifiedSingleEntity | UnconstrainedQualifiedSingleEntity {\n\t\tif (original.isCreating) {\n\t\t\tif (!fresh.isCreating) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t// Encoded within the placeholder\n\t\t\t\tisCreating: original.isCreating,\n\t\t\t\tisUnpersisted: original.isUnpersisted && fresh.isUnpersisted,\n\t\t\t\tentityName: original.entityName,\n\n\t\t\t\t// Not encoded within the placeholder\n\t\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tisCreating: original.isCreating,\n\t\t\twhere: original.where,\n\t\t\tentityName: original.entityName,\n\t\t\tfilter: original.filter,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\teventListeners: this.mergeSingleEntityEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeEntityListSubTreeParametersWithSamePlaceholders(\n\t\toriginal: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t\tfresh: QualifiedEntityList | UnconstrainedQualifiedEntityList,\n\t): QualifiedEntityList | UnconstrainedQualifiedEntityList {\n\t\tif (original.initialEntityCount !== fresh.initialEntityCount) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`Detected sub trees of the same entity '${original.entityName}' with different preferred initial ` +\n\t\t\t\t\t`entity counts: '${original.initialEntityCount}' and '${fresh.initialEntityCount}' respectively.`,\n\t\t\t)\n\t\t}\n\n\t\tif (original.isCreating) {\n\t\t\tif (!fresh.isCreating) {\n\t\t\t\tthrow new BindingError()\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t// Encoded within the placeholder\n\t\t\t\tisCreating: original.isCreating,\n\t\t\t\tisUnpersisted: original.isUnpersisted && fresh.isUnpersisted,\n\t\t\t\tentityName: original.entityName,\n\n\t\t\t\t// Not encoded within the placeholder\n\t\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\t\toriginal.childEventListeners,\n\t\t\t\t\tfresh.childEventListeners,\n\t\t\t\t),\n\t\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t// Encoded within the placeholder\n\t\t\tisCreating: original.isCreating,\n\t\t\tentityName: original.entityName,\n\t\t\tfilter: original.filter,\n\t\t\torderBy: original.orderBy,\n\t\t\toffset: original.offset,\n\t\t\tlimit: original.limit,\n\n\t\t\t// Not encoded within the placeholder\n\t\t\talias: this.mergeSubTreeAliases(original.alias, fresh.alias),\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t\t// forceCreation: original.value.forceCreation || fresh.value.forceCreation,\n\t\t\texpectedMutation: this.mergeExpectedQualifiedEntityMutation(original.expectedMutation, fresh.expectedMutation),\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\thasOneRelationPath: original.hasOneRelationPath, // TODO this is completely wrong.\n\t\t\tchildEventListeners: this.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.childEventListeners,\n\t\t\t\tfresh.childEventListeners,\n\t\t\t),\n\t\t\teventListeners: this.mergeEntityListEventListeners(original.eventListeners, fresh.eventListeners),\n\t\t\tinitialEntityCount: original.initialEntityCount, // Handled above\n\t\t}\n\t}\n\n\tpublic static mergeEntityCreationParameters(\n\t\toriginal: EntityCreationParameters,\n\t\tfresh: EntityCreationParameters,\n\t): EntityCreationParameters {\n\t\treturn {\n\t\t\t// forceCreation: original.forceCreation || fresh.forceCreation,\n\t\t\tisNonbearing: original.isNonbearing && fresh.isNonbearing,\n\t\t\tsetOnCreate: this.mergeSetOnCreate(original.setOnCreate, fresh.setOnCreate),\n\t\t}\n\t}\n\n\tpublic static mergeSetOnCreate(original: SetOnCreate, fresh: SetOnCreate): SetOnCreate {\n\t\tif (original === undefined && fresh === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\tconst originalCopy: Writable<UniqueWhere> = { ...original }\n\n\t\tfor (const field in fresh) {\n\t\t\tif (field in originalCopy) {\n\t\t\t\tconst fromOriginal = originalCopy[field]\n\t\t\t\tconst fromFresh = fresh[field]\n\n\t\t\t\tif (fromOriginal instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\tif (fromFresh instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\t\tif (fromOriginal.value === fromFresh.value) {\n\t\t\t\t\t\t\t// Good, do nothing.\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof fromOriginal === 'object') {\n\t\t\t\t\tif (fromFresh instanceof GraphQlBuilder.GraphQlLiteral) {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t} else if (typeof fromFresh === 'object') {\n\t\t\t\t\t\tconst merged = this.mergeSetOnCreate(fromOriginal, fromFresh)\n\t\t\t\t\t\tif (merged !== undefined) {\n\t\t\t\t\t\t\toriginalCopy[field] = merged\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (typeof fromFresh === 'string' || typeof fromFresh === 'number') {\n\t\t\t\t\tif (fromOriginal === fromFresh) {\n\t\t\t\t\t\t// Good, do nothing.\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new BindingError() // TODO msg\n\t\t\t} else {\n\t\t\t\toriginalCopy[field] = fresh[field]\n\t\t\t}\n\t\t}\n\n\t\treturn originalCopy\n\t}\n\n\tprivate static mergeSets<T>(original: Set<T>, fresh: Set<T>): Set<T> {\n\t\tconst combinedSet = new Set(original)\n\t\tfor (const item of fresh) {\n\t\t\tcombinedSet.add(item)\n\t\t}\n\t\treturn combinedSet\n\t}\n\n\tpublic static mergeParentEntityParameters(\n\t\toriginal: ParentEntityParameters | undefined,\n\t\tfresh: ParentEntityParameters | undefined,\n\t): ParentEntityParameters | undefined {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n\t\t}\n\t\treturn {\n\t\t\teventListeners: TreeParameterMerger.mergeSingleEntityEventListeners(\n\t\t\t\toriginal.eventListeners,\n\t\t\t\tfresh.eventListeners,\n\t\t\t),\n\t\t}\n\t}\n\n\tpublic static mergeInParentEntity<\n\t\tOriginal extends Record<Key, EntityEventListenerStore | undefined>,\n\t\tKey extends keyof Original,\n\t>(original: Original, key: Key, parentEntity: ParentEntityParameters | undefined): Original {\n\t\tif (!parentEntity) {\n\t\t\treturn original\n\t\t}\n\n\t\treturn {\n\t\t\t...original,\n\t\t\t[key]: TreeParameterMerger.mergeSingleEntityEventListeners(original[key], parentEntity.eventListeners),\n\t\t}\n\t}\n\n\tpublic static mergeSingleEntityEventListeners(\n\t\toriginal: EntityEventListenerStore | undefined,\n\t\tfresh: EntityEventListenerStore | undefined,\n\t): EntityEventListenerStore | undefined {\n\t\tif (original === undefined) {\n\t\t\tif (fresh === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.cloneSingleEntityEventListeners(fresh)\n\t\t}\n\n\t\tif (fresh === undefined) {\n\t\t\treturn this.cloneSingleEntityEventListeners(original)\n\t\t}\n\n\t\tconst store = this.cloneSingleEntityEventListeners(original)\n\t\tstore.append(fresh)\n\t\treturn store\n\t}\n\n\tpublic static mergeEntityListEventListeners(\n\t\toriginal: EntityListEventListenerStore | undefined,\n\t\tfresh: EntityListEventListenerStore | undefined,\n\t): EntityListEventListenerStore | undefined {\n\t\tif (original === undefined) {\n\t\t\tif (fresh === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.cloneEntityListEventListeners(fresh)\n\t\t}\n\n\t\tif (fresh === undefined) {\n\t\t\treturn this.cloneEntityListEventListeners(original)\n\t\t}\n\n\t\tconst store = this.cloneEntityListEventListeners(original)\n\t\tstore.append(fresh)\n\t\treturn store\n\t}\n\n\tpublic static cloneSingleEntityEventListeners(store: EntityEventListenerStore): EntityEventListenerStore {\n\t\t// TODO is intentional, that second clone is deep?\n\t\treturn store.clone()\n\t}\n\n\tpublic static cloneEntityListEventListeners(store: EntityListEventListenerStore): EntityListEventListenerStore {\n\t\treturn store.cloneDeep()\n\t}\n\n\tprivate static mergeExpectedRelationMutation(\n\t\toriginal: ExpectedRelationMutation,\n\t\tfresh: ExpectedRelationMutation,\n\t): ExpectedRelationMutation {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === 'none') {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === 'none') {\n\t\t\treturn original\n\t\t}\n\t\treturn 'anyMutation'\n\t}\n\n\tprivate static mergeExpectedQualifiedEntityMutation(\n\t\toriginal: ExpectedQualifiedEntityMutation,\n\t\tfresh: ExpectedQualifiedEntityMutation,\n\t): ExpectedQualifiedEntityMutation {\n\t\tif (original === fresh) {\n\t\t\treturn original\n\t\t}\n\t\tif (original === 'none') {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === 'none') {\n\t\t\treturn original\n\t\t}\n\t\treturn 'anyMutation'\n\t}\n\n\tprivate static mergeSubTreeAliases(\n\t\toriginal: Set<Alias> | undefined,\n\t\tfresh: Set<Alias> | undefined,\n\t): Set<Alias> | undefined {\n\t\tif (original === undefined) {\n\t\t\treturn fresh\n\t\t}\n\t\tif (fresh === undefined) {\n\t\t\treturn original\n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M,UAAA,QAAQ,KAAK,8BAA8B,QAAQ;AACzD,UAAM,OAAO,KAAK;AACX,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,gCAAgC,OAA2D;AAExG,WAAO,MAAM;EACd;AAAA,EAEA,OAAc,8BAA8B,OAAmE;AAC9G,WAAO,MAAM;EACd;AAAA,EAEA,OAAe,8BACd,UACA,OAC2B;AAC3B,QAAI,aAAa,OAAO;AAChB,aAAA;AAAA,IACR;AACA,QAAI,aAAa,QAAQ;AACjB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAQ;AACd,aAAA;AAAA,IACR;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,qCACd,UACA,OACkC;AAClC,QAAI,aAAa,OAAO;AAChB,aAAA;AAAA,IACR;AACA,QAAI,aAAa,QAAQ;AACjB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAQ;AACd,aAAA;AAAA,IACR;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAe,oBACd,UACA,OACyB;AACzB,QAAI,aAAa,QAAW;AACpB,aAAA;AAAA,IACR;AACA,QAAI,UAAU,QAAW;AACjB,aAAA;AAAA,IACR;AACO,WAAA,KAAK,UAAU,UAAU,KAAK;AAAA,EACtC;AACD;"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
const BindingError = require("../BindingError.cjs");
|
|
10
|
+
const MarkerComparator = require("./MarkerComparator.cjs");
|
|
11
|
+
const RequestResponseNormalizer = require("./RequestResponseNormalizer.cjs");
|
|
12
|
+
const NormalizedPersistedData = require("../accessorTree/NormalizedPersistedData.cjs");
|
|
13
|
+
const PlaceholderGenerator = require("../markers/PlaceholderGenerator.cjs");
|
|
14
|
+
const QueryLanguage = require("../queryLanguage/QueryLanguage.cjs");
|
|
15
|
+
const assertNever = require("../utils/assertNever.cjs");
|
|
16
|
+
const emptyEntityIdSet = /* @__PURE__ */ new Set();
|
|
17
|
+
class TreeStore {
|
|
18
|
+
constructor(_schema) {
|
|
19
|
+
__publicField(this, "entityStore", /* @__PURE__ */ new Map());
|
|
20
|
+
__publicField(this, "entityRealmStore", /* @__PURE__ */ new Map());
|
|
21
|
+
// This is tricky. We allow placeholder name duplicates, only the (TreeRootId, PlaceholderName) tuple is unique.
|
|
22
|
+
// This is useful when the tree is extended to contain a sub-tree with the same placeholder.
|
|
23
|
+
__publicField(this, "markerTrees", /* @__PURE__ */ new Map());
|
|
24
|
+
__publicField(this, "subTreeStatesByRoot", /* @__PURE__ */ new Map());
|
|
25
|
+
__publicField(this, "persistedData", new NormalizedPersistedData.NormalizedPersistedData(/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()));
|
|
26
|
+
this._schema = _schema;
|
|
27
|
+
}
|
|
28
|
+
mergeInQueryResponse(response, markerTree) {
|
|
29
|
+
RequestResponseNormalizer.RequestResponseNormalizer.mergeInQueryResponse(this.persistedData, response, markerTree);
|
|
30
|
+
}
|
|
31
|
+
mergeInMutationResponse(response, operations) {
|
|
32
|
+
RequestResponseNormalizer.RequestResponseNormalizer.mergeInMutationResponse(this.persistedData, response, operations);
|
|
33
|
+
}
|
|
34
|
+
get persistedEntityData() {
|
|
35
|
+
return this.persistedData.persistedEntityDataStore;
|
|
36
|
+
}
|
|
37
|
+
get subTreePersistedData() {
|
|
38
|
+
return this.persistedData.subTreeDataStore;
|
|
39
|
+
}
|
|
40
|
+
get schema() {
|
|
41
|
+
return this._schema;
|
|
42
|
+
}
|
|
43
|
+
getPathBackToParent(entityRealm) {
|
|
44
|
+
const blueprint = entityRealm.blueprint;
|
|
45
|
+
if (blueprint.parent === void 0) {
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
let parentEntityName;
|
|
49
|
+
let relationFromParent;
|
|
50
|
+
let parent;
|
|
51
|
+
if (blueprint.type === "hasOne") {
|
|
52
|
+
parentEntityName = blueprint.parent.entity.entityName;
|
|
53
|
+
relationFromParent = blueprint.marker.parameters.field;
|
|
54
|
+
parent = blueprint.parent;
|
|
55
|
+
} else if (blueprint.type === "listEntity") {
|
|
56
|
+
const grandparentBlueprint = blueprint.parent.blueprint;
|
|
57
|
+
if (grandparentBlueprint.parent === void 0) {
|
|
58
|
+
return void 0;
|
|
59
|
+
}
|
|
60
|
+
parentEntityName = grandparentBlueprint.parent.entity.entityName;
|
|
61
|
+
relationFromParent = grandparentBlueprint.marker.parameters.field;
|
|
62
|
+
parent = grandparentBlueprint.parent;
|
|
63
|
+
} else {
|
|
64
|
+
return assertNever.assertNever();
|
|
65
|
+
}
|
|
66
|
+
const relationSchema = this.schema.getEntityRelation(parentEntityName, relationFromParent);
|
|
67
|
+
const fieldBack = (relationSchema.ownedBy || relationSchema.inversedBy) ?? null;
|
|
68
|
+
if (fieldBack === null) {
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
parent,
|
|
73
|
+
fieldBackToParent: fieldBack
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
getSubTreeState(mode, treeRootId, aliasOrParameters, environment) {
|
|
77
|
+
const markerRoot = this.markerTrees.get(treeRootId);
|
|
78
|
+
const subTreeStates = this.subTreeStatesByRoot.get(treeRootId);
|
|
79
|
+
if (subTreeStates === void 0 || markerRoot === void 0) {
|
|
80
|
+
if (treeRootId) {
|
|
81
|
+
throw new BindingError.BindingError(
|
|
82
|
+
`Invalid tree id '${treeRootId}'. Make sure you use the one supplied by the correct extendTree call.`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
throw new BindingError.BindingError(`Failed to retrieve a sub tree.`);
|
|
86
|
+
}
|
|
87
|
+
let placeholderName;
|
|
88
|
+
if (typeof aliasOrParameters === "string") {
|
|
89
|
+
const placeholderByAlias = markerRoot.placeholdersByAliases.get(aliasOrParameters);
|
|
90
|
+
if (placeholderByAlias === void 0) {
|
|
91
|
+
throw new BindingError.BindingError(`Undefined sub-tree alias '${aliasOrParameters}'.`);
|
|
92
|
+
}
|
|
93
|
+
placeholderName = placeholderByAlias;
|
|
94
|
+
} else if (mode === "entityList") {
|
|
95
|
+
placeholderName = PlaceholderGenerator.PlaceholderGenerator.getEntityListSubTreePlaceholder(
|
|
96
|
+
aliasOrParameters.isCreating ? QueryLanguage.QueryLanguage.desugarUnconstrainedQualifiedEntityList(
|
|
97
|
+
aliasOrParameters,
|
|
98
|
+
environment
|
|
99
|
+
) : QueryLanguage.QueryLanguage.desugarQualifiedEntityList(aliasOrParameters, environment),
|
|
100
|
+
environment
|
|
101
|
+
);
|
|
102
|
+
} else if (mode === "entity") {
|
|
103
|
+
placeholderName = PlaceholderGenerator.PlaceholderGenerator.getEntitySubTreePlaceholder(
|
|
104
|
+
aliasOrParameters.isCreating ? QueryLanguage.QueryLanguage.desugarUnconstrainedQualifiedSingleEntity(
|
|
105
|
+
aliasOrParameters,
|
|
106
|
+
environment
|
|
107
|
+
) : QueryLanguage.QueryLanguage.desugarQualifiedSingleEntity(aliasOrParameters, environment),
|
|
108
|
+
environment
|
|
109
|
+
);
|
|
110
|
+
} else {
|
|
111
|
+
throw new BindingError.BindingError();
|
|
112
|
+
}
|
|
113
|
+
const subTreeState = subTreeStates.get(placeholderName);
|
|
114
|
+
if (subTreeState === void 0) {
|
|
115
|
+
throw new BindingError.BindingError(`Trying to retrieve a non-existent sub-tree '${placeholderName}'.`);
|
|
116
|
+
}
|
|
117
|
+
return subTreeState;
|
|
118
|
+
}
|
|
119
|
+
getEntityListPersistedIds(state) {
|
|
120
|
+
const blueprint = state.blueprint;
|
|
121
|
+
if (blueprint.parent) {
|
|
122
|
+
const entityData = this.persistedEntityData.get(blueprint.parent.entity.id.uniqueValue);
|
|
123
|
+
return entityData?.get(blueprint.marker.placeholderName) ?? emptyEntityIdSet;
|
|
124
|
+
} else {
|
|
125
|
+
return this.subTreePersistedData.get(blueprint.marker.placeholderName) ?? emptyEntityIdSet;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
disposeOfRealm(realmToDisposeOf) {
|
|
129
|
+
this.entityRealmStore.delete(realmToDisposeOf.realmKey);
|
|
130
|
+
realmToDisposeOf.entity.realms.delete(realmToDisposeOf.realmKey);
|
|
131
|
+
if (realmToDisposeOf.type === "entityRealm") {
|
|
132
|
+
realmToDisposeOf.blueprint.parent?.childrenWithPendingUpdates?.delete(realmToDisposeOf);
|
|
133
|
+
for (const child of realmToDisposeOf.children.values()) {
|
|
134
|
+
switch (child.type) {
|
|
135
|
+
case "field":
|
|
136
|
+
continue;
|
|
137
|
+
case "entityRealm":
|
|
138
|
+
case "entityRealmStub": {
|
|
139
|
+
this.disposeOfRealm(child);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case "entityList": {
|
|
143
|
+
for (const listChild of child.children.values()) {
|
|
144
|
+
this.disposeOfRealm(listChild);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const entity = realmToDisposeOf.entity;
|
|
151
|
+
if (entity.realms.size === 0) {
|
|
152
|
+
this.disposeOfEntity(entity);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
disposeOfEntity(entity) {
|
|
156
|
+
for (const realm of entity.realms.values()) {
|
|
157
|
+
this.disposeOfRealm(realm);
|
|
158
|
+
}
|
|
159
|
+
this.entityStore.delete(entity.id.uniqueValue);
|
|
160
|
+
this.persistedEntityData.delete(entity.id.uniqueValue);
|
|
161
|
+
}
|
|
162
|
+
effectivelyHasTreeRoot(candidateRoot) {
|
|
163
|
+
candidateRoots:
|
|
164
|
+
for (const candidateSubTree of candidateRoot.subTrees.values()) {
|
|
165
|
+
if (candidateSubTree.parameters.isCreating) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
for (const root of this.markerTrees.values()) {
|
|
169
|
+
for (const alreadyPresentSubTree of root.subTrees.values()) {
|
|
170
|
+
const isSubset = MarkerComparator.MarkerComparator.isSubTreeSubsetOf(candidateSubTree, alreadyPresentSubTree);
|
|
171
|
+
if (isSubset) {
|
|
172
|
+
continue candidateRoots;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
exports.TreeStore = TreeStore;
|
|
182
|
+
//# sourceMappingURL=TreeStore.cjs.map
|