@itwin/presentation-hierarchies 2.0.0-alpha.2 → 2.0.0-alpha.20
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/CHANGELOG.md +929 -12
- package/README.md +20 -50
- package/lib/hierarchies/HierarchyErrors.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyErrors.js.map +1 -0
- package/lib/hierarchies/HierarchyMerge.d.ts +19 -0
- package/lib/hierarchies/HierarchyMerge.d.ts.map +1 -0
- package/lib/{esm/hierarchies/HierarchyProvider.js → hierarchies/HierarchyMerge.js} +5 -6
- package/lib/hierarchies/HierarchyMerge.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.d.ts +21 -28
- package/lib/hierarchies/HierarchyNode.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNode.js +19 -21
- package/lib/hierarchies/HierarchyNode.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/HierarchyNodeIdentifier.d.ts +3 -1
- package/lib/hierarchies/HierarchyNodeIdentifier.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeIdentifier.js +23 -6
- package/lib/hierarchies/HierarchyNodeIdentifier.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.d.ts +5 -4
- package/lib/hierarchies/HierarchyNodeKey.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyNodeKey.js +1 -1
- package/lib/hierarchies/HierarchyNodeKey.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/HierarchyProvider.d.ts +59 -34
- package/lib/hierarchies/HierarchyProvider.d.ts.map +1 -0
- package/lib/hierarchies/HierarchyProvider.js +61 -0
- package/lib/hierarchies/HierarchyProvider.js.map +1 -0
- package/lib/hierarchies/HierarchySearch.d.ts +297 -0
- package/lib/hierarchies/HierarchySearch.d.ts.map +1 -0
- package/lib/hierarchies/HierarchySearch.js +464 -0
- package/lib/hierarchies/HierarchySearch.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/Logging.d.ts +1 -1
- package/lib/hierarchies/Logging.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/Logging.js +1 -1
- package/lib/hierarchies/Logging.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/HierarchyCache.d.ts +1 -1
- package/lib/hierarchies/imodel/HierarchyCache.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/HierarchyCache.js +4 -7
- package/lib/hierarchies/imodel/HierarchyCache.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.d.ts +34 -11
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyDefinition.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/IModelHierarchyNode.d.ts +5 -5
- package/lib/hierarchies/imodel/IModelHierarchyNode.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyNode.js.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts +136 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +1 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.js +656 -0
- package/lib/hierarchies/imodel/IModelHierarchyProvider.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.d.ts +1 -1
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/LimitingECSqlQueryExecutor.js +14 -11
- package/lib/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.d.ts +17 -12
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/NodeSelectQueryFactory.js +214 -139
- package/lib/hierarchies/imodel/NodeSelectQueryFactory.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.d.ts +7 -7
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/PredicateBasedHierarchyDefinition.js +3 -2
- package/lib/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +1 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts +35 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.d.ts.map +1 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.js +261 -0
- package/lib/hierarchies/imodel/SearchHierarchyDefinition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.d.ts +10 -12
- package/lib/hierarchies/imodel/TreeNodesReader.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/TreeNodesReader.js +12 -9
- package/lib/hierarchies/imodel/TreeNodesReader.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/Utils.d.ts +2 -1
- package/lib/hierarchies/imodel/Utils.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/Utils.js +20 -7
- package/lib/hierarchies/imodel/Utils.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/DetermineChildren.d.ts +2 -2
- package/lib/hierarchies/imodel/operators/DetermineChildren.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/DetermineChildren.js +11 -5
- package/lib/hierarchies/imodel/operators/DetermineChildren.js.map +1 -0
- package/lib/hierarchies/imodel/operators/Grouping.d.ts +26 -0
- package/lib/hierarchies/imodel/operators/Grouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/Grouping.js +33 -19
- package/lib/hierarchies/imodel/operators/Grouping.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideIfNoChildren.js +33 -10
- package/lib/hierarchies/imodel/operators/HideIfNoChildren.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/HideNodesInHierarchy.js +31 -15
- package/lib/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/AutoExpand.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +11 -0
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/BaseClassGrouping.js +10 -12
- package/lib/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +7 -0
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/ClassGrouping.js +8 -11
- package/lib/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.d.ts +1 -1
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/GroupHiding.js +1 -5
- package/lib/hierarchies/imodel/operators/grouping/GroupHiding.js.map +1 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +5 -0
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/LabelGrouping.js +2 -10
- package/lib/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.d.ts +7 -7
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/PropertiesGrouping.js +46 -37
- package/lib/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.d.ts +2 -2
- package/lib/hierarchies/imodel/operators/grouping/Shared.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/Shared.js +3 -1
- package/lib/hierarchies/imodel/operators/grouping/Shared.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/Common.d.ts +5 -2
- package/lib/hierarchies/internal/Common.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/Common.js +13 -3
- package/lib/hierarchies/internal/Common.js.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.d.ts.map +1 -0
- package/lib/hierarchies/internal/DisposePolyfill.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.d.ts +1 -1
- package/lib/hierarchies/internal/LoggingUtils.d.ts.map +1 -0
- package/lib/hierarchies/internal/LoggingUtils.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.d.ts +19 -8
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/RxjsHierarchyDefinition.js +9 -6
- package/lib/hierarchies/internal/RxjsHierarchyDefinition.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/SubscriptionScheduler.d.ts +1 -1
- package/lib/hierarchies/internal/SubscriptionScheduler.d.ts.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/SubscriptionScheduler.js +1 -4
- package/lib/hierarchies/internal/SubscriptionScheduler.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Partition.d.ts +2 -1
- package/lib/hierarchies/internal/operators/Partition.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Partition.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.d.ts +3 -3
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReduceToMergeMap.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.d.ts +1 -1
- package/lib/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ReleaseMainThread.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.d.ts +1 -1
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/ShareReplayWithErrors.js.map +1 -0
- package/lib/{cjs/hierarchies → hierarchies}/internal/operators/Sorting.d.ts +1 -1
- package/lib/hierarchies/internal/operators/Sorting.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/Sorting.js.map +1 -0
- package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.d.ts +1 -1
- package/lib/hierarchies/internal/operators/TapOnce.d.ts.map +1 -0
- package/lib/hierarchies/internal/operators/TapOnce.js.map +1 -0
- package/lib/presentation-hierarchies.d.ts +24 -0
- package/lib/presentation-hierarchies.d.ts.map +1 -0
- package/lib/{esm/presentation-hierarchies.js → presentation-hierarchies.js} +7 -7
- package/lib/presentation-hierarchies.js.map +1 -0
- package/package.json +29 -39
- package/lib/cjs/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyErrors.js +0 -20
- package/lib/cjs/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts +0 -133
- package/lib/cjs/hierarchies/HierarchyFiltering.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyFiltering.js +0 -232
- package/lib/cjs/hierarchies/HierarchyFiltering.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.d.ts +0 -156
- package/lib/cjs/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNode.js +0 -84
- package/lib/cjs/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js +0 -35
- package/lib/cjs/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts +0 -161
- package/lib/cjs/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyNodeKey.js +0 -166
- package/lib/cjs/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts +0 -109
- package/lib/cjs/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/HierarchyProvider.js +0 -44
- package/lib/cjs/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/Logging.d.ts.map +0 -1
- package/lib/cjs/hierarchies/Logging.js +0 -27
- package/lib/cjs/hierarchies/Logging.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +0 -36
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js +0 -283
- package/lib/cjs/hierarchies/imodel/FilteringHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js +0 -84
- package/lib/cjs/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts +0 -121
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js +0 -21
- package/lib/cjs/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js +0 -29
- package/lib/cjs/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -80
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js +0 -449
- package/lib/cjs/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts +0 -21
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js +0 -123
- package/lib/cjs/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts +0 -230
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js +0 -591
- package/lib/cjs/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js +0 -93
- package/lib/cjs/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts +0 -37
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js +0 -44
- package/lib/cjs/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/Utils.js +0 -59
- package/lib/cjs/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js +0 -34
- package/lib/cjs/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts +0 -26
- package/lib/cjs/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js +0 -162
- package/lib/cjs/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js +0 -52
- package/lib/cjs/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js +0 -68
- package/lib/cjs/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts +0 -4
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js +0 -26
- package/lib/cjs/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js +0 -114
- package/lib/cjs/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js +0 -55
- package/lib/cjs/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts +0 -4
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js +0 -53
- package/lib/cjs/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js +0 -60
- package/lib/cjs/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js +0 -309
- package/lib/cjs/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts +0 -5
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js +0 -29
- package/lib/cjs/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.d.ts +0 -58
- package/lib/cjs/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/Common.js +0 -80
- package/lib/cjs/hierarchies/internal/Common.js.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js +0 -11
- package/lib/cjs/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/cjs/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/EachValueFrom.js +0 -110
- package/lib/cjs/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts +0 -12
- package/lib/cjs/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/LoggingUtils.js +0 -37
- package/lib/cjs/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts +0 -64
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js +0 -25
- package/lib/cjs/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js +0 -57
- package/lib/cjs/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Partition.js +0 -60
- package/lib/cjs/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts +0 -22
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js +0 -50
- package/lib/cjs/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js +0 -24
- package/lib/cjs/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js +0 -23
- package/lib/cjs/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/Sorting.js +0 -25
- package/lib/cjs/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts +0 -4
- package/lib/cjs/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js +0 -19
- package/lib/cjs/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/presentation-hierarchies.d.ts +0 -15
- package/lib/cjs/presentation-hierarchies.d.ts.map +0 -1
- package/lib/cjs/presentation-hierarchies.js +0 -40
- package/lib/cjs/presentation-hierarchies.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.d.ts +0 -9
- package/lib/esm/hierarchies/HierarchyErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyErrors.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts +0 -133
- package/lib/esm/hierarchies/HierarchyFiltering.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyFiltering.js +0 -227
- package/lib/esm/hierarchies/HierarchyFiltering.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts +0 -29
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeIdentifier.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyNodeKey.js.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/HierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/Logging.d.ts +0 -13
- package/lib/esm/hierarchies/Logging.d.ts.map +0 -1
- package/lib/esm/hierarchies/Logging.js.map +0 -1
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts +0 -36
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js +0 -277
- package/lib/esm/hierarchies/imodel/FilteringHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts +0 -18
- package/lib/esm/hierarchies/imodel/HierarchyCache.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/HierarchyCache.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts +0 -234
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyNode.js.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts +0 -80
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js +0 -446
- package/lib/esm/hierarchies/imodel/IModelHierarchyProvider.js.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/LimitingECSqlQueryExecutor.js.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/NodeSelectQueryFactory.js.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts +0 -140
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/PredicateBasedHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/TreeNodesReader.js.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.d.ts +0 -4
- package/lib/esm/hierarchies/imodel/Utils.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/Utils.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/DetermineChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts +0 -26
- package/lib/esm/hierarchies/imodel/operators/Grouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/Grouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideIfNoChildren.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/HideNodesInHierarchy.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/AutoExpand.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts +0 -11
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/BaseClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts +0 -7
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/ClassGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/GroupHiding.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts +0 -5
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/LabelGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts +0 -32
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/PropertiesGrouping.js.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.d.ts.map +0 -1
- package/lib/esm/hierarchies/imodel/operators/grouping/Shared.js.map +0 -1
- package/lib/esm/hierarchies/internal/Common.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/Common.js.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/DisposePolyfill.js.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts +0 -12
- package/lib/esm/hierarchies/internal/EachValueFrom.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/EachValueFrom.js +0 -107
- package/lib/esm/hierarchies/internal/EachValueFrom.js.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/LoggingUtils.js.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/RxjsHierarchyDefinition.js.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts +0 -17
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/SubscriptionScheduler.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts +0 -6
- package/lib/esm/hierarchies/internal/operators/Partition.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Partition.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReduceToMergeMap.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts +0 -7
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ReleaseMainThread.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts +0 -9
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/ShareReplayWithErrors.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts +0 -13
- package/lib/esm/hierarchies/internal/operators/Sorting.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/Sorting.js.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.d.ts.map +0 -1
- package/lib/esm/hierarchies/internal/operators/TapOnce.js.map +0 -1
- package/lib/esm/presentation-hierarchies.d.ts +0 -15
- package/lib/esm/presentation-hierarchies.d.ts.map +0 -1
- package/lib/esm/presentation-hierarchies.js.map +0 -1
- /package/lib/{cjs/hierarchies → hierarchies}/HierarchyErrors.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/HierarchyErrors.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyDefinition.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/IModelHierarchyNode.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/imodel/operators/grouping/AutoExpand.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.d.ts +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/DisposePolyfill.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/LoggingUtils.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Partition.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReduceToMergeMap.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ReleaseMainThread.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/ShareReplayWithErrors.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/Sorting.js +0 -0
- /package/lib/{esm/hierarchies → hierarchies}/internal/operators/TapOnce.js +0 -0
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { assert } from "@itwin/core-bentley";
|
|
6
|
-
import { GenericInstanceFilter, GenericInstanceFilterRuleValue
|
|
7
|
-
import { ECSql, getClass, parseFullClassName, PrimitiveValue, } from "@itwin/presentation-shared";
|
|
6
|
+
import { GenericInstanceFilter, GenericInstanceFilterRuleValue } from "@itwin/core-common";
|
|
7
|
+
import { ECSql, getClass, normalizeFullClassName, parseFullClassName, PrimitiveValue, } from "@itwin/presentation-shared";
|
|
8
8
|
/**
|
|
9
9
|
* Column names of the SELECT clause created by `NodeSelectClauseFactory`. Order of the names matches the order of columns
|
|
10
10
|
* created by the factory.
|
|
@@ -13,7 +13,7 @@ import { ECSql, getClass, parseFullClassName, PrimitiveValue, } from "@itwin/pre
|
|
|
13
13
|
*/
|
|
14
14
|
export var NodeSelectClauseColumnNames;
|
|
15
15
|
(function (NodeSelectClauseColumnNames) {
|
|
16
|
-
/** Full class name of the instance the node represents. Type: `string` in format `{schema name}
|
|
16
|
+
/** Full class name of the instance the node represents. Type: `string` in format `{schema name}.{class name}`. */
|
|
17
17
|
NodeSelectClauseColumnNames["FullClassName"] = "FullClassName";
|
|
18
18
|
/** ECInstance ID of the instance the node represents. Type: `Id64String`. */
|
|
19
19
|
NodeSelectClauseColumnNames["ECInstanceId"] = "ECInstanceId";
|
|
@@ -41,7 +41,10 @@ export var NodeSelectClauseColumnNames;
|
|
|
41
41
|
})(NodeSelectClauseColumnNames || (NodeSelectClauseColumnNames = {}));
|
|
42
42
|
/**
|
|
43
43
|
* Creates an instance of `NodeSelectQueryFactory`.
|
|
44
|
-
*
|
|
44
|
+
*
|
|
45
|
+
* The created factory caches metadata derived from the iModel's schemas (e.g. the tree of hidden classes for a
|
|
46
|
+
* given select class). The cache lives for the lifetime of the factory and is not invalidated automatically, so
|
|
47
|
+
* the factory must be re-created when the iModel's schemas may have changed.
|
|
45
48
|
*/
|
|
46
49
|
export function createNodesQueryClauseFactory(props) {
|
|
47
50
|
return new NodeSelectQueryFactory(props);
|
|
@@ -50,6 +53,7 @@ export function createNodesQueryClauseFactory(props) {
|
|
|
50
53
|
class NodeSelectQueryFactory {
|
|
51
54
|
_imodelAccess;
|
|
52
55
|
_instanceLabelSelectClauseFactory;
|
|
56
|
+
_hiddenClassesTreeCache = new Map();
|
|
53
57
|
constructor(props) {
|
|
54
58
|
this._imodelAccess = props.imodelAccess;
|
|
55
59
|
this._instanceLabelSelectClauseFactory = props.instanceLabelSelectClauseFactory;
|
|
@@ -58,9 +62,11 @@ class NodeSelectQueryFactory {
|
|
|
58
62
|
async createSelectClause(props) {
|
|
59
63
|
// note: the columns order must match the order in `NodeSelectClauseColumnNames`
|
|
60
64
|
return `
|
|
61
|
-
ec_ClassName(${props.ecClassId.selector}) AS ${NodeSelectClauseColumnNames.FullClassName},
|
|
65
|
+
ec_ClassName(${props.ecClassId.selector}, 's.c') AS ${NodeSelectClauseColumnNames.FullClassName},
|
|
62
66
|
${props.ecInstanceId.selector} AS ${NodeSelectClauseColumnNames.ECInstanceId},
|
|
63
|
-
${createECSqlValueSelector(props.nodeLabel
|
|
67
|
+
${createECSqlValueSelector(typeof props.nodeLabel === "object" && "of" in props.nodeLabel
|
|
68
|
+
? { selector: await this._instanceLabelSelectClauseFactory.createSelectClause(props.nodeLabel.of) }
|
|
69
|
+
: props.nodeLabel)} AS ${NodeSelectClauseColumnNames.DisplayLabel},
|
|
64
70
|
CAST(${createECSqlValueSelector(props.hasChildren)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.HasChildren},
|
|
65
71
|
CAST(${createECSqlValueSelector(props.hideIfNoChildren)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.HideIfNoChildren},
|
|
66
72
|
CAST(${createECSqlValueSelector(props.hideNodeInHierarchy)} AS BOOLEAN) AS ${NodeSelectClauseColumnNames.HideNodeInHierarchy},
|
|
@@ -83,28 +89,32 @@ class NodeSelectQueryFactory {
|
|
|
83
89
|
*
|
|
84
90
|
* Special cases:
|
|
85
91
|
* - If `filter` is `undefined`, `joins` and `where` are set to empty strings and `from` is set to `contentClass.fullName`.
|
|
86
|
-
* - If the provided content class doesn't intersect with the property class in provided filter
|
|
87
|
-
* is returned to make sure the resulting query is valid and doesn't return anything.
|
|
92
|
+
* - If the provided content class doesn't intersect with the property class in provided filter OR referenced schema items (classes/properties)
|
|
93
|
+
* don't exist in the iModel, a special result is returned to make sure the resulting query is valid and doesn't return anything.
|
|
88
94
|
*/
|
|
89
95
|
async createFilterClauses(props) {
|
|
90
96
|
const { contentClass, filter } = props;
|
|
91
97
|
const { from, joins, where } = filter
|
|
92
98
|
? await createInstanceFilterClauses({ imodelAccess: this._imodelAccess, contentClass, filter })
|
|
93
|
-
: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
: { from: contentClass.fullName, joins: [], where: [] };
|
|
100
|
+
const normalizedFrom = normalizeFullClassName(from);
|
|
101
|
+
const fromClass = await getClass(this._imodelAccess, normalizedFrom);
|
|
102
|
+
// The hidden-classes tree depends only on the select class and the (static) schema metadata, but it is
|
|
103
|
+
// expensive to compute (it recursively walks the whole derived-class subtree). The same select classes
|
|
104
|
+
// recur across every hierarchy level, so memoize the result per class for the lifetime of this factory.
|
|
105
|
+
let hiddenClassesPromise = this._hiddenClassesTreeCache.get(normalizedFrom);
|
|
106
|
+
if (!hiddenClassesPromise) {
|
|
107
|
+
hiddenClassesPromise = getHiddenClassesTree(this._imodelAccess, fromClass);
|
|
108
|
+
// Don't keep a rejected result cached - drop it so a later call can retry. Until this handler runs, the
|
|
109
|
+
// entry stays this same promise (concurrent calls get a cache hit), so an unconditional delete is safe.
|
|
110
|
+
hiddenClassesPromise.catch(() => this._hiddenClassesTreeCache.delete(normalizedFrom));
|
|
111
|
+
this._hiddenClassesTreeCache.set(normalizedFrom, hiddenClassesPromise);
|
|
112
|
+
}
|
|
113
|
+
const hiddenClasses = await hiddenClassesPromise;
|
|
100
114
|
const hiddenClassesWhereClause = createWhereClauseForHiddenClasses(hiddenClasses, contentClass.alias);
|
|
101
115
|
hiddenClassesWhereClause.hideClause && where.push(hiddenClassesWhereClause.hideClause);
|
|
102
116
|
assert(!hiddenClassesWhereClause.showClause, "`showClause` is expected to always be empty here");
|
|
103
|
-
return {
|
|
104
|
-
from,
|
|
105
|
-
joins: joins.join("\n"),
|
|
106
|
-
where: where.join(" AND "),
|
|
107
|
-
};
|
|
117
|
+
return { from, joins: joins.join("\n"), where: where.join(" AND ") };
|
|
108
118
|
}
|
|
109
119
|
}
|
|
110
120
|
/**
|
|
@@ -121,47 +131,97 @@ class NodeSelectQueryFactory {
|
|
|
121
131
|
*/
|
|
122
132
|
async function createInstanceFilterClauses(props) {
|
|
123
133
|
const { imodelAccess, contentClass, filter } = props;
|
|
134
|
+
// In some cases the given filter means we want the query to return nothing - e.g. when filtering by classes that don't intersect
|
|
135
|
+
// with the given content class. Return a special result that makes sure the resulting query is valid, but returns no rows.
|
|
136
|
+
const DISABLE_QUERY = { from: contentClass.fullName, joins: [], where: ["FALSE"] };
|
|
124
137
|
const from = await specializeContentClass({
|
|
125
|
-
classHierarchyInspector:
|
|
138
|
+
classHierarchyInspector: {
|
|
139
|
+
async classDerivesFrom(derivedClassName, baseClassName) {
|
|
140
|
+
try {
|
|
141
|
+
return await imodelAccess.classDerivesFrom(derivedClassName, baseClassName);
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
/* v8 ignore else -- @preserve */
|
|
145
|
+
if (isSchemaOrClassNotFoundError(e)) {
|
|
146
|
+
// either derived or base class doesn't exist in this iModel
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
/* v8 ignore next -- @preserve */
|
|
150
|
+
throw e;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
},
|
|
126
154
|
contentClassName: contentClass.fullName,
|
|
127
|
-
filterClassNames: filter.propertyClassNames,
|
|
155
|
+
filterClassNames: filter.propertyClassNames.map(normalizeFullClassName),
|
|
128
156
|
});
|
|
129
157
|
if (!from) {
|
|
130
|
-
// filter class doesn't intersect with content class
|
|
131
|
-
return
|
|
158
|
+
// filter class doesn't intersect with content class
|
|
159
|
+
return DISABLE_QUERY;
|
|
132
160
|
}
|
|
133
|
-
|
|
134
|
-
* TODO:
|
|
135
|
-
* There may be similar related instance paths, e.g.:
|
|
136
|
-
* - A -> B -> C,
|
|
137
|
-
* - A -> B -> D.
|
|
138
|
-
* At this moment we're handling each path individually which means A and B would get joined twice. We could look into
|
|
139
|
-
* creating a join tree first, e.g.
|
|
140
|
-
* C
|
|
141
|
-
* /
|
|
142
|
-
* A -> B
|
|
143
|
-
* \
|
|
144
|
-
* D
|
|
145
|
-
*/
|
|
146
|
-
const joins = await Promise.all(filter.relatedInstances.map(async (rel, i) => ECSql.createRelationshipPathJoinClause({
|
|
147
|
-
schemaProvider: imodelAccess,
|
|
148
|
-
path: assignRelationshipPathAliases(rel.path, i, contentClass.alias, rel.alias),
|
|
149
|
-
})));
|
|
150
|
-
const where = new Array();
|
|
161
|
+
let filteredClassNamesInThisIModel;
|
|
151
162
|
if (filter.filteredClassNames && filter.filteredClassNames.length > 0) {
|
|
163
|
+
filteredClassNamesInThisIModel = (await Promise.all(filter.filteredClassNames
|
|
164
|
+
.map(normalizeFullClassName)
|
|
165
|
+
.map(async (fullClassName) => ({
|
|
166
|
+
fullClassName,
|
|
167
|
+
filteredClass: await tryGetClass(imodelAccess, fullClassName),
|
|
168
|
+
}))))
|
|
169
|
+
.filter(({ filteredClass }) => !!filteredClass)
|
|
170
|
+
.map(({ fullClassName }) => fullClassName);
|
|
171
|
+
if (filteredClassNamesInThisIModel.length === 0) {
|
|
172
|
+
// we had filter classes, but none of them exist in this iModel
|
|
173
|
+
return DISABLE_QUERY;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
let joins;
|
|
177
|
+
try {
|
|
178
|
+
joins = await Promise.all(filter.relatedInstances.map(async (rel, i) => {
|
|
179
|
+
const res = await ECSql.createRelationshipPathJoinClause({
|
|
180
|
+
schemaProvider: imodelAccess,
|
|
181
|
+
path: assignRelationshipPathAliases(rel.path, i, contentClass.alias, rel.alias),
|
|
182
|
+
});
|
|
183
|
+
assert(!res.bindings, "Expecting no bindings as the relationship path has no instance filter.");
|
|
184
|
+
return res.joins;
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
/* v8 ignore else -- @preserve */
|
|
189
|
+
if (isSchemaOrClassNotFoundError(e)) {
|
|
190
|
+
// at least one related instance spec uses a class that doesn't exist in this iModel
|
|
191
|
+
return DISABLE_QUERY;
|
|
192
|
+
}
|
|
193
|
+
/* v8 ignore next -- @preserve */
|
|
194
|
+
throw e;
|
|
195
|
+
}
|
|
196
|
+
const classAliasMap = new Map([[contentClass.alias, from]]);
|
|
197
|
+
filter.relatedInstances.forEach(({ path, alias }) => path.length > 0 && classAliasMap.set(alias, normalizeFullClassName(path[path.length - 1].targetClassName)));
|
|
198
|
+
let propertiesFilter;
|
|
199
|
+
try {
|
|
200
|
+
propertiesFilter = await createWhereClause(contentClass.alias, async (alias) => {
|
|
201
|
+
const aliasClassName = classAliasMap.get(alias);
|
|
202
|
+
return aliasClassName ? getClass(imodelAccess, aliasClassName) : undefined;
|
|
203
|
+
}, filter.rules);
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
// note: don't need to worry about schemas & classes here, because that's taken care of above, when
|
|
207
|
+
// validating property class names & related instance defs
|
|
208
|
+
/* v8 ignore else -- @preserve */
|
|
209
|
+
if (isPropertyNotFoundError(e)) {
|
|
210
|
+
// filter uses a property that doesn't exist in this iModel
|
|
211
|
+
return DISABLE_QUERY;
|
|
212
|
+
}
|
|
213
|
+
/* v8 ignore next -- @preserve */
|
|
214
|
+
throw e;
|
|
215
|
+
}
|
|
216
|
+
const where = new Array();
|
|
217
|
+
if (filteredClassNamesInThisIModel) {
|
|
152
218
|
where.push(`${ECSql.createRawPropertyValueSelector(contentClass.alias, "ECClassId")} IS (
|
|
153
|
-
${
|
|
219
|
+
${filteredClassNamesInThisIModel
|
|
154
220
|
.map(parseFullClassName)
|
|
155
221
|
.map(({ schemaName, className }) => `[${schemaName}].[${className}]`)
|
|
156
222
|
.join(", ")}
|
|
157
223
|
)`);
|
|
158
224
|
}
|
|
159
|
-
const classAliasMap = new Map([[contentClass.alias, from]]);
|
|
160
|
-
filter.relatedInstances.forEach(({ path, alias }) => path.length > 0 && classAliasMap.set(alias, path[path.length - 1].targetClassName));
|
|
161
|
-
const propertiesFilter = await createWhereClause(contentClass.alias, async (alias) => {
|
|
162
|
-
const aliasClassName = classAliasMap.get(alias);
|
|
163
|
-
return aliasClassName ? getClass(imodelAccess, aliasClassName) : undefined;
|
|
164
|
-
}, filter.rules);
|
|
165
225
|
if (propertiesFilter) {
|
|
166
226
|
where.push(propertiesFilter);
|
|
167
227
|
}
|
|
@@ -206,6 +266,8 @@ async function createGroupingSelector(grouping, imodelAccess, instanceLabelSelec
|
|
|
206
266
|
...createBaseGroupingParamSelectors(grouping.byBaseClasses),
|
|
207
267
|
]),
|
|
208
268
|
});
|
|
269
|
+
// TODO: MISSING_COVERAGE
|
|
270
|
+
/* v8 ignore else -- @preserve */
|
|
209
271
|
if (grouping.byProperties) {
|
|
210
272
|
const propertyClass = await getClass(imodelAccess, grouping.byProperties.propertiesClassName);
|
|
211
273
|
groupingSelectors.push({
|
|
@@ -244,16 +306,10 @@ async function createGroupingSelector(grouping, imodelAccess, instanceLabelSelec
|
|
|
244
306
|
function createLabelGroupingBaseParamsSelectors(byLabel) {
|
|
245
307
|
const selectors = new Array();
|
|
246
308
|
if (byLabel.action !== undefined) {
|
|
247
|
-
selectors.push({
|
|
248
|
-
key: "action",
|
|
249
|
-
selector: `${createECSqlValueSelector(byLabel.action)}`,
|
|
250
|
-
});
|
|
309
|
+
selectors.push({ key: "action", selector: `${createECSqlValueSelector(byLabel.action)}` });
|
|
251
310
|
}
|
|
252
311
|
if (byLabel.groupId !== undefined) {
|
|
253
|
-
selectors.push({
|
|
254
|
-
key: "groupId",
|
|
255
|
-
selector: createECSqlValueSelector(byLabel.groupId),
|
|
256
|
-
});
|
|
312
|
+
selectors.push({ key: "groupId", selector: createECSqlValueSelector(byLabel.groupId) });
|
|
257
313
|
}
|
|
258
314
|
if (byLabel.action !== "merge") {
|
|
259
315
|
selectors.push(...createBaseGroupingParamSelectors(byLabel));
|
|
@@ -262,17 +318,18 @@ function createLabelGroupingBaseParamsSelectors(byLabel) {
|
|
|
262
318
|
}
|
|
263
319
|
async function createPropertyGroupSelectors(propertyGroup, propertyClass, instanceLabelSelectClauseFactory) {
|
|
264
320
|
const selectors = new Array();
|
|
265
|
-
selectors.push({
|
|
266
|
-
|
|
267
|
-
selector: `${createECSqlValueSelector(propertyGroup.propertyName)}`,
|
|
268
|
-
});
|
|
269
|
-
const property = await propertyClass.getProperty(propertyGroup.propertyName);
|
|
321
|
+
selectors.push({ key: "propertyName", selector: `${createECSqlValueSelector(propertyGroup.propertyName)}` });
|
|
322
|
+
const property = propertyClass.getProperty(propertyGroup.propertyName);
|
|
270
323
|
if (!property) {
|
|
271
324
|
throw new Error(`Property "${propertyGroup.propertyName}" not found in ECClass "${propertyClass.fullName}".`);
|
|
272
325
|
}
|
|
273
326
|
if (property.isNavigation()) {
|
|
274
|
-
const relationshipClass =
|
|
275
|
-
const abstractConstraint = property.direction === "Forward"
|
|
327
|
+
const relationshipClass = property.relationshipClass;
|
|
328
|
+
const abstractConstraint = property.direction === "Forward"
|
|
329
|
+
? relationshipClass.target.abstractConstraint
|
|
330
|
+
: relationshipClass.source.abstractConstraint;
|
|
331
|
+
// TODO: MISSING_COVERAGE
|
|
332
|
+
/* v8 ignore else -- @preserve */
|
|
276
333
|
if (!abstractConstraint) {
|
|
277
334
|
throw new Error(`Could not determine class name for navigation property with direction "${property.direction}".`);
|
|
278
335
|
}
|
|
@@ -303,21 +360,10 @@ function createRangeParamSelectors(ranges) {
|
|
|
303
360
|
key: "ranges",
|
|
304
361
|
selector: `json_array(${ranges
|
|
305
362
|
.map((range) => serializeJsonObject([
|
|
306
|
-
{
|
|
307
|
-
|
|
308
|
-
selector: createECSqlValueSelector(range.fromValue),
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
key: "toValue",
|
|
312
|
-
selector: createECSqlValueSelector(range.toValue),
|
|
313
|
-
},
|
|
363
|
+
{ key: "fromValue", selector: createECSqlValueSelector(range.fromValue) },
|
|
364
|
+
{ key: "toValue", selector: createECSqlValueSelector(range.toValue) },
|
|
314
365
|
...(range.rangeLabel
|
|
315
|
-
? [
|
|
316
|
-
{
|
|
317
|
-
key: "rangeLabel",
|
|
318
|
-
selector: `${createECSqlValueSelector(range.rangeLabel)}`,
|
|
319
|
-
},
|
|
320
|
-
]
|
|
366
|
+
? [{ key: "rangeLabel", selector: `${createECSqlValueSelector(range.rangeLabel)}` }]
|
|
321
367
|
: []),
|
|
322
368
|
]))
|
|
323
369
|
.join(", ")})`,
|
|
@@ -326,22 +372,13 @@ function createRangeParamSelectors(ranges) {
|
|
|
326
372
|
function createBaseGroupingParamSelectors(params) {
|
|
327
373
|
const selectors = new Array();
|
|
328
374
|
if (params.hideIfNoSiblings !== undefined) {
|
|
329
|
-
selectors.push({
|
|
330
|
-
key: "hideIfNoSiblings",
|
|
331
|
-
selector: createECSqlValueSelector(params.hideIfNoSiblings),
|
|
332
|
-
});
|
|
375
|
+
selectors.push({ key: "hideIfNoSiblings", selector: createECSqlValueSelector(params.hideIfNoSiblings) });
|
|
333
376
|
}
|
|
334
377
|
if (params.hideIfOneGroupedNode !== undefined) {
|
|
335
|
-
selectors.push({
|
|
336
|
-
key: "hideIfOneGroupedNode",
|
|
337
|
-
selector: createECSqlValueSelector(params.hideIfOneGroupedNode),
|
|
338
|
-
});
|
|
378
|
+
selectors.push({ key: "hideIfOneGroupedNode", selector: createECSqlValueSelector(params.hideIfOneGroupedNode) });
|
|
339
379
|
}
|
|
340
380
|
if (params.autoExpand !== undefined) {
|
|
341
|
-
selectors.push({
|
|
342
|
-
key: "autoExpand",
|
|
343
|
-
selector: createECSqlValueSelector(params.autoExpand),
|
|
344
|
-
});
|
|
381
|
+
selectors.push({ key: "autoExpand", selector: createECSqlValueSelector(params.autoExpand) });
|
|
345
382
|
}
|
|
346
383
|
return selectors;
|
|
347
384
|
}
|
|
@@ -356,7 +393,15 @@ async function createWhereClause(contentClassAlias, classLoader, rule) {
|
|
|
356
393
|
return clause ? (rule.operator === "or" ? `(${clause})` : clause) : undefined;
|
|
357
394
|
}
|
|
358
395
|
const sourceAlias = rule.sourceAlias ? rule.sourceAlias : contentClassAlias;
|
|
359
|
-
const
|
|
396
|
+
const propertyClass = await classLoader(sourceAlias);
|
|
397
|
+
if (!propertyClass) {
|
|
398
|
+
throw new Error(`Class with alias "${sourceAlias}" not found.`);
|
|
399
|
+
}
|
|
400
|
+
const property = propertyClass.getProperty(rule.propertyName);
|
|
401
|
+
if (!property) {
|
|
402
|
+
throw new Error(`Property "${rule.propertyName}" not found in ECClass "${propertyClass.fullName}".`);
|
|
403
|
+
}
|
|
404
|
+
const propertyValueSelector = ECSql.createRawPropertyValueSelector(sourceAlias, property.name);
|
|
360
405
|
if (isUnaryRuleOperator(rule.operator)) {
|
|
361
406
|
switch (rule.operator) {
|
|
362
407
|
case "is-true":
|
|
@@ -378,24 +423,16 @@ async function createWhereClause(contentClassAlias, classLoader, rule) {
|
|
|
378
423
|
const escapedValue = value.replace(/[%_\\]/g, "\\$&");
|
|
379
424
|
return `${propertyValueSelector} ${ecsqlOperator} '%${escapedValue}%' ESCAPE '\\'`;
|
|
380
425
|
}
|
|
381
|
-
const propertyClass = await classLoader(sourceAlias);
|
|
382
|
-
if (!propertyClass) {
|
|
383
|
-
throw new Error(`Class with alias "${sourceAlias}" not found.`);
|
|
384
|
-
}
|
|
385
|
-
const property = await propertyClass.getProperty(rule.propertyName);
|
|
386
|
-
if (!property) {
|
|
387
|
-
throw new Error(`Property "${rule.propertyName}" not found in ECClass "${propertyClass.fullName}".`);
|
|
388
|
-
}
|
|
389
426
|
if (property.isNavigation()) {
|
|
390
|
-
assert(
|
|
427
|
+
assert(GenericInstanceFilterRuleValue.isInstanceKey(value));
|
|
391
428
|
return `${propertyValueSelector}.[Id] ${ecsqlOperator} ${ECSql.createRawPrimitiveValueSelector(value.id)}`;
|
|
392
429
|
}
|
|
393
430
|
if (property.isEnumeration()) {
|
|
394
|
-
assert(
|
|
431
|
+
assert(!GenericInstanceFilterRuleValue.isInstanceKey(value));
|
|
395
432
|
return `${propertyValueSelector} ${ecsqlOperator} ${ECSql.createRawPrimitiveValueSelector(value)}`;
|
|
396
433
|
}
|
|
397
434
|
if (property.isPrimitive()) {
|
|
398
|
-
assert(
|
|
435
|
+
assert(!GenericInstanceFilterRuleValue.isInstanceKey(value));
|
|
399
436
|
switch (property.primitiveType) {
|
|
400
437
|
case "Point2d": {
|
|
401
438
|
assert(rule.operator === "is-equal" || rule.operator === "is-not-equal");
|
|
@@ -472,14 +509,17 @@ function assignRelationshipPathAliases(path, pathIndex, sourceAlias, targetAlias
|
|
|
472
509
|
}
|
|
473
510
|
const result = [];
|
|
474
511
|
path.forEach((step, i) => {
|
|
512
|
+
const sourceClassName = normalizeFullClassName(step.sourceClassName);
|
|
513
|
+
const targetClassName = normalizeFullClassName(step.targetClassName);
|
|
514
|
+
const relationshipName = normalizeFullClassName(step.relationshipClassName);
|
|
475
515
|
result.push({
|
|
476
|
-
targetClassName
|
|
477
|
-
relationshipName
|
|
478
|
-
sourceClassName
|
|
516
|
+
targetClassName,
|
|
517
|
+
relationshipName,
|
|
518
|
+
sourceClassName,
|
|
479
519
|
relationshipReverse: !step.isForwardRelationship,
|
|
480
520
|
sourceAlias: i === 0 ? sourceAlias : result[i - 1].targetAlias,
|
|
481
|
-
relationshipAlias: createAlias(
|
|
482
|
-
targetAlias: i === path.length - 1 ? targetAlias : createAlias(
|
|
521
|
+
relationshipAlias: createAlias(relationshipName, i),
|
|
522
|
+
targetAlias: i === path.length - 1 ? targetAlias : createAlias(targetClassName, i),
|
|
483
523
|
joinType: "inner",
|
|
484
524
|
});
|
|
485
525
|
});
|
|
@@ -511,50 +551,65 @@ async function getSpecializedPropertyClass(classHierarchyInspector, classes) {
|
|
|
511
551
|
}
|
|
512
552
|
return resolvedClassName;
|
|
513
553
|
}
|
|
514
|
-
async function getHiddenClassesTree(selectClass, selectClassAttribute = "show") {
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
554
|
+
async function getHiddenClassesTree(schemaProvider, selectClass, selectClassAttribute = "show") {
|
|
555
|
+
const derivedClassNames = selectClass.getDerivedClassNames({ onlyDirect: true });
|
|
556
|
+
const derivedClassNamesBySchema = derivedClassNames.reduce((acc, fullClassName) => {
|
|
557
|
+
const { schemaName, className } = parseFullClassName(fullClassName);
|
|
558
|
+
let entry = acc.get(schemaName);
|
|
559
|
+
if (!entry) {
|
|
560
|
+
entry = [];
|
|
561
|
+
acc.set(schemaName, entry);
|
|
520
562
|
}
|
|
563
|
+
entry.push(className);
|
|
521
564
|
return acc;
|
|
522
|
-
},
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
565
|
+
}, new Map());
|
|
566
|
+
const derivedClassesBySchema = await Promise.all([...derivedClassNamesBySchema.entries()].map(async ([schemaName, classNames]) => {
|
|
567
|
+
const schema = await schemaProvider.getSchema(schemaName);
|
|
568
|
+
/* v8 ignore next 3 -- @preserve */
|
|
569
|
+
if (!schema) {
|
|
570
|
+
throw new Error(`Schema "${schemaName}" not found.`);
|
|
571
|
+
}
|
|
572
|
+
return {
|
|
573
|
+
schema,
|
|
574
|
+
classes: classNames.map((className) => {
|
|
575
|
+
const lookupClass = schema.getClass(className);
|
|
576
|
+
/* v8 ignore next 3 -- @preserve */
|
|
577
|
+
if (!lookupClass) {
|
|
578
|
+
throw new Error(`Class "${className}" not found in schema "${schemaName}".`);
|
|
579
|
+
}
|
|
580
|
+
return lookupClass;
|
|
581
|
+
}),
|
|
582
|
+
};
|
|
526
583
|
}));
|
|
527
|
-
const
|
|
528
|
-
|
|
584
|
+
const hiddenSchemas = new Map();
|
|
585
|
+
for (const { schema } of derivedClassesBySchema) {
|
|
586
|
+
hiddenSchemas.set(schema.name, schema.isHidden ? "hide" : undefined);
|
|
587
|
+
}
|
|
588
|
+
return Promise.all(derivedClassesBySchema
|
|
589
|
+
.flatMap(({ classes }) => classes)
|
|
590
|
+
.map(async (ecClass) => {
|
|
591
|
+
const hiddenClassAttr = (() => {
|
|
592
|
+
switch (ecClass.isHidden) {
|
|
593
|
+
case true:
|
|
594
|
+
return "hide";
|
|
595
|
+
case false:
|
|
596
|
+
return "show";
|
|
597
|
+
default:
|
|
598
|
+
return undefined;
|
|
599
|
+
}
|
|
600
|
+
})();
|
|
529
601
|
const attr = hiddenClassAttr ?? hiddenSchemas.get(ecClass.schema.name);
|
|
530
602
|
if (!attr || attr === selectClassAttribute) {
|
|
531
|
-
return getHiddenClassesTree(ecClass, selectClassAttribute);
|
|
603
|
+
return getHiddenClassesTree(schemaProvider, ecClass, selectClassAttribute);
|
|
532
604
|
}
|
|
533
605
|
return [
|
|
534
606
|
{
|
|
535
607
|
fullName: ecClass.fullName,
|
|
536
608
|
state: attr,
|
|
537
|
-
children: await getHiddenClassesTree(ecClass, attr),
|
|
609
|
+
children: await getHiddenClassesTree(schemaProvider, ecClass, attr),
|
|
538
610
|
},
|
|
539
611
|
];
|
|
540
|
-
}))).flat();
|
|
541
|
-
return tree;
|
|
542
|
-
}
|
|
543
|
-
async function getDirectDerivedClasses(ecClass) {
|
|
544
|
-
const allDerived = await ecClass.getDerivedClasses();
|
|
545
|
-
return (await Promise.all(allDerived.map(async (c) => ({ derived: c, base: await c.baseClass }))))
|
|
546
|
-
.filter(({ base }) => base?.fullName === ecClass.fullName)
|
|
547
|
-
.map(({ derived }) => derived);
|
|
548
|
-
}
|
|
549
|
-
async function getHiddenClassAttribute(ecClass) {
|
|
550
|
-
const customAttributes = await ecClass.getCustomAttributes();
|
|
551
|
-
const hiddenClassAttribute = customAttributes.get("CoreCustomAttributes.HiddenClass");
|
|
552
|
-
return hiddenClassAttribute ? (hiddenClassAttribute.Show ? "show" : "hide") : undefined;
|
|
553
|
-
}
|
|
554
|
-
async function getHiddenSchemaAttribute(ecSchema) {
|
|
555
|
-
const customAttributes = await ecSchema.getCustomAttributes();
|
|
556
|
-
const hiddenSchemaAttribute = customAttributes.get("CoreCustomAttributes.HiddenSchema");
|
|
557
|
-
return hiddenSchemaAttribute ? (hiddenSchemaAttribute.ShowClasses ? "show" : "hide") : undefined;
|
|
612
|
+
})).then((results) => results.flat());
|
|
558
613
|
}
|
|
559
614
|
function createWhereClauseForHiddenClasses(hiddenClasses, selectAlias) {
|
|
560
615
|
const res = {};
|
|
@@ -584,4 +639,24 @@ function createWhereClauseForHiddenClasses(hiddenClasses, selectAlias) {
|
|
|
584
639
|
}
|
|
585
640
|
return res;
|
|
586
641
|
}
|
|
642
|
+
async function tryGetClass(schemaProvider, fullClassName) {
|
|
643
|
+
try {
|
|
644
|
+
return await getClass(schemaProvider, fullClassName);
|
|
645
|
+
}
|
|
646
|
+
catch (e) {
|
|
647
|
+
/* v8 ignore else -- @preserve */
|
|
648
|
+
if (isSchemaOrClassNotFoundError(e)) {
|
|
649
|
+
return undefined;
|
|
650
|
+
}
|
|
651
|
+
/* v8 ignore next -- @preserve */
|
|
652
|
+
throw e;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
function isSchemaOrClassNotFoundError(e) {
|
|
656
|
+
return (e instanceof Error &&
|
|
657
|
+
(!!e.message.match(/^Schema "[\w\d_]+" not found/) || !!e.message.match(/^Class "[\w\d_\.:]+" not found/)));
|
|
658
|
+
}
|
|
659
|
+
function isPropertyNotFoundError(e) {
|
|
660
|
+
return e instanceof Error && !!e.message.match(/^Property "[\w\d]+" not found in ECClass/);
|
|
661
|
+
}
|
|
587
662
|
//# sourceMappingURL=NodeSelectQueryFactory.js.map
|