@azure/cosmos 4.7.0 → 4.8.0-alpha.20251121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/CosmosClientOptions.d.ts +1 -1
- package/dist/browser/CosmosClientOptions.js.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js +2 -34
- package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js +2 -35
- package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/browser/client/ChangeFeed/changeFeedUtils.js +47 -0
- package/dist/browser/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/browser/common/constants.d.ts.map +1 -1
- package/dist/browser/common/constants.js +16 -1
- package/dist/browser/common/constants.js.map +1 -1
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.js +84 -0
- package/dist/browser/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.js +39 -0
- package/dist/browser/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.js +4 -0
- package/dist/browser/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/browser/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/browser/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/browser/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/browser/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +174 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +28 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +129 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +66 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.js +23 -0
- package/dist/browser/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.js +55 -0
- package/dist/browser/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.js +156 -0
- package/dist/browser/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.js +105 -0
- package/dist/browser/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.js +93 -0
- package/dist/browser/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.js +65 -0
- package/dist/browser/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/browser/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/documentProducer.js +17 -4
- package/dist/browser/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/index.d.ts +7 -0
- package/dist/browser/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/index.js +4 -0
- package/dist/browser/queryExecutionContext/index.js.map +1 -1
- package/dist/browser/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/browser/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/browser/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/browser/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/orderByComparator.js +20 -3
- package/dist/browser/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/browser/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/browser/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/parallelQueryResult.js +23 -0
- package/dist/browser/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +4 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +310 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +102 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +180 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +93 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +4 -0
- package/dist/browser/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +53 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +34 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +4 -0
- package/dist/browser/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.js +4 -0
- package/dist/browser/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/browser/queryIterator.js.map +1 -1
- package/dist/browser/request/RequestHandler.d.ts.map +1 -1
- package/dist/browser/request/RequestHandler.js +10 -4
- package/dist/browser/request/RequestHandler.js.map +1 -1
- package/dist/browser/utils/offers.d.ts.map +1 -1
- package/dist/browser/utils/offers.js +0 -1
- package/dist/browser/utils/offers.js.map +1 -1
- package/dist/commonjs/CosmosClientOptions.d.ts +1 -1
- package/dist/commonjs/CosmosClientOptions.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js +1 -33
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js +1 -34
- package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js +48 -0
- package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/commonjs/common/constants.d.ts.map +1 -1
- package/dist/commonjs/common/constants.js +13 -2
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.js +93 -0
- package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.js +44 -0
- package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.js +5 -0
- package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/commonjs/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/commonjs/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/commonjs/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/commonjs/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +178 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +31 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +133 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +70 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.js +26 -0
- package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.js +59 -0
- package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.js +160 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.js +109 -0
- package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.js +97 -0
- package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.js +69 -0
- package/dist/commonjs/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/commonjs/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/documentProducer.js +17 -4
- package/dist/commonjs/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/index.d.ts +7 -0
- package/dist/commonjs/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/index.js +10 -0
- package/dist/commonjs/queryExecutionContext/index.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/commonjs/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByComparator.js +21 -3
- package/dist/commonjs/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.js +26 -0
- package/dist/commonjs/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +314 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +106 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +184 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +97 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +57 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +38 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.js +5 -0
- package/dist/commonjs/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/commonjs/queryIterator.js.map +1 -1
- package/dist/commonjs/request/RequestHandler.d.ts.map +1 -1
- package/dist/commonjs/request/RequestHandler.js +10 -4
- package/dist/commonjs/request/RequestHandler.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils/offers.d.ts.map +1 -1
- package/dist/commonjs/utils/offers.js +0 -1
- package/dist/commonjs/utils/offers.js.map +1 -1
- package/dist/esm/CosmosClientOptions.d.ts +1 -1
- package/dist/esm/CosmosClientOptions.js.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js +2 -34
- package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js +2 -35
- package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/esm/client/ChangeFeed/changeFeedUtils.js +47 -0
- package/dist/esm/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +16 -1
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.js +84 -0
- package/dist/esm/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.js +39 -0
- package/dist/esm/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.js +4 -0
- package/dist/esm/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/esm/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/esm/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/esm/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/esm/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +174 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +28 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +129 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +66 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.js +23 -0
- package/dist/esm/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.js +55 -0
- package/dist/esm/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.js +156 -0
- package/dist/esm/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.js +105 -0
- package/dist/esm/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.js +93 -0
- package/dist/esm/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.js +65 -0
- package/dist/esm/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/esm/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/documentProducer.js +17 -4
- package/dist/esm/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/index.d.ts +7 -0
- package/dist/esm/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/index.js +4 -0
- package/dist/esm/queryExecutionContext/index.js.map +1 -1
- package/dist/esm/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/esm/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/esm/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/esm/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/orderByComparator.js +20 -3
- package/dist/esm/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/esm/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/esm/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/parallelQueryResult.js +23 -0
- package/dist/esm/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +4 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +310 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +102 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +180 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +93 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +4 -0
- package/dist/esm/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +53 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +34 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +4 -0
- package/dist/esm/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.js +4 -0
- package/dist/esm/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/esm/queryIterator.js.map +1 -1
- package/dist/esm/request/RequestHandler.d.ts.map +1 -1
- package/dist/esm/request/RequestHandler.js +10 -4
- package/dist/esm/request/RequestHandler.js.map +1 -1
- package/dist/esm/utils/offers.d.ts.map +1 -1
- package/dist/esm/utils/offers.js +0 -1
- package/dist/esm/utils/offers.js.map +1 -1
- package/dist/react-native/CosmosClientOptions.d.ts +1 -1
- package/dist/react-native/CosmosClientOptions.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js +2 -34
- package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js +2 -35
- package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +15 -0
- package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.d.ts +3 -0
- package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts +6 -0
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.js +47 -0
- package/dist/react-native/client/ChangeFeed/changeFeedUtils.js.map +1 -1
- package/dist/react-native/common/constants.d.ts.map +1 -1
- package/dist/react-native/common/constants.js +16 -1
- package/dist/react-native/common/constants.js.map +1 -1
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts +99 -0
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.d.ts.map +1 -0
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.js +84 -0
- package/dist/react-native/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +1 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts +40 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.d.ts.map +1 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.js +39 -0
- package/dist/react-native/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +1 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.d.ts +21 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.d.ts.map +1 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.js +4 -0
- package/dist/react-native/documents/ContinuationToken/PartitionRangeUpdate.js.map +1 -0
- package/dist/react-native/documents/VectorEmbeddingPolicy.d.ts +4 -0
- package/dist/react-native/documents/VectorEmbeddingPolicy.d.ts.map +1 -1
- package/dist/react-native/documents/VectorEmbeddingPolicy.js +4 -0
- package/dist/react-native/documents/VectorEmbeddingPolicy.js.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js +4 -0
- package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js +4 -0
- package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +174 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +28 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +129 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +66 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.d.ts +2 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.js +23 -0
- package/dist/react-native/queryExecutionContext/ContinuationTokenParser.js.map +1 -0
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +22 -7
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +21 -5
- package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +28 -6
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +23 -7
- package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +35 -4
- package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts +1 -0
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +22 -4
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +24 -5
- package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +18 -5
- package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.d.ts +14 -0
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.js +55 -0
- package/dist/react-native/queryExecutionContext/LegacyFetchImplementation.js.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.d.ts +73 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.js +156 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.d.ts +19 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.js +105 -0
- package/dist/react-native/queryExecutionContext/PartitionRangeUtils.js.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.d.ts +20 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.js +93 -0
- package/dist/react-native/queryExecutionContext/QueryControlFetchImplementation.js.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.d.ts +9 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.js +65 -0
- package/dist/react-native/queryExecutionContext/QueryValidationHelper.js.map +1 -0
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.d.ts +2 -2
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js +2 -1
- package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/documentProducer.d.ts +9 -3
- package/dist/react-native/queryExecutionContext/documentProducer.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/documentProducer.js +17 -4
- package/dist/react-native/queryExecutionContext/documentProducer.js.map +1 -1
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.d.ts +1 -1
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js +18 -13
- package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/index.d.ts +7 -0
- package/dist/react-native/queryExecutionContext/index.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/index.js +4 -0
- package/dist/react-native/queryExecutionContext/index.js.map +1 -1
- package/dist/react-native/queryExecutionContext/nonStreamingOrderByResult.d.ts +5 -1
- package/dist/react-native/queryExecutionContext/nonStreamingOrderByResult.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/nonStreamingOrderByResult.js.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByComparator.d.ts +11 -2
- package/dist/react-native/queryExecutionContext/orderByComparator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByComparator.js +20 -3
- package/dist/react-native/queryExecutionContext/orderByComparator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.d.ts +4 -0
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js +18 -7
- package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.d.ts +7 -10
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js +30 -23
- package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.d.ts +18 -10
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.js +47 -23
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +160 -26
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js +453 -106
- package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
- package/dist/react-native/queryExecutionContext/parallelQueryResult.d.ts +35 -0
- package/dist/react-native/queryExecutionContext/parallelQueryResult.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/parallelQueryResult.js +23 -0
- package/dist/react-native/queryExecutionContext/parallelQueryResult.js.map +1 -0
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.d.ts +37 -7
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.d.ts.map +1 -1
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js +173 -120
- package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts +40 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +4 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts +49 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +310 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +18 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +102 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts +51 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +180 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts +76 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +93 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts +30 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +4 -0
- package/dist/react-native/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts +29 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +53 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts +27 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +34 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts +36 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +4 -0
- package/dist/react-native/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +1 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.d.ts +22 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.d.ts.map +1 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.js +4 -0
- package/dist/react-native/queryExecutionContext/queryRangeMapping.js.map +1 -0
- package/dist/react-native/queryIterator.js.map +1 -1
- package/dist/react-native/request/RequestHandler.d.ts.map +1 -1
- package/dist/react-native/request/RequestHandler.js +10 -4
- package/dist/react-native/request/RequestHandler.js.map +1 -1
- package/dist/react-native/utils/offers.d.ts.map +1 -1
- package/dist/react-native/utils/offers.js +0 -1
- package/dist/react-native/utils/offers.js.map +1 -1
- package/package.json +23 -22
package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.ts"],"names":[],"mappings":";;;AAMA,6DAAuD;AAEvD,sDAA2D;AAC3D,sDAAmE;AACnE,mDAAqE;
|
|
1
|
+
{"version":3,"file":"GroupByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.ts"],"names":[],"mappings":";;;AAMA,6DAAuD;AAEvD,sDAA2D;AAC3D,sDAAmE;AACnE,mDAAqE;AAGrE,sEAAsE;AAOtE,cAAc;AACd,MAAa,wBAAwB;IAEzB;IACA;IAFV,YACU,gBAAkC,EAClC,SAAoB;QADpB,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,cAAS,GAAT,SAAS,CAAW;IAC3B,CAAC;IAEa,SAAS,GAAyC,IAAI,GAAG,EAAE,CAAC;IAC5D,oBAAoB,GAAU,EAAE,CAAC;IAC1C,SAAS,GAAY,KAAK,CAAC;IAE5B,cAAc;QACnB,OAAO,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,cAAsC;QAC3D,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,IAAA,iCAAgB,GAAE;aAC5B,CAAC;QACJ,CAAC;QACD,MAAM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soft Corporation.\n// Licensed under the MIT License.\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport type { CosmosHeaders } from \"../CosmosHeaders.js\";\nimport type { QueryInfo } from \"../../request/ErrorResponse.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { Aggregator } from \"../Aggregators/index.js\";\nimport { createAggregator } from \"../Aggregators/index.js\";\nimport { getInitialHeader, mergeHeaders } from \"../headerUtils.js\";\nimport { emptyGroup, extractAggregateResult } from \"./emptyGroup.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\n\ninterface GroupByResult {\n groupByItems: any[];\n payload: any;\n}\n\n/** @hidden */\nexport class GroupByEndpointComponent implements ExecutionContext {\n constructor(\n private executionContext: ExecutionContext,\n private queryInfo: QueryInfo,\n ) {}\n\n private readonly groupings: Map<string, Map<string, Aggregator>> = new Map();\n private readonly aggregateResultArray: any[] = [];\n private completed: boolean = false;\n\n public hasMoreResults(): boolean {\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.completed) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n const aggregateHeaders = getInitialHeader();\n const response = await this.executionContext.fetchMore(diagnosticNode);\n\n if (!response) {\n // If there are any groupings, consolidate and return them\n if (this.groupings.size > 0) {\n return this.consolidateGroupResults(aggregateHeaders);\n }\n return { result: undefined, headers: aggregateHeaders };\n }\n\n mergeHeaders(aggregateHeaders, response.headers);\n\n if (\n response.result === undefined ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n // If there are any groupings, consolidate and return them\n if (this.groupings.size > 0) {\n return this.consolidateGroupResults(aggregateHeaders);\n }\n return { result: undefined, headers: aggregateHeaders };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: GroupByResult[] = parallelResult.buffer as GroupByResult[];\n\n // Process GROUP BY aggregation logic\n for (const item of dataToProcess) {\n // If it exists, process it via aggregators\n if (item) {\n const group = item.groupByItems ? await hashObject(item.groupByItems) : emptyGroup;\n const aggregators = this.groupings.get(group);\n const payload = item.payload;\n if (aggregators) {\n // Iterator over all results in the payload\n for (const key of Object.keys(payload)) {\n // in case the value of a group is null make sure we create a dummy payload with item2==null\n const effectiveGroupByValue = payload[key]\n ? payload[key]\n : new Map().set(\"item2\", null);\n const aggregateResult = extractAggregateResult(effectiveGroupByValue);\n aggregators.get(key).aggregate(aggregateResult);\n }\n } else {\n // This is the first time we have seen a grouping. Setup the initial result without aggregate values\n const grouping = new Map();\n this.groupings.set(group, grouping);\n // Iterator over all results in the payload\n for (const key of Object.keys(payload)) {\n const aggregateType = this.queryInfo.groupByAliasToAggregateType[key];\n // Create a new aggregator for this specific aggregate field\n const aggregator = createAggregator(aggregateType);\n grouping.set(key, aggregator);\n if (aggregateType) {\n const aggregateResult = extractAggregateResult(payload[key]);\n aggregator.aggregate(aggregateResult);\n } else {\n aggregator.aggregate(payload[key]);\n }\n }\n }\n }\n }\n\n if (this.executionContext.hasMoreResults()) {\n // Return empty buffer but preserve the structure and pass-through fields\n const result = createParallelQueryResult(\n [], // empty buffer\n new Map(),\n );\n\n return { result, headers: aggregateHeaders };\n } else {\n return this.consolidateGroupResults(aggregateHeaders);\n }\n }\n\n private consolidateGroupResults(aggregateHeaders: CosmosHeaders): Response<any> {\n for (const grouping of this.groupings.values()) {\n const groupResult: any = {};\n for (const [aggregateKey, aggregator] of grouping.entries()) {\n groupResult[aggregateKey] = aggregator.getResult();\n }\n this.aggregateResultArray.push(groupResult);\n }\n this.completed = true;\n\n // Return in the new structure format using the utility function\n const result = createParallelQueryResult(this.aggregateResultArray, new Map());\n\n return { result, headers: aggregateHeaders };\n }\n}\n"]}
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupByValueEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAM/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupByValueEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAM/E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAS1F,cAAc;AACd,qBAAa,6BAA8B,YAAW,gBAAgB;IAOlE,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;IAPnB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAa;IAClD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAkB;gBAGzB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS;IAMvB,cAAc,IAAI,OAAO;IAInB,SAAS,CAAC,cAAc,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAwFtF,OAAO,CAAC,yBAAyB;CAgBlC"}
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js
CHANGED
|
@@ -5,6 +5,7 @@ const hashObject_js_1 = require("../../utils/hashObject.js");
|
|
|
5
5
|
const index_js_1 = require("../Aggregators/index.js");
|
|
6
6
|
const headerUtils_js_1 = require("../headerUtils.js");
|
|
7
7
|
const emptyGroup_js_1 = require("./emptyGroup.js");
|
|
8
|
+
const parallelQueryResult_js_1 = require("../parallelQueryResult.js");
|
|
8
9
|
/** @hidden */
|
|
9
10
|
class GroupByValueEndpointComponent {
|
|
10
11
|
executionContext;
|
|
@@ -31,14 +32,24 @@ class GroupByValueEndpointComponent {
|
|
|
31
32
|
}
|
|
32
33
|
const aggregateHeaders = (0, headerUtils_js_1.getInitialHeader)();
|
|
33
34
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
35
|
+
if (!response) {
|
|
36
|
+
if (this.aggregators.size > 0) {
|
|
37
|
+
return this.generateAggregateResponse(aggregateHeaders);
|
|
38
|
+
}
|
|
39
|
+
return { result: undefined, headers: aggregateHeaders };
|
|
40
|
+
}
|
|
34
41
|
(0, headerUtils_js_1.mergeHeaders)(aggregateHeaders, response.headers);
|
|
35
|
-
if (response
|
|
42
|
+
if (response.result === undefined ||
|
|
43
|
+
!Array.isArray(response.result.buffer) ||
|
|
44
|
+
response.result.buffer.length === 0) {
|
|
36
45
|
if (this.aggregators.size > 0) {
|
|
37
46
|
return this.generateAggregateResponse(aggregateHeaders);
|
|
38
47
|
}
|
|
39
48
|
return { result: undefined, headers: aggregateHeaders };
|
|
40
49
|
}
|
|
41
|
-
|
|
50
|
+
const parallelResult = response.result;
|
|
51
|
+
const dataToProcess = parallelResult.buffer;
|
|
52
|
+
for (const item of dataToProcess) {
|
|
42
53
|
if (item) {
|
|
43
54
|
let grouping = emptyGroup_js_1.emptyGroup;
|
|
44
55
|
let payload = item;
|
|
@@ -69,13 +80,17 @@ class GroupByValueEndpointComponent {
|
|
|
69
80
|
}
|
|
70
81
|
// We bail early since we got an undefined result back `[{}]`
|
|
71
82
|
if (this.completed) {
|
|
83
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], new Map());
|
|
72
84
|
return {
|
|
73
|
-
result
|
|
85
|
+
result,
|
|
74
86
|
headers: aggregateHeaders,
|
|
75
87
|
};
|
|
76
88
|
}
|
|
77
89
|
if (this.executionContext.hasMoreResults()) {
|
|
78
|
-
|
|
90
|
+
// Return empty buffer but preserve the structure and pass-through fields
|
|
91
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], // empty buffer
|
|
92
|
+
new Map());
|
|
93
|
+
return { result, headers: aggregateHeaders };
|
|
79
94
|
}
|
|
80
95
|
else {
|
|
81
96
|
// If no results are left in the underlying execution context, convert our aggregate results to an array
|
|
@@ -90,8 +105,9 @@ class GroupByValueEndpointComponent {
|
|
|
90
105
|
}
|
|
91
106
|
}
|
|
92
107
|
this.completed = true;
|
|
108
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(this.aggregateResultArray, new Map());
|
|
93
109
|
return {
|
|
94
|
-
result
|
|
110
|
+
result,
|
|
95
111
|
headers: aggregateHeaders,
|
|
96
112
|
};
|
|
97
113
|
}
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupByValueEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.ts"],"names":[],"mappings":";;;AAMA,6DAAuD;AAEvD,sDAA2D;AAC3D,sDAAmE;AACnE,mDAAqE;
|
|
1
|
+
{"version":3,"file":"GroupByValueEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.ts"],"names":[],"mappings":";;;AAMA,6DAAuD;AAEvD,sDAA2D;AAC3D,sDAAmE;AACnE,mDAAqE;AAGrE,sEAAsE;AAOtE,cAAc;AACd,MAAa,6BA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IAAI,CAAC,oBAAoB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAE/E,OAAO;YACL,MAAM;YACN,OAAO,EAAE,gBAAgB;SAC1B,CAAC;IACJ,CAAC;CACF;AA1HD,sEA0HC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport type { CosmosHeaders } from \"../CosmosHeaders.js\";\nimport type { AggregateType, QueryInfo } from \"../../request/ErrorResponse.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { Aggregator } from \"../Aggregators/index.js\";\nimport { createAggregator } from \"../Aggregators/index.js\";\nimport { getInitialHeader, mergeHeaders } from \"../headerUtils.js\";\nimport { emptyGroup, extractAggregateResult } from \"./emptyGroup.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\n\ninterface GroupByResult {\n groupByItems: any[];\n payload: any;\n}\n\n/** @hidden */\nexport class GroupByValueEndpointComponent implements ExecutionContext {\n private readonly aggregators: Map<string, Aggregator> = new Map();\n private readonly aggregateResultArray: any[] = [];\n private aggregateType: AggregateType;\n private completed: boolean = false;\n\n constructor(\n private executionContext: ExecutionContext,\n private queryInfo: QueryInfo,\n ) {\n // VALUE queries will only every have a single grouping\n this.aggregateType = this.queryInfo.aggregates[0];\n }\n\n public hasMoreResults(): boolean {\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.completed) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n const aggregateHeaders = getInitialHeader();\n const response = await this.executionContext.fetchMore(diagnosticNode);\n\n if (!response) {\n if (this.aggregators.size > 0) {\n return this.generateAggregateResponse(aggregateHeaders);\n }\n return { result: undefined, headers: aggregateHeaders };\n }\n\n mergeHeaders(aggregateHeaders, response.headers);\n\n if (\n response.result === undefined ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n if (this.aggregators.size > 0) {\n return this.generateAggregateResponse(aggregateHeaders);\n }\n return { result: undefined, headers: aggregateHeaders };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: GroupByResult[] = parallelResult.buffer as GroupByResult[];\n\n for (const item of dataToProcess) {\n if (item) {\n let grouping: string = emptyGroup;\n let payload: any = item;\n if (item.groupByItems) {\n // If the query contains a GROUP BY clause, it will have a payload property and groupByItems\n payload = item.payload;\n grouping = await hashObject(item.groupByItems);\n }\n\n const aggregator = this.aggregators.get(grouping);\n if (!aggregator) {\n // This is the first time we have seen a grouping so create a new aggregator\n this.aggregators.set(grouping, createAggregator(this.aggregateType));\n }\n\n if (this.aggregateType) {\n const aggregateResult = extractAggregateResult(payload[0]);\n // if aggregate result is null, we need to short circuit aggregation and return undefined\n if (aggregateResult === null) {\n this.completed = true;\n }\n this.aggregators.get(grouping).aggregate(aggregateResult);\n } else {\n // Queries with no aggregates pass the payload directly to the aggregator\n // Example: SELECT VALUE c.team FROM c GROUP BY c.team\n this.aggregators.get(grouping).aggregate(payload);\n }\n }\n }\n\n // We bail early since we got an undefined result back `[{}]`\n if (this.completed) {\n const result = createParallelQueryResult([], new Map());\n\n return {\n result,\n headers: aggregateHeaders,\n };\n }\n\n if (this.executionContext.hasMoreResults()) {\n // Return empty buffer but preserve the structure and pass-through fields\n const result = createParallelQueryResult(\n [], // empty buffer\n new Map(),\n );\n\n return { result, headers: aggregateHeaders };\n } else {\n // If no results are left in the underlying execution context, convert our aggregate results to an array\n return this.generateAggregateResponse(aggregateHeaders);\n }\n }\n\n private generateAggregateResponse(aggregateHeaders: CosmosHeaders): Response<any> {\n for (const aggregator of this.aggregators.values()) {\n const result = aggregator.getResult();\n if (result !== undefined) {\n this.aggregateResultArray.push(result);\n }\n }\n this.completed = true;\n\n const result = createParallelQueryResult(this.aggregateResultArray, new Map());\n\n return {\n result,\n headers: aggregateHeaders,\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByDistinctEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByDistinctEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAS1F;;;GAGG;AACH,qBAAa,4CAA6C,YAAW,gBAAgB;IAqBjF,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,uBAAuB;IAC/B,OAAO,CAAC,qBAAqB;IAvB/B;;OAEG;IACH,OAAO,CAAC,YAAY,CAAoD;IACxE;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAoD;IACjF;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAA8B;IAEtD,OAAO,CAAC,UAAU,CAAW;IAC7B;;OAEG;IACH,OAAO,CAAC,WAAW,CAAkB;gBAG3B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,MAAM,EAC/B,qBAAqB,GAAE,OAAe;IAiBhD;;OAEG;YACW,qBAAqB;IA2B5B,cAAc,IAAI,OAAO;IAKnB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAoGxF"}
|
|
@@ -6,6 +6,7 @@ const hashObject_js_1 = require("../../utils/hashObject.js");
|
|
|
6
6
|
const fixedSizePriorityQueue_js_1 = require("../../utils/fixedSizePriorityQueue.js");
|
|
7
7
|
const nonStreamingOrderByMap_js_1 = require("../../utils/nonStreamingOrderByMap.js");
|
|
8
8
|
const orderByComparator_js_1 = require("../orderByComparator.js");
|
|
9
|
+
const parallelQueryResult_js_1 = require("../parallelQueryResult.js");
|
|
9
10
|
/**
|
|
10
11
|
* @hidden
|
|
11
12
|
* Represents an endpoint in handling an non-streaming order by distinct query.
|
|
@@ -99,19 +100,36 @@ class NonStreamingOrderByDistinctEndpointComponent {
|
|
|
99
100
|
if (this.executionContext.hasMoreResults()) {
|
|
100
101
|
// Grab the next result
|
|
101
102
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
102
|
-
if (response
|
|
103
|
+
if (!response) {
|
|
103
104
|
this.isCompleted = true;
|
|
104
105
|
if (this.aggregateMap.size() > 0) {
|
|
105
106
|
await this.buildFinalResultArray();
|
|
107
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(this.finalResultArray, new Map(), {}, undefined);
|
|
106
108
|
return {
|
|
107
|
-
result
|
|
109
|
+
result,
|
|
110
|
+
headers: resHeaders,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return { result: undefined, headers: resHeaders };
|
|
114
|
+
}
|
|
115
|
+
if (response.result === undefined ||
|
|
116
|
+
!Array.isArray(response.result.buffer) ||
|
|
117
|
+
response.result.buffer.length === 0) {
|
|
118
|
+
this.isCompleted = true;
|
|
119
|
+
if (this.aggregateMap.size() > 0) {
|
|
120
|
+
await this.buildFinalResultArray();
|
|
121
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(this.finalResultArray, new Map(), {}, undefined);
|
|
122
|
+
return {
|
|
123
|
+
result,
|
|
108
124
|
headers: response.headers,
|
|
109
125
|
};
|
|
110
126
|
}
|
|
111
127
|
return { result: undefined, headers: response.headers };
|
|
112
128
|
}
|
|
113
129
|
resHeaders = response.headers;
|
|
114
|
-
|
|
130
|
+
const parallelResult = response.result;
|
|
131
|
+
const dataToProcess = parallelResult.buffer;
|
|
132
|
+
for (const item of dataToProcess) {
|
|
115
133
|
if (item) {
|
|
116
134
|
const key = await (0, hashObject_js_1.hashObject)(item?.payload);
|
|
117
135
|
this.aggregateMap.set(key, item);
|
|
@@ -119,8 +137,10 @@ class NonStreamingOrderByDistinctEndpointComponent {
|
|
|
119
137
|
}
|
|
120
138
|
// return [] to signal that there are more results to fetch.
|
|
121
139
|
if (this.executionContext.hasMoreResults()) {
|
|
140
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], // empty buffer
|
|
141
|
+
new Map(), undefined, undefined);
|
|
122
142
|
return {
|
|
123
|
-
result
|
|
143
|
+
result,
|
|
124
144
|
headers: resHeaders,
|
|
125
145
|
};
|
|
126
146
|
}
|
|
@@ -129,14 +149,16 @@ class NonStreamingOrderByDistinctEndpointComponent {
|
|
|
129
149
|
if (!this.executionContext.hasMoreResults() && !this.isCompleted) {
|
|
130
150
|
this.isCompleted = true;
|
|
131
151
|
await this.buildFinalResultArray();
|
|
152
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(this.finalResultArray, new Map());
|
|
132
153
|
return {
|
|
133
|
-
result
|
|
154
|
+
result,
|
|
134
155
|
headers: resHeaders,
|
|
135
156
|
};
|
|
136
157
|
}
|
|
137
158
|
// Signal that there are no more results.
|
|
159
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], new Map());
|
|
138
160
|
return {
|
|
139
|
-
result
|
|
161
|
+
result,
|
|
140
162
|
headers: resHeaders,
|
|
141
163
|
};
|
|
142
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByDistinctEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.ts"],"names":[],"mappings":";;;AAIA,sDAAqD;AAErD,6DAAuD;AAEvD,qFAA+E;AAC/E,qFAA+E;AAC/E,kEAA4D;AAE5D;;;GAGG;AACH,MAAa,4CAA4C;IAqB7C;IACA;IACA;IACA;IAvBV;;OAEG;IACK,YAAY,CAAoD;IACxE;;OAEG;IACK,qBAAqB,CAAoD;IACjF;;OAEG;IACK,gBAAgB,CAA8B;IAE9C,UAAU,CAAW;IAC7B;;OAEG;IACK,WAAW,GAAY,KAAK,CAAC;IAErC,YACU,gBAAkC,EAClC,SAAoB,EACpB,uBAA+B,EAC/B,wBAAiC,KAAK;QAHtC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,cAAS,GAAT,SAAS,CAAW;QACpB,4BAAuB,GAAvB,uBAAuB,CAAQ;QAC/B,0BAAqB,GAArB,qBAAqB,CAAiB;QAE9C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;QACzC,MAAM,UAAU,GAAG,IAAI,wCAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,IAAI,CAAC,YAAY,GAAG,IAAI,kDAAsB,CAC5C,CAAC,CAA4B,EAAE,CAA4B,EAAE,EAAE;YAC7D,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC,CACF,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAG,IAAI,kDAAsB,CACrD,CAAC,CAA4B,EAAE,CAA4B,EAAE,EAAE;YAC7D,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC,EACD,IAAI,CAAC,uBAAuB,CAC7B,CAAC;IACJ,CAAC;IAED;;OA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M,IAAA,0BAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;oBAC5C,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;YAED,4DAA4D;YAC5D,IAAI,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3C,OAAO;oBACL,MAAM,EAAE,EAAE;oBACV,OAAO,EAAE,UAAU;iBACpB,CAAC;YACJ,CAAC;QACH,CAAC;QAED,iEAAiE;QACjE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACjE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC;YACnC,OAAO;gBACL,MAAM,EAAE,IAAI,CAAC,gBAAgB;gBAC7B,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;QACD,yCAAyC;QACzC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,UAAU;SACpB,CAAC;IACJ,CAAC;CACF;AA3ID,oGA2IC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { QueryInfo, Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport { NonStreamingOrderByMap } from \"../../utils/nonStreamingOrderByMap.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by distinct query.\n */\nexport class NonStreamingOrderByDistinctEndpointComponent implements ExecutionContext {\n /**\n * A Map that holds the distinct values of the items before storing in priority queue.\n */\n private aggregateMap: NonStreamingOrderByMap<NonStreamingOrderByResult>;\n /**\n * A priority queue to compute the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Array to store the final sorted results.\n */\n private finalResultArray: NonStreamingOrderByResult[];\n\n private sortOrders: string[];\n /**\n * Flag to determine if all results are fetched from backend and results can be returned.\n */\n private isCompleted: boolean = false;\n\n constructor(\n private executionContext: ExecutionContext,\n private queryInfo: QueryInfo,\n private priorityQueueBufferSize: number,\n private emitRawOrderByPayload: boolean = false,\n ) {\n this.sortOrders = this.queryInfo.orderBy;\n const comparator = new OrderByComparator(this.sortOrders);\n this.aggregateMap = new NonStreamingOrderByMap<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(a, b);\n },\n );\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Build final sorted result array from which responses will be served.\n */\n private async buildFinalResultArray(): Promise<void> {\n // Fetch all distinct values from the map and store in priority queue.\n const allValues = this.aggregateMap.getAllValuesAndReset();\n for (const value of allValues) {\n this.nonStreamingOrderByPQ.enqueue(value);\n }\n\n // Compute the final result array size based on offset and limit.\n const offSet = this.queryInfo.offset ? this.queryInfo.offset : 0;\n const queueSize = this.nonStreamingOrderByPQ.size();\n const finalArraySize = queueSize - offSet;\n\n if (finalArraySize <= 0) {\n this.finalResultArray = [];\n } else {\n this.finalResultArray = new Array(finalArraySize);\n // Only keep the final result array size number of items in the final result array and discard the rest.\n for (let count = finalArraySize - 1; count >= 0; count--) {\n if (this.emitRawOrderByPayload) {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue();\n } else {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue()?.payload;\n }\n }\n }\n }\n\n public hasMoreResults(): boolean {\n if (this.priorityQueueBufferSize === 0) return false;\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n\n // If there are more results in backend, keep filling map.\n if (this.executionContext.hasMoreResults()) {\n // Grab the next result\n const response = await this.executionContext.fetchMore(diagnosticNode);\n if (response === undefined || response.result === undefined) {\n this.isCompleted = true;\n if (this.aggregateMap.size() > 0) {\n await this.buildFinalResultArray();\n return {\n result: this.finalResultArray,\n headers: response.headers,\n };\n }\n return { result: undefined, headers: response.headers };\n }\n resHeaders = response.headers;\n for (const item of response.result) {\n if (item) {\n const key = await hashObject(item?.payload);\n this.aggregateMap.set(key, item);\n }\n }\n\n // return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n return {\n result: [],\n headers: resHeaders,\n };\n }\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n await this.buildFinalResultArray();\n return {\n result: this.finalResultArray,\n headers: resHeaders,\n };\n }\n // Signal that there are no more results.\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByDistinctEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.ts"],"names":[],"mappings":";;;AAIA,sDAAqD;AAErD,6DAAuD;AAEvD,qFAA+E;AAC/E,qFAA+E;AAC/E,kEAA4D;AAE5D,sEAAsE;AAEtE;;;GAGG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GAAG,EAAE,CAAC,CAAC;YAE3E,OAAO;gBACL,MAAM;gBACN,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;QACD,yCAAyC;QACzC,MAAM,MAAM,GAAG,IAAA,kDAAyB,EAAC,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAExD,OAAO;YACL,MAAM;YACN,OAAO,EAAE,UAAU;SACpB,CAAC;IACJ,CAAC;CACF;AAhLD,oGAgLC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { QueryInfo, Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport { hashObject } from \"../../utils/hashObject.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport { NonStreamingOrderByMap } from \"../../utils/nonStreamingOrderByMap.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by distinct query.\n */\nexport class NonStreamingOrderByDistinctEndpointComponent implements ExecutionContext {\n /**\n * A Map that holds the distinct values of the items before storing in priority queue.\n */\n private aggregateMap: NonStreamingOrderByMap<NonStreamingOrderByResult>;\n /**\n * A priority queue to compute the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Array to store the final sorted results.\n */\n private finalResultArray: NonStreamingOrderByResult[];\n\n private sortOrders: string[];\n /**\n * Flag to determine if all results are fetched from backend and results can be returned.\n */\n private isCompleted: boolean = false;\n\n constructor(\n private executionContext: ExecutionContext,\n private queryInfo: QueryInfo,\n private priorityQueueBufferSize: number,\n private emitRawOrderByPayload: boolean = false,\n ) {\n this.sortOrders = this.queryInfo.orderBy;\n const comparator = new OrderByComparator(this.sortOrders);\n this.aggregateMap = new NonStreamingOrderByMap<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(a, b);\n },\n );\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Build final sorted result array from which responses will be served.\n */\n private async buildFinalResultArray(): Promise<void> {\n // Fetch all distinct values from the map and store in priority queue.\n const allValues = this.aggregateMap.getAllValuesAndReset();\n for (const value of allValues) {\n this.nonStreamingOrderByPQ.enqueue(value);\n }\n\n // Compute the final result array size based on offset and limit.\n const offSet = this.queryInfo.offset ? this.queryInfo.offset : 0;\n const queueSize = this.nonStreamingOrderByPQ.size();\n const finalArraySize = queueSize - offSet;\n\n if (finalArraySize <= 0) {\n this.finalResultArray = [];\n } else {\n this.finalResultArray = new Array(finalArraySize);\n // Only keep the final result array size number of items in the final result array and discard the rest.\n for (let count = finalArraySize - 1; count >= 0; count--) {\n if (this.emitRawOrderByPayload) {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue();\n } else {\n this.finalResultArray[count] = this.nonStreamingOrderByPQ.dequeue()?.payload;\n }\n }\n }\n }\n\n public hasMoreResults(): boolean {\n if (this.priorityQueueBufferSize === 0) return false;\n return this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n\n // If there are more results in backend, keep filling map.\n if (this.executionContext.hasMoreResults()) {\n // Grab the next result\n const response = await this.executionContext.fetchMore(diagnosticNode);\n\n if (!response) {\n this.isCompleted = true;\n if (this.aggregateMap.size() > 0) {\n await this.buildFinalResultArray();\n const result = createParallelQueryResult(this.finalResultArray, new Map(), {}, undefined);\n\n return {\n result,\n headers: resHeaders,\n };\n }\n return { result: undefined, headers: resHeaders };\n }\n\n if (\n response.result === undefined ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n this.isCompleted = true;\n if (this.aggregateMap.size() > 0) {\n await this.buildFinalResultArray();\n const result = createParallelQueryResult(this.finalResultArray, new Map(), {}, undefined);\n\n return {\n result,\n headers: response.headers,\n };\n }\n return { result: undefined, headers: response.headers };\n }\n resHeaders = response.headers;\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: NonStreamingOrderByResult[] =\n parallelResult.buffer as NonStreamingOrderByResult[];\n\n for (const item of dataToProcess) {\n if (item) {\n const key = await hashObject(item?.payload);\n this.aggregateMap.set(key, item);\n }\n }\n\n // return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n const result = createParallelQueryResult(\n [], // empty buffer\n new Map(),\n undefined,\n undefined,\n );\n\n return {\n result,\n headers: resHeaders,\n };\n }\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n await this.buildFinalResultArray();\n const result = createParallelQueryResult(this.finalResultArray, new Map());\n\n return {\n result,\n headers: resHeaders,\n };\n }\n // Signal that there are no more results.\n const result = createParallelQueryResult([], new Map());\n\n return {\n result,\n headers: resHeaders,\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAU/D;;;GAGG;AACH,qBAAa,oCAAqC,YAAW,gBAAgB;IAiBzE,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,uBAAuB;IAC/B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,qBAAqB;IApB/B;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAoD;IACjF;;OAEG;IACH,OAAO,CAAC,WAAW,CAAkB;IACrC;;;;;;OAMG;gBAEO,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,GAAG,EAAE,EACjB,uBAAuB,EAAE,MAAM,EAC/B,MAAM,GAAE,MAAU,EAClB,qBAAqB,GAAE,OAAe;IAWhD;;;OAGG;IACI,cAAc,IAAI,OAAO;IAIhC;;;OAGG;IACU,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAiFzE,qBAAqB;CA6CpC"}
|
|
@@ -4,6 +4,7 @@ exports.NonStreamingOrderByEndpointComponent = void 0;
|
|
|
4
4
|
const orderByComparator_js_1 = require("../orderByComparator.js");
|
|
5
5
|
const fixedSizePriorityQueue_js_1 = require("../../utils/fixedSizePriorityQueue.js");
|
|
6
6
|
const headerUtils_js_1 = require("../headerUtils.js");
|
|
7
|
+
const parallelQueryResult_js_1 = require("../parallelQueryResult.js");
|
|
7
8
|
/**
|
|
8
9
|
* @hidden
|
|
9
10
|
* Represents an endpoint in handling an non-streaming order by query.
|
|
@@ -69,15 +70,26 @@ class NonStreamingOrderByEndpointComponent {
|
|
|
69
70
|
// If there are more results in backend, keep filling pq.
|
|
70
71
|
if (this.executionContext.hasMoreResults()) {
|
|
71
72
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
73
|
+
if (!response) {
|
|
74
|
+
this.isCompleted = true;
|
|
75
|
+
if (!this.nonStreamingOrderByPQ.isEmpty()) {
|
|
76
|
+
return this.buildFinalResultArray(resHeaders);
|
|
77
|
+
}
|
|
78
|
+
return { result: undefined, headers: resHeaders };
|
|
79
|
+
}
|
|
72
80
|
resHeaders = response.headers;
|
|
73
|
-
if (response
|
|
81
|
+
if (response.result === undefined ||
|
|
82
|
+
!response.result.buffer ||
|
|
83
|
+
response.result.buffer.length === 0) {
|
|
74
84
|
this.isCompleted = true;
|
|
75
85
|
if (!this.nonStreamingOrderByPQ.isEmpty()) {
|
|
76
86
|
return this.buildFinalResultArray(resHeaders);
|
|
77
87
|
}
|
|
78
88
|
return { result: undefined, headers: resHeaders };
|
|
79
89
|
}
|
|
80
|
-
|
|
90
|
+
const parallelResult = response.result;
|
|
91
|
+
const dataToProcess = parallelResult.buffer;
|
|
92
|
+
for (const item of dataToProcess) {
|
|
81
93
|
if (item !== undefined) {
|
|
82
94
|
this.nonStreamingOrderByPQ.enqueue(item);
|
|
83
95
|
}
|
|
@@ -85,23 +97,26 @@ class NonStreamingOrderByEndpointComponent {
|
|
|
85
97
|
}
|
|
86
98
|
// If the backend has more results to fetch, return [] to signal that there are more results to fetch.
|
|
87
99
|
if (this.executionContext.hasMoreResults()) {
|
|
100
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], // empty buffer
|
|
101
|
+
new Map(), {});
|
|
88
102
|
return {
|
|
89
|
-
result
|
|
103
|
+
result,
|
|
90
104
|
headers: resHeaders,
|
|
91
105
|
};
|
|
92
106
|
}
|
|
93
107
|
// If all results are fetched from backend, prepare final results
|
|
94
108
|
if (!this.executionContext.hasMoreResults() && !this.isCompleted) {
|
|
95
109
|
this.isCompleted = true;
|
|
96
|
-
return this.buildFinalResultArray(resHeaders);
|
|
110
|
+
return this.buildFinalResultArray(resHeaders, new Map(), {});
|
|
97
111
|
}
|
|
98
112
|
// If pq is empty, return undefined to signal that there are no more results.
|
|
113
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], new Map(), {});
|
|
99
114
|
return {
|
|
100
|
-
result
|
|
115
|
+
result,
|
|
101
116
|
headers: resHeaders,
|
|
102
117
|
};
|
|
103
118
|
}
|
|
104
|
-
async buildFinalResultArray(resHeaders) {
|
|
119
|
+
async buildFinalResultArray(resHeaders, partitionKeyRangeMap, updatedContinuationRanges) {
|
|
105
120
|
// Set isCompleted to true.
|
|
106
121
|
this.isCompleted = true;
|
|
107
122
|
// Reverse the priority queue to get the results in the correct order
|
|
@@ -127,8 +142,9 @@ class NonStreamingOrderByEndpointComponent {
|
|
|
127
142
|
buffer.push(this.nonStreamingOrderByPQ.dequeue()?.payload);
|
|
128
143
|
}
|
|
129
144
|
}
|
|
145
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(buffer, partitionKeyRangeMap || new Map(), updatedContinuationRanges || {}, undefined);
|
|
130
146
|
return {
|
|
131
|
-
result
|
|
147
|
+
result,
|
|
132
148
|
headers: resHeaders,
|
|
133
149
|
};
|
|
134
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonStreamingOrderByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":";;;AAKA,kEAA4D;AAE5D,qFAA+E;AAE/E,sDAAqD;AAErD;;;GAGG;AACH,MAAa,oC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EO,KAAK,CAAC,qBAAqB,CAAC,UAAyB;QAC3D,2BAA2B;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,qEAAqE;QACrE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;QAClE,4EAA4E;QAC5E,8DAA8D;QAC9D,OACE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,uBAAuB;YAC1C,IAAI,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EACrC,CAAC;YACD,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;QAED,iDAAiD;QACjD,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAU,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC/B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AArID,oFAqIC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport type { CosmosHeaders } from \"../headerUtils.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by query.\n */\nexport class NonStreamingOrderByEndpointComponent implements ExecutionContext {\n /**\n * A priority queue to store the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Flag to determine if all results are fetched from backend and results can be returned from priority queue.\n */\n private isCompleted: boolean = false;\n /**\n * Represents an endpoint in handling an non-streaming order by query. For each processed orderby\n * result it returns 'payload' item of the result\n *\n * @param executionContext - Underlying Execution Context\n * @hidden\n */\n constructor(\n private executionContext: ExecutionContext,\n private sortOrders: any[],\n private priorityQueueBufferSize: number,\n private offset: number = 0,\n private emitRawOrderByPayload: boolean = false,\n ) {\n const comparator = new OrderByComparator(this.sortOrders);\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Determine if there are still remaining resources to processs.\n * @returns true if there is other elements to process in the NonStreamingOrderByEndpointComponent.\n */\n public hasMoreResults(): boolean {\n return this.priorityQueueBufferSize > 0 && this.executionContext.hasMoreResults();\n }\n\n /**\n * Fetches the next batch of the result from the target container.\n * @param diagnosticNode - The diagnostic information for the request.\n */\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n // If there are more results in backend, keep filling pq.\n if (this.executionContext.hasMoreResults()) {\n const response = await this.executionContext.fetchMore(diagnosticNode);\n resHeaders = response.headers;\n if (response === undefined || response.result === undefined) {\n this.isCompleted = true;\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n return this.buildFinalResultArray(resHeaders);\n }\n return { result: undefined, headers: resHeaders };\n }\n\n for (const item of response.result) {\n if (item !== undefined) {\n this.nonStreamingOrderByPQ.enqueue(item);\n }\n }\n }\n\n // If the backend has more results to fetch, return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n return {\n result: [],\n headers: resHeaders,\n };\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n return this.buildFinalResultArray(resHeaders);\n }\n\n // If pq is empty, return undefined to signal that there are no more results.\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n\n private async buildFinalResultArray(resHeaders: CosmosHeaders): Promise<Response<any>> {\n // Set isCompleted to true.\n this.isCompleted = true;\n // Reverse the priority queue to get the results in the correct order\n this.nonStreamingOrderByPQ = this.nonStreamingOrderByPQ.reverse();\n // For offset limit case we set the size of priority queue to offset + limit\n // and we drain offset number of items from the priority queue\n while (\n this.offset < this.priorityQueueBufferSize &&\n this.offset > 0 &&\n !this.nonStreamingOrderByPQ.isEmpty()\n ) {\n this.nonStreamingOrderByPQ.dequeue();\n this.offset--;\n }\n\n // If pq is not empty, return the result from pq.\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n const buffer: any[] = [];\n if (this.emitRawOrderByPayload) {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue());\n }\n } else {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue()?.payload);\n }\n }\n return {\n result: buffer,\n headers: resHeaders,\n };\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NonStreamingOrderByEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.ts"],"names":[],"mappings":";;;AAKA,kEAA4D;AAE5D,qFAA+E;AAE/E,sDAAqD;AAGrD,sEAAsE;AAEtE;;;GAGG;AACH,MAAa,oCAAoC;IAiBrC;IACA;IACA;IACA;IACA;IApBV;;OAEG;IACK,qBAAqB,CAAoD;IACjF;;OAEG;IACK,WAAW,GAAY,KAAK,CAAC;IACrC;;;;;;OAMG;IACH,YACU,gBAAkC,EAClC,UAAiB,EACjB,uBAA+B,EAC/B,SAAiB,CAAC,EAClB,wBAAiC,KAAK;QAJtC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,eAAU,GAAV,UAAU,CAAO;QACjB,4BAAuB,GAAvB,uBAAuB,CAAQ;QAC/B,WAAM,GAAN,MAAM,CAAY;QAClB,0BAAqB,GAArB,qBAAqB,CAAiB;QAE9C,MAAM,UAAU,GAAG,IAAI,wCAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1D,IAAI,CAAC,qBAAqB,GAAG,IAAI,kDAAsB,CACrD,CAAC,CAA4B,EAAE,CAA4B,EAAE,EAAE;YAC7D,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,CAAC,EACD,IAAI,CAAC,uBAAuB,CAC7B,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,uBAAuB,GAAG,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IACpF,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,SAAS,CAAC,cAAuC;QAC5D,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE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C,MAAM,GAAG,IAAI,CAAC,uBAAuB;YAC1C,IAAI,CAAC,MAAM,GAAG,CAAC;YACf,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EACrC,CAAC;YACD,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,CAAC;QAED,iDAAiD;QACjD,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAU,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC/B,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,CAAC;oBAC7C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;YACD,MAAM,MAAM,GAAG,IAAA,kDAAyB,EACtC,MAAM,EACN,oBAAoB,IAAI,IAAI,GAAG,EAAE,EACjC,yBAAyB,IAAI,EAAE,EAC/B,SAAS,CACV,CAAC;YAEF,OAAO;gBACL,MAAM;gBACN,OAAO,EAAE,UAAU;aACpB,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA1KD,oFA0KC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { OrderByComparator } from \"../orderByComparator.js\";\nimport type { NonStreamingOrderByResult } from \"../nonStreamingOrderByResult.js\";\nimport { FixedSizePriorityQueue } from \"../../utils/fixedSizePriorityQueue.js\";\nimport type { CosmosHeaders } from \"../headerUtils.js\";\nimport { getInitialHeader } from \"../headerUtils.js\";\nimport type { QueryRangeMapping } from \"../queryRangeMapping.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\n\n/**\n * @hidden\n * Represents an endpoint in handling an non-streaming order by query.\n */\nexport class NonStreamingOrderByEndpointComponent implements ExecutionContext {\n /**\n * A priority queue to store the final sorted results.\n */\n private nonStreamingOrderByPQ: FixedSizePriorityQueue<NonStreamingOrderByResult>;\n /**\n * Flag to determine if all results are fetched from backend and results can be returned from priority queue.\n */\n private isCompleted: boolean = false;\n /**\n * Represents an endpoint in handling an non-streaming order by query. For each processed orderby\n * result it returns 'payload' item of the result\n *\n * @param executionContext - Underlying Execution Context\n * @hidden\n */\n constructor(\n private executionContext: ExecutionContext,\n private sortOrders: any[],\n private priorityQueueBufferSize: number,\n private offset: number = 0,\n private emitRawOrderByPayload: boolean = false,\n ) {\n const comparator = new OrderByComparator(this.sortOrders);\n this.nonStreamingOrderByPQ = new FixedSizePriorityQueue<NonStreamingOrderByResult>(\n (a: NonStreamingOrderByResult, b: NonStreamingOrderByResult) => {\n return comparator.compareItems(b, a);\n },\n this.priorityQueueBufferSize,\n );\n }\n\n /**\n * Determine if there are still remaining resources to processs.\n * @returns true if there is other elements to process in the NonStreamingOrderByEndpointComponent.\n */\n public hasMoreResults(): boolean {\n return this.priorityQueueBufferSize > 0 && this.executionContext.hasMoreResults();\n }\n\n /**\n * Fetches the next batch of the result from the target container.\n * @param diagnosticNode - The diagnostic information for the request.\n */\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n if (this.isCompleted) {\n return {\n result: undefined,\n headers: getInitialHeader(),\n };\n }\n let resHeaders = getInitialHeader();\n\n // if size is 0, just return undefined to signal to more results. Valid if query is TOP 0 or LIMIT 0\n if (this.priorityQueueBufferSize <= 0) {\n return {\n result: undefined,\n headers: resHeaders,\n };\n }\n // If there are more results in backend, keep filling pq.\n if (this.executionContext.hasMoreResults()) {\n const response = await this.executionContext.fetchMore(diagnosticNode);\n\n if (!response) {\n this.isCompleted = true;\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n return this.buildFinalResultArray(resHeaders);\n }\n return { result: undefined, headers: resHeaders };\n }\n\n resHeaders = response.headers;\n if (\n response.result === undefined ||\n !response.result.buffer ||\n response.result.buffer.length === 0\n ) {\n this.isCompleted = true;\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n return this.buildFinalResultArray(resHeaders);\n }\n return { result: undefined, headers: resHeaders };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: NonStreamingOrderByResult[] =\n parallelResult.buffer as NonStreamingOrderByResult[];\n\n for (const item of dataToProcess) {\n if (item !== undefined) {\n this.nonStreamingOrderByPQ.enqueue(item);\n }\n }\n }\n\n // If the backend has more results to fetch, return [] to signal that there are more results to fetch.\n if (this.executionContext.hasMoreResults()) {\n const result = createParallelQueryResult(\n [], // empty buffer\n new Map(),\n {},\n );\n\n return {\n result,\n headers: resHeaders,\n };\n }\n\n // If all results are fetched from backend, prepare final results\n if (!this.executionContext.hasMoreResults() && !this.isCompleted) {\n this.isCompleted = true;\n return this.buildFinalResultArray(resHeaders, new Map(), {});\n }\n\n // If pq is empty, return undefined to signal that there are no more results.\n const result = createParallelQueryResult([], new Map(), {});\n\n return {\n result,\n headers: resHeaders,\n };\n }\n\n private async buildFinalResultArray(\n resHeaders: CosmosHeaders,\n partitionKeyRangeMap?: Map<string, QueryRangeMapping>,\n updatedContinuationRanges?: Record<string, any>,\n ): Promise<Response<any>> {\n // Set isCompleted to true.\n this.isCompleted = true;\n // Reverse the priority queue to get the results in the correct order\n this.nonStreamingOrderByPQ = this.nonStreamingOrderByPQ.reverse();\n // For offset limit case we set the size of priority queue to offset + limit\n // and we drain offset number of items from the priority queue\n while (\n this.offset < this.priorityQueueBufferSize &&\n this.offset > 0 &&\n !this.nonStreamingOrderByPQ.isEmpty()\n ) {\n this.nonStreamingOrderByPQ.dequeue();\n this.offset--;\n }\n\n // If pq is not empty, return the result from pq.\n if (!this.nonStreamingOrderByPQ.isEmpty()) {\n const buffer: any[] = [];\n if (this.emitRawOrderByPayload) {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue());\n }\n } else {\n while (!this.nonStreamingOrderByPQ.isEmpty()) {\n buffer.push(this.nonStreamingOrderByPQ.dequeue()?.payload);\n }\n }\n const result = createParallelQueryResult(\n buffer,\n partitionKeyRangeMap || new Map(),\n updatedContinuationRanges || {},\n undefined,\n );\n\n return {\n result,\n headers: resHeaders,\n };\n }\n }\n}\n"]}
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffsetLimitEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"OffsetLimitEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,cAAc;AACd,qBAAa,4BAA6B,YAAW,gBAAgB;IAEjE,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,KAAK;gBAFL,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM;IAGhB,cAAc,IAAI,OAAO;IAInB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAiExF"}
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OffsetLimitEndpointComponent = void 0;
|
|
4
4
|
const headerUtils_js_1 = require("../headerUtils.js");
|
|
5
|
+
const parallelQueryResult_js_1 = require("../parallelQueryResult.js");
|
|
6
|
+
const PartitionRangeUtils_js_1 = require("../PartitionRangeUtils.js");
|
|
5
7
|
/** @hidden */
|
|
6
8
|
class OffsetLimitEndpointComponent {
|
|
7
9
|
executionContext;
|
|
@@ -19,20 +21,49 @@ class OffsetLimitEndpointComponent {
|
|
|
19
21
|
const aggregateHeaders = (0, headerUtils_js_1.getInitialHeader)();
|
|
20
22
|
const buffer = [];
|
|
21
23
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
24
|
+
if (!response) {
|
|
25
|
+
return { result: undefined, headers: aggregateHeaders };
|
|
26
|
+
}
|
|
22
27
|
(0, headerUtils_js_1.mergeHeaders)(aggregateHeaders, response.headers);
|
|
23
|
-
if (response
|
|
24
|
-
|
|
28
|
+
if (response.result === undefined ||
|
|
29
|
+
!Array.isArray(response.result.buffer) ||
|
|
30
|
+
response.result.buffer.length === 0) {
|
|
31
|
+
return { result: response.result, headers: response.headers };
|
|
25
32
|
}
|
|
26
|
-
|
|
33
|
+
const parallelResult = response.result;
|
|
34
|
+
const dataToProcess = parallelResult.buffer;
|
|
35
|
+
const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;
|
|
36
|
+
const updatedContinuationRanges = parallelResult.updatedContinuationRanges;
|
|
37
|
+
const orderByItems = parallelResult.orderByItems;
|
|
38
|
+
const initialOffset = this.offset;
|
|
39
|
+
const initialLimit = this.limit;
|
|
40
|
+
const filteredOrderByItems = [];
|
|
41
|
+
let itemIndex = 0;
|
|
42
|
+
for (const item of dataToProcess) {
|
|
27
43
|
if (this.offset > 0) {
|
|
28
44
|
this.offset--;
|
|
45
|
+
// Skip this item AND its corresponding orderByItems entry
|
|
29
46
|
}
|
|
30
47
|
else if (this.limit > 0) {
|
|
31
48
|
buffer.push(item);
|
|
49
|
+
// Include the corresponding orderByItems entry
|
|
50
|
+
if (orderByItems && itemIndex < orderByItems.length) {
|
|
51
|
+
filteredOrderByItems.push(orderByItems[itemIndex]);
|
|
52
|
+
}
|
|
32
53
|
this.limit--;
|
|
33
54
|
}
|
|
55
|
+
itemIndex++;
|
|
34
56
|
}
|
|
35
|
-
|
|
57
|
+
// Process offset/limit logic and update partition key range map
|
|
58
|
+
// Note: Pass initial offset/limit values (not current state) to calculateOffsetLimitForPartitionRanges
|
|
59
|
+
// This function updates partition metadata while the loop above processes actual data items
|
|
60
|
+
const updatedPartitionKeyRangeMap = (0, PartitionRangeUtils_js_1.calculateOffsetLimitForPartitionRanges)(partitionKeyRangeMap, initialOffset, initialLimit);
|
|
61
|
+
// Return in the new structure format using the utility function
|
|
62
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(buffer, updatedPartitionKeyRangeMap, updatedContinuationRanges, filteredOrderByItems.length > 0 ? filteredOrderByItems : undefined);
|
|
63
|
+
return {
|
|
64
|
+
result,
|
|
65
|
+
headers: aggregateHeaders,
|
|
66
|
+
};
|
|
36
67
|
}
|
|
37
68
|
}
|
|
38
69
|
exports.OffsetLimitEndpointComponent = OffsetLimitEndpointComponent;
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffsetLimitEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":";;;AAKA,sDAAmE;AAEnE,cAAc;AACd,MAAa,4BAA4B;IAE7B;IACA;IACA;IAHV,YACU,gBAAkC,EAClC,MAAc,EACd,KAAa;QAFb,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAQ;IACpB,CAAC;IAEG,cAAc;QACnB,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IACvF,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,cAAuC;QAC5D,MAAM,gBAAgB,GAAG,IAAA,iCAAgB,GAAE,CAAC;QAC5C,MAAM,MAAM,GAAU,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QACvE,IAAA,6BAAY,EAAC,gBAAgB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjD,
|
|
1
|
+
{"version":3,"file":"OffsetLimitEndpointComponent.js","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.ts"],"names":[],"mappings":";;;AAKA,sDAAmE;AAEnE,sEAAsE;AACtE,sEAAmF;AAEnF,cAAc;AACd,MAAa,4BAA4B;IAE7B;IACA;IACA;IAHV,YACU,gBAAkC,EAClC,MAAc,EACd,KAAa;QAFb,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,WAAM,GAAN,MAAM,CAAQ;QACd,UAAK,GAAL,KAAK,CAAQ;IACpB,CAAC;IAEG,cAAc;QACnB,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AU,EAAE,CAAC;QACvC,IAAI,SAAS,GAAG,CAAC,CAAC;QAElB,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,EAAE,CAAC;gBACd,0DAA0D;YAC5D,CAAC;iBAAM,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;gBAC1B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClB,+CAA+C;gBAC/C,IAAI,YAAY,IAAI,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;oBACpD,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;gBACrD,CAAC;gBACD,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,CAAC;YACD,SAAS,EAAE,CAAC;QACd,CAAC;QAED,gEAAgE;QAChE,uGAAuG;QACvG,4FAA4F;QAC5F,MAAM,2BAA2B,GAAG,IAAA,+DAAsC,EACxE,oBAAoB,EACpB,aAAa,EACb,YAAY,CACb,CAAC;QAEF,gEAAgE;QAChE,MAAM,MAAM,GAAG,IAAA,kDAAyB,EACtC,MAAM,EACN,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CACnE,CAAC;QAEF,OAAO;YACL,MAAM;YACN,OAAO,EAAE,gBAAgB;SAC1B,CAAC;IACJ,CAAC;CACF;AA5ED,oEA4EC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { DiagnosticNodeInternal } from \"../../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../../request/index.js\";\nimport type { ExecutionContext } from \"../ExecutionContext.js\";\nimport { getInitialHeader, mergeHeaders } from \"../headerUtils.js\";\nimport type { ParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { createParallelQueryResult } from \"../parallelQueryResult.js\";\nimport { calculateOffsetLimitForPartitionRanges } from \"../PartitionRangeUtils.js\";\n\n/** @hidden */\nexport class OffsetLimitEndpointComponent implements ExecutionContext {\n constructor(\n private executionContext: ExecutionContext,\n private offset: number,\n private limit: number,\n ) {}\n\n public hasMoreResults(): boolean {\n return (this.offset > 0 || this.limit > 0) && this.executionContext.hasMoreResults();\n }\n\n public async fetchMore(diagnosticNode?: DiagnosticNodeInternal): Promise<Response<any>> {\n const aggregateHeaders = getInitialHeader();\n const buffer: any[] = [];\n const response = await this.executionContext.fetchMore(diagnosticNode);\n if (!response) {\n return { result: undefined, headers: aggregateHeaders };\n }\n mergeHeaders(aggregateHeaders, response.headers);\n if (\n response.result === undefined ||\n !Array.isArray(response.result.buffer) ||\n response.result.buffer.length === 0\n ) {\n return { result: response.result, headers: response.headers };\n }\n\n const parallelResult = response.result as ParallelQueryResult;\n const dataToProcess: any[] = parallelResult.buffer;\n const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;\n const updatedContinuationRanges = parallelResult.updatedContinuationRanges;\n const orderByItems = parallelResult.orderByItems;\n\n const initialOffset = this.offset;\n const initialLimit = this.limit;\n\n const filteredOrderByItems: any[] = [];\n let itemIndex = 0;\n\n for (const item of dataToProcess) {\n if (this.offset > 0) {\n this.offset--;\n // Skip this item AND its corresponding orderByItems entry\n } else if (this.limit > 0) {\n buffer.push(item);\n // Include the corresponding orderByItems entry\n if (orderByItems && itemIndex < orderByItems.length) {\n filteredOrderByItems.push(orderByItems[itemIndex]);\n }\n this.limit--;\n }\n itemIndex++;\n }\n\n // Process offset/limit logic and update partition key range map\n // Note: Pass initial offset/limit values (not current state) to calculateOffsetLimitForPartitionRanges\n // This function updates partition metadata while the loop above processes actual data items\n const updatedPartitionKeyRangeMap = calculateOffsetLimitForPartitionRanges(\n partitionKeyRangeMap,\n initialOffset,\n initialLimit,\n );\n\n // Return in the new structure format using the utility function\n const result = createParallelQueryResult(\n buffer,\n updatedPartitionKeyRangeMap,\n updatedContinuationRanges,\n filteredOrderByItems.length > 0 ? filteredOrderByItems : undefined,\n );\n\n return {\n result,\n headers: aggregateHeaders,\n };\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ export declare class OrderByEndpointComponent implements ExecutionContext {
|
|
|
10
10
|
* result it returns 'payload' item of the result
|
|
11
11
|
*
|
|
12
12
|
* @param executionContext - Underlying Execution Context
|
|
13
|
+
* @param emitRawOrderByPayload - Whether to emit raw order by payload
|
|
13
14
|
* @hidden
|
|
14
15
|
*/
|
|
15
16
|
constructor(executionContext: ExecutionContext, emitRawOrderByPayload?: boolean);
|
package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"OrderByEndpointComponent.d.ts","sourceRoot":"","sources":["../../../../src/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,cAAc;AACd,qBAAa,wBAAyB,YAAW,gBAAgB;IAU7D,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,qBAAqB;IAV/B;;;;;;;OAOG;gBAEO,gBAAgB,EAAE,gBAAgB,EAClC,qBAAqB,GAAE,OAAe;IAEhD;;;OAGG;IACI,cAAc,IAAI,OAAO;IAInB,SAAS,CAAC,cAAc,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAgDxF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrderByEndpointComponent = void 0;
|
|
4
|
+
const parallelQueryResult_js_1 = require("../parallelQueryResult.js");
|
|
4
5
|
/** @hidden */
|
|
5
6
|
class OrderByEndpointComponent {
|
|
6
7
|
executionContext;
|
|
@@ -10,6 +11,7 @@ class OrderByEndpointComponent {
|
|
|
10
11
|
* result it returns 'payload' item of the result
|
|
11
12
|
*
|
|
12
13
|
* @param executionContext - Underlying Execution Context
|
|
14
|
+
* @param emitRawOrderByPayload - Whether to emit raw order by payload
|
|
13
15
|
* @hidden
|
|
14
16
|
*/
|
|
15
17
|
constructor(executionContext, emitRawOrderByPayload = false) {
|
|
@@ -25,19 +27,35 @@ class OrderByEndpointComponent {
|
|
|
25
27
|
}
|
|
26
28
|
async fetchMore(diagnosticNode) {
|
|
27
29
|
const buffer = [];
|
|
30
|
+
const orderByItemsArray = []; // Store order by items for each item
|
|
28
31
|
const response = await this.executionContext.fetchMore(diagnosticNode);
|
|
29
|
-
if (response
|
|
30
|
-
|
|
32
|
+
if (!response ||
|
|
33
|
+
!response.result ||
|
|
34
|
+
!Array.isArray(response.result.buffer) ||
|
|
35
|
+
response.result.buffer.length === 0) {
|
|
36
|
+
// Preserve the partitionKeyRangeMap and updatedContinuationRanges from the original response
|
|
37
|
+
// even when the buffer is empty, as they contain continuation token information
|
|
38
|
+
const originalResult = response?.result;
|
|
39
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], originalResult?.partitionKeyRangeMap || new Map(), originalResult?.updatedContinuationRanges || {}, []);
|
|
40
|
+
return { result, headers: response?.headers };
|
|
31
41
|
}
|
|
32
|
-
|
|
42
|
+
const parallelResult = response.result;
|
|
43
|
+
const rawBuffer = parallelResult.buffer;
|
|
44
|
+
const partitionKeyRangeMap = parallelResult.partitionKeyRangeMap;
|
|
45
|
+
const updatedContinuationRanges = parallelResult.updatedContinuationRanges;
|
|
46
|
+
// Process buffer items and collect order by items for each item
|
|
47
|
+
for (let i = 0; i < rawBuffer.length; i++) {
|
|
48
|
+
const item = rawBuffer[i];
|
|
33
49
|
if (this.emitRawOrderByPayload) {
|
|
34
50
|
buffer.push(item);
|
|
35
51
|
}
|
|
36
52
|
else {
|
|
37
53
|
buffer.push(item.payload);
|
|
38
54
|
}
|
|
55
|
+
orderByItemsArray.push({ orderByItems: item.orderByItems, _rid: item._rid });
|
|
39
56
|
}
|
|
40
|
-
|
|
57
|
+
const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(buffer, partitionKeyRangeMap, updatedContinuationRanges, orderByItemsArray);
|
|
58
|
+
return { result, headers: response.headers };
|
|
41
59
|
}
|
|
42
60
|
}
|
|
43
61
|
exports.OrderByEndpointComponent = OrderByEndpointComponent;
|