@contember/binding 1.2.3 → 1.3.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/accessorTree/RuntimeId.js +5 -5
- package/dist/development/accessorTree/RuntimeId.js.map +1 -1
- 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/EntityAccessor.js.map +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 +11 -6
- 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/Config.js +3 -3
- package/dist/development/core/Config.js.map +1 -1
- package/dist/development/core/DataBinding.cjs +352 -0
- package/dist/development/core/DataBinding.cjs.map +1 -0
- package/dist/development/core/DataBinding.js +56 -49
- 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/MarkerComparator.js.map +1 -1
- 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/MarkerMerger.js.map +1 -1
- 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 -73
- 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/RealmKeyGenerator.js.map +1 -1
- 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/TreeStore.js.map +1 -1
- package/dist/development/core/VariableInputTransformer.cjs +24 -0
- package/dist/development/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/development/core/VariableInputTransformer.js.map +1 -1
- 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/exceptions/TreeParameterSugarer.js.map +1 -1
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs +20 -0
- package/dist/development/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/development/core/factories/createBatchUpdatesOptions.js.map +1 -1
- 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/EntityOperations.js.map +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/FieldOperations.js.map +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/ListOperations.js.map +1 -1
- package/dist/development/core/operations/OperationsHelpers.cjs +85 -0
- package/dist/development/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/development/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/development/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/development/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/development/core/schema/Schema.cjs +39 -0
- package/dist/development/core/schema/Schema.cjs.map +1 -0
- package/dist/development/core/schema/Schema.js.map +1 -1
- 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/PlaceholderGenerator.js.map +1 -1
- 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 +70 -29
- 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 +16 -14
- 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/EventListenersStore.js.map +1 -1
- 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/TreeNodeUtils.js.map +1 -1
- package/dist/development/utils/assert.cjs +11 -0
- package/dist/development/utils/assert.cjs.map +1 -0
- package/dist/development/utils/assert.js.map +1 -1
- 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/development/utils/ucfirst.js.map +1 -1
- 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/accessorTree/RuntimeId.js +5 -5
- package/dist/production/accessorTree/RuntimeId.js.map +1 -1
- 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/EntityAccessor.js.map +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 +11 -6
- 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/Config.js +3 -3
- package/dist/production/core/Config.js.map +1 -1
- package/dist/production/core/DataBinding.cjs +352 -0
- package/dist/production/core/DataBinding.cjs.map +1 -0
- package/dist/production/core/DataBinding.js +56 -49
- 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/MarkerComparator.js.map +1 -1
- 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/MarkerMerger.js.map +1 -1
- 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 -73
- 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/RealmKeyGenerator.js.map +1 -1
- 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/TreeStore.js.map +1 -1
- package/dist/production/core/VariableInputTransformer.cjs +24 -0
- package/dist/production/core/VariableInputTransformer.cjs.map +1 -0
- package/dist/production/core/VariableInputTransformer.js.map +1 -1
- 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/exceptions/TreeParameterSugarer.js.map +1 -1
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs +20 -0
- package/dist/production/core/factories/createBatchUpdatesOptions.cjs.map +1 -0
- package/dist/production/core/factories/createBatchUpdatesOptions.js.map +1 -1
- 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/EntityOperations.js.map +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/ListOperations.js.map +1 -1
- package/dist/production/core/operations/OperationsHelpers.cjs +85 -0
- package/dist/production/core/operations/OperationsHelpers.cjs.map +1 -0
- package/dist/production/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/production/core/requestAliases/MutationAlias.cjs +14 -0
- package/dist/production/core/requestAliases/MutationAlias.cjs.map +1 -0
- package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/production/core/schema/Schema.cjs +39 -0
- package/dist/production/core/schema/Schema.cjs.map +1 -0
- package/dist/production/core/schema/Schema.js.map +1 -1
- 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/PlaceholderGenerator.js.map +1 -1
- 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 +70 -29
- 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 +16 -14
- 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/EventListenersStore.js.map +1 -1
- 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/TreeNodeUtils.js.map +1 -1
- package/dist/production/utils/assert.cjs +11 -0
- package/dist/production/utils/assert.cjs.map +1 -0
- package/dist/production/utils/assert.js.map +1 -1
- 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/production/utils/ucfirst.js.map +1 -1
- 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/EntityAccessor.d.ts +2 -2
- package/dist/types/accessors/EntityAccessor.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/EventListenersStore.d.ts +2 -1
- package/dist/types/treeParameters/EventListenersStore.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 +13 -15
- package/src/accessorTree/PersistResult.ts +1 -2
- package/src/accessorTree/index.ts +0 -15
- package/src/accessors/BindingOperations.ts +2 -2
- package/src/accessors/EntityAccessor.ts +2 -2
- package/src/accessors/ExtendTree.ts +1 -2
- package/src/accessors/TreeRootAccessor.ts +2 -2
- package/src/core/AccessorErrorManager.ts +17 -10
- 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 -112
- 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/EventListenersStore.ts +2 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutationGenerator.js","sources":["../../../src/core/MutationGenerator.ts"],"sourcesContent":["// noinspection JSVoidFunctionReturnValueUsed // IntelliJ seems to be super confused througouht this file.\n\nimport { CrudQueryBuilder, GraphQlBuilder } from '@contember/client'\nimport { ClientGeneratedUuid, ServerId } from '../accessorTree'\nimport { BindingError } from '../BindingError'\nimport { PRIMARY_KEY_NAME, TYPENAME_KEY_NAME } from '../bindingTypes'\nimport { EntityFieldMarkers, FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../markers'\nimport type { EntityId, EntityName, FieldValue, PlaceholderName } from '../treeParameters'\nimport { assertNever, isEmptyObject } from '../utils'\nimport { QueryGenerator } from './QueryGenerator'\nimport { MutationAlias } from './requestAliases'\nimport {\n\tEntityListState,\n\tEntityRealmState,\n\tEntityRealmStateStub,\n\tEntityState,\n\tFieldState,\n\tgetEntityMarker,\n\tStateIterator,\n} from './state'\nimport type { TreeStore } from './TreeStore'\n\ntype QueryBuilder = Omit<CrudQueryBuilder.CrudQueryBuilder, CrudQueryBuilder.Queries>\n\ntype ProcessedPlaceholdersByEntity = Map<EntityState, Set<PlaceholderName>>\n\nexport type SubMutationOperation =\n\t& {\n\t\talias: string,\n\t\tsubTreePlaceholder: PlaceholderName,\n\t\tsubTreeType: 'list' | 'single'\n\t}\n\t& (\n\t\t| { type: 'delete', id: EntityId }\n\t\t| { type: 'update', markers: EntityFieldMarkers, id: EntityId }\n\t\t| { type: 'create', markers: EntityFieldMarkers, id: EntityId }\n\t)\n\nexport type PersistMutationResult = {\n\tquery: string\n\toperations: SubMutationOperation[]\n}\n\n// TODO enforce correct expected mutations in dev mode.\nexport class MutationGenerator {\n\n\tprivate aliasCounter = 1\n\n\tpublic constructor(private readonly treeStore: TreeStore) {\n\t}\n\n\tpublic getPersistMutation(): PersistMutationResult | undefined {\n\t\ttry {\n\t\t\tlet builder: QueryBuilder = new CrudQueryBuilder.CrudQueryBuilder()\n\t\t\tconst operations: SubMutationOperation[] = []\n\t\t\tconst processedPlaceholdersByEntity: ProcessedPlaceholdersByEntity = new Map()\n\t\t\tconst processedDeletes = new Set<string>()\n\n\n\t\t\tfor (const [treeRootId, rootStates] of this.treeStore.subTreeStatesByRoot.entries()) {\n\t\t\t\tfor (const [placeholderName, subTreeState] of Array.from(rootStates.entries()).reverse()) {\n\t\t\t\t\tif (subTreeState.unpersistedChangesCount <= 0) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif (subTreeState.type === 'entityRealm') {\n\t\t\t\t\t\tconst subMutation = this.addSubMutation(\n\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\tplaceholderName,\n\t\t\t\t\t\t\t'single',\n\t\t\t\t\t\t\tsubTreeState.entity.id.value,\n\t\t\t\t\t\t\tsubTreeState,\n\t\t\t\t\t\t\tbuilder,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (subMutation) {\n\t\t\t\t\t\t\tbuilder = subMutation[0]\n\t\t\t\t\t\t\toperations.push(subMutation[1])\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (subTreeState.type === 'entityList') {\n\t\t\t\t\t\tfor (const childState of subTreeState.children.values()) {\n\t\t\t\t\t\t\tif (childState.type === 'entityRealmStub') {\n\t\t\t\t\t\t\t\t// TODO there can be a forceCreate somewhere in there that we're hereby ignoring.\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst subMutation = this.addSubMutation(\n\t\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\t\tplaceholderName,\n\t\t\t\t\t\t\t\t'list',\n\t\t\t\t\t\t\t\tchildState.entity.id.value,\n\t\t\t\t\t\t\t\tchildState,\n\t\t\t\t\t\t\t\tbuilder,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tif (subMutation) {\n\t\t\t\t\t\t\t\tbuilder = subMutation[0]\n\t\t\t\t\t\t\t\toperations.push(subMutation[1])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (subTreeState.plannedRemovals) {\n\t\t\t\t\t\t\tfor (const [removedId, removalType] of subTreeState.plannedRemovals) {\n\t\t\t\t\t\t\t\tif (removalType === 'disconnect') {\n\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (removalType === 'delete') {\n\t\t\t\t\t\t\t\t\tconst key = `${subTreeState.entityName}#${removedId}`\n\t\t\t\t\t\t\t\t\tif (processedDeletes.has(key)) {\n\t\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tprocessedDeletes.add(key)\n\t\t\t\t\t\t\t\t\tconst alias = this.createAlias()\n\t\t\t\t\t\t\t\t\tbuilder = this.addDeleteMutation(\n\t\t\t\t\t\t\t\t\t\tsubTreeState.entityName,\n\t\t\t\t\t\t\t\t\t\tremovedId,\n\t\t\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\t\t\tbuilder,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\toperations.push({ alias, subTreePlaceholder: placeholderName, subTreeType: 'list', type: 'delete', id: removedId })\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tassertNever(removalType)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tassertNever(subTreeState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst query = builder.inTransaction(undefined, { deferForeignKeyConstraints: true }).getGql()\n\t\t\treturn { query, operations }\n\t\t} catch (e) {\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\tprivate addSubMutation(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tsubTreePlaceholder: PlaceholderName,\n\t\tsubTreeType: 'list' | 'single',\n\t\tentityId: EntityId,\n\t\trealmState: EntityRealmState,\n\t\tqueryBuilder: QueryBuilder,\n\t): [QueryBuilder, SubMutationOperation] | undefined {\n\t\tif (realmState.unpersistedChangesCount === 0) {\n\t\t\t// Bail out early\n\t\t\treturn undefined\n\t\t}\n\t\tconst fieldMarkers = getEntityMarker(realmState).fields.markers\n\n\t\tconst alias = this.createAlias()\n\n\t\tif (realmState.entity.isScheduledForDeletion) {\n\t\t\tconst builder = this.addDeleteMutation(\n\t\t\t\trealmState.entity.entityName,\n\t\t\t\tentityId,\n\t\t\t\talias,\n\t\t\t\tqueryBuilder,\n\t\t\t)\n\t\t\treturn [\n\t\t\t\tbuilder,\n\t\t\t\t{\n\t\t\t\t\talias,\n\t\t\t\t\tsubTreePlaceholder,\n\t\t\t\t\tsubTreeType,\n\t\t\t\t\ttype: 'delete',\n\t\t\t\t\tid: entityId,\n\t\t\t\t},\n\t\t\t]\n\t\t} else if (!realmState.entity.id.existsOnServer) {\n\t\t\tconst builder = this.addCreateMutation(\n\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\trealmState,\n\t\t\t\talias,\n\t\t\t\tthis.getNodeFragmentName(subTreePlaceholder, subTreeType, realmState),\n\t\t\t\tqueryBuilder,\n\t\t\t\tfieldMarkers,\n\t\t\t)\n\t\t\tif (!builder) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tbuilder,\n\t\t\t\t{\n\t\t\t\t\talias,\n\t\t\t\t\tsubTreePlaceholder,\n\t\t\t\t\tsubTreeType,\n\t\t\t\t\ttype: 'create',\n\t\t\t\t\tmarkers: fieldMarkers,\n\t\t\t\t\tid: entityId,\n\t\t\t\t},\n]\n\t\t}\n\t\tconst builder = this.addUpdateMutation(\n\t\t\tprocessedPlaceholdersByEntity,\n\t\t\trealmState,\n\t\t\talias,\n\t\t\tthis.getNodeFragmentName(subTreePlaceholder, subTreeType, realmState),\n\t\t\tqueryBuilder,\n\t\t\tfieldMarkers,\n\t\t)\n\t\tif (!builder) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn [\n\t\t\tbuilder,\n\t\t\t{\n\t\t\t\talias,\n\t\t\t\tsubTreePlaceholder,\n\t\t\t\tsubTreeType,\n\t\t\t\ttype: 'update',\n\t\t\t\tid: entityId,\n\t\t\t\tmarkers: fieldMarkers,\n\t\t\t},\n\t\t]\n\t}\n\n\tprivate getNodeFragmentName(\n\t\tsubTreePlaceholder: PlaceholderName,\n\t\tsubTreeType: 'single' | 'list',\n\t\trealmState: EntityRealmState,\n\t): string | undefined {\n\t\tif (subTreeType !== 'list') {\n\t\t\treturn undefined\n\t\t}\n\t\treturn `${realmState.entity.entityName}_${subTreePlaceholder}`\n\t}\n\n\tprivate addDeleteMutation(\n\t\tentityName: EntityName,\n\t\tdeletedId: EntityId,\n\t\talias: string,\n\t\tqueryBuilder: QueryBuilder = new CrudQueryBuilder.CrudQueryBuilder(),\n\t): QueryBuilder {\n\t\treturn queryBuilder.delete(\n\t\t\tentityName,\n\t\t\tbuilder =>\n\t\t\t\tbuilder\n\t\t\t\t\t.ok()\n\t\t\t\t\t.node(builder => builder.column(PRIMARY_KEY_NAME))\n\t\t\t\t\t.by({ [PRIMARY_KEY_NAME]: deletedId })\n\t\t\t\t\t.errors()\n\t\t\t\t\t.errorMessage(),\n\t\t\talias,\n\t\t)\n\t}\n\n\tprivate addUpdateMutation(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tentityRealm: EntityRealmState,\n\t\talias: string,\n\t\tnodeFragmentName: string | undefined,\n\t\tqueryBuilder: QueryBuilder = new CrudQueryBuilder.CrudQueryBuilder(),\n\t\tfieldMarkers: EntityFieldMarkers,\n\t): QueryBuilder | undefined {\n\t\tconst updateBuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Update> =\n\t\t\tthis.registerUpdateMutationPart(\n\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\tentityRealm,\n\t\t\t\tnew CrudQueryBuilder.WriteDataBuilder(),\n\t\t\t)\n\t\tif (updateBuilder.data === undefined || isEmptyObject(updateBuilder.data)) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst runtimeId = entityRealm.entity.id\n\n\t\tif (!runtimeId.existsOnServer) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst readBuilder = QueryGenerator.registerQueryPart(\n\t\t\tfieldMarkers,\n\t\t\tCrudQueryBuilder.ReadBuilder.instantiate(),\n\t\t)\n\n\t\tif (nodeFragmentName) {\n\t\t\tqueryBuilder = queryBuilder.fragment(nodeFragmentName, entityRealm.entity.entityName, readBuilder)\n\t\t}\n\n\t\treturn queryBuilder.update(\n\t\t\tentityRealm.entity.entityName,\n\t\t\tbuilder =>\n\t\t\t\tbuilder\n\t\t\t\t\t.node(nodeFragmentName ? builder => builder.applyFragment(nodeFragmentName) : readBuilder)\n\t\t\t\t\t.data(updateBuilder)\n\t\t\t\t\t.by({ [PRIMARY_KEY_NAME]: runtimeId.value })\n\t\t\t\t\t.ok()\n\t\t\t\t\t.validation()\n\t\t\t\t\t.errors()\n\t\t\t\t\t.errorMessage(),\n\t\t\talias,\n\t\t)\n\t}\n\n\tprivate addCreateMutation(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tentityRealm: EntityRealmState,\n\t\talias: string,\n\t\tnodeFragmentName: string | undefined,\n\t\tqueryBuilder: QueryBuilder = new CrudQueryBuilder.CrudQueryBuilder(),\n\t\tfieldMarkers: EntityFieldMarkers,\n\t): QueryBuilder | undefined {\n\t\tconst createBuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create> =\n\t\t\tthis.registerCreateMutationPart(\n\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\tentityRealm,\n\t\t\t\tnew CrudQueryBuilder.WriteDataBuilder(),\n\t\t\t)\n\t\tif (createBuilder.data === undefined || isEmptyObject(createBuilder.data)) {\n\t\t\treturn undefined\n\t\t}\n\t\tconst readBuilder = QueryGenerator.registerQueryPart(\n\t\t\tfieldMarkers,\n\t\t\tCrudQueryBuilder.ReadBuilder.instantiate(),\n\t\t)\n\t\tif (nodeFragmentName) {\n\t\t\tqueryBuilder = queryBuilder.fragment(nodeFragmentName, entityRealm.entity.entityName, readBuilder)\n\t\t}\n\n\t\treturn queryBuilder.create(\n\t\t\tentityRealm.entity.entityName,\n\t\t\tbuilder => {\n\t\t\t\t// if (where && writeBuilder.data !== undefined && !isEmptyObject(writeBuilder.data)) {\n\t\t\t\t// \t// Shallow cloning the parameters like this IS too naïve but it will likely last surprisingly long before we\n\t\t\t\t// \t// run into issues.\n\t\t\t\t// \twriteBuilder = new CrudQueryBuilder.WriteDataBuilder({ ...writeBuilder.data, ...where })\n\t\t\t\t// }\n\t\t\t\treturn builder\n\t\t\t\t\t.node(nodeFragmentName ? builder => builder.applyFragment(nodeFragmentName) : readBuilder)\n\t\t\t\t\t.data(createBuilder)\n\t\t\t\t\t.ok()\n\t\t\t\t\t.validation()\n\t\t\t\t\t.errors()\n\t\t\t\t\t.errorMessage()\n\t\t\t},\n\t\t\talias,\n\t\t)\n\t}\n\n\tprivate registerCreateMutationPart(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tcurrentState: EntityRealmState | EntityRealmStateStub,\n\t\tbuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create> = new CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create>(),\n\t): CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create> {\n\t\tlet processedPlaceholders = processedPlaceholdersByEntity.get(currentState.entity)\n\n\t\tif (processedPlaceholders === undefined) {\n\t\t\tprocessedPlaceholdersByEntity.set(currentState.entity, (processedPlaceholders = new Set()))\n\t\t}\n\n\t\tif (currentState.type === 'entityRealmStub') {\n\t\t\t// TODO If there's a forceCreate, this is wrong.\n\t\t\treturn builder\n\t\t}\n\n\t\tfor (const siblingState of StateIterator.eachSiblingRealm(currentState)) {\n\n\t\t\tconst pathBack = this.treeStore.getPathBackToParent(siblingState)\n\n\t\t\tconst nonbearingFields: Array<| { type: 'field'; marker: FieldMarker; fieldState: FieldState }\n\t\t\t\t| { type: 'hasOne'; marker: HasOneRelationMarker; fieldState: EntityRealmState | EntityRealmStateStub }\n\t\t\t\t| { type: 'hasMany'; marker: HasManyRelationMarker; fieldState: EntityListState }> = []\n\n\t\t\tfor (const [placeholderName, fieldState] of siblingState.children) {\n\t\t\t\tif (processedPlaceholders.has(placeholderName)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tprocessedPlaceholders.add(placeholderName)\n\n\t\t\t\tswitch (fieldState.type) {\n\t\t\t\t\tcase 'field': {\n\t\t\t\t\t\tconst marker = fieldState.fieldMarker\n\t\t\t\t\t\tconst placeholderName = marker.placeholderName\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tplaceholderName === TYPENAME_KEY_NAME ||\n\t\t\t\t\t\t\t(placeholderName === PRIMARY_KEY_NAME && !(siblingState.entity.id instanceof ClientGeneratedUuid))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (marker.isNonbearing) {\n\t\t\t\t\t\t\tnonbearingFields.push({\n\t\t\t\t\t\t\t\ttype: 'field',\n\t\t\t\t\t\t\t\tmarker,\n\t\t\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuilder = this.registerCreateFieldPart(fieldState, marker, builder)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\t\tconst marker = getEntityMarker(fieldState)\n\t\t\t\t\t\tif (!(marker instanceof HasOneRelationMarker)) {\n\t\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (marker.parameters.isNonbearing) {\n\t\t\t\t\t\t\tnonbearingFields.push({\n\t\t\t\t\t\t\t\ttype: 'hasOne',\n\t\t\t\t\t\t\t\tmarker,\n\t\t\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuilder = this.registerCreateEntityPart(processedPlaceholdersByEntity, fieldState, marker, builder)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 'entityList': {\n\t\t\t\t\t\tconst marker = fieldState.blueprint.marker\n\t\t\t\t\t\tif (!(marker instanceof HasManyRelationMarker)) {\n\t\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (marker.parameters.isNonbearing) {\n\t\t\t\t\t\t\tnonbearingFields.push({\n\t\t\t\t\t\t\t\ttype: 'hasMany',\n\t\t\t\t\t\t\t\tmarker,\n\t\t\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuilder = this.registerCreateEntityListPart(processedPlaceholdersByEntity, fieldState, marker, builder)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\treturn assertNever(fieldState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if (\n\t\t\t// \tcurrentState.blueprint.creationParameters.forceCreation &&\n\t\t\t// \t(builder.data === undefined || isEmptyObject(builder.data))\n\t\t\t// ) {\n\t\t\t// \tbuilder = builder.set('_dummy_field_', true)\n\t\t\t// }\n\n\t\t\tif (\n\t\t\t\t(builder.data !== undefined && !isEmptyObject(builder.data)) ||\n\t\t\t\t!getEntityMarker(siblingState).fields.hasAtLeastOneBearingField\n\t\t\t) {\n\t\t\t\tfor (const field of nonbearingFields) {\n\t\t\t\t\tswitch (field.type) {\n\t\t\t\t\t\tcase 'field': {\n\t\t\t\t\t\t\tbuilder = this.registerCreateFieldPart(field.fieldState, field.marker, builder)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase 'hasOne': {\n\t\t\t\t\t\t\tbuilder = this.registerCreateEntityPart(\n\t\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\t\tfield.fieldState,\n\t\t\t\t\t\t\t\tfield.marker,\n\t\t\t\t\t\t\t\tbuilder,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase 'hasMany': {\n\t\t\t\t\t\t\tbuilder = this.registerCreateEntityListPart(\n\t\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\t\tfield.fieldState,\n\t\t\t\t\t\t\t\tfield.marker,\n\t\t\t\t\t\t\t\tbuilder,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tassertNever(field)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst setOnCreate = getEntityMarker(siblingState).parameters.setOnCreate\n\t\t\tif (setOnCreate && builder.data !== undefined && !isEmptyObject(builder.data)) {\n\t\t\t\tfor (const key in setOnCreate) {\n\t\t\t\t\tconst field = setOnCreate[key]\n\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof field === 'string' ||\n\t\t\t\t\t\ttypeof field === 'number' ||\n\t\t\t\t\t\tfield === null ||\n\t\t\t\t\t\tfield instanceof GraphQlBuilder.GraphQlLiteral\n\t\t\t\t\t) {\n\t\t\t\t\t\tbuilder = builder.set(key, field)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuilder = builder.one(key, builder => builder.connect(field))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn builder\n\t}\n\n\tprivate registerCreateFieldPart(\n\t\tfieldState: FieldState,\n\t\tmarker: FieldMarker,\n\t\tbuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create>,\n\t) {\n\t\tconst resolvedValue = fieldState.getAccessor().resolvedValue\n\n\t\tif (resolvedValue !== undefined && resolvedValue !== null) {\n\t\t\treturn builder.set(marker.fieldName, this.transformFieldValue(fieldState, resolvedValue))\n\t\t}\n\t\treturn builder\n\t}\n\n\tprivate registerCreateEntityPart(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tfieldState: EntityRealmState | EntityRealmStateStub,\n\t\tmarker: HasOneRelationMarker,\n\t\tbuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create>,\n\t) {\n\t\tconst reducedBy = marker.parameters.reducedBy\n\t\tconst runtimeId = fieldState.entity.id\n\n\t\tif (reducedBy === undefined) {\n\t\t\treturn builder.one(marker.parameters.field, builder => {\n\t\t\t\tif (this.shouldConnectInsteadOfCreate(processedPlaceholdersByEntity, fieldState)) {\n\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\treturn builder.connect({ [PRIMARY_KEY_NAME]: runtimeId.value })\n\t\t\t\t}\n\t\t\t\treturn builder.create(this.registerCreateMutationPart(processedPlaceholdersByEntity, fieldState))\n\t\t\t})\n\t\t}\n\t\treturn builder.many(marker.parameters.field, builder => {\n\t\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\t\t\tif (this.shouldConnectInsteadOfCreate(processedPlaceholdersByEntity, fieldState)) {\n\t\t\t\t// TODO also potentially update\n\t\t\t\treturn builder.connect({ [PRIMARY_KEY_NAME]: runtimeId.value }, alias)\n\t\t\t}\n\t\t\treturn builder.create(this.registerCreateMutationPart(processedPlaceholdersByEntity, fieldState), alias)\n\t\t})\n\t}\n\n\tprivate registerCreateEntityListPart(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tfieldState: EntityListState,\n\t\tmarker: HasManyRelationMarker,\n\t\tbuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Create>,\n\t) {\n\t\treturn builder.many(marker.parameters.field, builder => {\n\t\t\tfor (const entityRealm of fieldState.children.values()) {\n\t\t\t\tconst runtimeId = entityRealm.entity.id\n\t\t\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\t\t\t\tif (this.shouldConnectInsteadOfCreate(processedPlaceholdersByEntity, entityRealm)) {\n\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\tbuilder = builder.connect({ [PRIMARY_KEY_NAME]: runtimeId.value }, alias)\n\t\t\t\t} else {\n\t\t\t\t\tbuilder = builder.create(this.registerCreateMutationPart(processedPlaceholdersByEntity, entityRealm), alias)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn builder\n\t\t})\n\t}\n\n\tprivate shouldConnectInsteadOfCreate(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tcurrentState: EntityRealmState | EntityRealmStateStub,\n\t): boolean {\n\t\tconst runtimeId = currentState.entity.id\n\t\tconst processedPlaceholders = processedPlaceholdersByEntity.get(currentState.entity)\n\n\t\treturn runtimeId.existsOnServer || (runtimeId instanceof ClientGeneratedUuid && (processedPlaceholders?.has(PRIMARY_KEY_NAME) ?? false))\n\t}\n\n\tprivate registerUpdateMutationPart(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tcurrentState: EntityRealmState,\n\t\tbuilder: CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Update>,\n\t): CrudQueryBuilder.WriteDataBuilder<CrudQueryBuilder.WriteOperation.Update> {\n\t\tlet processedPlaceholders = processedPlaceholdersByEntity.get(currentState.entity)\n\n\t\tif (processedPlaceholders === undefined) {\n\t\t\tprocessedPlaceholdersByEntity.set(currentState.entity, (processedPlaceholders = new Set()))\n\t\t}\n\n\t\tconst pathBack = this.treeStore.getPathBackToParent(currentState)\n\t\tconst entityData = this.treeStore.persistedEntityData.get(currentState.entity.id.uniqueValue)\n\n\t\tfor (const [placeholderName, fieldState] of currentState.children) {\n\t\t\tif (placeholderName === PRIMARY_KEY_NAME || placeholderName === TYPENAME_KEY_NAME) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (processedPlaceholders.has(placeholderName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocessedPlaceholders.add(placeholderName)\n\n\t\t\tswitch (fieldState.type) {\n\t\t\t\tcase 'field': {\n\t\t\t\t\tif (fieldState.persistedValue !== undefined) {\n\t\t\t\t\t\tconst resolvedValue = fieldState.getAccessor().resolvedValue\n\t\t\t\t\t\tif (fieldState.persistedValue !== resolvedValue) {\n\t\t\t\t\t\t\tbuilder = builder.set(placeholderName, this.transformFieldValue(fieldState, resolvedValue))\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityRealmStub':\n\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\tconst marker = getEntityMarker(fieldState)\n\t\t\t\t\tif (!(marker instanceof HasOneRelationMarker)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst runtimeId = fieldState.entity.id\n\t\t\t\t\tconst reducedBy = marker.parameters.reducedBy\n\n\t\t\t\t\tif (reducedBy === undefined) {\n\t\t\t\t\t\tconst subBuilder = ((\n\t\t\t\t\t\t\tbuilder: CrudQueryBuilder.WriteOneRelationBuilder<CrudQueryBuilder.WriteOperation.Update>,\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tconst persistedValue = entityData?.get?.(placeholderName)\n\n\t\t\t\t\t\t\tif (persistedValue instanceof ServerId) {\n\t\t\t\t\t\t\t\tif (persistedValue.value === runtimeId.value) {\n\t\t\t\t\t\t\t\t\t// The persisted and currently referenced ids match, and so this is an update.\n\t\t\t\t\t\t\t\t\tif (fieldState.type === 'entityRealmStub') {\n\t\t\t\t\t\t\t\t\t\treturn builder // …unless we're dealing with a stub. There cannot be any updates there.\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn builder.update(builder =>\n\t\t\t\t\t\t\t\t\t\tthis.registerUpdateMutationPart(processedPlaceholdersByEntity, fieldState, builder),\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// There was a referenced entity but currently, there is a different one. Let's investigate:\n\n\t\t\t\t\t\t\t\tconst plannedDeletion = currentState.plannedHasOneDeletions?.get(placeholderName)\n\t\t\t\t\t\t\t\tif (plannedDeletion !== undefined) {\n\t\t\t\t\t\t\t\t\t// It's planned for deletion.\n\t\t\t\t\t\t\t\t\t// TODO also potentially do something about the current entity\n\t\t\t\t\t\t\t\t\treturn builder.delete()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (runtimeId.existsOnServer) {\n\t\t\t\t\t\t\t\t\t// This isn't the persisted entity but it does exist on the server. Thus this is a connect.\n\t\t\t\t\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\t\t\t\t\treturn builder.connect({\n\t\t\t\t\t\t\t\t\t\t[PRIMARY_KEY_NAME]: runtimeId.value,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// The currently present entity doesn't exist on the server. Try if creating yields anything…\n\t\t\t\t\t\t\t\tconst subBuilder = builder.create(\n\t\t\t\t\t\t\t\t\tthis.registerCreateMutationPart(processedPlaceholdersByEntity, fieldState),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tif (isEmptyObject(subBuilder.data)) {\n\t\t\t\t\t\t\t\t\t// …and if it doesn't, we just disconnect.\n\t\t\t\t\t\t\t\t\treturn builder.disconnect()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// …but if it does, we return the create, disconnecting implicitly.\n\t\t\t\t\t\t\t\treturn subBuilder\n\t\t\t\t\t\t\t} else if (runtimeId.existsOnServer) {\n\t\t\t\t\t\t\t\t// There isn't a linked entity on the server but we're seeing one that exists there.\n\t\t\t\t\t\t\t\t// Thus this is a connect.\n\t\t\t\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\t\t\t\treturn builder.connect({\n\t\t\t\t\t\t\t\t\t[PRIMARY_KEY_NAME]: runtimeId.value,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn builder.create(this.registerCreateMutationPart(processedPlaceholdersByEntity, fieldState))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})(CrudQueryBuilder.WriteOneRelationBuilder.instantiate<CrudQueryBuilder.WriteOperation.Update>())\n\n\t\t\t\t\t\tif (subBuilder.data) {\n\t\t\t\t\t\t\tbuilder = builder.one(marker.parameters.field, subBuilder.data)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This is a reduced has many relation.\n\t\t\t\t\t\tbuilder = builder.many(marker.parameters.field, builder => {\n\t\t\t\t\t\t\tconst persistedValue = entityData?.get?.(placeholderName)\n\t\t\t\t\t\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\n\t\t\t\t\t\t\tif (persistedValue instanceof ServerId) {\n\t\t\t\t\t\t\t\tif (persistedValue.value === runtimeId.value) {\n\t\t\t\t\t\t\t\t\tif (fieldState.type === 'entityRealmStub') {\n\t\t\t\t\t\t\t\t\t\treturn builder\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn builder.update(\n\t\t\t\t\t\t\t\t\t\treducedBy,\n\t\t\t\t\t\t\t\t\t\tbuilder => this.registerUpdateMutationPart(processedPlaceholdersByEntity, fieldState, builder),\n\t\t\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst plannedDeletion = currentState.plannedHasOneDeletions?.get(placeholderName)\n\t\t\t\t\t\t\t\tif (plannedDeletion !== undefined) {\n\t\t\t\t\t\t\t\t\t// TODO also potentially do something about the current entity\n\t\t\t\t\t\t\t\t\treturn builder.delete(reducedBy, alias)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (runtimeId.existsOnServer) {\n\t\t\t\t\t\t\t\t\t// TODO will re-using the alias like this work?\n\t\t\t\t\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\t\t\t\t\treturn builder.disconnect(reducedBy, alias).connect({ [PRIMARY_KEY_NAME]: runtimeId.value }, alias)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst subBuilder = builder.create(\n\t\t\t\t\t\t\t\t\tthis.registerCreateMutationPart(processedPlaceholdersByEntity, fieldState),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\tif (isEmptyObject(subBuilder.data)) {\n\t\t\t\t\t\t\t\t\treturn builder.disconnect(reducedBy, alias)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn subBuilder\n\t\t\t\t\t\t\t} else if (runtimeId.existsOnServer) {\n\t\t\t\t\t\t\t\treturn builder.connect({ [PRIMARY_KEY_NAME]: runtimeId.value }, alias)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn builder.create(this.registerCreateMutationPart(processedPlaceholdersByEntity, fieldState))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tconst marker = fieldState.blueprint.marker\n\t\t\t\t\tif (!(marker instanceof HasManyRelationMarker)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst persistedEntityIds = entityData?.get?.(placeholderName) ?? new Set()\n\n\t\t\t\t\tif (!(persistedEntityIds instanceof Set)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tbuilder = builder.many(marker.parameters.field, builder => {\n\t\t\t\t\t\tfor (const childState of fieldState.children.values()) {\n\t\t\t\t\t\t\tconst runtimeId = childState.entity.id\n\t\t\t\t\t\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\n\t\t\t\t\t\t\tif (runtimeId.existsOnServer) {\n\t\t\t\t\t\t\t\tif (persistedEntityIds.has(runtimeId.value)) {\n\t\t\t\t\t\t\t\t\tif (childState.type !== 'entityRealmStub') {\n\t\t\t\t\t\t\t\t\t\t// A stub cannot have any pending changes.\n\t\t\t\t\t\t\t\t\t\tbuilder = builder.update(\n\t\t\t\t\t\t\t\t\t\t\t{ [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t\t\t\t\t\t\t\t\tbuilder => this.registerUpdateMutationPart(processedPlaceholdersByEntity, childState, builder),\n\t\t\t\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\t\t\t\t\tbuilder = builder.connect({ [PRIMARY_KEY_NAME]: runtimeId.value }, alias)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbuilder = builder.create(\n\t\t\t\t\t\t\t\t\tthis.registerCreateMutationPart(processedPlaceholdersByEntity, childState),\n\t\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (fieldState.plannedRemovals) {\n\t\t\t\t\t\t\tfor (const [removedId, removalType] of fieldState.plannedRemovals) {\n\t\t\t\t\t\t\t\tconst alias = MutationAlias.encodeEntityId(new ServerId(removedId, fieldState.entityName))\n\t\t\t\t\t\t\t\tif (removalType === 'delete') {\n\t\t\t\t\t\t\t\t\tbuilder = builder.delete({ [PRIMARY_KEY_NAME]: removedId }, alias)\n\t\t\t\t\t\t\t\t} else if (removalType === 'disconnect') {\n\t\t\t\t\t\t\t\t\t// TODO also potentially update\n\t\t\t\t\t\t\t\t\tbuilder = builder.disconnect({ [PRIMARY_KEY_NAME]: removedId }, alias)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tassertNever(removalType)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn builder\n\t\t\t\t\t})\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(fieldState)\n\t\t\t}\n\t\t}\n\n\t\treturn builder\n\t}\n\n\tprivate transformFieldValue(fieldState: FieldState, value: FieldValue): FieldValue | GraphQlBuilder.GraphQlLiteral {\n\t\tif (typeof value !== 'string') {\n\t\t\treturn value\n\t\t}\n\t\tconst fieldSchema = this.treeStore.schema.getEntityColumn(\n\t\t\tfieldState.parent.entity.entityName,\n\t\t\tfieldState.fieldMarker.fieldName,\n\t\t)\n\n\t\treturn fieldSchema.enumName === null ? value : new GraphQlBuilder.GraphQlLiteral(value)\n\t}\n\n\tprivate createAlias(): string {\n\t\treturn `op_${this.aliasCounter++}`\n\t}\n}\n"],"names":["builder","placeholderName","subBuilder"],"mappings":";;;;;;;;;;;;;;;;;;AA4CO,MAAM,kBAAkB;AAAA,EAIvB,YAA6B,WAAsB;AAFlD,wCAAe;AAEa,SAAA,YAAA;AAAA,EACpC;AAAA,EAEO,qBAAwD;AAC1D,QAAA;AACC,UAAA,UAAwB,IAAI,iBAAiB;AACjD,YAAM,aAAqC,CAAA;AACrC,YAAA,oDAAmE;AACnE,YAAA,uCAAuB;AAGlB,iBAAA,CAAC,YAAY,UAAU,KAAK,KAAK,UAAU,oBAAoB,WAAW;AACzE,mBAAA,CAAC,iBAAiB,YAAY,KAAK,MAAM,KAAK,WAAW,QAAQ,CAAC,EAAE,WAAW;AACrF,cAAA,aAAa,2BAA2B,GAAG;AAC9C;AAAA,UACD;AACI,cAAA,aAAa,SAAS,eAAe;AACxC,kBAAM,cAAc,KAAK;AAAA,cACxB;AAAA,cACA;AAAA,cACA;AAAA,cACA,aAAa,OAAO,GAAG;AAAA,cACvB;AAAA,cACA;AAAA,YAAA;AAED,gBAAI,aAAa;AAChB,wBAAU,YAAY,CAAC;AACZ,yBAAA,KAAK,YAAY,CAAC,CAAC;AAAA,YAC/B;AAAA,UAAA,WACU,aAAa,SAAS,cAAc;AAC9C,uBAAW,cAAc,aAAa,SAAS,OAAA,GAAU;AACpD,kBAAA,WAAW,SAAS,mBAAm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|
1
|
+
{"version":3,"file":"MutationGenerator.js","sources":["../../../src/core/MutationGenerator.ts"],"sourcesContent":["import { ContentMutation, ContentQueryBuilder, GraphQlLiteral, Input, replaceGraphQlLiteral } from '@contember/client'\nimport { ClientGeneratedUuid, EntityFieldPersistedData, ReceivedEntityData, ServerId } from '../accessorTree'\nimport { BindingError } from '../BindingError'\nimport { PRIMARY_KEY_NAME, TYPENAME_KEY_NAME } from '../bindingTypes'\nimport { EntityFieldMarkers, FieldMarker, HasManyRelationMarker, HasOneRelationMarker } from '../markers'\nimport type { EntityId, EntityName, PlaceholderName, UniqueWhere } from '../treeParameters'\nimport { assertNever, isEmptyObject } from '../utils'\nimport { QueryGenerator } from './QueryGenerator'\nimport { MutationAlias } from './requestAliases'\nimport { EntityListState, EntityRealmState, EntityRealmStateStub, EntityState, FieldState, getEntityMarker, StateIterator } from './state'\nimport type { TreeStore } from './TreeStore'\n\n\ntype ProcessedPlaceholdersByEntity = Map<EntityState, Set<PlaceholderName>>\n\nexport type SubMutationOperation =\n\t& {\n\t\talias: string,\n\t\tsubTreePlaceholder: PlaceholderName,\n\t\tsubTreeType: 'list' | 'single'\n\t}\n\t& (\n\t\t| { type: 'delete', id: EntityId }\n\t\t| { type: 'update', markers: EntityFieldMarkers, id: EntityId }\n\t\t| { type: 'create', markers: EntityFieldMarkers, id: EntityId }\n\t)\n\nexport type PersistMutationResult = {\n\tmutations: Record<string, ContentMutation<ReceivedEntityData>>\n\toperations: SubMutationOperation[]\n}\n\n// TODO enforce correct expected mutations in dev mode.\nexport class MutationGenerator {\n\n\tprivate aliasCounter = 1\n\n\tpublic constructor(\n\t\tprivate readonly treeStore: TreeStore,\n\t\tprivate readonly qb: ContentQueryBuilder,\n\t) {\n\t}\n\n\tpublic getPersistMutation(): PersistMutationResult | undefined {\n\t\tconst mutations: Record<string, ContentMutation<any>> = {}\n\t\tconst operations: SubMutationOperation[] = []\n\t\tconst processedPlaceholdersByEntity: ProcessedPlaceholdersByEntity = new Map()\n\t\tconst processedDeletes = new Set<string>()\n\n\t\tfor (const [treeRootId, rootStates] of this.treeStore.subTreeStatesByRoot.entries()) {\n\t\t\tfor (const [placeholderName, subTreeState] of Array.from(rootStates.entries()).reverse()) {\n\t\t\t\tif (subTreeState.unpersistedChangesCount <= 0) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (subTreeState.type === 'entityRealm') {\n\t\t\t\t\tif (subTreeState.blueprint.type === 'subTree' && subTreeState.blueprint.marker.parameters.isCreating && subTreeState.blueprint.marker.parameters.isUnpersisted) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst subMutation = this.createMutation(\n\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\tplaceholderName,\n\t\t\t\t\t\t'single',\n\t\t\t\t\t\tsubTreeState.entity.id.value,\n\t\t\t\t\t\tsubTreeState,\n\t\t\t\t\t)\n\t\t\t\t\tif (subMutation) {\n\t\t\t\t\t\tmutations[subMutation[1].alias] = subMutation[0]\n\t\t\t\t\t\toperations.push(subMutation[1])\n\t\t\t\t\t}\n\t\t\t\t} else if (subTreeState.type === 'entityList') {\n\t\t\t\t\tif (subTreeState.blueprint.type === 'subTree' && subTreeState.blueprint.marker.parameters.isCreating && subTreeState.blueprint.marker.parameters.isUnpersisted) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfor (const childState of subTreeState.children.values()) {\n\t\t\t\t\t\tif (childState.type === 'entityRealmStub') {\n\t\t\t\t\t\t\t// TODO there can be a forceCreate somewhere in there that we're hereby ignoring.\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst subMutation = this.createMutation(\n\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\tplaceholderName,\n\t\t\t\t\t\t\t'list',\n\t\t\t\t\t\t\tchildState.entity.id.value,\n\t\t\t\t\t\t\tchildState,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (subMutation) {\n\t\t\t\t\t\t\tmutations[subMutation[1].alias] = subMutation[0]\n\t\t\t\t\t\t\toperations.push(subMutation[1])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (subTreeState.plannedRemovals) {\n\t\t\t\t\t\tfor (const [removedId, removalType] of subTreeState.plannedRemovals) {\n\t\t\t\t\t\t\tif (removalType === 'disconnect') {\n\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (removalType === 'delete') {\n\t\t\t\t\t\t\t\tconst key = `${subTreeState.entityName}#${removedId}`\n\t\t\t\t\t\t\t\tif (processedDeletes.has(key)) {\n\t\t\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tprocessedDeletes.add(key)\n\t\t\t\t\t\t\t\tconst alias = this.createAlias()\n\t\t\t\t\t\t\t\tmutations[alias] = this.createDeleteMutation(\n\t\t\t\t\t\t\t\t\tsubTreeState.entityName,\n\t\t\t\t\t\t\t\t\tremovedId,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\toperations.push({ alias, subTreePlaceholder: placeholderName, subTreeType: 'list', type: 'delete', id: removedId })\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tassertNever(removalType)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tassertNever(subTreeState)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { mutations, operations }\n\t}\n\n\tprivate createMutation(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tsubTreePlaceholder: PlaceholderName,\n\t\tsubTreeType: 'list' | 'single',\n\t\tentityId: EntityId,\n\t\trealmState: EntityRealmState,\n\t): [ContentMutation<any>, SubMutationOperation] | undefined {\n\t\tif (realmState.unpersistedChangesCount === 0) {\n\t\t\t// Bail out early\n\t\t\treturn undefined\n\t\t}\n\t\tconst fieldMarkers = getEntityMarker(realmState).fields.markers\n\n\t\tconst alias = this.createAlias()\n\n\t\tif (realmState.entity.isScheduledForDeletion) {\n\t\t\tconst mutation = this.createDeleteMutation(\n\t\t\t\trealmState.entity.entityName,\n\t\t\t\tentityId,\n\t\t\t)\n\t\t\treturn [\n\t\t\t\tmutation,\n\t\t\t\t{\n\t\t\t\t\talias,\n\t\t\t\t\tsubTreePlaceholder,\n\t\t\t\t\tsubTreeType,\n\t\t\t\t\ttype: 'delete',\n\t\t\t\t\tid: entityId,\n\t\t\t\t},\n\t\t\t]\n\t\t} else if (!realmState.entity.id.existsOnServer) {\n\t\t\tconst builder = this.createCreateMutation(\n\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\trealmState,\n\t\t\t\tfieldMarkers,\n\t\t\t)\n\t\t\tif (!builder) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn [\n\t\t\t\tbuilder,\n\t\t\t\t{\n\t\t\t\t\talias,\n\t\t\t\t\tsubTreePlaceholder,\n\t\t\t\t\tsubTreeType,\n\t\t\t\t\ttype: 'create',\n\t\t\t\t\tmarkers: fieldMarkers,\n\t\t\t\t\tid: entityId,\n\t\t\t\t},\n]\n\t\t}\n\t\tconst builder = this.createUpdateMutation(\n\t\t\tprocessedPlaceholdersByEntity,\n\t\t\trealmState,\n\t\t\tfieldMarkers,\n\t\t)\n\t\tif (!builder) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn [\n\t\t\tbuilder,\n\t\t\t{\n\t\t\t\talias,\n\t\t\t\tsubTreePlaceholder,\n\t\t\t\tsubTreeType,\n\t\t\t\ttype: 'update',\n\t\t\t\tid: entityId,\n\t\t\t\tmarkers: fieldMarkers,\n\t\t\t},\n\t\t]\n\t}\n\n\tprivate createDeleteMutation(\n\t\tentityName: EntityName,\n\t\tdeletedId: EntityId,\n\t): ContentMutation<any> {\n\t\treturn this.qb.delete(entityName, {\n\t\t\tby: { [PRIMARY_KEY_NAME]: deletedId },\n\t\t}, it => it.$(PRIMARY_KEY_NAME).$('__typename'))\n\t}\n\n\tprivate createUpdateMutation(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tentityRealm: EntityRealmState,\n\t\tfieldMarkers: EntityFieldMarkers,\n\t): ContentMutation<any> | undefined {\n\t\tconst input = this.getUpdateDataInput(processedPlaceholdersByEntity, entityRealm)\n\n\t\tif (input === undefined) {\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst runtimeId = entityRealm.entity.id\n\n\t\tif (!runtimeId.existsOnServer) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn this.qb.update(entityRealm.entity.entityName, {\n\t\t\tby: {\n\t\t\t\t[PRIMARY_KEY_NAME]: runtimeId.value,\n\t\t\t},\n\t\t\tdata: input,\n\t\t}, it => QueryGenerator.registerQueryPart(fieldMarkers, it).$(PRIMARY_KEY_NAME).$('__typename'))\n\t}\n\n\tprivate createCreateMutation(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tentityRealm: EntityRealmState,\n\t\tfieldMarkers: EntityFieldMarkers,\n\t): ContentMutation<any> | undefined {\n\t\tconst input = this.getCreateDataInput(\n\t\t\tprocessedPlaceholdersByEntity,\n\t\t\tentityRealm,\n\t\t)\n\t\tif (input === undefined) {\n\t\t\treturn undefined\n\t\t}\n\n\t\treturn this.qb.create(entityRealm.entity.entityName, {\n\t\t\tdata: input,\n\t\t}, it => QueryGenerator.registerQueryPart(fieldMarkers, it).$(PRIMARY_KEY_NAME).$('__typename'))\n\t}\n\n\tprivate getCreateDataInput(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tcurrentState: EntityRealmState | EntityRealmStateStub,\n\t): Input.CreateDataInput | undefined {\n\t\tlet processedPlaceholders = processedPlaceholdersByEntity.get(currentState.entity)\n\n\t\tif (processedPlaceholders === undefined) {\n\t\t\tprocessedPlaceholdersByEntity.set(currentState.entity, (processedPlaceholders = new Set()))\n\t\t}\n\n\t\tif (currentState.type === 'entityRealmStub') {\n\t\t\t// TODO If there's a forceCreate, this is wrong.\n\t\t\treturn undefined\n\t\t}\n\n\t\tconst result: Input.CreateDataInput = {}\n\t\tfor (const siblingState of StateIterator.eachSiblingRealm(currentState)) {\n\n\t\t\tconst pathBack = this.treeStore.getPathBackToParent(siblingState)\n\n\t\t\tconst nonbearingFields: Array<| { type: 'field'; marker: FieldMarker; fieldState: FieldState }\n\t\t\t\t| { type: 'hasOne'; marker: HasOneRelationMarker; fieldState: EntityRealmState | EntityRealmStateStub }\n\t\t\t\t| { type: 'hasMany'; marker: HasManyRelationMarker; fieldState: EntityListState }> = []\n\n\t\t\tfor (const [placeholderName, fieldState] of siblingState.children) {\n\t\t\t\tif (processedPlaceholders.has(placeholderName)) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tprocessedPlaceholders.add(placeholderName)\n\n\t\t\t\tswitch (fieldState.type) {\n\t\t\t\t\tcase 'field': {\n\t\t\t\t\t\tconst marker = fieldState.fieldMarker\n\t\t\t\t\t\tconst placeholderName = marker.placeholderName\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tplaceholderName === TYPENAME_KEY_NAME ||\n\t\t\t\t\t\t\t(placeholderName === PRIMARY_KEY_NAME && !(siblingState.entity.id instanceof ClientGeneratedUuid))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (marker.isNonbearing) {\n\t\t\t\t\t\t\tnonbearingFields.push({\n\t\t\t\t\t\t\t\ttype: 'field',\n\t\t\t\t\t\t\t\tmarker,\n\t\t\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst value = fieldState.getAccessor().resolvedValue\n\t\t\t\t\t\tif (value !== undefined && value !== null) {\n\t\t\t\t\t\t\tresult[marker.fieldName] = value\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\t\tconst marker = getEntityMarker(fieldState)\n\t\t\t\t\t\tif (!(marker instanceof HasOneRelationMarker)) {\n\t\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (marker.parameters.isNonbearing) {\n\t\t\t\t\t\t\tnonbearingFields.push({\n\t\t\t\t\t\t\t\ttype: 'hasOne',\n\t\t\t\t\t\t\t\tmarker,\n\t\t\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst input = this.getCreateOneRelationInput(processedPlaceholdersByEntity, fieldState, marker)\n\t\t\t\t\t\tif (input !== undefined) {\n\t\t\t\t\t\t\tresult[marker.parameters.field] = input\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tcase 'entityList': {\n\t\t\t\t\t\tconst marker = fieldState.blueprint.marker\n\t\t\t\t\t\tif (!(marker instanceof HasManyRelationMarker)) {\n\t\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (marker.parameters.isNonbearing) {\n\t\t\t\t\t\t\tnonbearingFields.push({\n\t\t\t\t\t\t\t\ttype: 'hasMany',\n\t\t\t\t\t\t\t\tmarker,\n\t\t\t\t\t\t\t\tfieldState,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst input = this.getCreateManyRelationInput(processedPlaceholdersByEntity, fieldState)\n\t\t\t\t\t\tif (input !== undefined) {\n\t\t\t\t\t\t\tresult[marker.parameters.field] = input\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\treturn assertNever(fieldState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((!isEmptyObject(result)) || !getEntityMarker(siblingState).fields.hasAtLeastOneBearingField) {\n\t\t\t\tfor (const field of nonbearingFields) {\n\t\t\t\t\tswitch (field.type) {\n\t\t\t\t\t\tcase 'field': {\n\t\t\t\t\t\t\tconst value = field.fieldState.getAccessor().resolvedValue\n\t\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\t\tresult[field.marker.fieldName] = value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase 'hasOne': {\n\t\t\t\t\t\t\tconst input = this.getCreateOneRelationInput(\n\t\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\t\tfield.fieldState,\n\t\t\t\t\t\t\t\tfield.marker,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tif (input !== undefined) {\n\t\t\t\t\t\t\t\tresult[field.marker.parameters.field] = input\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase 'hasMany': {\n\t\t\t\t\t\t\tconst input = this.getCreateManyRelationInput(\n\t\t\t\t\t\t\t\tprocessedPlaceholdersByEntity,\n\t\t\t\t\t\t\t\tfield.fieldState,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\tif (input !== undefined) {\n\t\t\t\t\t\t\t\tresult[field.marker.parameters.field] = input\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tassertNever(field)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst setOnCreate = getEntityMarker(siblingState).parameters.setOnCreate\n\t\t\tif (setOnCreate && !isEmptyObject(result)) {\n\t\t\t\tfor (const key in setOnCreate) {\n\t\t\t\t\tconst field = setOnCreate[key]\n\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof field === 'string' ||\n\t\t\t\t\t\ttypeof field === 'number' ||\n\t\t\t\t\t\tfield === null ||\n\t\t\t\t\t\tfield instanceof GraphQlLiteral\n\t\t\t\t\t) {\n\t\t\t\t\t\tresult[key] = field instanceof GraphQlLiteral ? field.value : field\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult[key] = { connect: replaceGraphQlLiteral(field) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn isEmptyObject(result) ? undefined : result\n\t}\n\n\tprivate getCreateOneRelationInput(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tfieldState: EntityRealmState | EntityRealmStateStub,\n\t\tmarker: HasOneRelationMarker,\n\t): Input.CreateOneRelationInput | Input.CreateManyRelationInput | undefined {\n\t\tconst reducedBy = marker.parameters.reducedBy\n\t\tconst runtimeId = fieldState.entity.id\n\n\t\tif (reducedBy === undefined) {\n\t\t\tif (this.shouldConnectInsteadOfCreate(processedPlaceholdersByEntity, fieldState)) {\n\t\t\t\treturn { connect: { [PRIMARY_KEY_NAME]: runtimeId.value } }\n\t\t\t}\n\n\t\t\tconst createData = this.getCreateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\t\tif (createData === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn { create: createData }\n\t\t}\n\n\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\t\tif (this.shouldConnectInsteadOfCreate(processedPlaceholdersByEntity, fieldState)) {\n\t\t\t// TODO also potentially update\n\t\t\treturn [{ connect: { [PRIMARY_KEY_NAME]: runtimeId.value }, alias }]\n\t\t}\n\t\tconst createData = this.getCreateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\tif (createData === undefined) {\n\t\t\treturn undefined\n\t\t}\n\t\treturn [{ create: createData, alias }]\n\t}\n\n\tprivate getCreateManyRelationInput(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tfieldState: EntityListState,\n\t): Input.CreateManyRelationInput | undefined {\n\t\tconst result: Input.CreateManyRelationInput = []\n\t\tfor (const entityRealm of fieldState.children.values()) {\n\t\t\tconst runtimeId = entityRealm.entity.id\n\t\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\t\t\tif (this.shouldConnectInsteadOfCreate(processedPlaceholdersByEntity, entityRealm)) {\n\t\t\t\tresult.push({\n\t\t\t\t\talias,\n\t\t\t\t\tconnect: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tconst createData = this.getCreateDataInput(processedPlaceholdersByEntity, entityRealm)\n\t\t\t\tif (createData === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tresult.push({\n\t\t\t\t\talias,\n\t\t\t\t\tcreate: createData,\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\treturn result.length === 0 ? undefined : result\n\t}\n\n\tprivate shouldConnectInsteadOfCreate(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tcurrentState: EntityRealmState | EntityRealmStateStub,\n\t): boolean {\n\t\tconst runtimeId = currentState.entity.id\n\t\tconst processedPlaceholders = processedPlaceholdersByEntity.get(currentState.entity)\n\n\t\treturn runtimeId.existsOnServer || (runtimeId instanceof ClientGeneratedUuid && (processedPlaceholders?.has(PRIMARY_KEY_NAME) ?? false))\n\t}\n\n\tprivate getUpdateDataInput(\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tcurrentState: EntityRealmState,\n\t): Input.UpdateDataInput | undefined {\n\t\tlet processedPlaceholders = processedPlaceholdersByEntity.get(currentState.entity)\n\n\t\tif (processedPlaceholders === undefined) {\n\t\t\tprocessedPlaceholdersByEntity.set(currentState.entity, (processedPlaceholders = new Set()))\n\t\t}\n\n\t\tconst pathBack = this.treeStore.getPathBackToParent(currentState)\n\t\tconst entityData = this.treeStore.persistedEntityData.get(currentState.entity.id.uniqueValue)\n\n\t\tconst result: Input.UpdateDataInput = {}\n\n\t\tfor (const [placeholderName, fieldState] of currentState.children) {\n\t\t\tif (placeholderName === PRIMARY_KEY_NAME || placeholderName === TYPENAME_KEY_NAME) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (processedPlaceholders.has(placeholderName)) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprocessedPlaceholders.add(placeholderName)\n\n\t\t\tswitch (fieldState.type) {\n\t\t\t\tcase 'field': {\n\t\t\t\t\tif (fieldState.persistedValue !== undefined) {\n\t\t\t\t\t\tconst resolvedValue = fieldState.getAccessor().resolvedValue\n\t\t\t\t\t\tif (fieldState.persistedValue !== resolvedValue) {\n\t\t\t\t\t\t\tresult[placeholderName] = resolvedValue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityRealmStub':\n\t\t\t\tcase 'entityRealm': {\n\t\t\t\t\tconst marker = getEntityMarker(fieldState)\n\t\t\t\t\tif (!(marker instanceof HasOneRelationMarker)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst reducedBy = marker.parameters.reducedBy\n\n\t\t\t\t\tconst persistedValue = entityData?.get?.(placeholderName)\n\t\t\t\t\tif (reducedBy === undefined) {\n\n\t\t\t\t\t\tconst relationData = this.getUpdateOneRelationInput(currentState, fieldState, persistedValue, processedPlaceholdersByEntity, placeholderName)\n\t\t\t\t\t\tif (relationData !== undefined) {\n\t\t\t\t\t\t\tresult[marker.parameters.field] = relationData\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst relationData = this.getUpdateManyRelationForReducedInput(currentState, fieldState, persistedValue, processedPlaceholdersByEntity, placeholderName, reducedBy)\n\t\t\t\t\t\tif (relationData !== undefined) {\n\t\t\t\t\t\t\tresult[marker.parameters.field] = relationData\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'entityList': {\n\t\t\t\t\tconst marker = fieldState.blueprint.marker\n\t\t\t\t\tif (!(marker instanceof HasManyRelationMarker)) {\n\t\t\t\t\t\tthrow new BindingError()\n\t\t\t\t\t}\n\t\t\t\t\tif (pathBack?.fieldBackToParent === marker.parameters.field) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst persistedEntityIds = entityData?.get?.(placeholderName) ?? new Set()\n\n\t\t\t\t\tif (!(persistedEntityIds instanceof Set)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst relationData = this.getUpdateManyRelationInput(fieldState, persistedEntityIds, processedPlaceholdersByEntity)\n\t\t\t\t\tif (relationData !== undefined) {\n\t\t\t\t\t\tresult[marker.parameters.field] = relationData\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(fieldState)\n\t\t\t}\n\t\t}\n\n\t\treturn isEmptyObject(result) ? undefined : result\n\t}\n\n\tprivate getUpdateOneRelationInput(\n\t\tcurrentState: EntityRealmState,\n\t\tfieldState: EntityRealmState | EntityRealmStateStub,\n\t\tpersistedValue: EntityFieldPersistedData | undefined,\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tplaceholderName: PlaceholderName,\n\t): Input.UpdateOneRelationInput | undefined {\n\t\tconst runtimeId = fieldState.entity.id\n\t\tif (persistedValue instanceof ServerId) {\n\t\t\tif (persistedValue.value === runtimeId.value) {\n\t\t\t\t// The persisted and currently referenced ids match, and so this is an update.\n\t\t\t\tif (fieldState.type === 'entityRealmStub') {\n\t\t\t\t\treturn undefined// …unless we're dealing with a stub. There cannot be any updates there.\n\t\t\t\t}\n\t\t\t\tconst input = this.getUpdateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\t\t\tif (input === undefined) {\n\t\t\t\t\treturn undefined\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tupdate: input,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// There was a referenced entity but currently, there is a different one. Let's investigate:\n\n\t\t\tconst plannedDeletion = currentState.plannedHasOneDeletions?.get(placeholderName)\n\t\t\tif (plannedDeletion !== undefined) {\n\t\t\t\t// It's planned for deletion.\n\t\t\t\t// TODO also potentially do something about the current entity\n\t\t\t\treturn {\n\t\t\t\t\tdelete: true,\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (runtimeId.existsOnServer) {\n\t\t\t\t// This isn't the persisted entity but it does exist on the server. Thus this is a connect.\n\t\t\t\t// TODO also potentially update\n\t\t\t\treturn {\n\t\t\t\t\tconnect: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t// The currently present entity doesn't exist on the server. Try if creating yields anything…\n\t\t\tconst createInput = this.getCreateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\t\tif (createInput !== undefined) {\n\t\t\t\treturn {\n\t\t\t\t\tcreate: createInput,\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// …but if it doesn't, we just disconnect.\n\t\t\t\treturn {\n\t\t\t\t\tdisconnect: true,\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (runtimeId.existsOnServer) {\n\t\t\t// There isn't a linked entity on the server but we're seeing one that exists there.\n\t\t\t// Thus this is a connect.\n\t\t\t// TODO also potentially update\n\t\t\treturn {\n\t\t\t\tconnect: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t}\n\t\t} else {\n\t\t\tconst input = this.getCreateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\t\tif (input === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tcreate: input,\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getUpdateManyRelationForReducedInput(\n\t\tcurrentState: EntityRealmState,\n\t\tfieldState: EntityRealmState | EntityRealmStateStub,\n\t\tpersistedValue: EntityFieldPersistedData | undefined,\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t\tplaceholderName: PlaceholderName,\n\t\treducedBy: UniqueWhere,\n\t): Input.UpdateManyRelationInput | undefined {\n\n\t\tconst runtimeId = fieldState.entity.id\n\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\n\t\tif (persistedValue instanceof ServerId) {\n\t\t\tif (persistedValue.value === runtimeId.value) {\n\t\t\t\tif (fieldState.type === 'entityRealmStub') {\n\t\t\t\t\treturn undefined\n\t\t\t\t}\n\t\t\t\tconst updateData = this.getUpdateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\t\t\tif (updateData === undefined) {\n\t\t\t\t\treturn undefined\n\t\t\t\t}\n\t\t\t\treturn [{\n\t\t\t\t\talias,\n\t\t\t\t\tupdate: {\n\t\t\t\t\t\tby: replaceGraphQlLiteral(reducedBy),\n\t\t\t\t\t\tdata: updateData,\n\t\t\t\t\t},\n\t\t\t\t}]\n\t\t\t}\n\t\t\tconst plannedDeletion = currentState.plannedHasOneDeletions?.get(placeholderName)\n\t\t\tif (plannedDeletion !== undefined) {\n\t\t\t\t// TODO also potentially do something about the current entity\n\t\t\t\treturn [{\n\t\t\t\t\talias,\n\t\t\t\t\tdelete: replaceGraphQlLiteral(reducedBy),\n\t\t\t\t}]\n\t\t\t}\n\t\t\tif (runtimeId.existsOnServer) {\n\t\t\t\t// TODO will re-using the alias like this work?\n\t\t\t\t// TODO also potentially update\n\t\t\t\treturn [\n\t\t\t\t\t{\n\t\t\t\t\t\talias,\n\t\t\t\t\t\tdisconnect: replaceGraphQlLiteral(reducedBy),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\talias,\n\t\t\t\t\t\tconnect: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t\t\t},\n\t\t\t\t]\n\t\t\t}\n\t\t\tconst createInput = this.getCreateDataInput(processedPlaceholdersByEntity, fieldState)\n\n\t\t\tif (createInput === undefined) {\n\t\t\t\treturn [{\n\t\t\t\t\talias,\n\t\t\t\t\tdisconnect: replaceGraphQlLiteral(reducedBy),\n\t\t\t\t}]\n\t\t\t}\n\t\t\treturn [{\n\t\t\t\talias,\n\t\t\t\tcreate: createInput,\n\t\t\t}]\n\t\t} else if (runtimeId.existsOnServer) {\n\t\t\treturn [{\n\t\t\t\talias,\n\t\t\t\tconnect: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t}]\n\t\t} else {\n\t\t\tconst createInput = this.getCreateDataInput(processedPlaceholdersByEntity, fieldState)\n\t\t\tif (createInput === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn [{\n\t\t\t\talias,\n\t\t\t\tcreate: createInput,\n\t\t\t}]\n\t\t}\n\t}\n\n\tprivate getUpdateManyRelationInput(\n\t\tfieldState: EntityListState,\n\t\tpersistedEntityIds: Set<EntityId>,\n\t\tprocessedPlaceholdersByEntity: ProcessedPlaceholdersByEntity,\n\t): Input.UpdateManyRelationInput | undefined {\n\n\t\tconst input: Input.UpdateManyRelationInput = []\n\t\tfor (const childState of fieldState.children.values()) {\n\t\t\tconst runtimeId = childState.entity.id\n\t\t\tconst alias = MutationAlias.encodeEntityId(runtimeId)\n\n\t\t\tif (runtimeId.existsOnServer) {\n\t\t\t\tif (persistedEntityIds.has(runtimeId.value)) {\n\t\t\t\t\tif (childState.type !== 'entityRealmStub') {\n\t\t\t\t\t\tconst dataInput = this.getUpdateDataInput(processedPlaceholdersByEntity, childState)\n\n\t\t\t\t\t\tif (dataInput !== undefined) {\n\t\t\t\t\t\t\tinput.push({\n\t\t\t\t\t\t\t\talias,\n\t\t\t\t\t\t\t\tupdate: {\n\t\t\t\t\t\t\t\t\tby: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t\t\t\t\t\t\tdata: dataInput,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tinput.push({\n\t\t\t\t\t\talias,\n\t\t\t\t\t\tconnect: { [PRIMARY_KEY_NAME]: runtimeId.value },\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst dataInput = this.getCreateDataInput(processedPlaceholdersByEntity, childState)\n\t\t\t\tif (dataInput !== undefined) {\n\t\t\t\t\tinput.push({\n\t\t\t\t\t\talias,\n\t\t\t\t\t\tcreate: dataInput,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (fieldState.plannedRemovals) {\n\t\t\tfor (const [removedId, removalType] of fieldState.plannedRemovals) {\n\t\t\t\tconst alias = MutationAlias.encodeEntityId(new ServerId(removedId, fieldState.entityName))\n\t\t\t\tif (removalType === 'delete') {\n\n\t\t\t\t\tinput.push({\n\t\t\t\t\t\talias,\n\t\t\t\t\t\tdelete: { [PRIMARY_KEY_NAME]: removedId },\n\t\t\t\t\t})\n\n\t\t\t\t} else if (removalType === 'disconnect') {\n\t\t\t\t\t// TODO also potentially update\n\n\t\t\t\t\tinput.push({\n\t\t\t\t\t\talias,\n\t\t\t\t\t\tdisconnect: { [PRIMARY_KEY_NAME]: removedId },\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tassertNever(removalType)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn input.length === 0 ? undefined : input\n\t}\n\n\n\tprivate createAlias(): string {\n\t\treturn `op_${this.aliasCoun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AE,CAAC,gBAAgB,GAAG,UAAU,MAAM;AAAA,UAAA,CAC/C;AAAA,QACF;AAAA,MAAA,OACM;AACN,cAAM,YAAY,KAAK,mBAAmB,+BAA+B,UAAU;AACnF,YAAI,cAAc,QAAW;AAC5B,gBAAM,KAAK;AAAA,YACV;AAAA,YACA,QAAQ;AAAA,UAAA,CACR;AAAA,QACF;AAAA,MACD;AAAA,IACD;AACA,QAAI,WAAW,iBAAiB;AAC/B,iBAAW,CAAC,WAAW,WAAW,KAAK,WAAW,iBAAiB;AAC5D,cAAA,QAAQ,cAAc,eAAe,IAAI,SAAS,WAAW,WAAW,UAAU,CAAC;AACzF,YAAI,gBAAgB,UAAU;AAE7B,gBAAM,KAAK;AAAA,YACV;AAAA,YACA,QAAQ,EAAE,CAAC,gBAAgB,GAAG,UAAU;AAAA,UAAA,CACxC;AAAA,QAAA,WAES,gBAAgB,cAAc;AAGxC,gBAAM,KAAK;AAAA,YACV;AAAA,YACA,YAAY,EAAE,CAAC,gBAAgB,GAAG,UAAU;AAAA,UAAA,CAC5C;AAAA,QAAA,OACK;AACN,sBAAuB;AAAA,QACxB;AAAA,MACD;AAAA,IACD;AAEO,WAAA,MAAM,WAAW,IAAI,SAAY;AAAA,EACzC;AAAA,EAGQ,cAAsB;AACtB,WAAA,MAAM,KAAK,cAAc;AAAA,EACjC;AACD;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const bindingTypes = require("../bindingTypes.cjs");
|
|
4
|
+
const client = require("@contember/client");
|
|
5
|
+
const ucfirst = require("../utils/ucfirst.cjs");
|
|
6
|
+
const EntitySubTreeMarker = require("../markers/EntitySubTreeMarker.cjs");
|
|
7
|
+
const EntityListSubTreeMarker = require("../markers/EntityListSubTreeMarker.cjs");
|
|
8
|
+
const FieldMarker = require("../markers/FieldMarker.cjs");
|
|
9
|
+
const HasOneRelationMarker = require("../markers/HasOneRelationMarker.cjs");
|
|
10
|
+
const HasManyRelationMarker = require("../markers/HasManyRelationMarker.cjs");
|
|
11
|
+
const assertNever = require("../utils/assertNever.cjs");
|
|
12
|
+
class QueryGenerator {
|
|
13
|
+
constructor(tree, qb) {
|
|
14
|
+
this.tree = tree;
|
|
15
|
+
this.qb = qb;
|
|
16
|
+
}
|
|
17
|
+
getReadQuery() {
|
|
18
|
+
const result = {};
|
|
19
|
+
for (const [, subTreeMarker] of this.tree.subTrees) {
|
|
20
|
+
if (subTreeMarker.parameters.isCreating) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (subTreeMarker instanceof EntitySubTreeMarker.EntitySubTreeMarker) {
|
|
24
|
+
result[subTreeMarker.placeholderName] = this.addGetQuery(subTreeMarker);
|
|
25
|
+
} else if (subTreeMarker instanceof EntityListSubTreeMarker.EntityListSubTreeMarker) {
|
|
26
|
+
result[subTreeMarker.placeholderName] = this.createListQuery(subTreeMarker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
addGetQuery(subTree) {
|
|
32
|
+
if (subTree.parameters.isCreating) {
|
|
33
|
+
throw new Error();
|
|
34
|
+
}
|
|
35
|
+
return this.qb.get(
|
|
36
|
+
subTree.entityName,
|
|
37
|
+
{
|
|
38
|
+
by: client.replaceGraphQlLiteral(subTree.parameters.where),
|
|
39
|
+
filter: resolveFilter(subTree.parameters.filter)
|
|
40
|
+
},
|
|
41
|
+
(it) => QueryGenerator.registerQueryPart(subTree.fields.markers, it)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
createListQuery(subTree) {
|
|
45
|
+
if (subTree.parameters.isCreating) {
|
|
46
|
+
throw new Error();
|
|
47
|
+
}
|
|
48
|
+
return this.qb.list(
|
|
49
|
+
subTree.entityName,
|
|
50
|
+
{
|
|
51
|
+
filter: resolveFilter(subTree.parameters.filter),
|
|
52
|
+
orderBy: client.replaceGraphQlLiteral(subTree.parameters.orderBy),
|
|
53
|
+
offset: subTree.parameters.offset,
|
|
54
|
+
limit: subTree.parameters.limit
|
|
55
|
+
},
|
|
56
|
+
(it) => QueryGenerator.registerQueryPart(subTree.fields.markers, it)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static registerQueryPart(fields, selection) {
|
|
60
|
+
selection = selection.$(bindingTypes.PRIMARY_KEY_NAME).$("__typename");
|
|
61
|
+
for (const [, fieldValue] of fields) {
|
|
62
|
+
if (fieldValue instanceof FieldMarker.FieldMarker) {
|
|
63
|
+
if (fieldValue.fieldName !== bindingTypes.PRIMARY_KEY_NAME) {
|
|
64
|
+
selection = selection.$(fieldValue.fieldName);
|
|
65
|
+
}
|
|
66
|
+
} else if (fieldValue instanceof HasOneRelationMarker.HasOneRelationMarker) {
|
|
67
|
+
const relation = fieldValue.parameters;
|
|
68
|
+
if (relation.reducedBy) {
|
|
69
|
+
const relationField = `${relation.field}By${ucfirst.ucfirst(Object.keys(relation.reducedBy)[0])}`;
|
|
70
|
+
selection = selection.$(
|
|
71
|
+
relationField,
|
|
72
|
+
{
|
|
73
|
+
by: client.replaceGraphQlLiteral(relation.reducedBy),
|
|
74
|
+
filter: resolveFilter(relation.filter),
|
|
75
|
+
as: fieldValue.placeholderName
|
|
76
|
+
},
|
|
77
|
+
(it) => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it)
|
|
78
|
+
);
|
|
79
|
+
} else {
|
|
80
|
+
selection = selection.$(
|
|
81
|
+
relation.field,
|
|
82
|
+
{
|
|
83
|
+
filter: resolveFilter(relation.filter),
|
|
84
|
+
as: fieldValue.placeholderName
|
|
85
|
+
},
|
|
86
|
+
(it) => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
} else if (fieldValue instanceof HasManyRelationMarker.HasManyRelationMarker) {
|
|
90
|
+
const relation = fieldValue.parameters;
|
|
91
|
+
selection = selection.$(
|
|
92
|
+
relation.field,
|
|
93
|
+
{
|
|
94
|
+
as: fieldValue.placeholderName,
|
|
95
|
+
filter: resolveFilter(relation.filter),
|
|
96
|
+
orderBy: client.replaceGraphQlLiteral(relation.orderBy),
|
|
97
|
+
offset: relation.offset,
|
|
98
|
+
limit: relation.limit
|
|
99
|
+
},
|
|
100
|
+
(it) => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it)
|
|
101
|
+
);
|
|
102
|
+
} else {
|
|
103
|
+
assertNever.assertNever();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return selection;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const resolveFilter = (input) => {
|
|
110
|
+
return client.replaceGraphQlLiteral(input);
|
|
111
|
+
};
|
|
112
|
+
exports.QueryGenerator = QueryGenerator;
|
|
113
|
+
//# sourceMappingURL=QueryGenerator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryGenerator.cjs","sources":["../../../src/core/QueryGenerator.ts"],"sourcesContent":["import { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport {\n\tEntityFieldMarkers,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMarkerTreeRoot,\n} from '../markers'\nimport { assertNever, ucfirst } from '../utils'\nimport { ContentEntitySelection, ContentQuery, ContentQueryBuilder, replaceGraphQlLiteral } from '@contember/client'\nimport { Filter } from '../treeParameters'\n\n\nexport class QueryGenerator {\n\tconstructor(\n\t\tprivate tree: MarkerTreeRoot,\n\t\tprivate qb: ContentQueryBuilder,\n\t) {}\n\n\tpublic getReadQuery(): Record<string, ContentQuery<any>> {\n\t\tconst result: Record<string, ContentQuery<any>> = {}\n\t\tfor (const [, subTreeMarker] of this.tree.subTrees) {\n\t\t\tif (subTreeMarker.parameters.isCreating) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (subTreeMarker instanceof EntitySubTreeMarker) {\n\t\t\t\tresult[subTreeMarker.placeholderName] = this.addGetQuery(subTreeMarker)\n\t\t\t} else if (subTreeMarker instanceof EntityListSubTreeMarker) {\n\t\t\t\tresult[subTreeMarker.placeholderName] = this.createListQuery(subTreeMarker)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tprivate addGetQuery(subTree: EntitySubTreeMarker): ContentQuery<any> {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\tthrow new Error()\n\t\t}\n\n\t\treturn this.qb.get(\n\t\t\tsubTree.entityName,\n\t\t\t{\n\t\t\t\tby: replaceGraphQlLiteral(subTree.parameters.where),\n\t\t\t\tfilter: resolveFilter(subTree.parameters.filter),\n\t\t\t},\n\t\t\tit => QueryGenerator.registerQueryPart(subTree.fields.markers, it),\n\t\t)\n\t}\n\n\tprivate createListQuery(subTree: EntityListSubTreeMarker): ContentQuery<any> {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\tthrow new Error()\n\t\t}\n\t\treturn this.qb.list(\n\t\t\tsubTree.entityName,\n\t\t\t{\n\t\t\t\tfilter: resolveFilter(subTree.parameters.filter),\n\t\t\t\torderBy: replaceGraphQlLiteral(subTree.parameters.orderBy),\n\t\t\t\toffset: subTree.parameters.offset,\n\t\t\t\tlimit: subTree.parameters.limit,\n\t\t\t},\n\t\t\tit => QueryGenerator.registerQueryPart(subTree.fields.markers, it),\n\t\t)\n\t}\n\n\tpublic static registerQueryPart(fields: EntityFieldMarkers, selection: ContentEntitySelection): ContentEntitySelection {\n\t\tselection = selection.$(PRIMARY_KEY_NAME).$('__typename')\n\n\t\tfor (const [, fieldValue] of fields) {\n\t\t\tif (fieldValue instanceof FieldMarker) {\n\t\t\t\tif (fieldValue.fieldName !== PRIMARY_KEY_NAME) {\n\t\t\t\t\tselection = selection.$(fieldValue.fieldName)\n\t\t\t\t}\n\t\t\t} else if (fieldValue instanceof HasOneRelationMarker) {\n\t\t\t\tconst relation = fieldValue.parameters\n\n\t\t\t\tif (relation.reducedBy) {\n\t\t\t\t\t// Assuming there's exactly one reducer field as enforced by MarkerTreeGenerator\n\t\t\t\t\tconst relationField = `${relation.field}By${ucfirst(Object.keys(relation.reducedBy)[0])}`\n\t\t\t\t\tselection = selection.$(\n\t\t\t\t\t\trelationField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tby: replaceGraphQlLiteral(relation.reducedBy),\n\t\t\t\t\t\t\tfilter: resolveFilter(relation.filter),\n\t\t\t\t\t\t\tas: fieldValue.placeholderName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tit => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it),\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tselection = selection.$(\n\t\t\t\t\t\trelation.field,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfilter: resolveFilter(relation.filter),\n\t\t\t\t\t\t\tas: fieldValue.placeholderName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tit => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else if (fieldValue instanceof HasManyRelationMarker) {\n\t\t\t\tconst relation = fieldValue.parameters\n\n\n\t\t\t\tselection = selection.$(\n\t\t\t\t\trelation.field,\n\t\t\t\t\t{\n\t\t\t\t\t\tas: fieldValue.placeholderName,\n\t\t\t\t\t\tfilter: resolveFilter(relation.filter),\n\t\t\t\t\t\torderBy: replaceGraphQlLiteral(relation.orderBy),\n\t\t\t\t\t\toffset: relation.offset,\n\t\t\t\t\t\tlimit: relation.limit,\n\t\t\t\t\t},\n\t\t\t\t\tit => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it),\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tassertNever(fieldValue)\n\t\t\t}\n\t\t}\n\n\t\treturn selection\n\t}\n}\n\nconst resolveFilter = (input?: Filter): Filter<never> => {\n\treturn replaceGraphQlLiteral<unknown>(input) as Filter<never>\n}\n"],"names":["EntitySubTreeMarker","EntityListSubTreeMarker","repla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S;AAAA,UACjB;AAAA,UACA,QAAM,eAAe,kBAAkB,WAAW,OAAO,SAAS,EAAE;AAAA,QAAA;AAAA,MACrE,OACM;AACNM,oBAAAA,YAAsB;AAAA,MACvB;AAAA,IACD;AAEO,WAAA;AAAA,EACR;AACD;AAEA,MAAM,gBAAgB,CAAC,UAAkC;AACxD,SAAON,OAAAA,sBAA+B,KAAK;AAC5C;;"}
|
|
@@ -1,123 +1,112 @@
|
|
|
1
|
-
import { CrudQueryBuilder } from "@contember/client";
|
|
2
1
|
import { PRIMARY_KEY_NAME } from "../bindingTypes.js";
|
|
2
|
+
import { replaceGraphQlLiteral } from "@contember/client";
|
|
3
3
|
import { ucfirst } from "../utils/ucfirst.js";
|
|
4
|
-
import { EntityListSubTreeMarker } from "../markers/EntityListSubTreeMarker.js";
|
|
5
4
|
import { EntitySubTreeMarker } from "../markers/EntitySubTreeMarker.js";
|
|
6
|
-
import {
|
|
5
|
+
import { EntityListSubTreeMarker } from "../markers/EntityListSubTreeMarker.js";
|
|
7
6
|
import { FieldMarker } from "../markers/FieldMarker.js";
|
|
8
7
|
import { HasOneRelationMarker } from "../markers/HasOneRelationMarker.js";
|
|
9
8
|
import { HasManyRelationMarker } from "../markers/HasManyRelationMarker.js";
|
|
9
|
+
import { assertNever } from "../utils/assertNever.js";
|
|
10
10
|
class QueryGenerator {
|
|
11
|
-
constructor(tree) {
|
|
11
|
+
constructor(tree, qb) {
|
|
12
12
|
this.tree = tree;
|
|
13
|
+
this.qb = qb;
|
|
13
14
|
}
|
|
14
15
|
getReadQuery() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const result = {};
|
|
17
|
+
for (const [, subTreeMarker] of this.tree.subTrees) {
|
|
18
|
+
if (subTreeMarker.parameters.isCreating) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (subTreeMarker instanceof EntitySubTreeMarker) {
|
|
22
|
+
result[subTreeMarker.placeholderName] = this.addGetQuery(subTreeMarker);
|
|
23
|
+
} else if (subTreeMarker instanceof EntityListSubTreeMarker) {
|
|
24
|
+
result[subTreeMarker.placeholderName] = this.createListQuery(subTreeMarker);
|
|
19
25
|
}
|
|
20
|
-
return baseQueryBuilder.getGql();
|
|
21
|
-
} catch (e) {
|
|
22
|
-
return void 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
addSubQuery(subTree, baseQueryBuilder) {
|
|
26
|
-
if (subTree.parameters.isCreating) {
|
|
27
|
-
return baseQueryBuilder;
|
|
28
|
-
}
|
|
29
|
-
if (subTree instanceof EntityListSubTreeMarker) {
|
|
30
|
-
return this.addListQuery(baseQueryBuilder, subTree);
|
|
31
|
-
} else if (subTree instanceof EntitySubTreeMarker) {
|
|
32
|
-
return this.addGetQuery(baseQueryBuilder, subTree);
|
|
33
26
|
}
|
|
34
|
-
|
|
27
|
+
return result;
|
|
35
28
|
}
|
|
36
|
-
addGetQuery(
|
|
29
|
+
addGetQuery(subTree) {
|
|
37
30
|
if (subTree.parameters.isCreating) {
|
|
38
|
-
|
|
31
|
+
throw new Error();
|
|
39
32
|
}
|
|
40
|
-
|
|
41
|
-
subTree.fields.markers,
|
|
42
|
-
CrudQueryBuilder.ReadBuilder.instantiate().by(subTree.parameters.where)
|
|
43
|
-
);
|
|
44
|
-
return baseQueryBuilder.get(
|
|
33
|
+
return this.qb.get(
|
|
45
34
|
subTree.entityName,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
35
|
+
{
|
|
36
|
+
by: replaceGraphQlLiteral(subTree.parameters.where),
|
|
37
|
+
filter: resolveFilter(subTree.parameters.filter)
|
|
38
|
+
},
|
|
39
|
+
(it) => QueryGenerator.registerQueryPart(subTree.fields.markers, it)
|
|
50
40
|
);
|
|
51
41
|
}
|
|
52
|
-
|
|
42
|
+
createListQuery(subTree) {
|
|
53
43
|
if (subTree.parameters.isCreating) {
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
let finalBuilder;
|
|
57
|
-
if (subTree.parameters) {
|
|
58
|
-
const parameters = subTree.parameters;
|
|
59
|
-
const withFilter = parameters.filter ? CrudQueryBuilder.ReadBuilder.instantiate().filter(parameters.filter) : CrudQueryBuilder.ReadBuilder.instantiate();
|
|
60
|
-
const withOrderBy = parameters.orderBy ? withFilter.orderBy(parameters.orderBy) : withFilter;
|
|
61
|
-
const withOffset = parameters.offset === void 0 ? withOrderBy : withOrderBy.offset(parameters.offset);
|
|
62
|
-
finalBuilder = parameters.limit === void 0 ? withOffset : withOffset.limit(parameters.limit);
|
|
63
|
-
} else {
|
|
64
|
-
finalBuilder = CrudQueryBuilder.ReadBuilder.instantiate();
|
|
44
|
+
throw new Error();
|
|
65
45
|
}
|
|
66
|
-
return
|
|
46
|
+
return this.qb.list(
|
|
67
47
|
subTree.entityName,
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
{
|
|
49
|
+
filter: resolveFilter(subTree.parameters.filter),
|
|
50
|
+
orderBy: replaceGraphQlLiteral(subTree.parameters.orderBy),
|
|
51
|
+
offset: subTree.parameters.offset,
|
|
52
|
+
limit: subTree.parameters.limit
|
|
53
|
+
},
|
|
54
|
+
(it) => QueryGenerator.registerQueryPart(subTree.fields.markers, it)
|
|
70
55
|
);
|
|
71
56
|
}
|
|
72
|
-
static registerQueryPart(fields,
|
|
73
|
-
|
|
57
|
+
static registerQueryPart(fields, selection) {
|
|
58
|
+
selection = selection.$(PRIMARY_KEY_NAME).$("__typename");
|
|
74
59
|
for (const [, fieldValue] of fields) {
|
|
75
60
|
if (fieldValue instanceof FieldMarker) {
|
|
76
61
|
if (fieldValue.fieldName !== PRIMARY_KEY_NAME) {
|
|
77
|
-
|
|
62
|
+
selection = selection.$(fieldValue.fieldName);
|
|
78
63
|
}
|
|
79
64
|
} else if (fieldValue instanceof HasOneRelationMarker) {
|
|
80
65
|
const relation = fieldValue.parameters;
|
|
81
|
-
const builderWithBody = CrudQueryBuilder.ReadBuilder.instantiate(
|
|
82
|
-
this.registerQueryPart(fieldValue.fields.markers, CrudQueryBuilder.ReadBuilder.instantiate()).objectBuilder
|
|
83
|
-
);
|
|
84
|
-
const filteredBuilder = relation.filter ? builderWithBody.filter(relation.filter) : builderWithBody;
|
|
85
66
|
if (relation.reducedBy) {
|
|
86
67
|
const relationField = `${relation.field}By${ucfirst(Object.keys(relation.reducedBy)[0])}`;
|
|
87
|
-
|
|
68
|
+
selection = selection.$(
|
|
88
69
|
relationField,
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
{
|
|
71
|
+
by: replaceGraphQlLiteral(relation.reducedBy),
|
|
72
|
+
filter: resolveFilter(relation.filter),
|
|
73
|
+
as: fieldValue.placeholderName
|
|
74
|
+
},
|
|
75
|
+
(it) => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it)
|
|
91
76
|
);
|
|
92
77
|
} else {
|
|
93
|
-
|
|
78
|
+
selection = selection.$(
|
|
94
79
|
relation.field,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
80
|
+
{
|
|
81
|
+
filter: resolveFilter(relation.filter),
|
|
82
|
+
as: fieldValue.placeholderName
|
|
83
|
+
},
|
|
84
|
+
(it) => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it)
|
|
98
85
|
);
|
|
99
86
|
}
|
|
100
87
|
} else if (fieldValue instanceof HasManyRelationMarker) {
|
|
101
88
|
const relation = fieldValue.parameters;
|
|
102
|
-
|
|
103
|
-
this.registerQueryPart(fieldValue.fields.markers, CrudQueryBuilder.ReadBuilder.instantiate()).objectBuilder
|
|
104
|
-
);
|
|
105
|
-
const withFilter = relation.filter ? builderWithBody.filter(relation.filter) : builderWithBody;
|
|
106
|
-
const withOrderBy = relation.orderBy ? withFilter.orderBy(relation.orderBy) : withFilter;
|
|
107
|
-
const withOffset = relation.offset === void 0 ? withOrderBy : withOrderBy.offset(relation.offset);
|
|
108
|
-
const withLimit = relation.limit === void 0 ? withOffset : withOffset.limit(relation.limit);
|
|
109
|
-
builder = builder.anyRelation(
|
|
89
|
+
selection = selection.$(
|
|
110
90
|
relation.field,
|
|
111
|
-
|
|
112
|
-
|
|
91
|
+
{
|
|
92
|
+
as: fieldValue.placeholderName,
|
|
93
|
+
filter: resolveFilter(relation.filter),
|
|
94
|
+
orderBy: replaceGraphQlLiteral(relation.orderBy),
|
|
95
|
+
offset: relation.offset,
|
|
96
|
+
limit: relation.limit
|
|
97
|
+
},
|
|
98
|
+
(it) => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it)
|
|
113
99
|
);
|
|
114
100
|
} else {
|
|
115
101
|
assertNever();
|
|
116
102
|
}
|
|
117
103
|
}
|
|
118
|
-
return
|
|
104
|
+
return selection;
|
|
119
105
|
}
|
|
120
106
|
}
|
|
107
|
+
const resolveFilter = (input) => {
|
|
108
|
+
return replaceGraphQlLiteral(input);
|
|
109
|
+
};
|
|
121
110
|
export {
|
|
122
111
|
QueryGenerator
|
|
123
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryGenerator.js","sources":["../../../src/core/QueryGenerator.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"QueryGenerator.js","sources":["../../../src/core/QueryGenerator.ts"],"sourcesContent":["import { PRIMARY_KEY_NAME } from '../bindingTypes'\nimport {\n\tEntityFieldMarkers,\n\tEntityListSubTreeMarker,\n\tEntitySubTreeMarker,\n\tFieldMarker,\n\tHasManyRelationMarker,\n\tHasOneRelationMarker,\n\tMarkerTreeRoot,\n} from '../markers'\nimport { assertNever, ucfirst } from '../utils'\nimport { ContentEntitySelection, ContentQuery, ContentQueryBuilder, replaceGraphQlLiteral } from '@contember/client'\nimport { Filter } from '../treeParameters'\n\n\nexport class QueryGenerator {\n\tconstructor(\n\t\tprivate tree: MarkerTreeRoot,\n\t\tprivate qb: ContentQueryBuilder,\n\t) {}\n\n\tpublic getReadQuery(): Record<string, ContentQuery<any>> {\n\t\tconst result: Record<string, ContentQuery<any>> = {}\n\t\tfor (const [, subTreeMarker] of this.tree.subTrees) {\n\t\t\tif (subTreeMarker.parameters.isCreating) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (subTreeMarker instanceof EntitySubTreeMarker) {\n\t\t\t\tresult[subTreeMarker.placeholderName] = this.addGetQuery(subTreeMarker)\n\t\t\t} else if (subTreeMarker instanceof EntityListSubTreeMarker) {\n\t\t\t\tresult[subTreeMarker.placeholderName] = this.createListQuery(subTreeMarker)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tprivate addGetQuery(subTree: EntitySubTreeMarker): ContentQuery<any> {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\tthrow new Error()\n\t\t}\n\n\t\treturn this.qb.get(\n\t\t\tsubTree.entityName,\n\t\t\t{\n\t\t\t\tby: replaceGraphQlLiteral(subTree.parameters.where),\n\t\t\t\tfilter: resolveFilter(subTree.parameters.filter),\n\t\t\t},\n\t\t\tit => QueryGenerator.registerQueryPart(subTree.fields.markers, it),\n\t\t)\n\t}\n\n\tprivate createListQuery(subTree: EntityListSubTreeMarker): ContentQuery<any> {\n\t\tif (subTree.parameters.isCreating) {\n\t\t\tthrow new Error()\n\t\t}\n\t\treturn this.qb.list(\n\t\t\tsubTree.entityName,\n\t\t\t{\n\t\t\t\tfilter: resolveFilter(subTree.parameters.filter),\n\t\t\t\torderBy: replaceGraphQlLiteral(subTree.parameters.orderBy),\n\t\t\t\toffset: subTree.parameters.offset,\n\t\t\t\tlimit: subTree.parameters.limit,\n\t\t\t},\n\t\t\tit => QueryGenerator.registerQueryPart(subTree.fields.markers, it),\n\t\t)\n\t}\n\n\tpublic static registerQueryPart(fields: EntityFieldMarkers, selection: ContentEntitySelection): ContentEntitySelection {\n\t\tselection = selection.$(PRIMARY_KEY_NAME).$('__typename')\n\n\t\tfor (const [, fieldValue] of fields) {\n\t\t\tif (fieldValue instanceof FieldMarker) {\n\t\t\t\tif (fieldValue.fieldName !== PRIMARY_KEY_NAME) {\n\t\t\t\t\tselection = selection.$(fieldValue.fieldName)\n\t\t\t\t}\n\t\t\t} else if (fieldValue instanceof HasOneRelationMarker) {\n\t\t\t\tconst relation = fieldValue.parameters\n\n\t\t\t\tif (relation.reducedBy) {\n\t\t\t\t\t// Assuming there's exactly one reducer field as enforced by MarkerTreeGenerator\n\t\t\t\t\tconst relationField = `${relation.field}By${ucfirst(Object.keys(relation.reducedBy)[0])}`\n\t\t\t\t\tselection = selection.$(\n\t\t\t\t\t\trelationField,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tby: replaceGraphQlLiteral(relation.reducedBy),\n\t\t\t\t\t\t\tfilter: resolveFilter(relation.filter),\n\t\t\t\t\t\t\tas: fieldValue.placeholderName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tit => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it),\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tselection = selection.$(\n\t\t\t\t\t\trelation.field,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfilter: resolveFilter(relation.filter),\n\t\t\t\t\t\t\tas: fieldValue.placeholderName,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tit => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else if (fieldValue instanceof HasManyRelationMarker) {\n\t\t\t\tconst relation = fieldValue.parameters\n\n\n\t\t\t\tselection = selection.$(\n\t\t\t\t\trelation.field,\n\t\t\t\t\t{\n\t\t\t\t\t\tas: fieldValue.placeholderName,\n\t\t\t\t\t\tfilter: resolveFilter(relation.filter),\n\t\t\t\t\t\torderBy: replaceGraphQlLiteral(relation.orderBy),\n\t\t\t\t\t\toffset: relation.offset,\n\t\t\t\t\t\tlimit: relation.limit,\n\t\t\t\t\t},\n\t\t\t\t\tit => QueryGenerator.registerQueryPart(fieldValue.fields.markers, it),\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tassertNever(fieldValue)\n\t\t\t}\n\t\t}\n\n\t\treturn selection\n\t}\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AAS,EAAE;AAAA,QAAA;AAAA,MACrE,OACM;AACN,oBAAsB;AAAA,MACvB;AAAA,IACD;AAEO,WAAA;AAAA,EACR;AACD;AAEA,MAAM,gBAAgB,CAAC,UAAkC;AACxD,SAAO,sBAA+B,KAAK;AAC5C;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 WeakIdCache = require("../structures/WeakIdCache.cjs");
|
|
10
|
+
const assertNever = require("../utils/assertNever.cjs");
|
|
11
|
+
const GLUE = "--";
|
|
12
|
+
const keyEndRegex = new RegExp(`${GLUE}\\d+$`);
|
|
13
|
+
class RealmKeyGenerator {
|
|
14
|
+
static vaguelyAppearsToBeAKey(candidate) {
|
|
15
|
+
return candidate.startsWith(`key${GLUE}`) && keyEndRegex.test(candidate);
|
|
16
|
+
}
|
|
17
|
+
static generateKey(parent, placeholderName, id, container) {
|
|
18
|
+
return `key${GLUE}${this.parentStateIdCache.getOptionalKeyId(
|
|
19
|
+
parent
|
|
20
|
+
)}${GLUE}${placeholderName}${id}${GLUE}${this.markerIdCache.getId(container)}`;
|
|
21
|
+
}
|
|
22
|
+
static getRealmKey(id, blueprint) {
|
|
23
|
+
const parent = blueprint.parent;
|
|
24
|
+
let placeholderName;
|
|
25
|
+
if (blueprint.type === "subTree") {
|
|
26
|
+
placeholderName = blueprint.marker.placeholderName;
|
|
27
|
+
} else if (blueprint.type === "listEntity") {
|
|
28
|
+
placeholderName = blueprint.parent.blueprint.marker.placeholderName;
|
|
29
|
+
} else if (blueprint.type === "hasOne") {
|
|
30
|
+
placeholderName = blueprint.marker.placeholderName;
|
|
31
|
+
} else {
|
|
32
|
+
return assertNever.assertNever();
|
|
33
|
+
}
|
|
34
|
+
return this.generateKey(
|
|
35
|
+
parent,
|
|
36
|
+
placeholderName,
|
|
37
|
+
id.value,
|
|
38
|
+
blueprint.type === "listEntity" ? blueprint.parent.blueprint.marker.fields : blueprint.marker.fields
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// We're using this id, and not, well, the entity id, because it *SIGNIFICANTLY* reduces the complexity of
|
|
43
|
+
// entity id changes.
|
|
44
|
+
__publicField(RealmKeyGenerator, "parentStateIdCache", new WeakIdCache.WeakIdCache());
|
|
45
|
+
__publicField(RealmKeyGenerator, "markerIdCache", new WeakIdCache.WeakIdCache());
|
|
46
|
+
exports.RealmKeyGenerator = RealmKeyGenerator;
|
|
47
|
+
//# sourceMappingURL=RealmKeyGenerator.cjs.map
|