@contember/binding 1.0.0-rc.9 → 1.1.0-alpha.1
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.js +0 -1
- package/dist/development/BindingError.js.map +1 -1
- package/dist/development/accessorPropagation/AccessorProvider.js +3 -5
- package/dist/development/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsContext.js +2 -4
- package/dist/development/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/development/accessorPropagation/BindingOperationsProvider.js +2 -4
- package/dist/development/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/development/accessorPropagation/EntityKeyContext.js +1 -3
- package/dist/development/accessorPropagation/EntityKeyContext.js.map +1 -1
- package/dist/development/accessorPropagation/EntityKeyProvider.js +2 -4
- package/dist/development/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/development/accessorPropagation/EnvironmentContext.js +2 -4
- package/dist/development/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/development/accessorPropagation/TreeRootIdContext.js +1 -3
- package/dist/development/accessorPropagation/TreeRootIdContext.js.map +1 -1
- package/dist/development/accessorPropagation/TreeRootIdProvider.js +2 -4
- package/dist/development/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js +2 -4
- package/dist/development/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/development/accessorPropagation/useBindingOperations.js +2 -4
- package/dist/development/accessorPropagation/useBindingOperations.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js +3 -5
- package/dist/development/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js +3 -5
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js +3 -5
- package/dist/development/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/development/accessorPropagation/useEntity.js +7 -9
- package/dist/development/accessorPropagation/useEntity.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityKey.js +3 -5
- package/dist/development/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityList.js +7 -9
- package/dist/development/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityListSubTree.js +4 -6
- package/dist/development/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js +2 -4
- package/dist/development/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
- package/dist/development/accessorPropagation/useEntitySubTree.js +4 -6
- package/dist/development/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js +2 -4
- package/dist/development/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
- package/dist/development/accessorPropagation/useEnvironment.js +2 -4
- package/dist/development/accessorPropagation/useEnvironment.js.map +1 -1
- package/dist/development/accessorPropagation/useField.js +7 -9
- package/dist/development/accessorPropagation/useField.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntityByKey.js +1 -3
- package/dist/development/accessorPropagation/useGetEntityByKey.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js +4 -6
- package/dist/development/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useGetEntitySubTree.js +4 -6
- package/dist/development/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/development/accessorPropagation/useGetTreeFilters.js +1 -3
- package/dist/development/accessorPropagation/useGetTreeFilters.js.map +1 -1
- package/dist/development/accessorPropagation/useHasEntity.js +2 -4
- package/dist/development/accessorPropagation/useHasEntity.js.map +1 -1
- package/dist/development/accessorPropagation/usePersist.js +1 -3
- package/dist/development/accessorPropagation/usePersist.js.map +1 -1
- package/dist/development/accessorPropagation/useTreeRootId.js +2 -4
- package/dist/development/accessorPropagation/useTreeRootId.js.map +1 -1
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js +9 -11
- package/dist/development/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/development/accessorSorting/addEntityAtIndex.js +2 -4
- package/dist/development/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/development/accessorSorting/errors.js +1 -3
- package/dist/development/accessorSorting/errors.js.map +1 -1
- package/dist/development/accessorSorting/moveEntity.js +1 -3
- package/dist/development/accessorSorting/moveEntity.js.map +1 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js +0 -1
- package/dist/development/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/development/accessorSorting/sortEntities.js +0 -1
- package/dist/development/accessorSorting/sortEntities.js.map +1 -1
- package/dist/development/accessorSorting/useSortedEntities.js +6 -8
- package/dist/development/accessorSorting/useSortedEntities.js.map +1 -1
- package/dist/development/accessorTree/AccessorTree.js +4 -6
- package/dist/development/accessorTree/AccessorTree.js.map +1 -1
- package/dist/development/accessorTree/DirtinessContext.js +1 -3
- package/dist/development/accessorTree/DirtinessContext.js.map +1 -1
- package/dist/development/accessorTree/MutationStateContext.js +1 -3
- package/dist/development/accessorTree/MutationStateContext.js.map +1 -1
- package/dist/development/accessorTree/NormalizedPersistedData.js +0 -1
- package/dist/development/accessorTree/NormalizedPersistedData.js.map +1 -1
- package/dist/development/accessorTree/RuntimeId.js +38 -20
- package/dist/development/accessorTree/RuntimeId.js.map +1 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js +0 -1
- package/dist/development/accessorTree/accessorTreeStateReducer.js.map +1 -1
- package/dist/development/accessorTree/metadataToRequestError.js +0 -1
- package/dist/development/accessorTree/metadataToRequestError.js.map +1 -1
- package/dist/development/accessorTree/useDataBinding.js +5 -7
- package/dist/development/accessorTree/useDataBinding.js.map +1 -1
- package/dist/development/accessorTree/useDirtinessState.js +2 -4
- package/dist/development/accessorTree/useDirtinessState.js.map +1 -1
- package/dist/development/accessorTree/useMutationState.js +2 -4
- package/dist/development/accessorTree/useMutationState.js.map +1 -1
- package/dist/development/accessors/EntityAccessor.js +4 -38
- package/dist/development/accessors/EntityAccessor.js.map +1 -1
- package/dist/development/accessors/EntityListAccessor.js +2 -4
- package/dist/development/accessors/EntityListAccessor.js.map +1 -1
- package/dist/development/accessors/ErrorAccessor.js +0 -1
- package/dist/development/accessors/ErrorAccessor.js.map +1 -1
- package/dist/development/accessors/FieldAccessor.js +3 -5
- package/dist/development/accessors/FieldAccessor.js.map +1 -1
- package/dist/development/accessors/TreeRootAccessor.js +0 -1
- package/dist/development/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/development/bindingTypes.js +0 -1
- package/dist/development/bindingTypes.js.map +1 -1
- package/dist/development/core/AccessorErrorManager.js +18 -11
- package/dist/development/core/AccessorErrorManager.js.map +1 -1
- package/dist/development/core/Config.js +18 -12
- package/dist/development/core/Config.js.map +1 -1
- package/dist/development/core/DataBinding.js +80 -72
- package/dist/development/core/DataBinding.js.map +1 -1
- package/dist/development/core/DirtinessTracker.js +10 -3
- package/dist/development/core/DirtinessTracker.js.map +1 -1
- package/dist/development/core/ErrorsPreprocessor.js +3 -5
- package/dist/development/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/development/core/EventManager.js +20 -16
- package/dist/development/core/EventManager.js.map +1 -1
- package/dist/development/core/IncrementalMarkerBuilder.js +14 -8
- package/dist/development/core/IncrementalMarkerBuilder.js.map +1 -1
- package/dist/development/core/MarkerComparator.js +6 -8
- package/dist/development/core/MarkerComparator.js.map +1 -1
- package/dist/development/core/MarkerMerger.js +18 -19
- package/dist/development/core/MarkerMerger.js.map +1 -1
- package/dist/development/core/MarkerTreeGenerator.js +18 -13
- package/dist/development/core/MarkerTreeGenerator.js.map +1 -1
- package/dist/development/core/MutationGenerator.js +17 -19
- package/dist/development/core/MutationGenerator.js.map +1 -1
- package/dist/development/core/QueryGenerator.js +9 -11
- package/dist/development/core/QueryGenerator.js.map +1 -1
- package/dist/development/core/RealmKeyGenerator.js +10 -6
- package/dist/development/core/RealmKeyGenerator.js.map +1 -1
- package/dist/development/core/RequestResponseNormalizer.js +33 -39
- package/dist/development/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/development/core/StateInitializer.js +36 -34
- package/dist/development/core/StateInitializer.js.map +1 -1
- package/dist/development/core/TreeAugmenter.js +15 -17
- package/dist/development/core/TreeAugmenter.js.map +1 -1
- package/dist/development/core/TreeFilterGenerator.js +9 -9
- package/dist/development/core/TreeFilterGenerator.js.map +1 -1
- package/dist/development/core/TreeParameterMerger.js +2 -4
- package/dist/development/core/TreeParameterMerger.js.map +1 -1
- package/dist/development/core/TreeStore.js +22 -18
- package/dist/development/core/TreeStore.js.map +1 -1
- package/dist/development/core/VariableInputTransformer.js +6 -5
- package/dist/development/core/VariableInputTransformer.js.map +1 -1
- package/dist/development/core/exceptions/ErrorLocator.js +10 -6
- package/dist/development/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/development/core/exceptions/LocalizedBindingError.js +1 -3
- package/dist/development/core/exceptions/LocalizedBindingError.js.map +1 -1
- package/dist/development/core/exceptions/MarkerSugarer.js +7 -9
- package/dist/development/core/exceptions/MarkerSugarer.js.map +1 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.js +0 -1
- package/dist/development/core/exceptions/TreeParameterSugarer.js.map +1 -1
- package/dist/development/core/factories/createBatchUpdatesOptions.js +1 -3
- package/dist/development/core/factories/createBatchUpdatesOptions.js.map +1 -1
- package/dist/development/core/operations/EntityOperations.js +17 -18
- package/dist/development/core/operations/EntityOperations.js.map +1 -1
- package/dist/development/core/operations/FieldOperations.js +11 -13
- package/dist/development/core/operations/FieldOperations.js.map +1 -1
- package/dist/development/core/operations/ListOperations.js +14 -16
- package/dist/development/core/operations/ListOperations.js.map +1 -1
- package/dist/development/core/operations/OperationsHelpers.js +6 -8
- package/dist/development/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/development/core/requestAliases/MutationAlias.js +7 -7
- package/dist/development/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/development/core/requestAliases/mutationOperationSubTreeType.js +0 -1
- package/dist/development/core/requestAliases/mutationOperationSubTreeType.js.map +1 -1
- package/dist/development/core/requestAliases/mutationOperationType.js +0 -1
- package/dist/development/core/requestAliases/mutationOperationType.js.map +1 -1
- package/dist/development/core/schema/Schema.js +3 -1
- package/dist/development/core/schema/Schema.js.map +1 -1
- package/dist/development/core/schema/SchemaLoader.js +9 -5
- package/dist/development/core/schema/SchemaLoader.js.map +1 -1
- package/dist/development/core/schema/SchemaPreprocessor.js +0 -1
- package/dist/development/core/schema/SchemaPreprocessor.js.map +1 -1
- package/dist/development/core/state/StateIterator.js +2 -4
- package/dist/development/core/state/StateIterator.js.map +1 -1
- package/dist/development/core/state/getEntityMarker.js +0 -1
- package/dist/development/core/state/getEntityMarker.js.map +1 -1
- package/dist/development/core/utils/getCombinedSignal.js +0 -1
- package/dist/development/core/utils/getCombinedSignal.js.map +1 -1
- package/dist/development/coreComponents/Component.js +2 -4
- package/dist/development/coreComponents/Component.js.map +1 -1
- package/dist/development/coreComponents/DataBindingProvider.js +3 -5
- package/dist/development/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/development/coreComponents/Entity.js +3 -5
- package/dist/development/coreComponents/Entity.js.map +1 -1
- package/dist/development/coreComponents/EntityList.js +3 -5
- package/dist/development/coreComponents/EntityList.js.map +1 -1
- package/dist/development/coreComponents/EntityListSubTree.js +13 -23
- package/dist/development/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/development/coreComponents/EntitySubTree.js +14 -34
- package/dist/development/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/development/coreComponents/Field.js +10 -8
- package/dist/development/coreComponents/Field.js.map +1 -1
- package/dist/development/coreComponents/HasMany.js +10 -14
- package/dist/development/coreComponents/HasMany.js.map +1 -1
- package/dist/development/coreComponents/HasOne.js +10 -14
- package/dist/development/coreComponents/HasOne.js.map +1 -1
- package/dist/development/coreComponents/ParentEntity.js +3 -5
- package/dist/development/coreComponents/ParentEntity.js.map +1 -1
- package/dist/development/dao/Environment.js +147 -89
- package/dist/development/dao/Environment.js.map +1 -1
- package/dist/development/dao/TreeNodeEnvironmentFactory.js +159 -0
- package/dist/development/dao/TreeNodeEnvironmentFactory.js.map +1 -0
- package/dist/development/dao/VariableFieldValue.js +0 -1
- package/dist/development/dao/VariableFieldValue.js.map +1 -1
- package/dist/development/entityEvents/useDerivedField.js +4 -6
- package/dist/development/entityEvents/useDerivedField.js.map +1 -1
- package/dist/development/entityEvents/useEntityBeforePersist.js +1 -3
- package/dist/development/entityEvents/useEntityBeforePersist.js.map +1 -1
- package/dist/development/entityEvents/useEntityBeforeUpdate.js +1 -3
- package/dist/development/entityEvents/useEntityBeforeUpdate.js.map +1 -1
- package/dist/development/entityEvents/useEntityEvent.js +3 -5
- package/dist/development/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/development/entityEvents/useEntityPersistError.js +1 -3
- package/dist/development/entityEvents/useEntityPersistError.js.map +1 -1
- package/dist/development/entityEvents/useEntityPersistSuccess.js +1 -3
- package/dist/development/entityEvents/useEntityPersistSuccess.js.map +1 -1
- package/dist/development/entityEvents/useOnConnectionUpdate.js +1 -3
- package/dist/development/entityEvents/useOnConnectionUpdate.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/FieldHelper.js +8 -4
- package/dist/development/fieldHelpers/helpers/FieldHelper.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js +1 -3
- package/dist/development/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js +2 -4
- package/dist/development/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
- package/dist/development/helperComponents/DeferredSubTrees.js +9 -11
- package/dist/development/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/development/helperComponents/EntityView.js +2 -4
- package/dist/development/helperComponents/EntityView.js.map +1 -1
- package/dist/development/helperComponents/FieldView.js +7 -9
- package/dist/development/helperComponents/FieldView.js.map +1 -1
- package/dist/development/helperComponents/StaticRender.js +2 -4
- package/dist/development/helperComponents/StaticRender.js.map +1 -1
- package/dist/development/helperComponents/SugaredField.js +3 -5
- package/dist/development/helperComponents/SugaredField.js.map +1 -1
- package/dist/development/index.js +101 -101
- package/dist/development/index.js.map +1 -1
- package/dist/development/markers/EntityFieldMarkersContainer.js +5 -7
- package/dist/development/markers/EntityFieldMarkersContainer.js.map +1 -1
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.js +0 -1
- package/dist/development/markers/EntityFieldsWithHoistablesMarker.js.map +1 -1
- package/dist/development/markers/EntityListSubTreeMarker.js +8 -4
- package/dist/development/markers/EntityListSubTreeMarker.js.map +1 -1
- package/dist/development/markers/EntitySubTreeMarker.js +8 -4
- package/dist/development/markers/EntitySubTreeMarker.js.map +1 -1
- package/dist/development/markers/FieldMarker.js +8 -4
- package/dist/development/markers/FieldMarker.js.map +1 -1
- package/dist/development/markers/HasManyRelationMarker.js +9 -5
- package/dist/development/markers/HasManyRelationMarker.js.map +1 -1
- package/dist/development/markers/HasOneRelationMarker.js +8 -4
- package/dist/development/markers/HasOneRelationMarker.js.map +1 -1
- package/dist/development/markers/MarkerTreeRoot.js +0 -1
- package/dist/development/markers/MarkerTreeRoot.js.map +1 -1
- package/dist/development/markers/ParentEntityMarker.js +0 -1
- package/dist/development/markers/ParentEntityMarker.js.map +1 -1
- package/dist/development/markers/PlaceholderGenerator.js +1 -3
- package/dist/development/markers/PlaceholderGenerator.js.map +1 -1
- package/dist/development/queryLanguage/CacheStore.js +10 -4
- package/dist/development/queryLanguage/CacheStore.js.map +1 -1
- package/dist/development/queryLanguage/MarkerFactory.js +15 -16
- package/dist/development/queryLanguage/MarkerFactory.js.map +1 -1
- package/dist/development/queryLanguage/Parser.js +572 -547
- package/dist/development/queryLanguage/Parser.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguage.js +32 -27
- package/dist/development/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/development/queryLanguage/QueryLanguageError.js +0 -1
- package/dist/development/queryLanguage/QueryLanguageError.js.map +1 -1
- package/dist/development/queryLanguage/tokenList.js +6 -3
- package/dist/development/queryLanguage/tokenList.js.map +1 -1
- package/dist/development/structures/BijectiveIndexedMap.js +14 -9
- package/dist/development/structures/BijectiveIndexedMap.js.map +1 -1
- package/dist/development/structures/LRUCache.js +7 -2
- package/dist/development/structures/LRUCache.js.map +1 -1
- package/dist/development/structures/WeakIdCache.js +11 -4
- package/dist/development/structures/WeakIdCache.js.map +1 -1
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js +1 -3
- package/dist/development/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
- package/dist/development/treeParameters/EntityCreationParameters.js +0 -1
- package/dist/development/treeParameters/EntityCreationParameters.js.map +1 -1
- package/dist/development/treeParameters/EntityListPreferences.js +0 -1
- package/dist/development/treeParameters/EntityListPreferences.js.map +1 -1
- package/dist/development/treeParameters/EventListenersStore.js +0 -1
- package/dist/development/treeParameters/EventListenersStore.js.map +1 -1
- package/dist/development/treeParameters/LeafField.js +0 -1
- package/dist/development/treeParameters/LeafField.js.map +1 -1
- package/dist/development/treeParameters/QualifiedEntityParameters.js +0 -1
- package/dist/development/treeParameters/QualifiedEntityParameters.js.map +1 -1
- package/dist/development/treeParameters/Relation.js +0 -1
- package/dist/development/treeParameters/Relation.js.map +1 -1
- package/dist/development/utils/Hashing.js +0 -1
- package/dist/development/utils/Hashing.js.map +1 -1
- package/dist/development/utils/assert.js +1 -3
- package/dist/development/utils/assert.js.map +1 -1
- package/dist/development/utils/assertNever.js +2 -4
- package/dist/development/utils/assertNever.js.map +1 -1
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.js +0 -1
- package/dist/development/utils/generateEnumerabilityPreventingEntropy.js.map +1 -1
- package/dist/development/utils/isEmptyObject.js +0 -1
- package/dist/development/utils/isEmptyObject.js.map +1 -1
- package/dist/development/utils/ucfirst.js +0 -1
- package/dist/development/utils/ucfirst.js.map +1 -1
- package/dist/production/BindingError.js.map +1 -1
- package/dist/production/accessorPropagation/AccessorProvider.js.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsContext.js.map +1 -1
- package/dist/production/accessorPropagation/BindingOperationsProvider.js.map +1 -1
- package/dist/production/accessorPropagation/EntityKeyContext.js.map +1 -1
- package/dist/production/accessorPropagation/EntityKeyProvider.js.map +1 -1
- package/dist/production/accessorPropagation/EnvironmentContext.js.map +1 -1
- package/dist/production/accessorPropagation/TreeRootIdContext.js.map +1 -1
- package/dist/production/accessorPropagation/TreeRootIdProvider.js.map +1 -1
- package/dist/production/accessorPropagation/useAccessorUpdateSubscription.js.map +1 -1
- package/dist/production/accessorPropagation/useBindingOperations.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeEntityList.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleEntity.js.map +1 -1
- package/dist/production/accessorPropagation/useDesugaredRelativeSingleField.js.map +1 -1
- package/dist/production/accessorPropagation/useEntity.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityKey.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityList.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useEntityListSubTreeParameters.js.map +1 -1
- package/dist/production/accessorPropagation/useEntitySubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useEntitySubTreeParameters.js.map +1 -1
- package/dist/production/accessorPropagation/useEnvironment.js.map +1 -1
- package/dist/production/accessorPropagation/useField.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntityByKey.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntityListSubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useGetEntitySubTree.js.map +1 -1
- package/dist/production/accessorPropagation/useGetTreeFilters.js.map +1 -1
- package/dist/production/accessorPropagation/useHasEntity.js.map +1 -1
- package/dist/production/accessorPropagation/usePersist.js.map +1 -1
- package/dist/production/accessorPropagation/useTreeRootId.js.map +1 -1
- package/dist/production/accessorSorting/SetOrderFieldOnCreate.js.map +1 -1
- package/dist/production/accessorSorting/addEntityAtIndex.js.map +1 -1
- package/dist/production/accessorSorting/errors.js.map +1 -1
- package/dist/production/accessorSorting/moveEntity.js.map +1 -1
- package/dist/production/accessorSorting/repairEntitiesOrder.js.map +1 -1
- package/dist/production/accessorSorting/sortEntities.js.map +1 -1
- package/dist/production/accessorSorting/useSortedEntities.js.map +1 -1
- package/dist/production/accessorTree/AccessorTree.js.map +1 -1
- package/dist/production/accessorTree/DirtinessContext.js.map +1 -1
- package/dist/production/accessorTree/MutationStateContext.js.map +1 -1
- package/dist/production/accessorTree/NormalizedPersistedData.js.map +1 -1
- package/dist/production/accessorTree/RuntimeId.js +17 -4
- package/dist/production/accessorTree/RuntimeId.js.map +1 -1
- package/dist/production/accessorTree/accessorTreeStateReducer.js.map +1 -1
- package/dist/production/accessorTree/metadataToRequestError.js.map +1 -1
- package/dist/production/accessorTree/useDataBinding.js.map +1 -1
- package/dist/production/accessorTree/useDirtinessState.js.map +1 -1
- package/dist/production/accessorTree/useMutationState.js.map +1 -1
- package/dist/production/accessors/EntityAccessor.js +0 -32
- package/dist/production/accessors/EntityAccessor.js.map +1 -1
- package/dist/production/accessors/EntityListAccessor.js +1 -1
- package/dist/production/accessors/EntityListAccessor.js.map +1 -1
- package/dist/production/accessors/ErrorAccessor.js.map +1 -1
- package/dist/production/accessors/FieldAccessor.js.map +1 -1
- package/dist/production/accessors/TreeRootAccessor.js.map +1 -1
- package/dist/production/bindingTypes.js.map +1 -1
- package/dist/production/core/AccessorErrorManager.js +3 -0
- package/dist/production/core/AccessorErrorManager.js.map +1 -1
- package/dist/production/core/Config.js.map +1 -1
- package/dist/production/core/DataBinding.js +28 -16
- package/dist/production/core/DataBinding.js.map +1 -1
- package/dist/production/core/DirtinessTracker.js.map +1 -1
- package/dist/production/core/ErrorsPreprocessor.js.map +1 -1
- package/dist/production/core/EventManager.js.map +1 -1
- package/dist/production/core/IncrementalMarkerBuilder.js.map +1 -1
- package/dist/production/core/MarkerComparator.js +1 -1
- package/dist/production/core/MarkerComparator.js.map +1 -1
- package/dist/production/core/MarkerMerger.js +1 -4
- package/dist/production/core/MarkerMerger.js.map +1 -1
- package/dist/production/core/MarkerTreeGenerator.js.map +1 -1
- package/dist/production/core/MutationGenerator.js +5 -5
- package/dist/production/core/MutationGenerator.js.map +1 -1
- package/dist/production/core/QueryGenerator.js.map +1 -1
- package/dist/production/core/RealmKeyGenerator.js.map +1 -1
- package/dist/production/core/RequestResponseNormalizer.js +27 -31
- package/dist/production/core/RequestResponseNormalizer.js.map +1 -1
- package/dist/production/core/StateInitializer.js +10 -12
- package/dist/production/core/StateInitializer.js.map +1 -1
- package/dist/production/core/TreeAugmenter.js +10 -10
- package/dist/production/core/TreeAugmenter.js.map +1 -1
- package/dist/production/core/TreeFilterGenerator.js +2 -2
- package/dist/production/core/TreeFilterGenerator.js.map +1 -1
- package/dist/production/core/TreeParameterMerger.js.map +1 -1
- package/dist/production/core/TreeStore.js +3 -3
- package/dist/production/core/TreeStore.js.map +1 -1
- package/dist/production/core/VariableInputTransformer.js +4 -1
- package/dist/production/core/VariableInputTransformer.js.map +1 -1
- package/dist/production/core/exceptions/ErrorLocator.js.map +1 -1
- package/dist/production/core/exceptions/LocalizedBindingError.js.map +1 -1
- package/dist/production/core/exceptions/MarkerSugarer.js.map +1 -1
- package/dist/production/core/exceptions/TreeParameterSugarer.js.map +1 -1
- package/dist/production/core/factories/createBatchUpdatesOptions.js.map +1 -1
- package/dist/production/core/operations/EntityOperations.js +6 -6
- package/dist/production/core/operations/EntityOperations.js.map +1 -1
- package/dist/production/core/operations/FieldOperations.js.map +1 -1
- package/dist/production/core/operations/ListOperations.js +2 -2
- package/dist/production/core/operations/ListOperations.js.map +1 -1
- package/dist/production/core/operations/OperationsHelpers.js +2 -2
- package/dist/production/core/operations/OperationsHelpers.js.map +1 -1
- package/dist/production/core/requestAliases/MutationAlias.js +5 -3
- package/dist/production/core/requestAliases/MutationAlias.js.map +1 -1
- package/dist/production/core/requestAliases/mutationOperationSubTreeType.js.map +1 -1
- package/dist/production/core/requestAliases/mutationOperationType.js.map +1 -1
- package/dist/production/core/schema/Schema.js +3 -0
- package/dist/production/core/schema/Schema.js.map +1 -1
- package/dist/production/core/schema/SchemaLoader.js.map +1 -1
- package/dist/production/core/schema/SchemaPreprocessor.js.map +1 -1
- package/dist/production/core/state/StateIterator.js.map +1 -1
- package/dist/production/core/state/getEntityMarker.js.map +1 -1
- package/dist/production/core/utils/getCombinedSignal.js.map +1 -1
- package/dist/production/coreComponents/Component.js.map +1 -1
- package/dist/production/coreComponents/DataBindingProvider.js.map +1 -1
- package/dist/production/coreComponents/Entity.js.map +1 -1
- package/dist/production/coreComponents/EntityList.js.map +1 -1
- package/dist/production/coreComponents/EntityListSubTree.js +4 -12
- package/dist/production/coreComponents/EntityListSubTree.js.map +1 -1
- package/dist/production/coreComponents/EntitySubTree.js +4 -22
- package/dist/production/coreComponents/EntitySubTree.js.map +1 -1
- package/dist/production/coreComponents/Field.js +5 -1
- package/dist/production/coreComponents/Field.js.map +1 -1
- package/dist/production/coreComponents/HasMany.js +3 -5
- package/dist/production/coreComponents/HasMany.js.map +1 -1
- package/dist/production/coreComponents/HasOne.js +3 -5
- package/dist/production/coreComponents/HasOne.js.map +1 -1
- package/dist/production/coreComponents/ParentEntity.js.map +1 -1
- package/dist/production/dao/Environment.js +147 -94
- package/dist/production/dao/Environment.js.map +1 -1
- package/dist/production/dao/TreeNodeEnvironmentFactory.js +159 -0
- package/dist/production/dao/TreeNodeEnvironmentFactory.js.map +1 -0
- package/dist/production/dao/VariableFieldValue.js.map +1 -1
- package/dist/production/entityEvents/useDerivedField.js.map +1 -1
- package/dist/production/entityEvents/useEntityBeforePersist.js.map +1 -1
- package/dist/production/entityEvents/useEntityBeforeUpdate.js.map +1 -1
- package/dist/production/entityEvents/useEntityEvent.js.map +1 -1
- package/dist/production/entityEvents/useEntityPersistError.js.map +1 -1
- package/dist/production/entityEvents/useEntityPersistSuccess.js.map +1 -1
- package/dist/production/entityEvents/useOnConnectionUpdate.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/FieldHelper.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/TemporalFieldHelper.js.map +1 -1
- package/dist/production/fieldHelpers/helpers/UuidFieldHelper.js.map +1 -1
- package/dist/production/helperComponents/DeferredSubTrees.js.map +1 -1
- package/dist/production/helperComponents/EntityView.js.map +1 -1
- package/dist/production/helperComponents/FieldView.js.map +1 -1
- package/dist/production/helperComponents/StaticRender.js.map +1 -1
- package/dist/production/helperComponents/SugaredField.js.map +1 -1
- package/dist/production/index.js +2 -2
- package/dist/production/markers/EntityFieldMarkersContainer.js.map +1 -1
- package/dist/production/markers/EntityFieldsWithHoistablesMarker.js.map +1 -1
- package/dist/production/markers/EntityListSubTreeMarker.js.map +1 -1
- package/dist/production/markers/EntitySubTreeMarker.js.map +1 -1
- package/dist/production/markers/FieldMarker.js.map +1 -1
- package/dist/production/markers/HasManyRelationMarker.js.map +1 -1
- package/dist/production/markers/HasOneRelationMarker.js.map +1 -1
- package/dist/production/markers/MarkerTreeRoot.js.map +1 -1
- package/dist/production/markers/ParentEntityMarker.js.map +1 -1
- package/dist/production/markers/PlaceholderGenerator.js.map +1 -1
- package/dist/production/queryLanguage/CacheStore.js.map +1 -1
- package/dist/production/queryLanguage/MarkerFactory.js +4 -3
- package/dist/production/queryLanguage/MarkerFactory.js.map +1 -1
- package/dist/production/queryLanguage/Parser.js +24 -7
- package/dist/production/queryLanguage/Parser.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguage.js.map +1 -1
- package/dist/production/queryLanguage/QueryLanguageError.js.map +1 -1
- package/dist/production/queryLanguage/tokenList.js +5 -0
- package/dist/production/queryLanguage/tokenList.js.map +1 -1
- package/dist/production/structures/BijectiveIndexedMap.js.map +1 -1
- package/dist/production/structures/LRUCache.js.map +1 -1
- package/dist/production/structures/WeakIdCache.js.map +1 -1
- package/dist/production/treeParameterHelpers/wrapFilterInHasOnes.js.map +1 -1
- package/dist/production/treeParameters/EntityCreationParameters.js.map +1 -1
- package/dist/production/treeParameters/EntityListPreferences.js.map +1 -1
- package/dist/production/treeParameters/EventListenersStore.js.map +1 -1
- package/dist/production/treeParameters/LeafField.js.map +1 -1
- package/dist/production/treeParameters/QualifiedEntityParameters.js.map +1 -1
- package/dist/production/treeParameters/Relation.js.map +1 -1
- package/dist/production/utils/Hashing.js.map +1 -1
- package/dist/production/utils/assert.js.map +1 -1
- package/dist/production/utils/assertNever.js +1 -1
- package/dist/production/utils/assertNever.js.map +1 -1
- package/dist/production/utils/generateEnumerabilityPreventingEntropy.js.map +1 -1
- package/dist/production/utils/isEmptyObject.js.map +1 -1
- package/dist/production/utils/ucfirst.js.map +1 -1
- package/dist/types/accessorTree/MutationRequestResponse.d.ts +9 -1
- package/dist/types/accessorTree/MutationRequestResponse.d.ts.map +1 -1
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts +4 -4
- package/dist/types/accessorTree/NormalizedPersistedData.d.ts.map +1 -1
- package/dist/types/accessorTree/PersistResult.d.ts +2 -1
- package/dist/types/accessorTree/PersistResult.d.ts.map +1 -1
- package/dist/types/accessorTree/QueryRequestResponse.d.ts +15 -10
- package/dist/types/accessorTree/QueryRequestResponse.d.ts.map +1 -1
- package/dist/types/accessorTree/RequestError.d.ts +9 -1
- package/dist/types/accessorTree/RequestError.d.ts.map +1 -1
- package/dist/types/accessorTree/RuntimeId.d.ts +16 -6
- package/dist/types/accessorTree/RuntimeId.d.ts.map +1 -1
- package/dist/types/accessors/EntityAccessor.d.ts +1 -3
- package/dist/types/accessors/EntityAccessor.d.ts.map +1 -1
- package/dist/types/accessors/EntityListAccessor.d.ts +2 -2
- package/dist/types/accessors/EntityListAccessor.d.ts.map +1 -1
- package/dist/types/core/AccessorErrorManager.d.ts.map +1 -1
- package/dist/types/core/DataBinding.d.ts +1 -0
- 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/MarkerMerger.d.ts.map +1 -1
- package/dist/types/core/RequestResponseNormalizer.d.ts.map +1 -1
- package/dist/types/core/StateInitializer.d.ts.map +1 -1
- package/dist/types/core/TreeStore.d.ts +3 -3
- package/dist/types/core/TreeStore.d.ts.map +1 -1
- package/dist/types/core/VariableInputTransformer.d.ts.map +1 -1
- package/dist/types/core/operations/ListOperations.d.ts +2 -1
- package/dist/types/core/operations/ListOperations.d.ts.map +1 -1
- package/dist/types/core/requestAliases/MutationAlias.d.ts.map +1 -1
- package/dist/types/core/schema/Schema.d.ts +2 -0
- package/dist/types/core/schema/Schema.d.ts.map +1 -1
- package/dist/types/core/schema/index.d.ts +0 -1
- package/dist/types/core/schema/index.d.ts.map +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts +1 -1
- package/dist/types/coreComponents/EntityListSubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts +1 -1
- package/dist/types/coreComponents/EntitySubTree.d.ts.map +1 -1
- package/dist/types/coreComponents/Field.d.ts.map +1 -1
- package/dist/types/coreComponents/HasMany.d.ts +1 -1
- package/dist/types/coreComponents/HasMany.d.ts.map +1 -1
- package/dist/types/coreComponents/HasOne.d.ts +1 -1
- package/dist/types/coreComponents/HasOne.d.ts.map +1 -1
- package/dist/types/dao/Environment.d.ts +81 -42
- package/dist/types/dao/Environment.d.ts.map +1 -1
- package/dist/types/dao/TreeNodeEnvironmentFactory.d.ts +19 -0
- package/dist/types/dao/TreeNodeEnvironmentFactory.d.ts.map +1 -0
- package/dist/types/queryLanguage/MarkerFactory.d.ts.map +1 -1
- package/dist/types/queryLanguage/Parser.d.ts +1 -0
- package/dist/types/queryLanguage/Parser.d.ts.map +1 -1
- package/dist/types/queryLanguage/tokenList.d.ts +1 -0
- package/dist/types/queryLanguage/tokenList.d.ts.map +1 -1
- package/dist/types/treeParameters/primitives/EntityId.d.ts +1 -1
- package/dist/types/treeParameters/primitives/EntityId.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -10
- package/src/accessorTree/MutationRequestResponse.ts +4 -1
- package/src/accessorTree/NormalizedPersistedData.ts +4 -4
- package/src/accessorTree/PersistResult.ts +2 -1
- package/src/accessorTree/QueryRequestResponse.ts +18 -14
- package/src/accessorTree/RequestError.ts +7 -1
- package/src/accessorTree/RuntimeId.ts +27 -6
- package/src/accessors/EntityAccessor.ts +2 -51
- package/src/accessors/EntityListAccessor.ts +3 -3
- package/src/core/AccessorErrorManager.ts +3 -0
- package/src/core/DataBinding.ts +32 -33
- package/src/core/ErrorsPreprocessor.ts +2 -2
- package/src/core/MarkerMerger.ts +1 -4
- package/src/core/MutationGenerator.ts +5 -5
- package/src/core/RequestResponseNormalizer.ts +37 -38
- package/src/core/StateInitializer.ts +15 -17
- package/src/core/TreeAugmenter.ts +11 -11
- package/src/core/TreeFilterGenerator.ts +5 -5
- package/src/core/TreeStore.ts +12 -6
- package/src/core/VariableInputTransformer.ts +7 -4
- package/src/core/operations/EntityOperations.ts +5 -5
- package/src/core/operations/FieldOperations.ts +2 -2
- package/src/core/operations/ListOperations.ts +4 -4
- package/src/core/operations/OperationsHelpers.ts +2 -2
- package/src/core/requestAliases/MutationAlias.ts +5 -3
- package/src/core/schema/Schema.ts +5 -0
- package/src/core/schema/index.ts +0 -1
- package/src/coreComponents/EntityListSubTree.tsx +5 -16
- package/src/coreComponents/EntitySubTree.tsx +17 -32
- package/src/coreComponents/Field.tsx +4 -0
- package/src/coreComponents/HasMany.tsx +4 -6
- package/src/coreComponents/HasOne.tsx +6 -7
- package/src/dao/Environment.ts +221 -126
- package/src/dao/TreeNodeEnvironmentFactory.ts +228 -0
- package/src/queryLanguage/MarkerFactory.ts +5 -3
- package/src/queryLanguage/Parser.ts +36 -12
- package/src/queryLanguage/tokenList.ts +6 -0
- package/src/treeParameters/primitives/EntityId.ts +1 -1
- package/src/tsconfig.json +1 -1
- package/src/utils/assertNever.ts +1 -1
- package/dist/development/core/schema/SchemaValidator.js +0 -118
- package/dist/development/core/schema/SchemaValidator.js.map +0 -1
- package/dist/types/core/schema/SchemaValidator.d.ts +0 -14
- package/dist/types/core/schema/SchemaValidator.d.ts.map +0 -1
- package/src/core/schema/SchemaValidator.ts +0 -238
|
@@ -1,560 +1,580 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
entityName,
|
|
35
|
-
field,
|
|
36
|
-
filter,
|
|
37
|
-
hasOneRelationPath
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
qualifiedSingleEntity = this.RULE("qualifiedSingleEntity", () => {
|
|
41
|
-
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
42
|
-
const where = this.SUBRULE(this.uniqueWhere);
|
|
43
|
-
const filter = this.OPTION(() => this.SUBRULE(this.nonUniqueWhere));
|
|
44
|
-
const relativeSingleEntity = this.OPTION1(() => {
|
|
45
|
-
this.CONSUME(tokens.Dot);
|
|
46
|
-
return this.SUBRULE(this.relativeSingleEntity);
|
|
47
|
-
});
|
|
48
|
-
const hasOneRelationPath = this.ACTION(() => relativeSingleEntity === void 0 ? [] : relativeSingleEntity.hasOneRelationPath);
|
|
49
|
-
return {
|
|
50
|
-
entityName,
|
|
51
|
-
where,
|
|
52
|
-
hasOneRelationPath,
|
|
53
|
-
filter
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
unconstrainedQualifiedEntityList = this.RULE("unconstrainedQualifiedEntityList", () => {
|
|
57
|
-
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
58
|
-
const relativeSingleEntity = this.OPTION(() => {
|
|
59
|
-
this.CONSUME(tokens.Dot);
|
|
60
|
-
return this.SUBRULE(this.relativeSingleEntity);
|
|
61
|
-
});
|
|
62
|
-
const hasOneRelationPath = this.ACTION(() => relativeSingleEntity === void 0 ? [] : relativeSingleEntity.hasOneRelationPath);
|
|
63
|
-
return {
|
|
64
|
-
entityName,
|
|
65
|
-
hasOneRelationPath
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
unconstrainedQualifiedSingleEntity = this.RULE("unconstrainedQualifiedSingleEntity", () => {
|
|
69
|
-
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
70
|
-
const relativeSingleEntity = this.OPTION1(() => {
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { GraphQlBuilder } from "@contember/client";
|
|
8
|
+
import { EmbeddedActionsParser, Lexer } from "chevrotain";
|
|
9
|
+
import { CacheStore } from "./CacheStore.js";
|
|
10
|
+
import { QueryLanguageError } from "./QueryLanguageError.js";
|
|
11
|
+
import { tokenList, tokens, TokenRegExps } from "./tokenList.js";
|
|
12
|
+
import { BindingError } from "../BindingError.js";
|
|
13
|
+
import { Environment } from "../dao/Environment.js";
|
|
14
|
+
const _Parser = class extends EmbeddedActionsParser {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(tokenList, { outputCst: false, maxLookahead: 1 });
|
|
17
|
+
__publicField(this, "qualifiedEntityList", this.RULE("qualifiedEntityList", () => {
|
|
18
|
+
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
19
|
+
const filter = this.OPTION(() => this.SUBRULE(this.nonUniqueWhere));
|
|
20
|
+
const relativeSingleEntity = this.OPTION1(() => {
|
|
21
|
+
this.CONSUME(tokens.Dot);
|
|
22
|
+
return this.SUBRULE(this.relativeSingleEntity);
|
|
23
|
+
});
|
|
24
|
+
const hasOneRelationPath = this.ACTION(() => relativeSingleEntity === void 0 ? [] : relativeSingleEntity.hasOneRelationPath);
|
|
25
|
+
return {
|
|
26
|
+
entityName,
|
|
27
|
+
filter,
|
|
28
|
+
hasOneRelationPath
|
|
29
|
+
};
|
|
30
|
+
}));
|
|
31
|
+
__publicField(this, "qualifiedFieldList", this.RULE("qualifiedFieldList", () => {
|
|
32
|
+
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
33
|
+
const filter = this.OPTION(() => this.SUBRULE(this.nonUniqueWhere));
|
|
71
34
|
this.CONSUME(tokens.Dot);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const filter = this.OPTION1(() => this.SUBRULE(this.nonUniqueWhere));
|
|
127
|
-
const hasOneRelation = {
|
|
128
|
-
field: fieldName,
|
|
129
|
-
filter,
|
|
130
|
-
reducedBy
|
|
131
|
-
};
|
|
132
|
-
return hasOneRelation;
|
|
133
|
-
});
|
|
134
|
-
nonUniqueWhere = this.RULE("nonUniqueWhere", () => {
|
|
135
|
-
const cnfWhere = [];
|
|
136
|
-
this.AT_LEAST_ONE(() => {
|
|
137
|
-
this.CONSUME(tokens.LeftBracket);
|
|
138
|
-
cnfWhere.push(this.SUBRULE(this.disjunction));
|
|
139
|
-
this.CONSUME(tokens.RightBracket);
|
|
140
|
-
});
|
|
141
|
-
if (cnfWhere.length === 1) {
|
|
142
|
-
return cnfWhere[0];
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
and: cnfWhere
|
|
146
|
-
};
|
|
147
|
-
});
|
|
148
|
-
disjunction = this.RULE("disjunction", () => {
|
|
149
|
-
const conjunctions = [];
|
|
150
|
-
this.AT_LEAST_ONE_SEP({
|
|
151
|
-
SEP: tokens.Or,
|
|
152
|
-
DEF: () => {
|
|
153
|
-
conjunctions.push(this.SUBRULE(this.conjunction));
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
if (conjunctions.length === 1) {
|
|
157
|
-
return conjunctions[0];
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
or: conjunctions
|
|
161
|
-
};
|
|
162
|
-
});
|
|
163
|
-
conjunction = this.RULE("conjunction", () => {
|
|
164
|
-
const negations = [];
|
|
165
|
-
this.AT_LEAST_ONE_SEP({
|
|
166
|
-
SEP: tokens.And,
|
|
167
|
-
DEF: () => {
|
|
168
|
-
negations.push(this.SUBRULE(this.negation));
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
if (negations.length === 1) {
|
|
172
|
-
return negations[0];
|
|
173
|
-
}
|
|
174
|
-
return {
|
|
175
|
-
and: negations
|
|
176
|
-
};
|
|
177
|
-
});
|
|
178
|
-
negation = this.RULE("negation", () => {
|
|
179
|
-
return this.OR([
|
|
180
|
-
{
|
|
181
|
-
ALT: () => {
|
|
182
|
-
this.CONSUME(tokens.Not);
|
|
183
|
-
return {
|
|
184
|
-
not: this.SUBRULE(this.filterGroup)
|
|
185
|
-
};
|
|
35
|
+
const { hasOneRelationPath, field } = this.SUBRULE(this.relativeSingleField);
|
|
36
|
+
return {
|
|
37
|
+
entityName,
|
|
38
|
+
field,
|
|
39
|
+
filter,
|
|
40
|
+
hasOneRelationPath
|
|
41
|
+
};
|
|
42
|
+
}));
|
|
43
|
+
__publicField(this, "qualifiedSingleEntity", this.RULE("qualifiedSingleEntity", () => {
|
|
44
|
+
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
45
|
+
const where = this.SUBRULE(this.uniqueWhere);
|
|
46
|
+
const filter = this.OPTION(() => this.SUBRULE(this.nonUniqueWhere));
|
|
47
|
+
const relativeSingleEntity = this.OPTION1(() => {
|
|
48
|
+
this.CONSUME(tokens.Dot);
|
|
49
|
+
return this.SUBRULE(this.relativeSingleEntity);
|
|
50
|
+
});
|
|
51
|
+
const hasOneRelationPath = this.ACTION(() => relativeSingleEntity === void 0 ? [] : relativeSingleEntity.hasOneRelationPath);
|
|
52
|
+
return {
|
|
53
|
+
entityName,
|
|
54
|
+
where,
|
|
55
|
+
hasOneRelationPath,
|
|
56
|
+
filter
|
|
57
|
+
};
|
|
58
|
+
}));
|
|
59
|
+
__publicField(this, "unconstrainedQualifiedEntityList", this.RULE("unconstrainedQualifiedEntityList", () => {
|
|
60
|
+
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
61
|
+
const relativeSingleEntity = this.OPTION(() => {
|
|
62
|
+
this.CONSUME(tokens.Dot);
|
|
63
|
+
return this.SUBRULE(this.relativeSingleEntity);
|
|
64
|
+
});
|
|
65
|
+
const hasOneRelationPath = this.ACTION(() => relativeSingleEntity === void 0 ? [] : relativeSingleEntity.hasOneRelationPath);
|
|
66
|
+
return {
|
|
67
|
+
entityName,
|
|
68
|
+
hasOneRelationPath
|
|
69
|
+
};
|
|
70
|
+
}));
|
|
71
|
+
__publicField(this, "unconstrainedQualifiedSingleEntity", this.RULE("unconstrainedQualifiedSingleEntity", () => {
|
|
72
|
+
const entityName = this.SUBRULE(this.entityIdentifier);
|
|
73
|
+
const relativeSingleEntity = this.OPTION1(() => {
|
|
74
|
+
this.CONSUME(tokens.Dot);
|
|
75
|
+
return this.SUBRULE(this.relativeSingleEntity);
|
|
76
|
+
});
|
|
77
|
+
const hasOneRelationPath = this.ACTION(() => relativeSingleEntity === void 0 ? [] : relativeSingleEntity.hasOneRelationPath);
|
|
78
|
+
return {
|
|
79
|
+
entityName,
|
|
80
|
+
hasOneRelationPath
|
|
81
|
+
};
|
|
82
|
+
}));
|
|
83
|
+
__publicField(this, "relativeSingleField", this.RULE("relativeSingleField", () => {
|
|
84
|
+
let { hasOneRelationPath } = this.SUBRULE(this.relativeSingleEntity);
|
|
85
|
+
const last = this.ACTION(() => hasOneRelationPath.pop());
|
|
86
|
+
this.ACTION(() => {
|
|
87
|
+
if (last.reducedBy !== void 0 || last.filter !== void 0) {
|
|
88
|
+
throw new QueryLanguageError(`Cannot parse '${_Parser.rawInput}': the last field '${last.field}' is being reduced or filtered, which, grammatically, makes it a relation but a single field is expected.`);
|
|
186
89
|
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
90
|
+
});
|
|
91
|
+
const field = this.ACTION(() => last.field);
|
|
92
|
+
return {
|
|
93
|
+
hasOneRelationPath,
|
|
94
|
+
field
|
|
95
|
+
};
|
|
96
|
+
}));
|
|
97
|
+
__publicField(this, "relativeSingleEntity", this.RULE("relativeSingleEntity", () => {
|
|
98
|
+
const hasOneRelationPath = [];
|
|
99
|
+
this.AT_LEAST_ONE_SEP({
|
|
100
|
+
SEP: tokens.Dot,
|
|
101
|
+
DEF: () => {
|
|
102
|
+
hasOneRelationPath.push(this.SUBRULE(this.hasOneRelation));
|
|
191
103
|
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
hasOneRelationPath
|
|
107
|
+
};
|
|
108
|
+
}));
|
|
109
|
+
__publicField(this, "relativeEntityList", this.RULE("relativeEntityList", () => {
|
|
110
|
+
let { hasOneRelationPath } = this.SUBRULE(this.relativeSingleEntity);
|
|
111
|
+
const last = this.ACTION(() => hasOneRelationPath.pop());
|
|
112
|
+
this.ACTION(() => {
|
|
113
|
+
if (last.reducedBy !== void 0) {
|
|
114
|
+
throw new QueryLanguageError(`Cannot parse '${_Parser.rawInput}': the last field '${last.field}' is being reduced, which, grammatically, makes it a has-one relation but a has-many relation is expected.`);
|
|
203
115
|
}
|
|
204
|
-
}
|
|
205
|
-
{
|
|
206
|
-
|
|
116
|
+
});
|
|
117
|
+
const hasManyRelation = this.ACTION(() => ({
|
|
118
|
+
field: last.field,
|
|
119
|
+
filter: last.filter
|
|
120
|
+
}));
|
|
121
|
+
return {
|
|
122
|
+
hasOneRelationPath,
|
|
123
|
+
hasManyRelation
|
|
124
|
+
};
|
|
125
|
+
}));
|
|
126
|
+
__publicField(this, "hasOneRelation", this.RULE("hasOneRelation", () => {
|
|
127
|
+
const fieldName = this.SUBRULE(this.fieldName);
|
|
128
|
+
const reducedBy = this.OPTION(() => this.SUBRULE(this.uniqueWhere));
|
|
129
|
+
const filter = this.OPTION1(() => this.SUBRULE(this.nonUniqueWhere));
|
|
130
|
+
const hasOneRelation = {
|
|
131
|
+
field: fieldName,
|
|
132
|
+
filter,
|
|
133
|
+
reducedBy
|
|
134
|
+
};
|
|
135
|
+
return hasOneRelation;
|
|
136
|
+
}));
|
|
137
|
+
__publicField(this, "nonUniqueWhere", this.RULE("nonUniqueWhere", () => {
|
|
138
|
+
const cnfWhere = [];
|
|
139
|
+
this.AT_LEAST_ONE(() => {
|
|
140
|
+
this.CONSUME(tokens.LeftBracket);
|
|
141
|
+
cnfWhere.push(this.SUBRULE(this.disjunction));
|
|
142
|
+
this.CONSUME(tokens.RightBracket);
|
|
143
|
+
});
|
|
144
|
+
if (cnfWhere.length === 1) {
|
|
145
|
+
return cnfWhere[0];
|
|
207
146
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
return variable;
|
|
220
|
-
});
|
|
147
|
+
return {
|
|
148
|
+
and: cnfWhere
|
|
149
|
+
};
|
|
150
|
+
}));
|
|
151
|
+
__publicField(this, "disjunction", this.RULE("disjunction", () => {
|
|
152
|
+
const conjunctions = [];
|
|
153
|
+
this.AT_LEAST_ONE_SEP({
|
|
154
|
+
SEP: tokens.Or,
|
|
155
|
+
DEF: () => {
|
|
156
|
+
conjunctions.push(this.SUBRULE(this.conjunction));
|
|
221
157
|
}
|
|
222
|
-
}
|
|
223
|
-
{
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
]);
|
|
227
|
-
});
|
|
228
|
-
fieldWhere = this.RULE("fieldWhere", () => {
|
|
229
|
-
const fields = [];
|
|
230
|
-
this.AT_LEAST_ONE_SEP({
|
|
231
|
-
SEP: tokens.Dot,
|
|
232
|
-
DEF: () => {
|
|
233
|
-
fields.push(this.SUBRULE(this.fieldIdentifier));
|
|
158
|
+
});
|
|
159
|
+
if (conjunctions.length === 1) {
|
|
160
|
+
return conjunctions[0];
|
|
234
161
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
let i = fields.length - 1;
|
|
238
|
-
let where = {
|
|
239
|
-
[fields[i--]]: condition
|
|
240
|
-
};
|
|
241
|
-
while (i >= 0) {
|
|
242
|
-
where = {
|
|
243
|
-
[fields[i--]]: where
|
|
162
|
+
return {
|
|
163
|
+
or: conjunctions
|
|
244
164
|
};
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
return this.ACTION(() => {
|
|
253
|
-
if (columnValue === null) {
|
|
254
|
-
if (operator === "eq") {
|
|
255
|
-
condition.null = true;
|
|
256
|
-
} else if (operator === "notEq") {
|
|
257
|
-
condition.null = false;
|
|
258
|
-
} else {
|
|
259
|
-
throw new QueryLanguageError(`The null keyword as a right hand operand can only be tested for (in)equality.`);
|
|
165
|
+
}));
|
|
166
|
+
__publicField(this, "conjunction", this.RULE("conjunction", () => {
|
|
167
|
+
const negations = [];
|
|
168
|
+
this.AT_LEAST_ONE_SEP({
|
|
169
|
+
SEP: tokens.And,
|
|
170
|
+
DEF: () => {
|
|
171
|
+
negations.push(this.SUBRULE(this.negation));
|
|
260
172
|
}
|
|
261
|
-
|
|
173
|
+
});
|
|
174
|
+
if (negations.length === 1) {
|
|
175
|
+
return negations[0];
|
|
262
176
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
{
|
|
282
|
-
ALT: () => {
|
|
283
|
-
this.CONSUME(tokens.LowerThan);
|
|
284
|
-
return "lt";
|
|
177
|
+
return {
|
|
178
|
+
and: negations
|
|
179
|
+
};
|
|
180
|
+
}));
|
|
181
|
+
__publicField(this, "negation", this.RULE("negation", () => {
|
|
182
|
+
return this.OR([
|
|
183
|
+
{
|
|
184
|
+
ALT: () => {
|
|
185
|
+
this.CONSUME(tokens.Not);
|
|
186
|
+
return {
|
|
187
|
+
not: this.SUBRULE(this.filterGroup)
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
ALT: () => {
|
|
193
|
+
return this.SUBRULE1(this.filterGroup);
|
|
194
|
+
}
|
|
285
195
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
196
|
+
]);
|
|
197
|
+
}));
|
|
198
|
+
__publicField(this, "filterGroup", this.RULE("filterGroup", () => {
|
|
199
|
+
return this.OR([
|
|
200
|
+
{
|
|
201
|
+
ALT: () => {
|
|
202
|
+
this.CONSUME(tokens.LeftParenthesis);
|
|
203
|
+
const subFilter = this.SUBRULE(this.disjunction);
|
|
204
|
+
this.CONSUME1(tokens.RightParenthesis);
|
|
205
|
+
return subFilter;
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
ALT: () => this.SUBRULE1(this.filterAtom)
|
|
291
210
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
211
|
+
]);
|
|
212
|
+
}));
|
|
213
|
+
__publicField(this, "filterAtom", this.RULE("filterAtom", () => {
|
|
214
|
+
return this.OR([
|
|
215
|
+
{
|
|
216
|
+
ALT: () => {
|
|
217
|
+
const variable = this.SUBRULE(this.variable);
|
|
218
|
+
return this.ACTION(() => {
|
|
219
|
+
if (typeof variable !== "object" || variable instanceof GraphQlBuilder.GraphQlLiteral) {
|
|
220
|
+
throw new QueryLanguageError(`Invalid filter value '${JSON.stringify(variable)}'`);
|
|
221
|
+
}
|
|
222
|
+
return variable;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
ALT: () => this.SUBRULE1(this.fieldWhere)
|
|
297
228
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
229
|
+
]);
|
|
230
|
+
}));
|
|
231
|
+
__publicField(this, "fieldWhere", this.RULE("fieldWhere", () => {
|
|
232
|
+
const fields = [];
|
|
233
|
+
this.AT_LEAST_ONE_SEP({
|
|
234
|
+
SEP: tokens.Dot,
|
|
235
|
+
DEF: () => {
|
|
236
|
+
fields.push(this.SUBRULE(this.fieldIdentifier));
|
|
303
237
|
}
|
|
238
|
+
});
|
|
239
|
+
const condition = this.SUBRULE(this.condition);
|
|
240
|
+
let i = fields.length - 1;
|
|
241
|
+
let where = {
|
|
242
|
+
[fields[i--]]: condition
|
|
243
|
+
};
|
|
244
|
+
while (i >= 0) {
|
|
245
|
+
where = {
|
|
246
|
+
[fields[i--]]: where
|
|
247
|
+
};
|
|
304
248
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
{
|
|
322
|
-
ALT: () => {
|
|
323
|
-
this.CONSUME(tokens.False);
|
|
324
|
-
return false;
|
|
249
|
+
return where;
|
|
250
|
+
}));
|
|
251
|
+
__publicField(this, "condition", this.RULE("condition", () => {
|
|
252
|
+
const operator = this.SUBRULE(this.conditionOperator);
|
|
253
|
+
const columnValue = this.SUBRULE(this.columnValue);
|
|
254
|
+
const condition = {};
|
|
255
|
+
return this.ACTION(() => {
|
|
256
|
+
if (columnValue === null) {
|
|
257
|
+
if (operator === "eq") {
|
|
258
|
+
condition.null = true;
|
|
259
|
+
} else if (operator === "notEq") {
|
|
260
|
+
condition.null = false;
|
|
261
|
+
} else {
|
|
262
|
+
throw new QueryLanguageError(`The null keyword as a right hand operand can only be tested for (in)equality.`);
|
|
263
|
+
}
|
|
264
|
+
return condition;
|
|
325
265
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
SEP: tokens.Comma,
|
|
337
|
-
DEF: () => {
|
|
338
|
-
const nestedFields = [];
|
|
339
|
-
this.AT_LEAST_ONE_SEP1({
|
|
340
|
-
SEP: tokens.Dot,
|
|
341
|
-
DEF: () => {
|
|
342
|
-
nestedFields.push(this.SUBRULE(this.fieldIdentifier));
|
|
266
|
+
condition[operator] = columnValue;
|
|
267
|
+
return condition;
|
|
268
|
+
});
|
|
269
|
+
}));
|
|
270
|
+
__publicField(this, "conditionOperator", this.RULE("conditionOperator", () => {
|
|
271
|
+
return this.OR([
|
|
272
|
+
{
|
|
273
|
+
ALT: () => {
|
|
274
|
+
this.CONSUME(tokens.Equals);
|
|
275
|
+
return "eq";
|
|
343
276
|
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
for (let i = 0, len = nestedFields.length; i < len; i++) {
|
|
350
|
-
const nestedField = nestedFields[i];
|
|
351
|
-
const isLast = len - 1 === i;
|
|
352
|
-
if (isLast) {
|
|
353
|
-
if (nestedField in nestedWhere) {
|
|
354
|
-
throw new QueryLanguageError(`Duplicate '${nestedFields.slice(0, i + 1).join(".")}' field`);
|
|
355
|
-
}
|
|
356
|
-
nestedWhere[nestedField] = primaryValue;
|
|
357
|
-
} else {
|
|
358
|
-
if (nestedField in nestedWhere) {
|
|
359
|
-
const existingWhere = nestedWhere[nestedField];
|
|
360
|
-
if (typeof existingWhere === "object" && !(existingWhere instanceof GraphQlBuilder.GraphQlLiteral)) {
|
|
361
|
-
nestedWhere = existingWhere;
|
|
362
|
-
} else {
|
|
363
|
-
throw new QueryLanguageError(`Malformed expression: cannot simultaneously treat the '${nestedFields.slice(0, i + 1).join(".")}' field as a scalar as well as a relation.`);
|
|
364
|
-
}
|
|
365
|
-
} else {
|
|
366
|
-
const newWhere = {};
|
|
367
|
-
nestedWhere[nestedField] = newWhere;
|
|
368
|
-
nestedWhere = newWhere;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
ALT: () => {
|
|
280
|
+
this.CONSUME(tokens.NotEquals);
|
|
281
|
+
return "notEq";
|
|
371
282
|
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
});
|
|
378
|
-
orderBy = this.RULE("orderBy", () => {
|
|
379
|
-
const order = [];
|
|
380
|
-
this.AT_LEAST_ONE_SEP({
|
|
381
|
-
SEP: tokens.Comma,
|
|
382
|
-
DEF: () => {
|
|
383
|
-
const fieldNames = [];
|
|
384
|
-
this.AT_LEAST_ONE_SEP1({
|
|
385
|
-
SEP: tokens.Dot,
|
|
386
|
-
DEF: () => {
|
|
387
|
-
fieldNames.push(this.SUBRULE(this.fieldIdentifier));
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
ALT: () => {
|
|
286
|
+
this.CONSUME(tokens.LowerThan);
|
|
287
|
+
return "lt";
|
|
388
288
|
}
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
throw new QueryLanguageError(`The only valid order directions are \`asc\` and \`desc\`.`);
|
|
395
|
-
}
|
|
396
|
-
} else {
|
|
397
|
-
literal = new GraphQlBuilder.GraphQlLiteral("asc");
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
ALT: () => {
|
|
292
|
+
this.CONSUME(tokens.LowerEqual);
|
|
293
|
+
return "lte";
|
|
398
294
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
ALT: () => {
|
|
298
|
+
this.CONSUME(tokens.GreaterThan);
|
|
299
|
+
return "gt";
|
|
402
300
|
}
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
ALT: () => this.SUBRULE(this.string)
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
ALT: () => this.SUBRULE(this.number)
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
ALT: () => this.SUBRULE(this.graphQlLiteral)
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
ALT: () => {
|
|
486
|
-
const variableValue = this.SUBRULE(this.variable);
|
|
487
|
-
return this.ACTION(() => {
|
|
488
|
-
if (typeof variableValue === "string" || typeof variableValue === "number" || variableValue instanceof GraphQlBuilder.GraphQlLiteral) {
|
|
489
|
-
return variableValue;
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
ALT: () => {
|
|
304
|
+
this.CONSUME(tokens.GreaterEqual);
|
|
305
|
+
return "gte";
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
]);
|
|
309
|
+
}));
|
|
310
|
+
__publicField(this, "columnValue", this.RULE("columnValue", () => {
|
|
311
|
+
return this.OR([
|
|
312
|
+
{
|
|
313
|
+
ALT: () => {
|
|
314
|
+
this.CONSUME(tokens.Null);
|
|
315
|
+
return null;
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
ALT: () => {
|
|
320
|
+
this.CONSUME(tokens.True);
|
|
321
|
+
return true;
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
ALT: () => {
|
|
326
|
+
this.CONSUME(tokens.False);
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
ALT: () => this.SUBRULE(this.primaryValue)
|
|
332
|
+
}
|
|
333
|
+
]);
|
|
334
|
+
}));
|
|
335
|
+
__publicField(this, "uniqueWhere", this.RULE("uniqueWhere", () => {
|
|
336
|
+
const where = {};
|
|
337
|
+
this.CONSUME(tokens.LeftParenthesis);
|
|
338
|
+
this.AT_LEAST_ONE_SEP({
|
|
339
|
+
SEP: tokens.Comma,
|
|
340
|
+
DEF: () => {
|
|
341
|
+
const nestedFields = [];
|
|
342
|
+
this.AT_LEAST_ONE_SEP1({
|
|
343
|
+
SEP: tokens.Dot,
|
|
344
|
+
DEF: () => {
|
|
345
|
+
nestedFields.push(this.SUBRULE(this.fieldIdentifier));
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
this.CONSUME(tokens.Equals);
|
|
349
|
+
const primaryValue = this.SUBRULE(this.primaryValue);
|
|
350
|
+
this.ACTION(() => {
|
|
351
|
+
let nestedWhere = where;
|
|
352
|
+
for (let i = 0, len = nestedFields.length; i < len; i++) {
|
|
353
|
+
const nestedField = nestedFields[i];
|
|
354
|
+
const isLast = len - 1 === i;
|
|
355
|
+
if (isLast) {
|
|
356
|
+
if (nestedField in nestedWhere) {
|
|
357
|
+
throw new QueryLanguageError(`Duplicate '${nestedFields.slice(0, i + 1).join(".")}' field`);
|
|
358
|
+
}
|
|
359
|
+
nestedWhere[nestedField] = primaryValue;
|
|
360
|
+
} else {
|
|
361
|
+
if (nestedField in nestedWhere) {
|
|
362
|
+
const existingWhere = nestedWhere[nestedField];
|
|
363
|
+
if (typeof existingWhere === "object" && !(existingWhere instanceof GraphQlBuilder.GraphQlLiteral)) {
|
|
364
|
+
nestedWhere = existingWhere;
|
|
365
|
+
} else {
|
|
366
|
+
throw new QueryLanguageError(`Malformed expression: cannot simultaneously treat the '${nestedFields.slice(0, i + 1).join(".")}' field as a scalar as well as a relation.`);
|
|
367
|
+
}
|
|
368
|
+
} else {
|
|
369
|
+
const newWhere = {};
|
|
370
|
+
nestedWhere[nestedField] = newWhere;
|
|
371
|
+
nestedWhere = newWhere;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
490
374
|
}
|
|
491
|
-
throw new QueryLanguageError(`A variable can resolve to a literal, string or a number, not ${typeof variableValue}`);
|
|
492
375
|
});
|
|
493
376
|
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
377
|
+
});
|
|
378
|
+
this.CONSUME(tokens.RightParenthesis);
|
|
379
|
+
return where;
|
|
380
|
+
}));
|
|
381
|
+
__publicField(this, "orderBy", this.RULE("orderBy", () => {
|
|
382
|
+
const order = [];
|
|
383
|
+
this.AT_LEAST_ONE_SEP({
|
|
384
|
+
SEP: tokens.Comma,
|
|
385
|
+
DEF: () => {
|
|
386
|
+
const fieldNames = [];
|
|
387
|
+
this.AT_LEAST_ONE_SEP1({
|
|
388
|
+
SEP: tokens.Dot,
|
|
389
|
+
DEF: () => {
|
|
390
|
+
fieldNames.push(this.SUBRULE(this.fieldIdentifier));
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
let literal = this.OPTION(() => this.SUBRULE1(this.graphQlLiteral));
|
|
394
|
+
this.ACTION(() => {
|
|
395
|
+
if (literal) {
|
|
396
|
+
if (literal.value !== "asc" && literal.value !== "desc") {
|
|
397
|
+
throw new QueryLanguageError(`The only valid order directions are \`asc\` and \`desc\`.`);
|
|
398
|
+
}
|
|
399
|
+
} else {
|
|
400
|
+
literal = new GraphQlBuilder.GraphQlLiteral("asc");
|
|
401
|
+
}
|
|
402
|
+
let orderBy = literal;
|
|
403
|
+
for (let i = fieldNames.length - 1; i >= 0; i--) {
|
|
404
|
+
orderBy = { [fieldNames[i]]: orderBy };
|
|
521
405
|
}
|
|
522
|
-
|
|
406
|
+
order.push(orderBy);
|
|
523
407
|
});
|
|
524
408
|
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
409
|
+
});
|
|
410
|
+
return order;
|
|
411
|
+
}));
|
|
412
|
+
__publicField(this, "taggedMap", this.RULE("taggedMap", () => {
|
|
413
|
+
const name = this.SUBRULE(this.pageName);
|
|
414
|
+
return {
|
|
415
|
+
name,
|
|
416
|
+
entries: this.OPTION(() => this.SUBRULE(this.taggedMapEntries)) ?? []
|
|
417
|
+
};
|
|
418
|
+
}));
|
|
419
|
+
__publicField(this, "taggedMapEntries", this.RULE("taggedMapEntries", () => {
|
|
420
|
+
this.CONSUME(tokens.LeftParenthesis);
|
|
421
|
+
const entries = [];
|
|
422
|
+
this.AT_LEAST_ONE_SEP({
|
|
423
|
+
SEP: tokens.Comma,
|
|
424
|
+
DEF: () => entries.push(this.SUBRULE(this.taggedMapEntry))
|
|
425
|
+
});
|
|
426
|
+
this.CONSUME(tokens.RightParenthesis);
|
|
427
|
+
return entries;
|
|
428
|
+
}));
|
|
429
|
+
__publicField(this, "taggedMapEntry", this.RULE("taggedMapEntry", () => {
|
|
430
|
+
const variableName = this.CONSUME(tokens.Identifier).image;
|
|
431
|
+
this.CONSUME1(tokens.Colon);
|
|
432
|
+
const value = this.OR([
|
|
433
|
+
{
|
|
434
|
+
ALT: () => this.SUBRULE(this.taggedMapLiteralValue)
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
ALT: () => this.SUBRULE(this.taggedMapVariableValue)
|
|
438
|
+
}
|
|
439
|
+
]);
|
|
440
|
+
return {
|
|
441
|
+
key: variableName,
|
|
442
|
+
value
|
|
443
|
+
};
|
|
444
|
+
}));
|
|
445
|
+
__publicField(this, "taggedMapLiteralValue", this.RULE("taggedMapLiteralValue", () => {
|
|
446
|
+
const value = this.OR([
|
|
447
|
+
{
|
|
448
|
+
ALT: () => this.SUBRULE(this.string)
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
ALT: () => this.SUBRULE(this.number)
|
|
452
|
+
}
|
|
453
|
+
]);
|
|
454
|
+
return {
|
|
455
|
+
type: "literal",
|
|
456
|
+
value
|
|
457
|
+
};
|
|
458
|
+
}));
|
|
459
|
+
__publicField(this, "taggedMapVariableValue", this.RULE("taggedMapVariableValue", () => {
|
|
460
|
+
const start = this.CONSUME(tokens.DollarSign);
|
|
461
|
+
this.SUBRULE(this.relativeSingleField);
|
|
462
|
+
const end = this.LA(0);
|
|
463
|
+
const field = this.input.slice(this.input.indexOf(start) + 1, this.input.indexOf(end) + 1).map((it) => it.image).join("");
|
|
464
|
+
return {
|
|
465
|
+
type: "variable",
|
|
466
|
+
value: field
|
|
467
|
+
};
|
|
468
|
+
}));
|
|
469
|
+
__publicField(this, "fieldName", this.RULE("fieldName", () => {
|
|
470
|
+
return this.OR([
|
|
471
|
+
{
|
|
472
|
+
ALT: () => this.SUBRULE(this.fieldIdentifier)
|
|
473
|
+
}
|
|
474
|
+
]);
|
|
475
|
+
}));
|
|
476
|
+
__publicField(this, "primaryValue", this.RULE("primaryValue", () => {
|
|
477
|
+
return this.OR([
|
|
478
|
+
{
|
|
479
|
+
ALT: () => this.SUBRULE(this.string)
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
ALT: () => this.SUBRULE(this.number)
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
ALT: () => this.SUBRULE(this.graphQlLiteral)
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
ALT: () => {
|
|
489
|
+
const variableValue = this.SUBRULE(this.variable);
|
|
490
|
+
return this.ACTION(() => {
|
|
491
|
+
if (typeof variableValue === "string" || typeof variableValue === "number" || variableValue instanceof GraphQlBuilder.GraphQlLiteral) {
|
|
492
|
+
return variableValue;
|
|
493
|
+
}
|
|
494
|
+
throw new QueryLanguageError(`A variable can resolve to a literal, string or a number, not ${typeof variableValue}`);
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
]);
|
|
499
|
+
}));
|
|
500
|
+
__publicField(this, "fieldIdentifier", this.RULE("fieldIdentifier", () => {
|
|
501
|
+
return this.SUBRULE(this.identifier);
|
|
502
|
+
}));
|
|
503
|
+
__publicField(this, "identifier", this.RULE("identifier", () => {
|
|
504
|
+
return this.OR([
|
|
505
|
+
{
|
|
506
|
+
ALT: () => this.CONSUME(tokens.Identifier).image
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
ALT: () => this.CONSUME(tokens.EntityIdentifier).image
|
|
510
|
+
}
|
|
511
|
+
]);
|
|
512
|
+
}));
|
|
513
|
+
__publicField(this, "pageName", this.RULE("pageName", () => {
|
|
514
|
+
const parts = [];
|
|
515
|
+
this.AT_LEAST_ONE_SEP({
|
|
516
|
+
SEP: tokens.Slash,
|
|
517
|
+
DEF: () => parts.push(this.CONSUME(tokens.Identifier).image)
|
|
518
|
+
});
|
|
519
|
+
return parts.join("/");
|
|
520
|
+
}));
|
|
521
|
+
__publicField(this, "entityIdentifier", this.RULE("entityIdentifier", () => {
|
|
522
|
+
return this.OR([
|
|
523
|
+
{
|
|
524
|
+
ALT: () => this.CONSUME(tokens.EntityIdentifier).image
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
ALT: () => {
|
|
528
|
+
const variable = this.SUBRULE(this.variable);
|
|
529
|
+
return this.ACTION(() => {
|
|
530
|
+
if (!(typeof variable === "string") || !TokenRegExps.entityIdentifier.test(variable)) {
|
|
531
|
+
throw new QueryLanguageError(`The value of the variable $${variable} is not a valid entity identifier.`);
|
|
532
|
+
}
|
|
533
|
+
return variable;
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
]);
|
|
538
|
+
}));
|
|
539
|
+
__publicField(this, "string", this.RULE("string", () => {
|
|
540
|
+
const image = this.CONSUME(tokens.StringLiteral).image;
|
|
541
|
+
return image.substring(1, image.length - 1).replace("\\'", "'").replace("\\b", "\b").replace("\\f", "\f").replace("\\n", "\n").replace("\\r", "\r").replace("\\t", " ").replace("\\v", "\v");
|
|
542
|
+
}));
|
|
543
|
+
__publicField(this, "number", this.RULE("number", () => {
|
|
544
|
+
return parseFloat(this.CONSUME(tokens.NumberLiteral).image);
|
|
545
|
+
}));
|
|
546
|
+
__publicField(this, "graphQlLiteral", this.RULE("graphQlLiteral", () => {
|
|
547
|
+
const image = this.SUBRULE(this.identifier);
|
|
548
|
+
return new GraphQlBuilder.GraphQlLiteral(image);
|
|
549
|
+
}));
|
|
550
|
+
__publicField(this, "variable", this.RULE("variable", () => {
|
|
551
|
+
this.CONSUME(tokens.DollarSign);
|
|
552
|
+
const variableName = this.CONSUME(tokens.Identifier).image;
|
|
553
|
+
return this.ACTION(() => {
|
|
554
|
+
if (variableName === "rootWhereAsFilter") {
|
|
555
|
+
console.warn("$rootWhereAsFilter is deprecated, use $rootFilter");
|
|
556
|
+
}
|
|
557
|
+
switch (variableName) {
|
|
558
|
+
case "rootWhereAsFilter":
|
|
559
|
+
case "rootFilter":
|
|
560
|
+
return _Parser.environment.getSubTree().filter;
|
|
561
|
+
}
|
|
562
|
+
if (_Parser.environment.hasVariable(variableName)) {
|
|
563
|
+
return _Parser.environment.getVariable(variableName);
|
|
564
|
+
}
|
|
565
|
+
if (_Parser.environment.hasParameter(variableName)) {
|
|
566
|
+
return _Parser.environment.getParameter(variableName);
|
|
567
|
+
}
|
|
568
|
+
if (_Parser.environment.hasDimension(variableName)) {
|
|
569
|
+
const dimensionValue = _Parser.environment.getDimension(variableName);
|
|
570
|
+
if (dimensionValue.length > 1) {
|
|
571
|
+
throw new BindingError(`The variable $${variableName} resolved to a dimension which exists but contains ${dimensionValue.length} values. It has to contain exactly one. Perhaps you forgot to set the 'maxItems' prop of your DimensionsSwitcher?`);
|
|
572
|
+
}
|
|
549
573
|
return dimensionValue[0];
|
|
550
574
|
}
|
|
551
|
-
throw new QueryLanguageError(`
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
});
|
|
555
|
-
});
|
|
556
|
-
constructor() {
|
|
557
|
-
super(tokenList, { outputCst: false, maxLookahead: 1 });
|
|
575
|
+
throw new QueryLanguageError(`Undefined variable $${variableName}.`);
|
|
576
|
+
});
|
|
577
|
+
}));
|
|
558
578
|
this.performSelfAnalysis();
|
|
559
579
|
}
|
|
560
580
|
static parseQueryLanguageExpression(input, entry, environment) {
|
|
@@ -562,64 +582,69 @@ class Parser extends EmbeddedActionsParser {
|
|
|
562
582
|
if (cached !== void 0) {
|
|
563
583
|
return cached;
|
|
564
584
|
}
|
|
565
|
-
const lexingResult =
|
|
585
|
+
const lexingResult = _Parser.lexer.tokenize(_Parser.rawInput = input);
|
|
566
586
|
if (lexingResult.errors.length !== 0) {
|
|
567
587
|
throw new QueryLanguageError(`Failed to tokenize '${input}'.
|
|
568
588
|
|
|
569
589
|
${lexingResult.errors.map((i) => i.message).join("\n")}`);
|
|
570
590
|
}
|
|
571
|
-
|
|
572
|
-
|
|
591
|
+
_Parser.environment = environment;
|
|
592
|
+
_Parser.parser.input = lexingResult.tokens;
|
|
573
593
|
let expression;
|
|
574
594
|
switch (entry) {
|
|
575
595
|
case "relativeSingleField":
|
|
576
|
-
expression =
|
|
596
|
+
expression = _Parser.parser.relativeSingleField();
|
|
577
597
|
break;
|
|
578
598
|
case "relativeSingleEntity":
|
|
579
|
-
expression =
|
|
599
|
+
expression = _Parser.parser.relativeSingleEntity();
|
|
580
600
|
break;
|
|
581
601
|
case "relativeEntityList":
|
|
582
|
-
expression =
|
|
602
|
+
expression = _Parser.parser.relativeEntityList();
|
|
583
603
|
break;
|
|
584
604
|
case "qualifiedEntityList":
|
|
585
|
-
expression =
|
|
605
|
+
expression = _Parser.parser.qualifiedEntityList();
|
|
586
606
|
break;
|
|
587
607
|
case "qualifiedFieldList":
|
|
588
|
-
expression =
|
|
608
|
+
expression = _Parser.parser.qualifiedFieldList();
|
|
589
609
|
break;
|
|
590
610
|
case "qualifiedSingleEntity":
|
|
591
|
-
expression =
|
|
611
|
+
expression = _Parser.parser.qualifiedSingleEntity();
|
|
592
612
|
break;
|
|
593
613
|
case "unconstrainedQualifiedEntityList":
|
|
594
|
-
expression =
|
|
614
|
+
expression = _Parser.parser.unconstrainedQualifiedEntityList();
|
|
595
615
|
break;
|
|
596
616
|
case "unconstrainedQualifiedSingleEntity":
|
|
597
|
-
expression =
|
|
617
|
+
expression = _Parser.parser.unconstrainedQualifiedSingleEntity();
|
|
598
618
|
break;
|
|
599
619
|
case "uniqueWhere":
|
|
600
|
-
expression =
|
|
620
|
+
expression = _Parser.parser.uniqueWhere();
|
|
601
621
|
break;
|
|
602
622
|
case "filter":
|
|
603
|
-
expression =
|
|
623
|
+
expression = _Parser.parser.nonUniqueWhere();
|
|
604
624
|
break;
|
|
605
625
|
case "orderBy":
|
|
606
|
-
expression =
|
|
626
|
+
expression = _Parser.parser.orderBy();
|
|
607
627
|
break;
|
|
608
628
|
case "taggedMap":
|
|
609
|
-
expression =
|
|
629
|
+
expression = _Parser.parser.taggedMap();
|
|
610
630
|
break;
|
|
611
631
|
default:
|
|
612
632
|
throw new QueryLanguageError(`Not implemented entry point '${entry}'`);
|
|
613
633
|
}
|
|
614
|
-
if (
|
|
634
|
+
if (_Parser.parser.errors.length !== 0) {
|
|
615
635
|
throw new QueryLanguageError(`Failed to parse '${input}'.
|
|
616
636
|
|
|
617
|
-
${
|
|
637
|
+
${_Parser.parser.errors.map((i) => i.message).join("\n")}`);
|
|
618
638
|
}
|
|
619
639
|
this.cacheStore.set(environment, entry, input, expression);
|
|
620
640
|
return expression;
|
|
621
641
|
}
|
|
622
|
-
}
|
|
623
|
-
|
|
642
|
+
};
|
|
643
|
+
let Parser = _Parser;
|
|
644
|
+
__publicField(Parser, "rawInput", "");
|
|
645
|
+
__publicField(Parser, "lexer", new Lexer(tokenList));
|
|
646
|
+
__publicField(Parser, "parser", new _Parser());
|
|
647
|
+
__publicField(Parser, "environment", Environment.create());
|
|
648
|
+
__publicField(Parser, "cacheStore", new CacheStore());
|
|
624
649
|
export { Parser };
|
|
625
650
|
//# sourceMappingURL=Parser.js.map
|