@contember/binding 1.2.7 → 1.3.0-alpha.11
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 +6 -5
- 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 -75
- package/dist/development/core/QueryGenerator.js.map +1 -1
- package/dist/development/core/RealmKeyGenerator.cjs +47 -0
- package/dist/development/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/development/core/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 +6 -5
- 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 -75
- package/dist/production/core/QueryGenerator.js.map +1 -1
- package/dist/production/core/RealmKeyGenerator.cjs +47 -0
- package/dist/production/core/RealmKeyGenerator.cjs.map +1 -0
- package/dist/production/core/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 +11 -9
- package/src/core/DataBinding.ts +76 -75
- package/src/core/ErrorsPreprocessor.ts +24 -23
- package/src/core/EventManager.ts +6 -3
- package/src/core/MutationGenerator.ts +411 -412
- package/src/core/QueryGenerator.ts +66 -117
- package/src/core/StateInitializer.ts +2 -2
- package/src/core/TreeParameterMerger.ts +8 -0
- package/src/core/index.ts +7 -1
- package/src/core/schema/SchemaLoader.ts +2 -2
- package/src/core/schema/index.ts +2 -0
- package/src/core/state/EntityListState.ts +2 -0
- package/src/core/utils/createQueryBuilder.ts +31 -0
- package/src/dao/Environment.ts +6 -2
- package/src/dao/index.ts +1 -0
- package/src/index.ts +0 -5
- package/src/queryLanguage/CacheStore.ts +1 -0
- package/src/queryLanguage/Parser.ts +76 -37
- package/src/queryLanguage/QueryLanguage.ts +4 -1
- package/src/queryLanguage/tokenList.ts +1 -1
- package/src/treeParameters/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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getEntityMarker = require("./getEntityMarker.cjs");
|
|
4
|
+
const assertNever = require("../../utils/assertNever.cjs");
|
|
5
|
+
class StateIterator {
|
|
6
|
+
static *eachSiblingRealm(state, relevantPlaceholder) {
|
|
7
|
+
for (let [realmKey, realm] of state.entity.realms) {
|
|
8
|
+
if (realm.type === "entityRealmStub") {
|
|
9
|
+
if (relevantPlaceholder === void 0 || getEntityMarker.getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {
|
|
10
|
+
realm.getAccessor();
|
|
11
|
+
realm = state.entity.realms.get(realmKey);
|
|
12
|
+
} else {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
yield realm;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
// Note that this only yields siblings with the same placeholderName!
|
|
20
|
+
static *eachSiblingRealmChild(treeStore, state) {
|
|
21
|
+
if (state.type === "entityList" && state.blueprint.parent === void 0) {
|
|
22
|
+
for (const [, rootStates] of treeStore.subTreeStatesByRoot) {
|
|
23
|
+
const rootList = rootStates.get(state.blueprint.marker.placeholderName);
|
|
24
|
+
if (rootList?.type === "entityList") {
|
|
25
|
+
yield rootList;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let closestEntityRealm;
|
|
31
|
+
let placeholderName;
|
|
32
|
+
if (state.type === "field") {
|
|
33
|
+
closestEntityRealm = state.parent;
|
|
34
|
+
placeholderName = state.placeholderName;
|
|
35
|
+
} else if (state.type === "entityList") {
|
|
36
|
+
closestEntityRealm = state.blueprint.parent;
|
|
37
|
+
placeholderName = state.blueprint.marker.placeholderName;
|
|
38
|
+
} else {
|
|
39
|
+
return assertNever.assertNever();
|
|
40
|
+
}
|
|
41
|
+
for (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {
|
|
42
|
+
const child = realm.children.get(placeholderName);
|
|
43
|
+
if (child === void 0) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (child.type === state.type) {
|
|
47
|
+
yield child;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
static *depthFirstAllNodes(root) {
|
|
52
|
+
switch (root.type) {
|
|
53
|
+
case "entityRealm":
|
|
54
|
+
case "entityList":
|
|
55
|
+
for (const childState of root.children.values()) {
|
|
56
|
+
switch (childState.type) {
|
|
57
|
+
case "field":
|
|
58
|
+
case "entityRealm":
|
|
59
|
+
case "entityList":
|
|
60
|
+
yield* this.depthFirstAllNodes(childState);
|
|
61
|
+
break;
|
|
62
|
+
case "entityRealmStub":
|
|
63
|
+
break;
|
|
64
|
+
default:
|
|
65
|
+
return assertNever.assertNever();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case "field":
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
return assertNever.assertNever();
|
|
73
|
+
}
|
|
74
|
+
yield root;
|
|
75
|
+
}
|
|
76
|
+
static *depthFirstINodes(root, match) {
|
|
77
|
+
switch (root.type) {
|
|
78
|
+
case "entityRealm":
|
|
79
|
+
case "entityList":
|
|
80
|
+
for (const childState of root.children.values()) {
|
|
81
|
+
if (childState.type === "entityRealm" || childState.type === "entityList") {
|
|
82
|
+
yield* this.depthFirstINodes(childState, match);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
default:
|
|
87
|
+
return assertNever.assertNever();
|
|
88
|
+
}
|
|
89
|
+
if (match === void 0 || match(root)) {
|
|
90
|
+
yield root;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
static *eachRootState(treeStore) {
|
|
94
|
+
for (const rootStates of treeStore.subTreeStatesByRoot.values()) {
|
|
95
|
+
yield* rootStates.entries();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.StateIterator = StateIterator;
|
|
100
|
+
//# sourceMappingURL=StateIterator.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateIterator.cjs","sources":["../../../../src/core/state/StateIterator.ts"],"sourcesContent":["import type { FieldValue, PlaceholderName } from '../../treeParameters'\nimport { assertNever } from '../../utils'\nimport type { TreeStore } from '../TreeStore'\nimport type { EntityListState } from './EntityListState'\nimport type { EntityRealmState } from './EntityRealmState'\nimport type { FieldState } from './FieldState'\nimport { getEntityMarker } from './getEntityMarker'\nimport type { RootStateNode, StateINode, StateNode } from './StateNode'\n\nexport class StateIterator {\n\tpublic static *eachSiblingRealm(\n\t\tstate: EntityRealmState,\n\t\trelevantPlaceholder?: PlaceholderName,\n\t): IterableIterator<EntityRealmState> {\n\t\tfor (let [realmKey, realm] of state.entity.realms) {\n\t\t\tif (realm.type === 'entityRealmStub') {\n\t\t\t\tif (relevantPlaceholder === undefined || getEntityMarker(realm).fields.placeholders.has(relevantPlaceholder)) {\n\t\t\t\t\trealm.getAccessor()\n\t\t\t\t\trealm = state.entity.realms.get(realmKey) as EntityRealmState\n\t\t\t\t} else {\n\t\t\t\t\t// This realm is irrelevant. No need to force-initialize it.\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tyield realm\n\t\t}\n\t}\n\n\t// Note that this only yields siblings with the same placeholderName!\n\tpublic static *eachSiblingRealmChild<Value extends FieldValue, S extends EntityListState | FieldState<Value>>(\n\t\ttreeStore: TreeStore,\n\t\tstate: S & StateNode<Value>,\n\t): IterableIterator<S> {\n\t\tif (state.type === 'entityList' && state.blueprint.parent === undefined) {\n\t\t\t// Top-level entity list\n\t\t\tfor (const [, rootStates] of treeStore.subTreeStatesByRoot) {\n\t\t\t\tconst rootList = rootStates.get(state.blueprint.marker.placeholderName)\n\t\t\t\tif (rootList?.type === 'entityList') {\n\t\t\t\t\tyield rootList as S\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tlet closestEntityRealm: EntityRealmState\n\t\tlet placeholderName: PlaceholderName\n\n\t\tif (state.type === 'field') {\n\t\t\tclosestEntityRealm = state.parent\n\t\t\tplaceholderName = state.placeholderName\n\t\t} else if (state.type === 'entityList') {\n\t\t\tclosestEntityRealm = state.blueprint.parent! // The parent-less case is handled above. Hence the assertion.\n\t\t\tplaceholderName = state.blueprint.marker.placeholderName\n\t\t} else {\n\t\t\treturn assertNever(state)\n\t\t}\n\n\t\tfor (const realm of this.eachSiblingRealm(closestEntityRealm, placeholderName)) {\n\t\t\tconst child = realm.children.get(placeholderName)\n\t\t\tif (child === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (child.type === state.type) {\n\t\t\t\tyield child as S\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static *depthFirstAllNodes(root: StateNode): IterableIterator<StateNode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tswitch (childState.type) {\n\t\t\t\t\t\tcase 'field':\n\t\t\t\t\t\tcase 'entityRealm':\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tyield* this.depthFirstAllNodes(childState)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tcase 'entityRealmStub':\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn assertNever(childState)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'field':\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tyield root\n\t}\n\n\tpublic static *depthFirstINodes(\n\t\troot: StateINode,\n\t\tmatch?: (iNode: StateINode) => boolean,\n\t): IterableIterator<StateINode> {\n\t\tswitch (root.type) {\n\t\t\tcase 'entityRealm':\n\t\t\tcase 'entityList':\n\t\t\t\tfor (const childState of root.children.values()) {\n\t\t\t\t\tif (childState.type === 'entityRealm' || childState.type === 'entityList') {\n\t\t\t\t\t\tyield* this.depthFirstINodes(childState, match)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\treturn assertNever(root)\n\t\t}\n\t\tif (match === undefined || match(root)) {\n\t\t\tyield root\n\t\t}\n\t}\n\n\tpublic static *eachRootState(treeStore: TreeStore): IterableIterator<[PlaceholderName, RootStateNode]> {\n\t\tfor (const rootStates of treeStore.subTreeStatesByRoot.values()) {\n\t\t\tyield* rootStates.entries()\n\t\t}\n\t}\n}\n"],"names":["getEntityMarker","assertNever"],"mappings":";;;;AASO,MAAM,cAAc;AAAA,EAC1B,QAAe,iBACd,OACA,qBACqC;AACrC,aAAS,CAAC,UAAU,KAAK,KAAK,MAAM,OAAO,QAAQ;AAC9C,UAAA,MAAM,SAAS,mBAAmB;AACjC,YAAA,wBAAwB,UAAaA,gCAAgB,KAAK,EAAE,OAAO,aAAa,IAAI,mBAAmB,GAAG;AAC7G,gBAAM,YAAY;AAClB,kBAAQ,MAAM,OAAO,OAAO,IAAI,QAAQ;AAAA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A,IACzB;AACM,UAAA;AAAA,EACP;AAAA,EAEA,QAAe,iBACd,MACA,OAC+B;AAC/B,YAAQ,KAAK,MAAM;AAAA,MAClB,KAAK;AAAA,MACL,KAAK;AACJ,mBAAW,cAAc,KAAK,SAAS,OAAA,GAAU;AAChD,cAAI,WAAW,SAAS,iBAAiB,WAAW,SAAS,cAAc;AACnE,mBAAA,KAAK,iBAAiB,YAAY,KAAK;AAAA,UAC/C;AAAA,QACD;AACA;AAAA,MACD;AACC,eAAOA,YAAAA,YAAgB;AAAA,IACzB;AACA,QAAI,UAAU,UAAa,MAAM,IAAI,GAAG;AACjC,YAAA;AAAA,IACP;AAAA,EACD;AAAA,EAEA,QAAe,cAAc,WAA0E;AACtG,eAAW,cAAc,UAAU,oBAAoB,OAAA,GAAU;AAChE,aAAO,WAAW;IACnB;AAAA,EACD;AACD;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getEntityMarker = (realm) => realm.blueprint.type === "listEntity" ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker;
|
|
4
|
+
exports.getEntityMarker = getEntityMarker;
|
|
5
|
+
//# sourceMappingURL=getEntityMarker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntityMarker.cjs","sources":["../../../../src/core/state/getEntityMarker.ts"],"sourcesContent":["import type { EntityRealmState, EntityRealmStateStub } from './EntityRealmState'\n\nexport const getEntityMarker = (realm: EntityRealmState | EntityRealmStateStub) =>\n\trealm.blueprint.type === 'listEntity' ? realm.blueprint.parent.blueprint.marker : realm.blueprint.marker\n"],"names":[],"mappings":";;AAEO,MAAM,kBAAkB,CAAC,UAC/B,MAAM,UAAU,SAAS,eAAe,MAAM,UAAU,OAAO,UAAU,SAAS,MAAM,UAAU;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const client = require("@contember/client");
|
|
4
|
+
const createQueryBuilder = (schema) => {
|
|
5
|
+
const schemaNames = {
|
|
6
|
+
entities: Object.fromEntries(schema.getEntityNames().map((it) => {
|
|
7
|
+
const entity = schema.getEntity(it);
|
|
8
|
+
return [it, {
|
|
9
|
+
name: it,
|
|
10
|
+
scalars: Array.from(entity.fields.values()).filter((it2) => it2.__typename === "_Column").map((it2) => it2.name),
|
|
11
|
+
fields: Object.fromEntries(Array.from(entity.fields.values()).map((it2) => {
|
|
12
|
+
if (it2.__typename === "_Column") {
|
|
13
|
+
return [it2.name, { type: "column" }];
|
|
14
|
+
}
|
|
15
|
+
if (it2.__typename === "_Relation") {
|
|
16
|
+
return [
|
|
17
|
+
it2.name,
|
|
18
|
+
{
|
|
19
|
+
type: it2.type === "ManyHasMany" || it2.type === "OneHasMany" ? "many" : "one",
|
|
20
|
+
entity: it2.targetEntity
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
throw new Error();
|
|
25
|
+
}))
|
|
26
|
+
}];
|
|
27
|
+
}))
|
|
28
|
+
};
|
|
29
|
+
return new client.ContentQueryBuilder(schemaNames);
|
|
30
|
+
};
|
|
31
|
+
exports.createQueryBuilder = createQueryBuilder;
|
|
32
|
+
//# sourceMappingURL=createQueryBuilder.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createQueryBuilder.cjs","sources":["../../../../src/core/utils/createQueryBuilder.ts"],"sourcesContent":["import { Schema, SchemaRelation } from '../schema'\nimport { ContentQueryBuilder, SchemaEntityNames, SchemaNames } from '@contember/client'\n\nexport const createQueryBuilder = (schema: Schema) => {\n\tconst schemaNames: SchemaNames = {\n\t\tentities: Object.fromEntries(schema.getEntityNames().map((it): [string, SchemaEntityNames<string>] => {\n\t\t\tconst entity = schema.getEntity(it)\n\t\t\treturn [it, {\n\t\t\t\tname: it,\n\t\t\t\tscalars: Array.from(entity.fields.values()).filter(it => it.__typename === '_Column').map(it => it.name),\n\t\t\t\tfields: Object.fromEntries(Array.from(entity.fields.values()).map(it => {\n\t\t\t\t\tif (it.__typename === '_Column') {\n\t\t\t\t\t\treturn [it.name, { type: 'column' }]\n\t\t\t\t\t}\n\t\t\t\t\tif (it.__typename === '_Relation') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tit.name,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: it.type === 'ManyHasMany' || it.type === 'OneHasMany' ? 'many' : 'one',\n\t\t\t\t\t\t\t\tentity: (it as SchemaRelation).targetEntity,\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\tthrow new Error()\n\t\t\t\t})),\n\t\t\t}]\n\t\t})),\n\t}\n\n\treturn new ContentQueryBuilder(schemaNames)\n}\n"],"names":["it","ContentQueryBuilder"],"mappings":";;;AAGa,MAAA,qBAAqB,CAAC,WAAmB;AACrD,QAAM,cAA2B;AAAA,IAChC,UAAU,OAAO,YAAY,OAAO,iBAAiB,IAAI,CAAC,OAA4C;AAC/F,YAAA,SAAS,OAAO,UAAU,EAAE;AAClC,aAAO,CAAC,IAAI;AAAA,QACX,MAAM;AAAA,QACN,SAAS,MAAM,KAAK,OAAO,OAAO,OAAA,CAAQ,EAAE,OAAO,CAAAA,QAAMA,IAAG,eAAe,SAAS,EAAE,IAAI,CAAAA,QAAMA,IAAG,IAAI;AAAA,QACvG,QAAQ,OAAO,YAAY,MAAM,KAAK,OAAO,OAAO,OAAQ,CAAA,EAAE,IAAI,CAAAA,QAAM;AACnEA,cAAAA,IAAG,eAAe,WAAW;AAChC,mBAAO,CAACA,IAAG,MAAM,EAAE,MAAM,SAAU,CAAA;AAAA,UACpC;AACIA,cAAAA,IAAG,eAAe,aAAa;AAC3B,mBAAA;AAAA,cACNA,IAAG;AAAA,cACH;AAAA,gBACC,MAAMA,IAAG,SAAS,iBAAiBA,IAAG,SAAS,eAAe,SAAS;AAAA,gBACvE,QAASA,IAAsB;AAAA,cAChC;AAAA,YAAA;AAAA,UAEF;AACA,gBAAM,IAAI,MAAM;AAAA,QAAA,CAChB,CAAC;AAAA,MAAA,CACF;AAAA,IAAA,CACD,CAAC;AAAA,EAAA;AAGI,SAAA,IAAIC,OAAAA,oBAAoB,WAAW;AAC3C;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ContentQueryBuilder } from "@contember/client";
|
|
2
|
+
const createQueryBuilder = (schema) => {
|
|
3
|
+
const schemaNames = {
|
|
4
|
+
entities: Object.fromEntries(schema.getEntityNames().map((it) => {
|
|
5
|
+
const entity = schema.getEntity(it);
|
|
6
|
+
return [it, {
|
|
7
|
+
name: it,
|
|
8
|
+
scalars: Array.from(entity.fields.values()).filter((it2) => it2.__typename === "_Column").map((it2) => it2.name),
|
|
9
|
+
fields: Object.fromEntries(Array.from(entity.fields.values()).map((it2) => {
|
|
10
|
+
if (it2.__typename === "_Column") {
|
|
11
|
+
return [it2.name, { type: "column" }];
|
|
12
|
+
}
|
|
13
|
+
if (it2.__typename === "_Relation") {
|
|
14
|
+
return [
|
|
15
|
+
it2.name,
|
|
16
|
+
{
|
|
17
|
+
type: it2.type === "ManyHasMany" || it2.type === "OneHasMany" ? "many" : "one",
|
|
18
|
+
entity: it2.targetEntity
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
throw new Error();
|
|
23
|
+
}))
|
|
24
|
+
}];
|
|
25
|
+
}))
|
|
26
|
+
};
|
|
27
|
+
return new ContentQueryBuilder(schemaNames);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
createQueryBuilder
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=createQueryBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createQueryBuilder.js","sources":["../../../../src/core/utils/createQueryBuilder.ts"],"sourcesContent":["import { Schema, SchemaRelation } from '../schema'\nimport { ContentQueryBuilder, SchemaEntityNames, SchemaNames } from '@contember/client'\n\nexport const createQueryBuilder = (schema: Schema) => {\n\tconst schemaNames: SchemaNames = {\n\t\tentities: Object.fromEntries(schema.getEntityNames().map((it): [string, SchemaEntityNames<string>] => {\n\t\t\tconst entity = schema.getEntity(it)\n\t\t\treturn [it, {\n\t\t\t\tname: it,\n\t\t\t\tscalars: Array.from(entity.fields.values()).filter(it => it.__typename === '_Column').map(it => it.name),\n\t\t\t\tfields: Object.fromEntries(Array.from(entity.fields.values()).map(it => {\n\t\t\t\t\tif (it.__typename === '_Column') {\n\t\t\t\t\t\treturn [it.name, { type: 'column' }]\n\t\t\t\t\t}\n\t\t\t\t\tif (it.__typename === '_Relation') {\n\t\t\t\t\t\treturn [\n\t\t\t\t\t\t\tit.name,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: it.type === 'ManyHasMany' || it.type === 'OneHasMany' ? 'many' : 'one',\n\t\t\t\t\t\t\t\tentity: (it as SchemaRelation).targetEntity,\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\tthrow new Error()\n\t\t\t\t})),\n\t\t\t}]\n\t\t})),\n\t}\n\n\treturn new ContentQueryBuilder(schemaNames)\n}\n"],"names":["it"],"mappings":";AAGa,MAAA,qBAAqB,CAAC,WAAmB;AACrD,QAAM,cAA2B;AAAA,IAChC,UAAU,OAAO,YAAY,OAAO,iBAAiB,IAAI,CAAC,OAA4C;AAC/F,YAAA,SAAS,OAAO,UAAU,EAAE;AAClC,aAAO,CAAC,IAAI;AAAA,QACX,MAAM;AAAA,QACN,SAAS,MAAM,KAAK,OAAO,OAAO,OAAA,CAAQ,EAAE,OAAO,CAAAA,QAAMA,IAAG,eAAe,SAAS,EAAE,IAAI,CAAAA,QAAMA,IAAG,IAAI;AAAA,QACvG,QAAQ,OAAO,YAAY,MAAM,KAAK,OAAO,OAAO,OAAQ,CAAA,EAAE,IAAI,CAAAA,QAAM;AACnEA,cAAAA,IAAG,eAAe,WAAW;AAChC,mBAAO,CAACA,IAAG,MAAM,EAAE,MAAM,SAAU,CAAA;AAAA,UACpC;AACIA,cAAAA,IAAG,eAAe,aAAa;AAC3B,mBAAA;AAAA,cACNA,IAAG;AAAA,cACH;AAAA,gBACC,MAAMA,IAAG,SAAS,iBAAiBA,IAAG,SAAS,eAAe,SAAS;AAAA,gBACvE,QAASA,IAAsB;AAAA,cAChC;AAAA,YAAA;AAAA,UAEF;AACA,gBAAM,IAAI,MAAM;AAAA,QAAA,CAChB,CAAC;AAAA,MAAA,CACF;AAAA,IAAA,CACD,CAAC;AAAA,EAAA;AAGI,SAAA,IAAI,oBAAoB,WAAW;AAC3C;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getCombinedSignal = (components) => {
|
|
4
|
+
let abortedCount = 0;
|
|
5
|
+
let signalCount = 0;
|
|
6
|
+
const controller = new AbortController();
|
|
7
|
+
const refresh = () => {
|
|
8
|
+
if (signalCount === 0) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (abortedCount >= signalCount) {
|
|
12
|
+
controller.abort();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
for (const component of components) {
|
|
16
|
+
if (!component) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
signalCount++;
|
|
20
|
+
if (component.aborted) {
|
|
21
|
+
abortedCount++;
|
|
22
|
+
} else {
|
|
23
|
+
component.addEventListener("abort", () => {
|
|
24
|
+
abortedCount++;
|
|
25
|
+
refresh();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
refresh();
|
|
30
|
+
return controller.signal;
|
|
31
|
+
};
|
|
32
|
+
exports.getCombinedSignal = getCombinedSignal;
|
|
33
|
+
//# sourceMappingURL=getCombinedSignal.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCombinedSignal.cjs","sources":["../../../../src/core/utils/getCombinedSignal.ts"],"sourcesContent":["// Returns a signal that aborts when all present signals are aborted.\nexport const getCombinedSignal = (components: Iterable<AbortSignal | undefined>): AbortSignal => {\n\tlet abortedCount = 0\n\tlet signalCount = 0\n\n\tconst controller = new AbortController()\n\tconst refresh = () => {\n\t\tif (signalCount === 0) {\n\t\t\treturn\n\t\t}\n\t\tif (abortedCount >= signalCount) {\n\t\t\tcontroller.abort()\n\t\t}\n\t}\n\n\tfor (const component of components) {\n\t\tif (!component) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsignalCount++\n\n\t\tif (component.aborted) {\n\t\t\tabortedCount++\n\t\t} else {\n\t\t\tcomponent.addEventListener('abort', () => {\n\t\t\t\tabortedCount++\n\t\t\t\trefresh()\n\t\t\t})\n\t\t}\n\t}\n\n\trefresh()\n\n\treturn controller.signal\n}\n"],"names":[],"mappings":";;AACa,MAAA,oBAAoB,CAAC,eAA+D;AAChG,MAAI,eAAe;AACnB,MAAI,cAAc;AAEZ,QAAA,aAAa,IAAI;AACvB,QAAM,UAAU,MAAM;AACrB,QAAI,gBAAgB,GAAG;AACtB;AAAA,IACD;AACA,QAAI,gBAAgB,aAAa;AAChC,iBAAW,MAAM;AAAA,IAClB;AAAA,EAAA;AAGD,aAAW,aAAa,YAAY;AACnC,QAAI,CAAC,WAAW;AACf;AAAA,IACD;AAEA;AAEA,QAAI,UAAU,SAAS;AACtB;AAAA,IAAA,OACM;AACI,gBAAA,iBAAiB,SAAS,MAAM;AACzC;AACQ;MAAA,CACR;AAAA,IACF;AAAA,EACD;AAEQ;AAER,SAAO,WAAW;AACnB;;"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const BindingError = require("../BindingError.cjs");
|
|
4
|
+
const equal = require("fast-deep-equal/es6/index.js");
|
|
5
|
+
class Environment {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
this.options = options;
|
|
8
|
+
}
|
|
9
|
+
static create() {
|
|
10
|
+
return new Environment({
|
|
11
|
+
dimensions: {},
|
|
12
|
+
variables: {},
|
|
13
|
+
parameters: {},
|
|
14
|
+
extensions: /* @__PURE__ */ new Map()
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
getSubTree() {
|
|
18
|
+
for (let env = this; env.options.node; env = env.getParent()) {
|
|
19
|
+
const node = env.options.node;
|
|
20
|
+
if (node.type === "subtree-entity" || node.type === "subtree-entity-list") {
|
|
21
|
+
return node;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
throw new BindingError.BindingError("Not in a SubTree");
|
|
25
|
+
}
|
|
26
|
+
getSubTreeNode() {
|
|
27
|
+
if (!this.options.node) {
|
|
28
|
+
throw new BindingError.BindingError();
|
|
29
|
+
}
|
|
30
|
+
return this.options.node;
|
|
31
|
+
}
|
|
32
|
+
withSubTree(SubTree) {
|
|
33
|
+
const { parent, ...options } = this.options;
|
|
34
|
+
return new Environment({
|
|
35
|
+
...options,
|
|
36
|
+
node: SubTree
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
withSubTreeChild(node) {
|
|
40
|
+
if (!this.options.node) {
|
|
41
|
+
throw new BindingError.BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`);
|
|
42
|
+
}
|
|
43
|
+
if (this.options.node.entity.fields.get(node.field.name) !== node.field) {
|
|
44
|
+
throw new BindingError.BindingError();
|
|
45
|
+
}
|
|
46
|
+
return new Environment({
|
|
47
|
+
...this.options,
|
|
48
|
+
node,
|
|
49
|
+
parent: this
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
hasVariable(key) {
|
|
53
|
+
return key in this.options.variables;
|
|
54
|
+
}
|
|
55
|
+
getVariable(key) {
|
|
56
|
+
if (!(key in this.options.variables)) {
|
|
57
|
+
throw new BindingError.BindingError(`Variable ${key} not found`);
|
|
58
|
+
}
|
|
59
|
+
return this.options.variables[key];
|
|
60
|
+
}
|
|
61
|
+
getVariableOrElse(key, fallback) {
|
|
62
|
+
return this.options.variables[key] ?? fallback;
|
|
63
|
+
}
|
|
64
|
+
/** @deprecated use getVariable or getParameter */
|
|
65
|
+
getValue(key) {
|
|
66
|
+
console.warn("Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.");
|
|
67
|
+
return this.getVariableOrElse(key, void 0) ?? this.getParameterOrElse(key, void 0);
|
|
68
|
+
}
|
|
69
|
+
/** @deprecated use getVariableOrElse or getParameterOrElse */
|
|
70
|
+
getValueOrElse(key, fallback) {
|
|
71
|
+
console.warn("Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.");
|
|
72
|
+
return this.getVariableOrElse(key, void 0) ?? this.getParameterOrElse(key, fallback);
|
|
73
|
+
}
|
|
74
|
+
/** @deprecated */
|
|
75
|
+
hasName(key) {
|
|
76
|
+
console.warn("Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.");
|
|
77
|
+
return key in this.options.variables || key in this.options.parameters;
|
|
78
|
+
}
|
|
79
|
+
withVariables(variables) {
|
|
80
|
+
if (variables === void 0) {
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
const newVariables = { ...this.options.variables };
|
|
84
|
+
for (const [newName, newValue] of Object.entries(variables)) {
|
|
85
|
+
if (newName === "labelMiddleware") {
|
|
86
|
+
throw new BindingError.BindingError("You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.");
|
|
87
|
+
}
|
|
88
|
+
const resolvedValue = typeof newValue === "function" ? newValue(this) : newValue;
|
|
89
|
+
if (resolvedValue === void 0) {
|
|
90
|
+
delete newVariables[newName];
|
|
91
|
+
} else {
|
|
92
|
+
newVariables[newName] = resolvedValue;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return new Environment({
|
|
96
|
+
...this.options,
|
|
97
|
+
variables: newVariables,
|
|
98
|
+
parent: this
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
getAllVariables() {
|
|
102
|
+
return this.options.variables;
|
|
103
|
+
}
|
|
104
|
+
hasParameter(key) {
|
|
105
|
+
return key in this.options.parameters;
|
|
106
|
+
}
|
|
107
|
+
getParameter(key) {
|
|
108
|
+
if (!(key in this.options.parameters)) {
|
|
109
|
+
throw new BindingError.BindingError(`Parameter ${key} not found`);
|
|
110
|
+
}
|
|
111
|
+
return this.options.parameters[key];
|
|
112
|
+
}
|
|
113
|
+
getParameterOrElse(key, fallback) {
|
|
114
|
+
return this.options.parameters[key] ?? fallback;
|
|
115
|
+
}
|
|
116
|
+
getAllParameters() {
|
|
117
|
+
return this.options.parameters;
|
|
118
|
+
}
|
|
119
|
+
withParameters(parameters) {
|
|
120
|
+
return new Environment({ ...this.options, parameters });
|
|
121
|
+
}
|
|
122
|
+
hasDimension(dimensionName) {
|
|
123
|
+
return dimensionName in this.options.dimensions;
|
|
124
|
+
}
|
|
125
|
+
getDimension(dimensionName) {
|
|
126
|
+
if (!(dimensionName in this.options.dimensions)) {
|
|
127
|
+
throw new BindingError.BindingError(`Dimension ${dimensionName} does not exist.`);
|
|
128
|
+
}
|
|
129
|
+
return this.options.dimensions[dimensionName];
|
|
130
|
+
}
|
|
131
|
+
getDimensionOrElse(dimensionName, fallback) {
|
|
132
|
+
return this.options.dimensions[dimensionName] ?? fallback;
|
|
133
|
+
}
|
|
134
|
+
getAllDimensions() {
|
|
135
|
+
return this.options.dimensions;
|
|
136
|
+
}
|
|
137
|
+
withDimensions(dimensions) {
|
|
138
|
+
const newDimensions = {
|
|
139
|
+
...this.options.dimensions,
|
|
140
|
+
...dimensions
|
|
141
|
+
};
|
|
142
|
+
if (equal(newDimensions, this.options.dimensions)) {
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
return new Environment({ ...this.options, dimensions: newDimensions });
|
|
146
|
+
}
|
|
147
|
+
getSchema() {
|
|
148
|
+
if (!this.options.schema) {
|
|
149
|
+
throw new BindingError.BindingError("Schema is not set");
|
|
150
|
+
}
|
|
151
|
+
return this.options.schema;
|
|
152
|
+
}
|
|
153
|
+
withSchema(schema) {
|
|
154
|
+
return new Environment({ ...this.options, schema });
|
|
155
|
+
}
|
|
156
|
+
getParent() {
|
|
157
|
+
if (!this.options.parent) {
|
|
158
|
+
throw new BindingError.BindingError("There is no parent environment");
|
|
159
|
+
}
|
|
160
|
+
return this.options.parent;
|
|
161
|
+
}
|
|
162
|
+
withExtension(extension, state) {
|
|
163
|
+
return new Environment({
|
|
164
|
+
...this.options,
|
|
165
|
+
extensions: new Map([...this.options.extensions, [extension, state]])
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
getExtension(extension) {
|
|
169
|
+
const state = this.options.extensions.get(extension);
|
|
170
|
+
return extension.create(state, this);
|
|
171
|
+
}
|
|
172
|
+
merge(other) {
|
|
173
|
+
if (other === this) {
|
|
174
|
+
return this;
|
|
175
|
+
}
|
|
176
|
+
if (!equal(this.options.node, other.options.node)) {
|
|
177
|
+
throw new BindingError.BindingError(`Cannot merge two environments with different tree position.`);
|
|
178
|
+
}
|
|
179
|
+
if (this.options.parameters !== other.options.parameters) {
|
|
180
|
+
throw new BindingError.BindingError(`Cannot merge two environments with different parameters.`);
|
|
181
|
+
}
|
|
182
|
+
if (this.options.dimensions !== other.options.dimensions) {
|
|
183
|
+
throw new BindingError.BindingError(`Cannot merge two environments with different dimensions.`);
|
|
184
|
+
}
|
|
185
|
+
if (this.options.extensions !== other.options.extensions) {
|
|
186
|
+
throw new BindingError.BindingError(`Cannot merge two environments with different extensions.`);
|
|
187
|
+
}
|
|
188
|
+
if (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
for (const key in other.options.variables) {
|
|
192
|
+
if (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {
|
|
193
|
+
throw new BindingError.BindingError(`Cannot merge two environments with different value of variable ${key}:
|
|
194
|
+
` + JSON.stringify(this.options.variables[key]) + "\n" + JSON.stringify(other.options.variables[key]));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return new Environment({
|
|
198
|
+
...this.options,
|
|
199
|
+
parent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : void 0,
|
|
200
|
+
variables: { ...this.options.variables, ...other.options.variables }
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
((Environment2) => {
|
|
205
|
+
Environment2.createExtension = (create, otherMethods) => {
|
|
206
|
+
return {
|
|
207
|
+
create,
|
|
208
|
+
...otherMethods
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
})(Environment || (Environment = {}));
|
|
212
|
+
exports.Environment = Environment;
|
|
213
|
+
//# sourceMappingURL=Environment.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Environment.cjs","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { Filter } from '../treeParameters'\nimport equal from 'fast-deep-equal/es6/index.js'\nimport { Schema, SchemaColumn, SchemaEntity, SchemaRelation } from '../core/schema'\nimport { GraphQlLiteral } from '@contember/client'\n\nclass Environment {\n\tprivate constructor(\n\t\tprivate readonly options: Environment.Options,\n\t) {\n\t}\n\n\tpublic static create() {\n\t\treturn new Environment({\n\t\t\tdimensions: {},\n\t\t\tvariables: {},\n\t\t\tparameters: {},\n\t\t\textensions: new Map(),\n\t\t})\n\t}\n\n\tpublic getSubTree(): Environment.SubTreeNode {\n\t\tfor (let env: Environment = this; env.options.node; env = env.getParent()) {\n\t\t\tconst node = env.options.node\n\t\t\tif (node.type === 'subtree-entity' || node.type === 'subtree-entity-list') {\n\t\t\t\treturn node\n\t\t\t}\n\t\t}\n\t\tthrow new BindingError('Not in a SubTree')\n\t}\n\n\tpublic getSubTreeNode(): Environment.AnyNode {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn this.options.node\n\t}\n\n\tpublic withSubTree(SubTree: Environment.SubTreeNode) {\n\t\tconst { parent, ...options } = this.options\n\t\treturn new Environment({\n\t\t\t...options,\n\t\t\tnode: SubTree,\n\t\t})\n\t}\n\n\tpublic withSubTreeChild(node: Environment.InnerNode) {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`)\n\t\t}\n\t\tif (this.options.node.entity.fields.get(node.field.name) !== node.field) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tnode,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\n\tpublic hasVariable(key: string): boolean {\n\t\treturn key in this.options.variables\n\t}\n\n\tpublic getVariable<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tif (!(key in this.options.variables)) {\n\t\t\tthrow new BindingError(`Variable ${key} not found`)\n\t\t}\n\t\treturn this.options.variables[key] as V\n\t}\n\n\tpublic getVariableOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\treturn (this.options.variables[key] as V) ?? fallback\n\t}\n\n\t/** @deprecated use getVariable or getParameter */\n\tpublic getValue<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tconsole.warn('Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, undefined) as V\n\t}\n\n\t/** @deprecated use getVariableOrElse or getParameterOrElse */\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\tconsole.warn('Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, fallback) as any\n\t}\n\n\t/** @deprecated */\n\tpublic hasName(key: string): boolean {\n\t\tconsole.warn('Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.')\n\t\treturn key in this.options.variables || key in this.options.parameters\n\t}\n\n\tpublic withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment {\n\t\tif (variables === undefined) {\n\t\t\treturn this\n\t\t}\n\t\tconst newVariables = { ...this.options.variables }\n\t\tfor (const [newName, newValue] of Object.entries(variables)) {\n\t\t\tif (newName === 'labelMiddleware') {\n\t\t\t\tthrow new BindingError('You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.')\n\t\t\t}\n\t\t\tconst resolvedValue = typeof newValue === 'function' ? newValue(this) : newValue\n\t\t\tif (resolvedValue === undefined) {\n\t\t\t\tdelete newVariables[newName]\n\t\t\t} else {\n\t\t\t\tnewVariables[newName] = resolvedValue\n\t\t\t}\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tvariables: newVariables,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\tpublic getAllVariables() {\n\t\treturn this.options.variables\n\t}\n\n\tpublic hasParameter(key: string): boolean {\n\t\treturn key in this.options.parameters\n\t}\n\n\tpublic getParameter<F>(key: string): string | number {\n\t\tif (!(key in this.options.parameters)) {\n\t\t\tthrow new BindingError(`Parameter ${key} not found`)\n\t\t}\n\t\treturn this.options.parameters[key] as string | number\n\t}\n\n\tpublic getParameterOrElse<F>(key: string, fallback: F): string | number | F {\n\t\treturn this.options.parameters[key] ?? fallback\n\t}\n\n\tpublic getAllParameters() {\n\t\treturn this.options.parameters\n\t}\n\n\tpublic withParameters(parameters: Environment.Parameters): Environment {\n\t\treturn new Environment({ ...this.options, parameters })\n\t}\n\n\tpublic hasDimension(dimensionName: string): boolean {\n\t\treturn dimensionName in this.options.dimensions\n\t}\n\n\tpublic getDimension<F>(dimensionName: string): string[] {\n\t\tif (!(dimensionName in this.options.dimensions)) {\n\t\t\tthrow new BindingError(`Dimension ${dimensionName} does not exist.`)\n\t\t}\n\t\treturn this.options.dimensions[dimensionName]\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: string, fallback: F): string[] | F {\n\t\treturn this.options.dimensions[dimensionName] ?? fallback\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn this.options.dimensions\n\t}\n\n\tpublic withDimensions(dimensions: Environment.SelectedDimensions): Environment {\n\t\tconst newDimensions = {\n\t\t\t...this.options.dimensions,\n\t\t\t...dimensions,\n\t\t}\n\t\tif (equal(newDimensions, this.options.dimensions)) {\n\t\t\treturn this\n\t\t}\n\t\treturn new Environment({ ...this.options, dimensions: newDimensions })\n\t}\n\n\tpublic getSchema(): Schema {\n\t\tif (!this.options.schema) {\n\t\t\tthrow new BindingError('Schema is not set')\n\t\t}\n\t\treturn this.options.schema\n\t}\n\n\tpublic withSchema(schema: Schema): Environment {\n\t\treturn new Environment({ ...this.options, schema })\n\t}\n\n\tpublic getParent(): Environment {\n\t\tif (!this.options.parent) {\n\t\t\tthrow new BindingError('There is no parent environment')\n\t\t}\n\t\treturn this.options.parent\n\t}\n\n\tpublic withExtension<S, R>(extension: Environment.Extension<S, R>, state: S): Environment {\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\textensions: new Map([...this.options.extensions, [extension, state] as [Environment.Extension<unknown, unknown>, unknown]]),\n\t\t})\n\t}\n\n\tpublic getExtension<S, R>(extension: Environment.Extension<S, R>): R {\n\t\tconst state = this.options.extensions.get(extension as Environment.Extension<unknown, unknown>)\n\t\treturn extension.create(state as S, this)\n\t}\n\n\tpublic merge(other: Environment): Environment {\n\t\tif (other === this) {\n\t\t\treturn this\n\t\t}\n\t\tif (!equal(this.options.node, other.options.node)) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different tree position.`)\n\t\t}\n\t\tif (this.options.parameters !== other.options.parameters) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different parameters.`)\n\t\t}\n\t\tif (this.options.dimensions !== other.options.dimensions) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different dimensions.`)\n\t\t}\n\t\tif (this.options.extensions !== other.options.extensions) {\n\t\t\t// todo: deep compare?\n\t\t\tthrow new BindingError(`Cannot merge two environments with different extensions.`)\n\t\t}\n\n\t\tif (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {\n\t\t\treturn this\n\t\t}\n\t\tfor (const key in other.options.variables) {\n\t\t\tif (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {\n\t\t\t\tthrow new BindingError(`Cannot merge two environments with different value of variable ${key}:\\n`\n\t\t\t\t\t+ JSON.stringify(this.options.variables[key]) + '\\n'\n\t\t\t\t\t+ JSON.stringify(other.options.variables[key]))\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tparent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : undefined,\n\t\t\tvariables: { ...this.options.variables, ...other.options.variables },\n\t\t})\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string\n\n\texport type ReactElementLike = {\n\t\ttype: any\n\t\tprops: any\n\t}\n\n\texport type Value = string | number | boolean | undefined | GraphQlLiteral | Filter | ReactElementLike\n\n\texport type ResolvedValue = Value\n\n\texport interface Options {\n\t\tnode?: AnyNode\n\t\tschema?: Schema\n\t\tdimensions: SelectedDimensions\n\t\tparameters: Parameters\n\t\tvariables: CustomVariables\n\t\tparent?: Environment\n\t\textensions: Map<Extension<unknown, unknown>, unknown>\n\t}\n\n\texport type SubTreeNode =\n\t\t| SubTreeEntityNode\n\t\t| SubTreeEntityListNode\n\n\texport type InnerNode =\n\t\t| EntityNode\n\t\t| EntityListNode\n\t\t| ColumnNode\n\n\texport type AnyNode =\n\t\t| SubTreeNode\n\t\t| InnerNode\n\n\texport interface SubTreeEntityNode {\n\t\ttype: 'subtree-entity'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero' | 'one' | 'zero-or-one'\n\t\tfilter: Filter\n\t}\n\n\texport interface SubTreeEntityListNode {\n\t\ttype: 'subtree-entity-list'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero-to-many' | 'zero'\n\t\tfilter: Filter\n\t}\n\n\texport interface EntityNode {\n\t\ttype: 'entity'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface EntityListNode {\n\t\ttype: 'entity-list'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface ColumnNode {\n\t\ttype: 'column'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaColumn\n\t}\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport type Parameters = {\n\t\t[K in string]?: string | number\n\t}\n\n\texport interface CustomVariables {\n\t\t[key: string]: Value\n\t}\n\n\texport interface ValuesMapWithFactory {\n\t\t[key: string]:\n\t\t\t| ((environment: Environment) => Value)\n\t\t\t| Value\n\t}\n\n\texport type Extension<State, Result> = {\n\t\tcreate: (state: State | undefined, environment: Environment) => Result\n\t}\n\n\texport const createExtension = <S, R>(create: Extension<S, R>['create'], otherMethods?: Omit<Extension<S, R>, 'create'>): Extension<S, R> => {\n\t\treturn {\n\t\t\tcreate,\n\t\t\t...otherMethods,\n\t\t}\n\t}\n\n\t/** @deprecated */\n\texport type DeltaFactory = ValuesMapWithFactory\n}\n\nexport { Environment }\n"],"names":["BindingError","Environment"],"mappings":";;;;AAMA,MAAM,YAAY;AAAA,EACT,YACU,SAChB;AADgB,SAAA,UAAA;AAAA,EAElB;AAAA,EAEA,OAAc,SAAS;AACtB,WAAO,IAAI,YAAY;AAAA,MACtB,YAAY,CAAC;AAAA,MACb,WAAW,CAAC;AAAA,MACZ,YAAY,CAAC;AAAA,MACb,gCAAgB,IAAI;AAAA,IAAA,CACpB;AAAA,EACF;AAAA,EAEO,aAAsC;AACnC,aAAA,MAAmB,MAAM,IAAI,QAAQ,MAAM,MAAM,IAAI,aAAa;AACpE,YAAA,OAAO,IAAI,QAAQ;AACzB,UAAI,KAAK,SAAS,oBAAoB,KAAK,SAAS,uBAAuB;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AI,YAAY;AAAA,MACtB,GAAG,KAAK;AAAA,MACR,QAAQ,KAAK,QAAQ,UAAU,MAAM,QAAQ,SAAS,KAAK,QAAQ,OAAO,MAAM,MAAM,QAAQ,MAAM,IAAI;AAAA,MACxG,WAAW,EAAE,GAAG,KAAK,QAAQ,WAAW,GAAG,MAAM,QAAQ,UAAU;AAAA,IAAA,CACnE;AAAA,EACF;AACD;AAAA,CAEA,CAAUC,iBAAV;AAyFcA,eAAA,kBAAkB,CAAO,QAAmC,iBAAoE;AACrI,WAAA;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IAAA;AAAA,EACJ;AACD,GA9FS,gBAAA,cAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Environment.js","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import type { ReactNode } from 'react'\nimport { BindingError } from '../BindingError'\nimport type { Filter } from '../treeParameters'\nimport equal from 'fast-deep-equal/es6/index.js'\nimport { Schema, SchemaColumn, SchemaEntity, SchemaRelation } from '../core/schema'\nimport { GraphQlLiteral } from '@contember/client'\n\nclass Environment {\n\tprivate constructor(\n\t\tprivate readonly options: Environment.Options,\n\t) {\n\t}\n\n\tpublic static create() {\n\t\treturn new Environment({\n\t\t\tdimensions: {},\n\t\t\tvariables: {},\n\t\t\tparameters: {},\n\t\t\textensions: new Map(),\n\t\t})\n\t}\n\n\tpublic getSubTree(): Environment.SubTreeNode {\n\t\tfor (let env: Environment = this; env.options.node; env = env.getParent()) {\n\t\t\tconst node = env.options.node\n\t\t\tif (node.type === 'subtree-entity' || node.type === 'subtree-entity-list') {\n\t\t\t\treturn node\n\t\t\t}\n\t\t}\n\t\tthrow new BindingError('Not in a SubTree')\n\t}\n\n\tpublic getSubTreeNode(): Environment.AnyNode {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn this.options.node\n\t}\n\n\tpublic withSubTree(SubTree: Environment.SubTreeNode) {\n\t\tconst { parent, ...options } = this.options\n\t\treturn new Environment({\n\t\t\t...options,\n\t\t\tnode: SubTree,\n\t\t})\n\t}\n\n\tpublic withSubTreeChild(node: Environment.InnerNode) {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`)\n\t\t}\n\t\tif (this.options.node.entity.fields.get(node.field.name) !== node.field) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tnode,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\n\tpublic hasVariable(key: string): boolean {\n\t\treturn key in this.options.variables\n\t}\n\n\tpublic getVariable<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tif (!(key in this.options.variables)) {\n\t\t\tthrow new BindingError(`Variable ${key} not found`)\n\t\t}\n\t\treturn this.options.variables[key] as V\n\t}\n\n\tpublic getVariableOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\treturn (this.options.variables[key] as V) ?? fallback\n\t}\n\n\t/** @deprecated use getVariable or getParameter */\n\tpublic getValue<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tconsole.warn('Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, undefined) as V\n\t}\n\n\t/** @deprecated use getVariableOrElse or getParameterOrElse */\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\tconsole.warn('Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, fallback) as any\n\t}\n\n\t/** @deprecated */\n\tpublic hasName(key: string): boolean {\n\t\tconsole.warn('Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.')\n\t\treturn key in this.options.variables || key in this.options.parameters\n\t}\n\n\tpublic withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment {\n\t\tif (variables === undefined) {\n\t\t\treturn this\n\t\t}\n\t\tconst newVariables = { ...this.options.variables }\n\t\tfor (const [newName, newValue] of Object.entries(variables)) {\n\t\t\tif (newName === 'labelMiddleware') {\n\t\t\t\tthrow new BindingError('You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.')\n\t\t\t}\n\t\t\tconst resolvedValue = typeof newValue === 'function' ? newValue(this) : newValue\n\t\t\tif (resolvedValue === undefined) {\n\t\t\t\tdelete newVariables[newName]\n\t\t\t} else {\n\t\t\t\tnewVariables[newName] = resolvedValue\n\t\t\t}\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tvariables: newVariables,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\tpublic getAllVariables() {\n\t\treturn this.options.variables\n\t}\n\n\tpublic hasParameter(key: string): boolean {\n\t\treturn key in this.options.parameters\n\t}\n\n\tpublic getParameter<F>(key: string): string | number {\n\t\tif (!(key in this.options.parameters)) {\n\t\t\tthrow new BindingError(`Parameter ${key} not found`)\n\t\t}\n\t\treturn this.options.parameters[key] as string | number\n\t}\n\n\tpublic getParameterOrElse<F>(key: string, fallback: F): string | number | F {\n\t\treturn this.options.parameters[key] ?? fallback\n\t}\n\n\tpublic getAllParameters() {\n\t\treturn this.options.parameters\n\t}\n\n\tpublic withParameters(parameters: Environment.Parameters): Environment {\n\t\treturn new Environment({ ...this.options, parameters })\n\t}\n\n\tpublic hasDimension(dimensionName: string): boolean {\n\t\treturn dimensionName in this.options.dimensions\n\t}\n\n\tpublic getDimension<F>(dimensionName: string): string[] {\n\t\tif (!(dimensionName in this.options.dimensions)) {\n\t\t\tthrow new BindingError(`Dimension ${dimensionName} does not exist.`)\n\t\t}\n\t\treturn this.options.dimensions[dimensionName]\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: string, fallback: F): string[] | F {\n\t\treturn this.options.dimensions[dimensionName] ?? fallback\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn this.options.dimensions\n\t}\n\n\tpublic withDimensions(dimensions: Environment.SelectedDimensions): Environment {\n\t\tconst newDimensions = {\n\t\t\t...this.options.dimensions,\n\t\t\t...dimensions,\n\t\t}\n\t\tif (equal(newDimensions, this.options.dimensions)) {\n\t\t\treturn this\n\t\t}\n\t\treturn new Environment({ ...this.options, dimensions: newDimensions })\n\t}\n\n\tpublic getSchema(): Schema {\n\t\tif (!this.options.schema) {\n\t\t\tthrow new BindingError('Schema is not set')\n\t\t}\n\t\treturn this.options.schema\n\t}\n\n\tpublic withSchema(schema: Schema): Environment {\n\t\treturn new Environment({ ...this.options, schema })\n\t}\n\n\tpublic getParent(): Environment {\n\t\tif (!this.options.parent) {\n\t\t\tthrow new BindingError('There is no parent environment')\n\t\t}\n\t\treturn this.options.parent\n\t}\n\n\tpublic withExtension<S, R>(extension: Environment.Extension<S, R>, state: S): Environment {\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\textensions: new Map([...this.options.extensions, [extension, state] as [Environment.Extension<unknown, unknown>, unknown]]),\n\t\t})\n\t}\n\n\tpublic getExtension<S, R>(extension: Environment.Extension<S, R>): R {\n\t\tconst state = this.options.extensions.get(extension as Environment.Extension<unknown, unknown>)\n\t\treturn extension.create(state as S, this)\n\t}\n\n\tpublic merge(other: Environment): Environment {\n\t\tif (other === this) {\n\t\t\treturn this\n\t\t}\n\t\tif (!equal(this.options.node, other.options.node)) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different tree position.`)\n\t\t}\n\t\tif (this.options.parameters !== other.options.parameters) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different parameters.`)\n\t\t}\n\t\tif (this.options.dimensions !== other.options.dimensions) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different dimensions.`)\n\t\t}\n\t\tif (this.options.extensions !== other.options.extensions) {\n\t\t\t// todo: deep compare?\n\t\t\tthrow new BindingError(`Cannot merge two environments with different extensions.`)\n\t\t}\n\n\t\tif (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {\n\t\t\treturn this\n\t\t}\n\t\tfor (const key in other.options.variables) {\n\t\t\tif (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {\n\t\t\t\tthrow new BindingError(`Cannot merge two environments with different value of variable ${key}:\\n`\n\t\t\t\t\t+ JSON.stringify(this.options.variables[key]) + '\\n'\n\t\t\t\t\t+ JSON.stringify(other.options.variables[key]))\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tparent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : undefined,\n\t\t\tvariables: { ...this.options.variables, ...other.options.variables },\n\t\t})\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string\n\n\texport type Value = ReactNode | GraphQlLiteral | Filter\n\n\texport type ResolvedValue = Value\n\n\texport interface Options {\n\t\tnode?: AnyNode\n\t\tschema?: Schema\n\t\tdimensions: SelectedDimensions\n\t\tparameters: Parameters\n\t\tvariables: CustomVariables\n\t\tparent?: Environment\n\t\textensions: Map<Extension<unknown, unknown>, unknown>\n\t}\n\n\texport type SubTreeNode =\n\t\t| SubTreeEntityNode\n\t\t| SubTreeEntityListNode\n\n\texport type InnerNode =\n\t\t| EntityNode\n\t\t| EntityListNode\n\t\t| ColumnNode\n\n\texport type AnyNode =\n\t\t| SubTreeNode\n\t\t| InnerNode\n\n\texport interface SubTreeEntityNode {\n\t\ttype: 'subtree-entity'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero' | 'one' | 'zero-or-one'\n\t\tfilter: Filter\n\t}\n\n\texport interface SubTreeEntityListNode {\n\t\ttype: 'subtree-entity-list'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero-to-many' | 'zero'\n\t\tfilter: Filter\n\t}\n\n\texport interface EntityNode {\n\t\ttype: 'entity'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface EntityListNode {\n\t\ttype: 'entity-list'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface ColumnNode {\n\t\ttype: 'column'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaColumn\n\t}\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport type Parameters = {\n\t\t[K in string]?: string | number\n\t}\n\n\texport interface CustomVariables {\n\t\t[key: string]: Value\n\t}\n\n\texport interface ValuesMapWithFactory {\n\t\t[key: string]:\n\t\t\t| ((environment: Environment) => Value)\n\t\t\t| Value\n\t}\n\n\texport type Extension<State, Result> = {\n\t\tcreate: (state: State | undefined, environment: Environment) => Result\n\t}\n\n\texport const createExtension = <S, R>(create: Extension<S, R>['create'], otherMethods?: Omit<Extension<S, R>, 'create'>): Extension<S, R> => {\n\t\treturn {\n\t\t\tcreate,\n\t\t\t...otherMethods,\n\t\t}\n\t}\n\n\t/** @deprecated */\n\texport type DeltaFactory = ValuesMapWithFactory\n}\n\nexport { Environment }\n"],"names":["Environment"],"mappings":";;AAOA,MAAM,YAAY;AAAA,EACT,YACU,SAChB;AADgB,SAAA,UAAA;AAAA,EAElB;AAAA,EAEA,OAAc,SAAS;AACtB,WAAO,IAAI,YAAY;AAAA,MACtB,YAAY,CAAC;AAAA,MACb,WAAW,CAAC;AAAA,MACZ,YAAY,CAAC;AAAA,MACb,gCAAgB,IAAI;AAAA,IAAA,CACpB;AAAA,EACF;AAAA,EAEO,aAAsC;AACnC,aAAA,MAAmB,MAAM,IAAI,QAAQ,MAAM,MAAM,IAAI,aAAa;AACpE,YAAA,OAAO,IAAI,QAAQ;AACzB,UAAI,KAAK,SAAS,oBAAoB,KAAK,SAAS,uBAAuB;AACnE,eAAA;AAAA,MACR;AAAA,IACD;AACM,UAAA,IAAI,aAAa,kBAAkB;AAAA,EAC1C;AAAA,EAEO,iBAAsC;AACxC,QAAA,CAAC,KAAK,QAAQ,MAAM;AACvB,YAAM,IAAI,aAAa;AAAA,IACxB;AACA,WAAO,KA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B,CAAO,QAAmC,iBAAoE;AACrI,WAAA;AAAA,MACN;AAAA,MACA,GAAG;AAAA,IAAA;AAAA,EACJ;AACD,GAzFS,gBAAA,cAAA,CAAA,EAAA;"}
|
|
1
|
+
{"version":3,"file":"Environment.js","sources":["../../../src/dao/Environment.ts"],"sourcesContent":["import { BindingError } from '../BindingError'\nimport type { Filter } from '../treeParameters'\nimport equal from 'fast-deep-equal/es6/index.js'\nimport { Schema, SchemaColumn, SchemaEntity, SchemaRelation } from '../core/schema'\nimport { GraphQlLiteral } from '@contember/client'\n\nclass Environment {\n\tprivate constructor(\n\t\tprivate readonly options: Environment.Options,\n\t) {\n\t}\n\n\tpublic static create() {\n\t\treturn new Environment({\n\t\t\tdimensions: {},\n\t\t\tvariables: {},\n\t\t\tparameters: {},\n\t\t\textensions: new Map(),\n\t\t})\n\t}\n\n\tpublic getSubTree(): Environment.SubTreeNode {\n\t\tfor (let env: Environment = this; env.options.node; env = env.getParent()) {\n\t\t\tconst node = env.options.node\n\t\t\tif (node.type === 'subtree-entity' || node.type === 'subtree-entity-list') {\n\t\t\t\treturn node\n\t\t\t}\n\t\t}\n\t\tthrow new BindingError('Not in a SubTree')\n\t}\n\n\tpublic getSubTreeNode(): Environment.AnyNode {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn this.options.node\n\t}\n\n\tpublic withSubTree(SubTree: Environment.SubTreeNode) {\n\t\tconst { parent, ...options } = this.options\n\t\treturn new Environment({\n\t\t\t...options,\n\t\t\tnode: SubTree,\n\t\t})\n\t}\n\n\tpublic withSubTreeChild(node: Environment.InnerNode) {\n\t\tif (!this.options.node) {\n\t\t\tthrow new BindingError(`Cannot call withSubTreeChild without previous call of withSubTree`)\n\t\t}\n\t\tif (this.options.node.entity.fields.get(node.field.name) !== node.field) {\n\t\t\tthrow new BindingError()\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tnode,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\n\tpublic hasVariable(key: string): boolean {\n\t\treturn key in this.options.variables\n\t}\n\n\tpublic getVariable<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tif (!(key in this.options.variables)) {\n\t\t\tthrow new BindingError(`Variable ${key} not found`)\n\t\t}\n\t\treturn this.options.variables[key] as V\n\t}\n\n\tpublic getVariableOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\treturn (this.options.variables[key] as V) ?? fallback\n\t}\n\n\t/** @deprecated use getVariable or getParameter */\n\tpublic getValue<V extends Environment.Value = Environment.Value>(key: string): V {\n\t\tconsole.warn('Environment.getValue() is deprecated, use Environment.getVariable() or Environment.getParameter() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, undefined) as V\n\t}\n\n\t/** @deprecated use getVariableOrElse or getParameterOrElse */\n\tpublic getValueOrElse<F, V extends Environment.Value = Environment.Value>(key: string, fallback: F): V | F {\n\t\tconsole.warn('Environment.getValueOrElse() is deprecated, use Environment.getVariableOrElse() or Environment.getParameterOrElse() instead.')\n\t\treturn this.getVariableOrElse(key, undefined) ?? this.getParameterOrElse(key, fallback) as any\n\t}\n\n\t/** @deprecated */\n\tpublic hasName(key: string): boolean {\n\t\tconsole.warn('Environment.hasName() is deprecated, use Environment.hasVariable() or Environment.hasParameter() instead.')\n\t\treturn key in this.options.variables || key in this.options.parameters\n\t}\n\n\tpublic withVariables(variables: Environment.ValuesMapWithFactory | undefined): Environment {\n\t\tif (variables === undefined) {\n\t\t\treturn this\n\t\t}\n\t\tconst newVariables = { ...this.options.variables }\n\t\tfor (const [newName, newValue] of Object.entries(variables)) {\n\t\t\tif (newName === 'labelMiddleware') {\n\t\t\t\tthrow new BindingError('You cannot pass labelMiddleware to withVariables method. Use withLabelMiddleware instead.')\n\t\t\t}\n\t\t\tconst resolvedValue = typeof newValue === 'function' ? newValue(this) : newValue\n\t\t\tif (resolvedValue === undefined) {\n\t\t\t\tdelete newVariables[newName]\n\t\t\t} else {\n\t\t\t\tnewVariables[newName] = resolvedValue\n\t\t\t}\n\t\t}\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tvariables: newVariables,\n\t\t\tparent: this,\n\t\t})\n\t}\n\n\tpublic getAllVariables() {\n\t\treturn this.options.variables\n\t}\n\n\tpublic hasParameter(key: string): boolean {\n\t\treturn key in this.options.parameters\n\t}\n\n\tpublic getParameter<F>(key: string): string | number {\n\t\tif (!(key in this.options.parameters)) {\n\t\t\tthrow new BindingError(`Parameter ${key} not found`)\n\t\t}\n\t\treturn this.options.parameters[key] as string | number\n\t}\n\n\tpublic getParameterOrElse<F>(key: string, fallback: F): string | number | F {\n\t\treturn this.options.parameters[key] ?? fallback\n\t}\n\n\tpublic getAllParameters() {\n\t\treturn this.options.parameters\n\t}\n\n\tpublic withParameters(parameters: Environment.Parameters): Environment {\n\t\treturn new Environment({ ...this.options, parameters })\n\t}\n\n\tpublic hasDimension(dimensionName: string): boolean {\n\t\treturn dimensionName in this.options.dimensions\n\t}\n\n\tpublic getDimension<F>(dimensionName: string): string[] {\n\t\tif (!(dimensionName in this.options.dimensions)) {\n\t\t\tthrow new BindingError(`Dimension ${dimensionName} does not exist.`)\n\t\t}\n\t\treturn this.options.dimensions[dimensionName]\n\t}\n\n\tpublic getDimensionOrElse<F>(dimensionName: string, fallback: F): string[] | F {\n\t\treturn this.options.dimensions[dimensionName] ?? fallback\n\t}\n\n\tpublic getAllDimensions(): Environment.SelectedDimensions {\n\t\treturn this.options.dimensions\n\t}\n\n\tpublic withDimensions(dimensions: Environment.SelectedDimensions): Environment {\n\t\tconst newDimensions = {\n\t\t\t...this.options.dimensions,\n\t\t\t...dimensions,\n\t\t}\n\t\tif (equal(newDimensions, this.options.dimensions)) {\n\t\t\treturn this\n\t\t}\n\t\treturn new Environment({ ...this.options, dimensions: newDimensions })\n\t}\n\n\tpublic getSchema(): Schema {\n\t\tif (!this.options.schema) {\n\t\t\tthrow new BindingError('Schema is not set')\n\t\t}\n\t\treturn this.options.schema\n\t}\n\n\tpublic withSchema(schema: Schema): Environment {\n\t\treturn new Environment({ ...this.options, schema })\n\t}\n\n\tpublic getParent(): Environment {\n\t\tif (!this.options.parent) {\n\t\t\tthrow new BindingError('There is no parent environment')\n\t\t}\n\t\treturn this.options.parent\n\t}\n\n\tpublic withExtension<S, R>(extension: Environment.Extension<S, R>, state: S): Environment {\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\textensions: new Map([...this.options.extensions, [extension, state] as [Environment.Extension<unknown, unknown>, unknown]]),\n\t\t})\n\t}\n\n\tpublic getExtension<S, R>(extension: Environment.Extension<S, R>): R {\n\t\tconst state = this.options.extensions.get(extension as Environment.Extension<unknown, unknown>)\n\t\treturn extension.create(state as S, this)\n\t}\n\n\tpublic merge(other: Environment): Environment {\n\t\tif (other === this) {\n\t\t\treturn this\n\t\t}\n\t\tif (!equal(this.options.node, other.options.node)) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different tree position.`)\n\t\t}\n\t\tif (this.options.parameters !== other.options.parameters) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different parameters.`)\n\t\t}\n\t\tif (this.options.dimensions !== other.options.dimensions) {\n\t\t\tthrow new BindingError(`Cannot merge two environments with different dimensions.`)\n\t\t}\n\t\tif (this.options.extensions !== other.options.extensions) {\n\t\t\t// todo: deep compare?\n\t\t\tthrow new BindingError(`Cannot merge two environments with different extensions.`)\n\t\t}\n\n\t\tif (equal(this.options.variables, other.options.variables) && this.options.parent === other.options.parent) {\n\t\t\treturn this\n\t\t}\n\t\tfor (const key in other.options.variables) {\n\t\t\tif (key in this.options.variables && !equal(this.options.variables[key], other.options.variables[key])) {\n\t\t\t\tthrow new BindingError(`Cannot merge two environments with different value of variable ${key}:\\n`\n\t\t\t\t\t+ JSON.stringify(this.options.variables[key]) + '\\n'\n\t\t\t\t\t+ JSON.stringify(other.options.variables[key]))\n\t\t\t}\n\t\t}\n\n\t\treturn new Environment({\n\t\t\t...this.options,\n\t\t\tparent: this.options.parent && other.options.parent ? this.options.parent.merge(other.options.parent) : undefined,\n\t\t\tvariables: { ...this.options.variables, ...other.options.variables },\n\t\t})\n\t}\n}\n\nnamespace Environment {\n\texport type Name = string\n\n\texport type ReactElementLike = {\n\t\ttype: any\n\t\tprops: any\n\t}\n\n\texport type Value = string | number | boolean | undefined | GraphQlLiteral | Filter | ReactElementLike\n\n\texport type ResolvedValue = Value\n\n\texport interface Options {\n\t\tnode?: AnyNode\n\t\tschema?: Schema\n\t\tdimensions: SelectedDimensions\n\t\tparameters: Parameters\n\t\tvariables: CustomVariables\n\t\tparent?: Environment\n\t\textensions: Map<Extension<unknown, unknown>, unknown>\n\t}\n\n\texport type SubTreeNode =\n\t\t| SubTreeEntityNode\n\t\t| SubTreeEntityListNode\n\n\texport type InnerNode =\n\t\t| EntityNode\n\t\t| EntityListNode\n\t\t| ColumnNode\n\n\texport type AnyNode =\n\t\t| SubTreeNode\n\t\t| InnerNode\n\n\texport interface SubTreeEntityNode {\n\t\ttype: 'subtree-entity'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero' | 'one' | 'zero-or-one'\n\t\tfilter: Filter\n\t}\n\n\texport interface SubTreeEntityListNode {\n\t\ttype: 'subtree-entity-list'\n\t\tentity: SchemaEntity\n\t\texpectedCardinality: 'zero-to-many' | 'zero'\n\t\tfilter: Filter\n\t}\n\n\texport interface EntityNode {\n\t\ttype: 'entity'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface EntityListNode {\n\t\ttype: 'entity-list'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaRelation\n\t}\n\n\texport interface ColumnNode {\n\t\ttype: 'column'\n\t\tentity: SchemaEntity\n\t\tfield: SchemaColumn\n\t}\n\n\texport interface SelectedDimensions {\n\t\t[key: string]: string[]\n\t}\n\n\texport type Parameters = {\n\t\t[K in string]?: string | number\n\t}\n\n\texport interface CustomVariables {\n\t\t[key: string]: Value\n\t}\n\n\texport interface ValuesMapWithFactory {\n\t\t[key: string]:\n\t\t\t| ((environment: Environment) => Value)\n\t\t\t| Value\n\t}\n\n\texport type Extension<State, Result> = {\n\t\tcreate: (state: State | undefined, environment: Environment) => Result\n\t}\n\n\texport const createExtension = <S, R>(create: Extension<S, R>['create'], otherMethods?: Omit<Extension<S, R>, 'create'>): Extension<S, R> => {\n\t\treturn {\n\t\t\tcreate,\n\t\t\t...otherMethods,\n\t\t}\n\t}\n\n\t/** @deprecated */\n\texport type DeltaFactory = ValuesMapWithFactory\n}\n\nexport { Environment }\n"],"names":["Environment"],"mappings":";;AAMA,MAAM,YAAY;AAAA,EACT,YACU,SAChB;AADgB,SAAA,UAAA;AAAA,EAElB;AAAA,EAEA,OAAc,SAAS;AACtB,WAAO,IAAI,YAAY;AAAA,MACtB,YAAY,CAAC;AAAA,MACb,WAAW,CAAC;AAAA,MACZ,YAAY,CAAC;AAAA,MACb,gCAAgB,IAAI;AAAA,IAAA,CACpB;AAAA,EACF;AAAA,EAEO,aAAsC;AACnC,aAAA,MAAmB,MAAM,IAAI,QAAQ,MAAM,MAAM,IAAI,aAAa;AACpE,YAAA,OAAO,IAAI,QAAQ;AACzB,UAAI,KAAK,SAAS,oBAAoB,KAAK,SAAS,uBAAuB;AACnE,eAAA;AAAA,MACR;AAAA,IACD;AACM,UAAA,IAAI,aAAa,kBAAkB;AAAA,EAC1C;AAAA,EAEO,iBAAsC;AACxC,QAAA,CAAC,KAAK,QAAQ,MAAM;AACvB,YAAM,IAAI,aAAa;AAAA,IACxB;AACA,WAAO,KAAK,QAAQ;AAAA,EACrB;AAAA,EAEO,YAAY,SAAkC;AACpD,UAAM,EAAE,QAAQ,GAAG,QAAA,IAAY,KAAK;AACpC,WAAO,IAAI,YAAY;AAAA,MACtB,GAAG;AAAA,MACH,MAAM;AAAA,IAAA,CACN;AAAA,EACF;AAAA,EAEO,iBAAiB,MAA6B;AAChD,QAAA,CAAC,KAAK,QAAQ,MAAM;AACjB,YAAA,IAAI,aAAa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