@azure/cosmos 4.9.1 → 4.9.2

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.
Files changed (1282) hide show
  1. package/dist/browser/PartitionKeyRangeFailoverInfo.d.ts +1 -1
  2. package/dist/browser/PartitionKeyRangeFailoverInfo.d.ts.map +1 -1
  3. package/dist/browser/PartitionKeyRangeFailoverInfo.js +0 -2
  4. package/dist/browser/PartitionKeyRangeFailoverInfo.js.map +1 -1
  5. package/dist/browser/bulk/index.d.ts +1 -1
  6. package/dist/browser/bulk/index.d.ts.map +1 -1
  7. package/dist/browser/bulk/index.js.map +1 -1
  8. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts +2 -2
  9. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  10. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  11. package/dist/browser/client/ChangeFeed/buildChangeFeedIterator.js.map +1 -1
  12. package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts +4 -4
  13. package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  14. package/dist/browser/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  15. package/dist/browser/client/ChangeFeed/index.d.ts +2 -2
  16. package/dist/browser/client/ChangeFeed/index.d.ts.map +1 -1
  17. package/dist/browser/client/ChangeFeed/index.js.map +1 -1
  18. package/dist/browser/client/ClientUtils.d.ts +1 -1
  19. package/dist/browser/client/ClientUtils.d.ts.map +1 -1
  20. package/dist/browser/client/ClientUtils.js.map +1 -1
  21. package/dist/browser/client/Conflict/index.d.ts +2 -2
  22. package/dist/browser/client/Conflict/index.d.ts.map +1 -1
  23. package/dist/browser/client/Conflict/index.js.map +1 -1
  24. package/dist/browser/client/Container/ContainerDefinition.d.ts +1 -1
  25. package/dist/browser/client/Container/ContainerDefinition.d.ts.map +1 -1
  26. package/dist/browser/client/Container/ContainerDefinition.js.map +1 -1
  27. package/dist/browser/client/Container/index.d.ts +4 -4
  28. package/dist/browser/client/Container/index.d.ts.map +1 -1
  29. package/dist/browser/client/Container/index.js.map +1 -1
  30. package/dist/browser/client/Database/index.d.ts +2 -2
  31. package/dist/browser/client/Database/index.d.ts.map +1 -1
  32. package/dist/browser/client/Database/index.js.map +1 -1
  33. package/dist/browser/client/Item/Items.d.ts.map +1 -1
  34. package/dist/browser/client/Item/Items.js.map +1 -1
  35. package/dist/browser/client/Item/index.d.ts +1 -1
  36. package/dist/browser/client/Item/index.d.ts.map +1 -1
  37. package/dist/browser/client/Item/index.js.map +1 -1
  38. package/dist/browser/client/Offer/index.d.ts +1 -1
  39. package/dist/browser/client/Offer/index.d.ts.map +1 -1
  40. package/dist/browser/client/Offer/index.js.map +1 -1
  41. package/dist/browser/client/Permission/index.d.ts +2 -2
  42. package/dist/browser/client/Permission/index.d.ts.map +1 -1
  43. package/dist/browser/client/Permission/index.js.map +1 -1
  44. package/dist/browser/client/StoredProcedure/index.d.ts +1 -1
  45. package/dist/browser/client/StoredProcedure/index.d.ts.map +1 -1
  46. package/dist/browser/client/StoredProcedure/index.js.map +1 -1
  47. package/dist/browser/client/Trigger/index.d.ts +1 -1
  48. package/dist/browser/client/Trigger/index.d.ts.map +1 -1
  49. package/dist/browser/client/Trigger/index.js.map +1 -1
  50. package/dist/browser/client/User/index.d.ts +1 -1
  51. package/dist/browser/client/User/index.d.ts.map +1 -1
  52. package/dist/browser/client/User/index.js.map +1 -1
  53. package/dist/browser/client/UserDefinedFunction/index.d.ts +1 -1
  54. package/dist/browser/client/UserDefinedFunction/index.d.ts.map +1 -1
  55. package/dist/browser/client/UserDefinedFunction/index.js.map +1 -1
  56. package/dist/browser/client/index.d.ts +1 -1
  57. package/dist/browser/client/index.d.ts.map +1 -1
  58. package/dist/browser/client/index.js +0 -1
  59. package/dist/browser/client/index.js.map +1 -1
  60. package/dist/browser/common/constants.js +1 -1
  61. package/dist/browser/common/constants.js.map +1 -1
  62. package/dist/browser/common/helper.d.ts +4 -4
  63. package/dist/browser/common/helper.d.ts.map +1 -1
  64. package/dist/browser/common/helper.js.map +1 -1
  65. package/dist/browser/common/platform.d.ts +1 -1
  66. package/dist/browser/common/platform.d.ts.map +1 -1
  67. package/dist/browser/common/platform.js.map +1 -1
  68. package/dist/browser/diagnostics/DiagnosticNodeInternal.d.ts +1 -1
  69. package/dist/browser/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  70. package/dist/browser/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  71. package/dist/browser/documents/index.d.ts +4 -4
  72. package/dist/browser/documents/index.d.ts.map +1 -1
  73. package/dist/browser/documents/index.js +0 -4
  74. package/dist/browser/documents/index.js.map +1 -1
  75. package/dist/browser/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts +6 -2
  76. package/dist/browser/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts.map +1 -0
  77. package/dist/browser/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -3
  78. package/dist/browser/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -0
  79. package/dist/browser/encryption/Cache/ProtectedDataEncryptionKeyCache.d.ts +5 -1
  80. package/dist/browser/encryption/Cache/ProtectedDataEncryptionKeyCache.d.ts.map +1 -0
  81. package/dist/browser/encryption/Cache/ProtectedDataEncryptionKeyCache.js +5 -2
  82. package/dist/browser/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -0
  83. package/dist/browser/encryption/ClientEncryptionIncludedPath.d.ts +1 -1
  84. package/dist/browser/encryption/ClientEncryptionIncludedPath.d.ts.map +1 -1
  85. package/dist/browser/encryption/ClientEncryptionIncludedPath.js.map +1 -1
  86. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts +4 -4
  87. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts.map +1 -1
  88. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  89. package/dist/browser/encryption/ClientEncryptionKey/index.d.ts +2 -2
  90. package/dist/browser/encryption/ClientEncryptionKey/index.d.ts.map +1 -1
  91. package/dist/browser/encryption/ClientEncryptionKey/index.js.map +1 -1
  92. package/dist/browser/encryption/EncryptionKey/DataEncryptionKey.d.ts +6 -1
  93. package/dist/browser/encryption/EncryptionKey/DataEncryptionKey.d.ts.map +1 -0
  94. package/dist/browser/encryption/EncryptionKey/DataEncryptionKey.js +8 -2
  95. package/dist/browser/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -0
  96. package/dist/browser/encryption/EncryptionKeyResolver/index.d.ts +1 -1
  97. package/dist/browser/encryption/EncryptionKeyResolver/index.d.ts.map +1 -1
  98. package/dist/browser/encryption/EncryptionKeyResolver/index.js.map +1 -1
  99. package/dist/browser/encryption/EncryptionQueryBuilder.d.ts +2 -2
  100. package/dist/browser/encryption/EncryptionQueryBuilder.d.ts.map +1 -1
  101. package/dist/browser/encryption/EncryptionQueryBuilder.js.map +1 -1
  102. package/dist/browser/encryption/Serializers/BooleanSerializer.d.ts +1 -1
  103. package/dist/browser/encryption/Serializers/BooleanSerializer.d.ts.map +1 -1
  104. package/dist/browser/encryption/Serializers/BooleanSerializer.js.map +1 -1
  105. package/dist/browser/encryption/Serializers/FloatSerializer.d.ts +1 -1
  106. package/dist/browser/encryption/Serializers/FloatSerializer.d.ts.map +1 -1
  107. package/dist/browser/encryption/Serializers/FloatSerializer.js.map +1 -1
  108. package/dist/browser/encryption/Serializers/StringSerializer.d.ts +1 -1
  109. package/dist/browser/encryption/Serializers/StringSerializer.d.ts.map +1 -1
  110. package/dist/browser/encryption/Serializers/StringSerializer.js.map +1 -1
  111. package/dist/browser/encryption/Serializers/index.d.ts +1 -1
  112. package/dist/browser/encryption/Serializers/index.d.ts.map +1 -1
  113. package/dist/browser/encryption/Serializers/index.js.map +1 -1
  114. package/dist/browser/encryption/index.d.ts +5 -5
  115. package/dist/browser/encryption/index.d.ts.map +1 -1
  116. package/dist/browser/encryption/index.js.map +1 -1
  117. package/dist/browser/globalPartitionEndpointManager.d.ts +2 -1
  118. package/dist/browser/globalPartitionEndpointManager.d.ts.map +1 -1
  119. package/dist/browser/globalPartitionEndpointManager.js.map +1 -1
  120. package/dist/browser/index.d.ts +16 -16
  121. package/dist/browser/index.d.ts.map +1 -1
  122. package/dist/browser/index.js +1 -1
  123. package/dist/browser/index.js.map +1 -1
  124. package/dist/browser/queryExecutionContext/Aggregators/index.d.ts +1 -1
  125. package/dist/browser/queryExecutionContext/Aggregators/index.d.ts.map +1 -1
  126. package/dist/browser/queryExecutionContext/Aggregators/index.js.map +1 -1
  127. package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +26 -18
  128. package/dist/browser/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -1
  129. package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +48 -25
  130. package/dist/browser/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -1
  131. package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +17 -26
  132. package/dist/browser/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -1
  133. package/dist/browser/queryExecutionContext/PartitionRangeManager.d.ts +8 -7
  134. package/dist/browser/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -1
  135. package/dist/browser/queryExecutionContext/PartitionRangeManager.js +13 -12
  136. package/dist/browser/queryExecutionContext/PartitionRangeManager.js.map +1 -1
  137. package/dist/browser/queryExecutionContext/index.d.ts +2 -2
  138. package/dist/browser/queryExecutionContext/index.d.ts.map +1 -1
  139. package/dist/browser/queryExecutionContext/index.js +0 -2
  140. package/dist/browser/queryExecutionContext/index.js.map +1 -1
  141. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +1 -1
  142. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
  143. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  144. package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +0 -4
  145. package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -1
  146. package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +2 -10
  147. package/dist/browser/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -1
  148. package/dist/browser/request/defaultAgent.d.ts +1 -1
  149. package/dist/browser/request/defaultAgent.d.ts.map +1 -0
  150. package/dist/browser/request/defaultAgent.js +1 -1
  151. package/dist/browser/request/defaultAgent.js.map +1 -0
  152. package/dist/browser/request/hybridSearchQueryResult.d.ts +1 -1
  153. package/dist/browser/request/hybridSearchQueryResult.d.ts.map +1 -1
  154. package/dist/browser/request/hybridSearchQueryResult.js.map +1 -1
  155. package/dist/browser/request/index.d.ts +8 -8
  156. package/dist/browser/request/index.d.ts.map +1 -1
  157. package/dist/browser/request/index.js +0 -1
  158. package/dist/browser/request/index.js.map +1 -1
  159. package/dist/browser/retry/endpointDiscoveryRetryPolicy.d.ts +1 -1
  160. package/dist/browser/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
  161. package/dist/browser/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  162. package/dist/browser/retry/index.d.ts +1 -1
  163. package/dist/browser/retry/index.d.ts.map +1 -1
  164. package/dist/browser/retry/index.js +0 -3
  165. package/dist/browser/retry/index.js.map +1 -1
  166. package/dist/browser/retry/timeoutFailoverRetryPolicy.d.ts +1 -1
  167. package/dist/browser/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  168. package/dist/browser/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  169. package/dist/browser/utils/atob.d.ts +1 -1
  170. package/dist/browser/utils/atob.d.ts.map +1 -0
  171. package/dist/browser/utils/atob.js +1 -1
  172. package/dist/browser/utils/atob.js.map +1 -0
  173. package/dist/browser/utils/digest.d.ts +1 -1
  174. package/dist/browser/utils/digest.d.ts.map +1 -0
  175. package/dist/browser/utils/digest.js +1 -1
  176. package/dist/browser/utils/digest.js.map +1 -0
  177. package/dist/browser/utils/envUtils.d.ts +1 -1
  178. package/dist/browser/utils/envUtils.d.ts.map +1 -0
  179. package/dist/browser/utils/envUtils.js +1 -1
  180. package/dist/browser/utils/envUtils.js.map +1 -0
  181. package/dist/browser/utils/hashing/hash.d.ts +1 -1
  182. package/dist/browser/utils/hashing/hash.d.ts.map +1 -1
  183. package/dist/browser/utils/hashing/hash.js.map +1 -1
  184. package/dist/browser/utils/hmac.d.ts +1 -1
  185. package/dist/browser/utils/hmac.d.ts.map +1 -0
  186. package/dist/browser/utils/hmac.js +1 -1
  187. package/dist/browser/utils/hmac.js.map +1 -0
  188. package/dist/commonjs/ChangeFeedIterator.js +125 -110
  189. package/dist/commonjs/ChangeFeedIterator.js.map +7 -1
  190. package/dist/commonjs/ChangeFeedOptions.js +15 -3
  191. package/dist/commonjs/ChangeFeedOptions.js.map +7 -1
  192. package/dist/commonjs/ChangeFeedResponse.js +80 -78
  193. package/dist/commonjs/ChangeFeedResponse.js.map +7 -1
  194. package/dist/commonjs/ClientContext.js +867 -761
  195. package/dist/commonjs/ClientContext.js.map +7 -1
  196. package/dist/commonjs/CosmosClient.js +293 -286
  197. package/dist/commonjs/CosmosClient.js.map +7 -1
  198. package/dist/commonjs/CosmosClientOptions.js +15 -3
  199. package/dist/commonjs/CosmosClientOptions.js.map +7 -1
  200. package/dist/commonjs/CosmosDiagnostics.js +51 -55
  201. package/dist/commonjs/CosmosDiagnostics.js.map +7 -1
  202. package/dist/commonjs/GlobalEndpointManagerOptions.js +15 -3
  203. package/dist/commonjs/GlobalEndpointManagerOptions.js.map +7 -1
  204. package/dist/commonjs/PartitionKeyRangeFailoverInfo.d.ts +1 -1
  205. package/dist/commonjs/PartitionKeyRangeFailoverInfo.d.ts.map +1 -1
  206. package/dist/commonjs/PartitionKeyRangeFailoverInfo.js +148 -134
  207. package/dist/commonjs/PartitionKeyRangeFailoverInfo.js.map +7 -1
  208. package/dist/commonjs/auth.js +91 -84
  209. package/dist/commonjs/auth.js.map +7 -1
  210. package/dist/commonjs/bulk/Batcher.js +177 -149
  211. package/dist/commonjs/bulk/Batcher.js.map +7 -1
  212. package/dist/commonjs/bulk/BulkHelper.js +320 -289
  213. package/dist/commonjs/bulk/BulkHelper.js.map +7 -1
  214. package/dist/commonjs/bulk/BulkResponse.js +140 -118
  215. package/dist/commonjs/bulk/BulkResponse.js.map +7 -1
  216. package/dist/commonjs/bulk/CongestionAlgorithm.js +71 -66
  217. package/dist/commonjs/bulk/CongestionAlgorithm.js.map +7 -1
  218. package/dist/commonjs/bulk/HelperPerPartition.js +167 -130
  219. package/dist/commonjs/bulk/HelperPerPartition.js.map +7 -1
  220. package/dist/commonjs/bulk/ItemOperation.js +15 -5
  221. package/dist/commonjs/bulk/ItemOperation.js.map +7 -1
  222. package/dist/commonjs/bulk/ItemOperationContext.js +53 -38
  223. package/dist/commonjs/bulk/ItemOperationContext.js.map +7 -1
  224. package/dist/commonjs/bulk/Limiter.js +198 -212
  225. package/dist/commonjs/bulk/Limiter.js.map +7 -1
  226. package/dist/commonjs/bulk/PartitionMetric.js +58 -35
  227. package/dist/commonjs/bulk/PartitionMetric.js.map +7 -1
  228. package/dist/commonjs/bulk/index.d.ts +1 -1
  229. package/dist/commonjs/bulk/index.d.ts.map +1 -1
  230. package/dist/commonjs/bulk/index.js +30 -10
  231. package/dist/commonjs/bulk/index.js.map +7 -1
  232. package/dist/commonjs/client/ChangeFeed/ChangeFeedEnums.js +31 -14
  233. package/dist/commonjs/client/ChangeFeed/ChangeFeedEnums.js.map +7 -1
  234. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js +374 -327
  235. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js.map +7 -1
  236. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts +2 -2
  237. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  238. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js +180 -146
  239. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +7 -1
  240. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorBuilder.js +78 -63
  241. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +7 -1
  242. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.js +15 -5
  243. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +7 -1
  244. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorResponse.js +67 -78
  245. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +7 -1
  246. package/dist/commonjs/client/ChangeFeed/ChangeFeedMode.js +31 -11
  247. package/dist/commonjs/client/ChangeFeed/ChangeFeedMode.js.map +7 -1
  248. package/dist/commonjs/client/ChangeFeed/ChangeFeedPolicy.js +30 -12
  249. package/dist/commonjs/client/ChangeFeed/ChangeFeedPolicy.js.map +7 -1
  250. package/dist/commonjs/client/ChangeFeed/ChangeFeedPullModelIterator.js +15 -3
  251. package/dist/commonjs/client/ChangeFeed/ChangeFeedPullModelIterator.js.map +7 -1
  252. package/dist/commonjs/client/ChangeFeed/ChangeFeedRange.js +53 -38
  253. package/dist/commonjs/client/ChangeFeed/ChangeFeedRange.js.map +7 -1
  254. package/dist/commonjs/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +52 -36
  255. package/dist/commonjs/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +7 -1
  256. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFrom.js +70 -54
  257. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFrom.js.map +7 -1
  258. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromBeginning.js +33 -16
  259. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +7 -1
  260. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromContinuation.js +47 -38
  261. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +7 -1
  262. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromNow.js +33 -18
  263. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromNow.js.map +7 -1
  264. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromTime.js +38 -21
  265. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromTime.js.map +7 -1
  266. package/dist/commonjs/client/ChangeFeed/CompositeContinuationToken.js +38 -21
  267. package/dist/commonjs/client/ChangeFeed/CompositeContinuationToken.js.map +7 -1
  268. package/dist/commonjs/client/ChangeFeed/ContinuationTokenForPartitionKey.js +43 -26
  269. package/dist/commonjs/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +7 -1
  270. package/dist/commonjs/client/ChangeFeed/FeedRange.js +50 -38
  271. package/dist/commonjs/client/ChangeFeed/FeedRange.js.map +7 -1
  272. package/dist/commonjs/client/ChangeFeed/FeedRangeQueue.js +68 -49
  273. package/dist/commonjs/client/ChangeFeed/FeedRangeQueue.js.map +7 -1
  274. package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.js +15 -5
  275. package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.js.map +7 -1
  276. package/dist/commonjs/client/ChangeFeed/buildChangeFeedIterator.js +143 -71
  277. package/dist/commonjs/client/ChangeFeed/buildChangeFeedIterator.js.map +7 -1
  278. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts +4 -4
  279. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  280. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js +160 -188
  281. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js.map +7 -1
  282. package/dist/commonjs/client/ChangeFeed/index.d.ts +2 -2
  283. package/dist/commonjs/client/ChangeFeed/index.d.ts.map +1 -1
  284. package/dist/commonjs/client/ChangeFeed/index.js +59 -29
  285. package/dist/commonjs/client/ChangeFeed/index.js.map +7 -1
  286. package/dist/commonjs/client/ClientUtils.d.ts +1 -1
  287. package/dist/commonjs/client/ClientUtils.d.ts.map +1 -1
  288. package/dist/commonjs/client/ClientUtils.js +42 -16
  289. package/dist/commonjs/client/ClientUtils.js.map +7 -1
  290. package/dist/commonjs/client/Conflict/Conflict.js +127 -100
  291. package/dist/commonjs/client/Conflict/Conflict.js.map +7 -1
  292. package/dist/commonjs/client/Conflict/ConflictDefinition.js +15 -3
  293. package/dist/commonjs/client/Conflict/ConflictDefinition.js.map +7 -1
  294. package/dist/commonjs/client/Conflict/ConflictResolutionMode.js +31 -11
  295. package/dist/commonjs/client/Conflict/ConflictResolutionMode.js.map +7 -1
  296. package/dist/commonjs/client/Conflict/ConflictResolutionPolicy.js +15 -3
  297. package/dist/commonjs/client/Conflict/ConflictResolutionPolicy.js.map +7 -1
  298. package/dist/commonjs/client/Conflict/ConflictResponse.js +34 -13
  299. package/dist/commonjs/client/Conflict/ConflictResponse.js.map +7 -1
  300. package/dist/commonjs/client/Conflict/Conflicts.js +70 -51
  301. package/dist/commonjs/client/Conflict/Conflicts.js.map +7 -1
  302. package/dist/commonjs/client/Conflict/index.d.ts +2 -2
  303. package/dist/commonjs/client/Conflict/index.d.ts.map +1 -1
  304. package/dist/commonjs/client/Conflict/index.js +36 -14
  305. package/dist/commonjs/client/Conflict/index.js.map +7 -1
  306. package/dist/commonjs/client/Container/Container.js +664 -599
  307. package/dist/commonjs/client/Container/Container.js.map +7 -1
  308. package/dist/commonjs/client/Container/ContainerDefinition.d.ts +1 -1
  309. package/dist/commonjs/client/Container/ContainerDefinition.d.ts.map +1 -1
  310. package/dist/commonjs/client/Container/ContainerDefinition.js +15 -3
  311. package/dist/commonjs/client/Container/ContainerDefinition.js.map +7 -1
  312. package/dist/commonjs/client/Container/ContainerRequest.js +15 -3
  313. package/dist/commonjs/client/Container/ContainerRequest.js.map +7 -1
  314. package/dist/commonjs/client/Container/ContainerResponse.js +34 -14
  315. package/dist/commonjs/client/Container/ContainerResponse.js.map +7 -1
  316. package/dist/commonjs/client/Container/Containers.js +232 -218
  317. package/dist/commonjs/client/Container/Containers.js.map +7 -1
  318. package/dist/commonjs/client/Container/PartitionKeyRange.js +15 -3
  319. package/dist/commonjs/client/Container/PartitionKeyRange.js.map +7 -1
  320. package/dist/commonjs/client/Container/UniqueKeyPolicy.js +15 -3
  321. package/dist/commonjs/client/Container/UniqueKeyPolicy.js.map +7 -1
  322. package/dist/commonjs/client/Container/index.d.ts +4 -4
  323. package/dist/commonjs/client/Container/index.d.ts.map +1 -1
  324. package/dist/commonjs/client/Container/index.js +33 -12
  325. package/dist/commonjs/client/Container/index.js.map +7 -1
  326. package/dist/commonjs/client/Database/Database.js +528 -448
  327. package/dist/commonjs/client/Database/Database.js.map +7 -1
  328. package/dist/commonjs/client/Database/DatabaseDefinition.js +15 -3
  329. package/dist/commonjs/client/Database/DatabaseDefinition.js.map +7 -1
  330. package/dist/commonjs/client/Database/DatabaseRequest.js +15 -3
  331. package/dist/commonjs/client/Database/DatabaseRequest.js.map +7 -1
  332. package/dist/commonjs/client/Database/DatabaseResponse.js +34 -14
  333. package/dist/commonjs/client/Database/DatabaseResponse.js.map +7 -1
  334. package/dist/commonjs/client/Database/Databases.js +197 -188
  335. package/dist/commonjs/client/Database/Databases.js.map +7 -1
  336. package/dist/commonjs/client/Database/index.d.ts +2 -2
  337. package/dist/commonjs/client/Database/index.d.ts.map +1 -1
  338. package/dist/commonjs/client/Database/index.js +33 -12
  339. package/dist/commonjs/client/Database/index.js.map +7 -1
  340. package/dist/commonjs/client/Item/Item.js +506 -383
  341. package/dist/commonjs/client/Item/Item.js.map +7 -1
  342. package/dist/commonjs/client/Item/ItemDefinition.js +15 -5
  343. package/dist/commonjs/client/Item/ItemDefinition.js.map +7 -1
  344. package/dist/commonjs/client/Item/ItemResponse.js +34 -13
  345. package/dist/commonjs/client/Item/ItemResponse.js.map +7 -1
  346. package/dist/commonjs/client/Item/Items.d.ts.map +1 -1
  347. package/dist/commonjs/client/Item/Items.js +888 -717
  348. package/dist/commonjs/client/Item/Items.js.map +7 -1
  349. package/dist/commonjs/client/Item/index.d.ts +1 -1
  350. package/dist/commonjs/client/Item/index.d.ts.map +1 -1
  351. package/dist/commonjs/client/Item/index.js +33 -12
  352. package/dist/commonjs/client/Item/index.js.map +7 -1
  353. package/dist/commonjs/client/Offer/Offer.js +115 -90
  354. package/dist/commonjs/client/Offer/Offer.js.map +7 -1
  355. package/dist/commonjs/client/Offer/OfferDefinition.js +15 -3
  356. package/dist/commonjs/client/Offer/OfferDefinition.js.map +7 -1
  357. package/dist/commonjs/client/Offer/OfferResponse.js +34 -13
  358. package/dist/commonjs/client/Offer/OfferResponse.js.map +7 -1
  359. package/dist/commonjs/client/Offer/Offers.js +65 -51
  360. package/dist/commonjs/client/Offer/Offers.js.map +7 -1
  361. package/dist/commonjs/client/Offer/index.d.ts +1 -1
  362. package/dist/commonjs/client/Offer/index.d.ts.map +1 -1
  363. package/dist/commonjs/client/Offer/index.js +33 -12
  364. package/dist/commonjs/client/Offer/index.js.map +7 -1
  365. package/dist/commonjs/client/Permission/Permission.js +158 -127
  366. package/dist/commonjs/client/Permission/Permission.js.map +7 -1
  367. package/dist/commonjs/client/Permission/PermissionBody.js +15 -3
  368. package/dist/commonjs/client/Permission/PermissionBody.js.map +7 -1
  369. package/dist/commonjs/client/Permission/PermissionDefinition.js +15 -3
  370. package/dist/commonjs/client/Permission/PermissionDefinition.js.map +7 -1
  371. package/dist/commonjs/client/Permission/PermissionResponse.js +34 -13
  372. package/dist/commonjs/client/Permission/PermissionResponse.js.map +7 -1
  373. package/dist/commonjs/client/Permission/Permissions.js +170 -144
  374. package/dist/commonjs/client/Permission/Permissions.js.map +7 -1
  375. package/dist/commonjs/client/Permission/index.d.ts +2 -2
  376. package/dist/commonjs/client/Permission/index.d.ts.map +1 -1
  377. package/dist/commonjs/client/Permission/index.js +33 -12
  378. package/dist/commonjs/client/Permission/index.js.map +7 -1
  379. package/dist/commonjs/client/Resource.js +15 -3
  380. package/dist/commonjs/client/Resource.js.map +7 -1
  381. package/dist/commonjs/client/SasToken/PermissionScopeValues.js +91 -80
  382. package/dist/commonjs/client/SasToken/PermissionScopeValues.js.map +7 -1
  383. package/dist/commonjs/client/SasToken/SasTokenProperties.js +43 -24
  384. package/dist/commonjs/client/SasToken/SasTokenProperties.js.map +7 -1
  385. package/dist/commonjs/client/Script/Scripts.js +97 -80
  386. package/dist/commonjs/client/Script/Scripts.js.map +7 -1
  387. package/dist/commonjs/client/StoredProcedure/StoredProcedure.js +224 -185
  388. package/dist/commonjs/client/StoredProcedure/StoredProcedure.js.map +7 -1
  389. package/dist/commonjs/client/StoredProcedure/StoredProcedureDefinition.js +15 -3
  390. package/dist/commonjs/client/StoredProcedure/StoredProcedureDefinition.js.map +7 -1
  391. package/dist/commonjs/client/StoredProcedure/StoredProcedureResponse.js +44 -23
  392. package/dist/commonjs/client/StoredProcedure/StoredProcedureResponse.js.map +7 -1
  393. package/dist/commonjs/client/StoredProcedure/StoredProcedures.js +131 -111
  394. package/dist/commonjs/client/StoredProcedure/StoredProcedures.js.map +7 -1
  395. package/dist/commonjs/client/StoredProcedure/index.d.ts +1 -1
  396. package/dist/commonjs/client/StoredProcedure/index.d.ts.map +1 -1
  397. package/dist/commonjs/client/StoredProcedure/index.js +33 -12
  398. package/dist/commonjs/client/StoredProcedure/index.js.map +7 -1
  399. package/dist/commonjs/client/Trigger/Trigger.js +169 -138
  400. package/dist/commonjs/client/Trigger/Trigger.js.map +7 -1
  401. package/dist/commonjs/client/Trigger/TriggerDefinition.js +15 -3
  402. package/dist/commonjs/client/Trigger/TriggerDefinition.js.map +7 -1
  403. package/dist/commonjs/client/Trigger/TriggerResponse.js +34 -13
  404. package/dist/commonjs/client/Trigger/TriggerResponse.js.map +7 -1
  405. package/dist/commonjs/client/Trigger/Triggers.js +130 -110
  406. package/dist/commonjs/client/Trigger/Triggers.js.map +7 -1
  407. package/dist/commonjs/client/Trigger/index.d.ts +1 -1
  408. package/dist/commonjs/client/Trigger/index.d.ts.map +1 -1
  409. package/dist/commonjs/client/Trigger/index.js +33 -12
  410. package/dist/commonjs/client/Trigger/index.js.map +7 -1
  411. package/dist/commonjs/client/User/User.js +170 -141
  412. package/dist/commonjs/client/User/User.js.map +7 -1
  413. package/dist/commonjs/client/User/UserDefinition.js +15 -3
  414. package/dist/commonjs/client/User/UserDefinition.js.map +7 -1
  415. package/dist/commonjs/client/User/UserResponse.js +34 -13
  416. package/dist/commonjs/client/User/UserResponse.js.map +7 -1
  417. package/dist/commonjs/client/User/Users.js +154 -128
  418. package/dist/commonjs/client/User/Users.js.map +7 -1
  419. package/dist/commonjs/client/User/index.d.ts +1 -1
  420. package/dist/commonjs/client/User/index.d.ts.map +1 -1
  421. package/dist/commonjs/client/User/index.js +33 -12
  422. package/dist/commonjs/client/User/index.js.map +7 -1
  423. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunction.js +168 -137
  424. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunction.js.map +7 -1
  425. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionDefinition.js +15 -3
  426. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionDefinition.js.map +7 -1
  427. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionResponse.js +42 -21
  428. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +7 -1
  429. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctions.js +127 -107
  430. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctions.js.map +7 -1
  431. package/dist/commonjs/client/UserDefinedFunction/index.d.ts +1 -1
  432. package/dist/commonjs/client/UserDefinedFunction/index.d.ts.map +1 -1
  433. package/dist/commonjs/client/UserDefinedFunction/index.js +33 -12
  434. package/dist/commonjs/client/UserDefinedFunction/index.js.map +7 -1
  435. package/dist/commonjs/client/index.d.ts +1 -1
  436. package/dist/commonjs/client/index.d.ts.map +1 -1
  437. package/dist/commonjs/client/index.js +41 -18
  438. package/dist/commonjs/client/index.js.map +7 -1
  439. package/dist/commonjs/common/constants.js +514 -500
  440. package/dist/commonjs/common/constants.js.map +7 -1
  441. package/dist/commonjs/common/helper.d.ts +4 -4
  442. package/dist/commonjs/common/helper.d.ts.map +1 -1
  443. package/dist/commonjs/common/helper.js +349 -412
  444. package/dist/commonjs/common/helper.js.map +7 -1
  445. package/dist/commonjs/common/index.js +27 -10
  446. package/dist/commonjs/common/index.js.map +7 -1
  447. package/dist/commonjs/common/logger.js +28 -9
  448. package/dist/commonjs/common/logger.js.map +7 -1
  449. package/dist/commonjs/common/partitionKeys.js +27 -7
  450. package/dist/commonjs/common/partitionKeys.js.map +7 -1
  451. package/dist/commonjs/common/platform.d.ts +1 -1
  452. package/dist/commonjs/common/platform.d.ts.map +1 -1
  453. package/dist/commonjs/common/platform.js +54 -42
  454. package/dist/commonjs/common/platform.js.map +7 -1
  455. package/dist/commonjs/common/statusCodes.js +76 -60
  456. package/dist/commonjs/common/statusCodes.js.map +7 -1
  457. package/dist/commonjs/common/uriFactory.js +79 -195
  458. package/dist/commonjs/common/uriFactory.js.map +7 -1
  459. package/dist/commonjs/diagnostics/CosmosDbDiagnosticLevel.js +32 -15
  460. package/dist/commonjs/diagnostics/CosmosDbDiagnosticLevel.js.map +7 -1
  461. package/dist/commonjs/diagnostics/CosmosDiagnosticsContext.js +145 -126
  462. package/dist/commonjs/diagnostics/CosmosDiagnosticsContext.js.map +7 -1
  463. package/dist/commonjs/diagnostics/DiagnosticFormatter.js +29 -10
  464. package/dist/commonjs/diagnostics/DiagnosticFormatter.js.map +7 -1
  465. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.d.ts +1 -1
  466. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  467. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js +316 -305
  468. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js.map +7 -1
  469. package/dist/commonjs/diagnostics/DiagnosticWriter.js +35 -25
  470. package/dist/commonjs/diagnostics/DiagnosticWriter.js.map +7 -1
  471. package/dist/commonjs/diagnostics/diagnosticLevelComparator.js +39 -24
  472. package/dist/commonjs/diagnostics/diagnosticLevelComparator.js.map +7 -1
  473. package/dist/commonjs/diagnostics/index.js +67 -34
  474. package/dist/commonjs/diagnostics/index.js.map +7 -1
  475. package/dist/commonjs/documents/ComputedProperty.js +15 -3
  476. package/dist/commonjs/documents/ComputedProperty.js.map +7 -1
  477. package/dist/commonjs/documents/ConnectionMode.js +30 -12
  478. package/dist/commonjs/documents/ConnectionMode.js.map +7 -1
  479. package/dist/commonjs/documents/ConnectionPolicy.js +43 -26
  480. package/dist/commonjs/documents/ConnectionPolicy.js.map +7 -1
  481. package/dist/commonjs/documents/ConsistencyLevel.js +34 -43
  482. package/dist/commonjs/documents/ConsistencyLevel.js.map +7 -1
  483. package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.js +76 -79
  484. package/dist/commonjs/documents/ContinuationToken/CompositeQueryContinuationToken.js.map +7 -1
  485. package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.js +48 -38
  486. package/dist/commonjs/documents/ContinuationToken/OrderByQueryContinuationToken.js.map +7 -1
  487. package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.js +15 -5
  488. package/dist/commonjs/documents/ContinuationToken/PartitionRangeUpdate.js.map +7 -1
  489. package/dist/commonjs/documents/DataType.js +35 -22
  490. package/dist/commonjs/documents/DataType.js.map +7 -1
  491. package/dist/commonjs/documents/DatabaseAccount.js +109 -100
  492. package/dist/commonjs/documents/DatabaseAccount.js.map +7 -1
  493. package/dist/commonjs/documents/Document.js +15 -3
  494. package/dist/commonjs/documents/Document.js.map +7 -1
  495. package/dist/commonjs/documents/FullTextPolicy.js +15 -5
  496. package/dist/commonjs/documents/FullTextPolicy.js.map +7 -1
  497. package/dist/commonjs/documents/GeospatialType.js +31 -13
  498. package/dist/commonjs/documents/GeospatialType.js.map +7 -1
  499. package/dist/commonjs/documents/IndexKind.js +31 -20
  500. package/dist/commonjs/documents/IndexKind.js.map +7 -1
  501. package/dist/commonjs/documents/IndexingMode.js +32 -27
  502. package/dist/commonjs/documents/IndexingMode.js.map +7 -1
  503. package/dist/commonjs/documents/IndexingPolicy.js +41 -30
  504. package/dist/commonjs/documents/IndexingPolicy.js.map +7 -1
  505. package/dist/commonjs/documents/PartitionKey.js +43 -27
  506. package/dist/commonjs/documents/PartitionKey.js.map +7 -1
  507. package/dist/commonjs/documents/PartitionKeyDefinition.js +15 -3
  508. package/dist/commonjs/documents/PartitionKeyDefinition.js.map +7 -1
  509. package/dist/commonjs/documents/PartitionKeyDefinitionVersion.js +31 -14
  510. package/dist/commonjs/documents/PartitionKeyDefinitionVersion.js.map +7 -1
  511. package/dist/commonjs/documents/PartitionKeyInternal.js +35 -28
  512. package/dist/commonjs/documents/PartitionKeyInternal.js.map +7 -1
  513. package/dist/commonjs/documents/PartitionKeyKind.js +31 -14
  514. package/dist/commonjs/documents/PartitionKeyKind.js.map +7 -1
  515. package/dist/commonjs/documents/PermissionMode.js +32 -18
  516. package/dist/commonjs/documents/PermissionMode.js.map +7 -1
  517. package/dist/commonjs/documents/PriorityLevel.js +31 -25
  518. package/dist/commonjs/documents/PriorityLevel.js.map +7 -1
  519. package/dist/commonjs/documents/TriggerOperation.js +34 -23
  520. package/dist/commonjs/documents/TriggerOperation.js.map +7 -1
  521. package/dist/commonjs/documents/TriggerType.js +31 -17
  522. package/dist/commonjs/documents/TriggerType.js.map +7 -1
  523. package/dist/commonjs/documents/UserDefinedFunctionType.js +30 -15
  524. package/dist/commonjs/documents/UserDefinedFunctionType.js.map +7 -1
  525. package/dist/commonjs/documents/VectorEmbeddingPolicy.js +41 -44
  526. package/dist/commonjs/documents/VectorEmbeddingPolicy.js.map +7 -1
  527. package/dist/commonjs/documents/index.d.ts +4 -4
  528. package/dist/commonjs/documents/index.d.ts.map +1 -1
  529. package/dist/commonjs/documents/index.js +57 -29
  530. package/dist/commonjs/documents/index.js.map +7 -1
  531. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts +1 -1
  532. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts.map +1 -1
  533. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +97 -71
  534. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +7 -1
  535. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/index.js +27 -8
  536. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/index.js.map +7 -1
  537. package/dist/commonjs/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +37 -23
  538. package/dist/commonjs/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +7 -1
  539. package/dist/commonjs/encryption/Cache/EncryptionSettingsCache.js +52 -36
  540. package/dist/commonjs/encryption/Cache/EncryptionSettingsCache.js.map +7 -1
  541. package/dist/commonjs/encryption/Cache/KeyEncryptionKeyCache.js +46 -32
  542. package/dist/commonjs/encryption/Cache/KeyEncryptionKeyCache.js.map +7 -1
  543. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.js +98 -86
  544. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +7 -1
  545. package/dist/commonjs/encryption/ClientEncryptionIncludedPath.d.ts +1 -1
  546. package/dist/commonjs/encryption/ClientEncryptionIncludedPath.d.ts.map +1 -1
  547. package/dist/commonjs/encryption/ClientEncryptionIncludedPath.js +15 -5
  548. package/dist/commonjs/encryption/ClientEncryptionIncludedPath.js.map +7 -1
  549. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyProperties.js +15 -5
  550. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyProperties.js.map +7 -1
  551. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyRequest.js +15 -5
  552. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyRequest.js.map +7 -1
  553. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts +4 -4
  554. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts.map +1 -1
  555. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +34 -16
  556. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +7 -1
  557. package/dist/commonjs/encryption/ClientEncryptionKey/index.d.ts +2 -2
  558. package/dist/commonjs/encryption/ClientEncryptionKey/index.d.ts.map +1 -1
  559. package/dist/commonjs/encryption/ClientEncryptionKey/index.js +27 -8
  560. package/dist/commonjs/encryption/ClientEncryptionKey/index.js.map +7 -1
  561. package/dist/commonjs/encryption/ClientEncryptionOptions.js +15 -5
  562. package/dist/commonjs/encryption/ClientEncryptionOptions.js.map +7 -1
  563. package/dist/commonjs/encryption/ClientEncryptionPolicy.js +15 -5
  564. package/dist/commonjs/encryption/ClientEncryptionPolicy.js.map +7 -1
  565. package/dist/commonjs/encryption/CosmosEncryptedNumber.js +31 -20
  566. package/dist/commonjs/encryption/CosmosEncryptedNumber.js.map +7 -1
  567. package/dist/commonjs/encryption/EncryptionItemQueryIterator.js +129 -106
  568. package/dist/commonjs/encryption/EncryptionItemQueryIterator.js.map +7 -1
  569. package/dist/commonjs/encryption/EncryptionKey/DataEncryptionKey.js +51 -32
  570. package/dist/commonjs/encryption/EncryptionKey/DataEncryptionKey.js.map +7 -1
  571. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +36 -23
  572. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +7 -1
  573. package/dist/commonjs/encryption/EncryptionKey/index.js +30 -10
  574. package/dist/commonjs/encryption/EncryptionKey/index.js.map +7 -1
  575. package/dist/commonjs/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +112 -94
  576. package/dist/commonjs/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +7 -1
  577. package/dist/commonjs/encryption/EncryptionKeyResolver/EncryptionKeyResolver.js +15 -5
  578. package/dist/commonjs/encryption/EncryptionKeyResolver/EncryptionKeyResolver.js.map +7 -1
  579. package/dist/commonjs/encryption/EncryptionKeyResolver/index.d.ts +1 -1
  580. package/dist/commonjs/encryption/EncryptionKeyResolver/index.d.ts.map +1 -1
  581. package/dist/commonjs/encryption/EncryptionKeyResolver/index.js +27 -8
  582. package/dist/commonjs/encryption/EncryptionKeyResolver/index.js.map +7 -1
  583. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.js +80 -55
  584. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.js.map +7 -1
  585. package/dist/commonjs/encryption/EncryptionKeyWrapMetadata.js +15 -5
  586. package/dist/commonjs/encryption/EncryptionKeyWrapMetadata.js.map +7 -1
  587. package/dist/commonjs/encryption/EncryptionManager.js +57 -42
  588. package/dist/commonjs/encryption/EncryptionManager.js.map +7 -1
  589. package/dist/commonjs/encryption/EncryptionProcessor.js +340 -284
  590. package/dist/commonjs/encryption/EncryptionProcessor.js.map +7 -1
  591. package/dist/commonjs/encryption/EncryptionQueryBuilder.d.ts +2 -2
  592. package/dist/commonjs/encryption/EncryptionQueryBuilder.d.ts.map +1 -1
  593. package/dist/commonjs/encryption/EncryptionQueryBuilder.js +109 -99
  594. package/dist/commonjs/encryption/EncryptionQueryBuilder.js.map +7 -1
  595. package/dist/commonjs/encryption/EncryptionSettingForProperty.js +64 -33
  596. package/dist/commonjs/encryption/EncryptionSettingForProperty.js.map +7 -1
  597. package/dist/commonjs/encryption/EncryptionSettings.js +45 -30
  598. package/dist/commonjs/encryption/EncryptionSettings.js.map +7 -1
  599. package/dist/commonjs/encryption/KeyEncryptionKey.js +51 -28
  600. package/dist/commonjs/encryption/KeyEncryptionKey.js.map +7 -1
  601. package/dist/commonjs/encryption/Serializers/BooleanSerializer.d.ts +1 -1
  602. package/dist/commonjs/encryption/Serializers/BooleanSerializer.d.ts.map +1 -1
  603. package/dist/commonjs/encryption/Serializers/BooleanSerializer.js +37 -18
  604. package/dist/commonjs/encryption/Serializers/BooleanSerializer.js.map +7 -1
  605. package/dist/commonjs/encryption/Serializers/FloatSerializer.d.ts +1 -1
  606. package/dist/commonjs/encryption/Serializers/FloatSerializer.d.ts.map +1 -1
  607. package/dist/commonjs/encryption/Serializers/FloatSerializer.js +39 -20
  608. package/dist/commonjs/encryption/Serializers/FloatSerializer.js.map +7 -1
  609. package/dist/commonjs/encryption/Serializers/NumberSerializer.js +38 -19
  610. package/dist/commonjs/encryption/Serializers/NumberSerializer.js.map +7 -1
  611. package/dist/commonjs/encryption/Serializers/Serializer.js +15 -5
  612. package/dist/commonjs/encryption/Serializers/Serializer.js.map +7 -1
  613. package/dist/commonjs/encryption/Serializers/StringSerializer.d.ts +1 -1
  614. package/dist/commonjs/encryption/Serializers/StringSerializer.d.ts.map +1 -1
  615. package/dist/commonjs/encryption/Serializers/StringSerializer.js +33 -14
  616. package/dist/commonjs/encryption/Serializers/StringSerializer.js.map +7 -1
  617. package/dist/commonjs/encryption/Serializers/index.d.ts +1 -1
  618. package/dist/commonjs/encryption/Serializers/index.d.ts.map +1 -1
  619. package/dist/commonjs/encryption/Serializers/index.js +36 -14
  620. package/dist/commonjs/encryption/Serializers/index.js.map +7 -1
  621. package/dist/commonjs/encryption/enums/EncryptionAlgorithm.js +30 -13
  622. package/dist/commonjs/encryption/enums/EncryptionAlgorithm.js.map +7 -1
  623. package/dist/commonjs/encryption/enums/EncryptionKeyResolverName.js +30 -12
  624. package/dist/commonjs/encryption/enums/EncryptionKeyResolverName.js.map +7 -1
  625. package/dist/commonjs/encryption/enums/EncryptionType.js +31 -16
  626. package/dist/commonjs/encryption/enums/EncryptionType.js.map +7 -1
  627. package/dist/commonjs/encryption/enums/KeyEncryptionAlgorithm.js +30 -12
  628. package/dist/commonjs/encryption/enums/KeyEncryptionAlgorithm.js.map +7 -1
  629. package/dist/commonjs/encryption/enums/TypeMarker.js +34 -14
  630. package/dist/commonjs/encryption/enums/TypeMarker.js.map +7 -1
  631. package/dist/commonjs/encryption/enums/index.js +36 -14
  632. package/dist/commonjs/encryption/enums/index.js.map +7 -1
  633. package/dist/commonjs/encryption/index.d.ts +5 -5
  634. package/dist/commonjs/encryption/index.d.ts.map +1 -1
  635. package/dist/commonjs/encryption/index.js +55 -26
  636. package/dist/commonjs/encryption/index.js.map +7 -1
  637. package/dist/commonjs/extractPartitionKey.js +92 -91
  638. package/dist/commonjs/extractPartitionKey.js.map +7 -1
  639. package/dist/commonjs/globalEndpointManager.js +364 -357
  640. package/dist/commonjs/globalEndpointManager.js.map +7 -1
  641. package/dist/commonjs/globalPartitionEndpointManager.d.ts +2 -1
  642. package/dist/commonjs/globalPartitionEndpointManager.d.ts.map +1 -1
  643. package/dist/commonjs/globalPartitionEndpointManager.js +322 -297
  644. package/dist/commonjs/globalPartitionEndpointManager.js.map +7 -1
  645. package/dist/commonjs/index.d.ts +16 -16
  646. package/dist/commonjs/index.d.ts.map +1 -1
  647. package/dist/commonjs/index.js +177 -96
  648. package/dist/commonjs/index.js.map +7 -1
  649. package/dist/commonjs/plugins/Plugin.js +50 -44
  650. package/dist/commonjs/plugins/Plugin.js.map +7 -1
  651. package/dist/commonjs/queryExecutionContext/Aggregators/Aggregator.js +15 -3
  652. package/dist/commonjs/queryExecutionContext/Aggregators/Aggregator.js.map +7 -1
  653. package/dist/commonjs/queryExecutionContext/Aggregators/AverageAggregator.js +49 -29
  654. package/dist/commonjs/queryExecutionContext/Aggregators/AverageAggregator.js.map +7 -1
  655. package/dist/commonjs/queryExecutionContext/Aggregators/CountAggregator.js +46 -26
  656. package/dist/commonjs/queryExecutionContext/Aggregators/CountAggregator.js.map +7 -1
  657. package/dist/commonjs/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +64 -54
  658. package/dist/commonjs/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +7 -1
  659. package/dist/commonjs/queryExecutionContext/Aggregators/MakeListAggregator.js +38 -18
  660. package/dist/commonjs/queryExecutionContext/Aggregators/MakeListAggregator.js.map +7 -1
  661. package/dist/commonjs/queryExecutionContext/Aggregators/MakeSetAggregator.js +46 -29
  662. package/dist/commonjs/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +7 -1
  663. package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js +54 -38
  664. package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js.map +7 -1
  665. package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js +58 -43
  666. package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js.map +7 -1
  667. package/dist/commonjs/queryExecutionContext/Aggregators/StaticValueAggregator.js +34 -14
  668. package/dist/commonjs/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +7 -1
  669. package/dist/commonjs/queryExecutionContext/Aggregators/SumAggregator.js +44 -25
  670. package/dist/commonjs/queryExecutionContext/Aggregators/SumAggregator.js.map +7 -1
  671. package/dist/commonjs/queryExecutionContext/Aggregators/index.d.ts +1 -1
  672. package/dist/commonjs/queryExecutionContext/Aggregators/index.d.ts.map +1 -1
  673. package/dist/commonjs/queryExecutionContext/Aggregators/index.js +63 -39
  674. package/dist/commonjs/queryExecutionContext/Aggregators/index.js.map +7 -1
  675. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +181 -166
  676. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +7 -1
  677. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js +45 -30
  678. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ContinuationTokenManagerFactory.js.map +7 -1
  679. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +146 -124
  680. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +7 -1
  681. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +70 -65
  682. package/dist/commonjs/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +7 -1
  683. package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.js +38 -24
  684. package/dist/commonjs/queryExecutionContext/ContinuationTokenParser.js.map +7 -1
  685. package/dist/commonjs/queryExecutionContext/CosmosHeaders.js +15 -3
  686. package/dist/commonjs/queryExecutionContext/CosmosHeaders.js.map +7 -1
  687. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +110 -107
  688. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +7 -1
  689. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +115 -107
  690. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +7 -1
  691. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +164 -155
  692. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +7 -1
  693. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +152 -143
  694. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +7 -1
  695. package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +81 -64
  696. package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +7 -1
  697. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +79 -58
  698. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +7 -1
  699. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +70 -48
  700. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +7 -1
  701. package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +59 -42
  702. package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +7 -1
  703. package/dist/commonjs/queryExecutionContext/EndpointComponent/emptyGroup.js +30 -13
  704. package/dist/commonjs/queryExecutionContext/EndpointComponent/emptyGroup.js.map +7 -1
  705. package/dist/commonjs/queryExecutionContext/ExecutionContext.js +15 -3
  706. package/dist/commonjs/queryExecutionContext/ExecutionContext.js.map +7 -1
  707. package/dist/commonjs/queryExecutionContext/FetchResult.js +55 -38
  708. package/dist/commonjs/queryExecutionContext/FetchResult.js.map +7 -1
  709. package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.js +59 -55
  710. package/dist/commonjs/queryExecutionContext/LegacyFetchImplementation.js.map +7 -1
  711. package/dist/commonjs/queryExecutionContext/PartitionRangeManager.d.ts +8 -7
  712. package/dist/commonjs/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -1
  713. package/dist/commonjs/queryExecutionContext/PartitionRangeManager.js +151 -155
  714. package/dist/commonjs/queryExecutionContext/PartitionRangeManager.js.map +7 -1
  715. package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.js +93 -102
  716. package/dist/commonjs/queryExecutionContext/PartitionRangeUtils.js.map +7 -1
  717. package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.js +110 -89
  718. package/dist/commonjs/queryExecutionContext/QueryControlFetchImplementation.js.map +7 -1
  719. package/dist/commonjs/queryExecutionContext/QueryValidationHelper.js +63 -66
  720. package/dist/commonjs/queryExecutionContext/QueryValidationHelper.js.map +7 -1
  721. package/dist/commonjs/queryExecutionContext/SqlQuerySpec.js +15 -3
  722. package/dist/commonjs/queryExecutionContext/SqlQuerySpec.js.map +7 -1
  723. package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js +219 -191
  724. package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js.map +7 -1
  725. package/dist/commonjs/queryExecutionContext/documentProducer.js +284 -276
  726. package/dist/commonjs/queryExecutionContext/documentProducer.js.map +7 -1
  727. package/dist/commonjs/queryExecutionContext/headerUtils.js +94 -89
  728. package/dist/commonjs/queryExecutionContext/headerUtils.js.map +7 -1
  729. package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js +491 -481
  730. package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js.map +7 -1
  731. package/dist/commonjs/queryExecutionContext/index.d.ts +2 -2
  732. package/dist/commonjs/queryExecutionContext/index.d.ts.map +1 -1
  733. package/dist/commonjs/queryExecutionContext/index.js +61 -29
  734. package/dist/commonjs/queryExecutionContext/index.js.map +7 -1
  735. package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResponse.js +15 -5
  736. package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResponse.js.map +7 -1
  737. package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.js +15 -5
  738. package/dist/commonjs/queryExecutionContext/nonStreamingOrderByResult.js.map +7 -1
  739. package/dist/commonjs/queryExecutionContext/orderByComparator.js +105 -113
  740. package/dist/commonjs/queryExecutionContext/orderByComparator.js.map +7 -1
  741. package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js +143 -134
  742. package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js.map +7 -1
  743. package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js +90 -61
  744. package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js.map +7 -1
  745. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.js +85 -68
  746. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContext.js.map +7 -1
  747. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +1 -1
  748. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
  749. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js +832 -788
  750. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js.map +7 -1
  751. package/dist/commonjs/queryExecutionContext/parallelQueryResult.js +35 -24
  752. package/dist/commonjs/queryExecutionContext/parallelQueryResult.js.map +7 -1
  753. package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js +278 -228
  754. package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js.map +7 -1
  755. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js +15 -5
  756. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/FilterStrategy.js.map +7 -1
  757. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js +261 -299
  758. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/OrderByQueryRangeStrategy.js.map +7 -1
  759. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +0 -4
  760. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -1
  761. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +93 -98
  762. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +7 -1
  763. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js +147 -177
  764. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/RidSkipCountFilter.js.map +7 -1
  765. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js +104 -92
  766. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeManager.js.map +7 -1
  767. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js +15 -5
  768. package/dist/commonjs/queryExecutionContext/queryFilteringStrategy/TargetPartitionRangeStrategy.js.map +7 -1
  769. package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js +66 -55
  770. package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/OrderByQueryProcessingStrategy.js.map +7 -1
  771. package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js +51 -36
  772. package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/ParallelQueryProcessingStrategy.js.map +7 -1
  773. package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js +15 -5
  774. package/dist/commonjs/queryExecutionContext/queryProcessingStrategy/QueryProcessingStrategy.js.map +7 -1
  775. package/dist/commonjs/queryExecutionContext/queryRangeMapping.js +15 -5
  776. package/dist/commonjs/queryExecutionContext/queryRangeMapping.js.map +7 -1
  777. package/dist/commonjs/queryIterator.js +404 -354
  778. package/dist/commonjs/queryIterator.js.map +7 -1
  779. package/dist/commonjs/queryMetrics/clientSideMetrics.js +47 -29
  780. package/dist/commonjs/queryMetrics/clientSideMetrics.js.map +7 -1
  781. package/dist/commonjs/queryMetrics/index.js +52 -19
  782. package/dist/commonjs/queryMetrics/index.js.map +7 -1
  783. package/dist/commonjs/queryMetrics/queryMetrics.js +175 -159
  784. package/dist/commonjs/queryMetrics/queryMetrics.js.map +7 -1
  785. package/dist/commonjs/queryMetrics/queryMetricsConstants.js +74 -57
  786. package/dist/commonjs/queryMetrics/queryMetricsConstants.js.map +7 -1
  787. package/dist/commonjs/queryMetrics/queryMetricsUtils.js +51 -38
  788. package/dist/commonjs/queryMetrics/queryMetricsUtils.js.map +7 -1
  789. package/dist/commonjs/queryMetrics/queryPreparationTime.js +105 -65
  790. package/dist/commonjs/queryMetrics/queryPreparationTime.js.map +7 -1
  791. package/dist/commonjs/queryMetrics/runtimeExecutionTimes.js +116 -68
  792. package/dist/commonjs/queryMetrics/runtimeExecutionTimes.js.map +7 -1
  793. package/dist/commonjs/queryMetrics/timeSpan.js +205 -217
  794. package/dist/commonjs/queryMetrics/timeSpan.js.map +7 -1
  795. package/dist/commonjs/request/ErrorResponse.js +45 -27
  796. package/dist/commonjs/request/ErrorResponse.js.map +7 -1
  797. package/dist/commonjs/request/FeedOptions.js +15 -3
  798. package/dist/commonjs/request/FeedOptions.js.map +7 -1
  799. package/dist/commonjs/request/FeedResponse.js +55 -40
  800. package/dist/commonjs/request/FeedResponse.js.map +7 -1
  801. package/dist/commonjs/request/RequestContext.js +15 -3
  802. package/dist/commonjs/request/RequestContext.js.map +7 -1
  803. package/dist/commonjs/request/RequestHandler.js +172 -153
  804. package/dist/commonjs/request/RequestHandler.js.map +7 -1
  805. package/dist/commonjs/request/RequestOptions.js +15 -3
  806. package/dist/commonjs/request/RequestOptions.js.map +7 -1
  807. package/dist/commonjs/request/ResourceResponse.js +43 -27
  808. package/dist/commonjs/request/ResourceResponse.js.map +7 -1
  809. package/dist/commonjs/request/Response.js +15 -3
  810. package/dist/commonjs/request/Response.js.map +7 -1
  811. package/dist/commonjs/request/SharedOptions.js +15 -3
  812. package/dist/commonjs/request/SharedOptions.js.map +7 -1
  813. package/dist/commonjs/request/StatusCodes.js +15 -5
  814. package/dist/commonjs/request/StatusCodes.js.map +7 -1
  815. package/dist/commonjs/request/TimeoutError.js +34 -16
  816. package/dist/commonjs/request/TimeoutError.js.map +7 -1
  817. package/dist/commonjs/request/defaultAgent.js +45 -18
  818. package/dist/commonjs/request/defaultAgent.js.map +7 -1
  819. package/dist/commonjs/request/globalStatistics.js +15 -5
  820. package/dist/commonjs/request/globalStatistics.js.map +7 -1
  821. package/dist/commonjs/request/hybridSearchQueryResult.d.ts +1 -1
  822. package/dist/commonjs/request/hybridSearchQueryResult.d.ts.map +1 -1
  823. package/dist/commonjs/request/hybridSearchQueryResult.js +61 -45
  824. package/dist/commonjs/request/hybridSearchQueryResult.js.map +7 -1
  825. package/dist/commonjs/request/index.d.ts +8 -8
  826. package/dist/commonjs/request/index.d.ts.map +1 -1
  827. package/dist/commonjs/request/index.js +36 -16
  828. package/dist/commonjs/request/index.js.map +7 -1
  829. package/dist/commonjs/request/request.js +187 -186
  830. package/dist/commonjs/request/request.js.map +7 -1
  831. package/dist/commonjs/retry/RetryContext.js +15 -3
  832. package/dist/commonjs/retry/RetryContext.js.map +7 -1
  833. package/dist/commonjs/retry/RetryPolicy.js +15 -3
  834. package/dist/commonjs/retry/RetryPolicy.js.map +7 -1
  835. package/dist/commonjs/retry/bulkExecutionRetryPolicy.js +64 -56
  836. package/dist/commonjs/retry/bulkExecutionRetryPolicy.js.map +7 -1
  837. package/dist/commonjs/retry/defaultRetryPolicy.js +66 -115
  838. package/dist/commonjs/retry/defaultRetryPolicy.js.map +7 -1
  839. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.d.ts +1 -1
  840. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
  841. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js +93 -73
  842. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js.map +7 -1
  843. package/dist/commonjs/retry/index.d.ts +1 -1
  844. package/dist/commonjs/retry/index.d.ts.map +1 -1
  845. package/dist/commonjs/retry/index.js +29 -12
  846. package/dist/commonjs/retry/index.js.map +7 -1
  847. package/dist/commonjs/retry/resourceThrottleRetryPolicy.js +73 -61
  848. package/dist/commonjs/retry/resourceThrottleRetryPolicy.js.map +7 -1
  849. package/dist/commonjs/retry/retryOptions.js +15 -3
  850. package/dist/commonjs/retry/retryOptions.js.map +7 -1
  851. package/dist/commonjs/retry/retryUtility.js +168 -133
  852. package/dist/commonjs/retry/retryUtility.js.map +7 -1
  853. package/dist/commonjs/retry/sessionRetryPolicy.js +79 -73
  854. package/dist/commonjs/retry/sessionRetryPolicy.js.map +7 -1
  855. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.d.ts +1 -1
  856. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  857. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js +116 -119
  858. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js.map +7 -1
  859. package/dist/commonjs/routing/CollectionRoutingMapFactory.js +69 -67
  860. package/dist/commonjs/routing/CollectionRoutingMapFactory.js.map +7 -1
  861. package/dist/commonjs/routing/QueryRange.js +92 -66
  862. package/dist/commonjs/routing/QueryRange.js.map +7 -1
  863. package/dist/commonjs/routing/inMemoryCollectionRoutingMap.js +111 -84
  864. package/dist/commonjs/routing/inMemoryCollectionRoutingMap.js.map +7 -1
  865. package/dist/commonjs/routing/index.js +27 -10
  866. package/dist/commonjs/routing/index.js.map +7 -1
  867. package/dist/commonjs/routing/partitionKeyRangeCache.js +81 -56
  868. package/dist/commonjs/routing/partitionKeyRangeCache.js.map +7 -1
  869. package/dist/commonjs/routing/smartRoutingMapProvider.js +130 -110
  870. package/dist/commonjs/routing/smartRoutingMapProvider.js.map +7 -1
  871. package/dist/commonjs/session/SessionContext.js +15 -3
  872. package/dist/commonjs/session/SessionContext.js.map +7 -1
  873. package/dist/commonjs/session/VectorSessionToken.js +125 -125
  874. package/dist/commonjs/session/VectorSessionToken.js.map +7 -1
  875. package/dist/commonjs/session/sessionContainer.js +132 -127
  876. package/dist/commonjs/session/sessionContainer.js.map +7 -1
  877. package/dist/commonjs/tsdoc-metadata.json +1 -1
  878. package/dist/commonjs/utils/SasToken.js +100 -120
  879. package/dist/commonjs/utils/SasToken.js.map +7 -1
  880. package/dist/commonjs/utils/atob.js +23 -7
  881. package/dist/commonjs/utils/atob.js.map +7 -1
  882. package/dist/commonjs/utils/batch.js +195 -197
  883. package/dist/commonjs/utils/batch.js.map +7 -1
  884. package/dist/commonjs/utils/cachedClient.js +31 -11
  885. package/dist/commonjs/utils/cachedClient.js.map +7 -1
  886. package/dist/commonjs/utils/checkURL.js +33 -14
  887. package/dist/commonjs/utils/checkURL.js.map +7 -1
  888. package/dist/commonjs/utils/diagnostics.js +106 -118
  889. package/dist/commonjs/utils/diagnostics.js.map +7 -1
  890. package/dist/commonjs/utils/digest.js +30 -10
  891. package/dist/commonjs/utils/digest.js.map +7 -1
  892. package/dist/commonjs/utils/encode.js +43 -23
  893. package/dist/commonjs/utils/encode.js.map +7 -1
  894. package/dist/commonjs/utils/envUtils.js +39 -10
  895. package/dist/commonjs/utils/envUtils.js.map +7 -1
  896. package/dist/commonjs/utils/fixedSizePriorityQueue.js +85 -55
  897. package/dist/commonjs/utils/fixedSizePriorityQueue.js.map +7 -1
  898. package/dist/commonjs/utils/globalCrypto.js +28 -10
  899. package/dist/commonjs/utils/globalCrypto.js.map +7 -1
  900. package/dist/commonjs/utils/hashObject.js +40 -11
  901. package/dist/commonjs/utils/hashObject.js.map +7 -1
  902. package/dist/commonjs/utils/hashing/encoding/number.js +72 -56
  903. package/dist/commonjs/utils/hashing/encoding/number.js.map +7 -1
  904. package/dist/commonjs/utils/hashing/encoding/prefix.js +49 -29
  905. package/dist/commonjs/utils/hashing/encoding/prefix.js.map +7 -1
  906. package/dist/commonjs/utils/hashing/encoding/string.js +44 -27
  907. package/dist/commonjs/utils/hashing/encoding/string.js.map +7 -1
  908. package/dist/commonjs/utils/hashing/hash.d.ts +1 -1
  909. package/dist/commonjs/utils/hashing/hash.d.ts.map +1 -1
  910. package/dist/commonjs/utils/hashing/hash.js +54 -43
  911. package/dist/commonjs/utils/hashing/hash.js.map +7 -1
  912. package/dist/commonjs/utils/hashing/multiHash.js +28 -11
  913. package/dist/commonjs/utils/hashing/multiHash.js.map +7 -1
  914. package/dist/commonjs/utils/hashing/murmurHash.js +361 -412
  915. package/dist/commonjs/utils/hashing/murmurHash.js.map +7 -1
  916. package/dist/commonjs/utils/hashing/v1.js +100 -71
  917. package/dist/commonjs/utils/hashing/v1.js.map +7 -1
  918. package/dist/commonjs/utils/hashing/v2.js +83 -63
  919. package/dist/commonjs/utils/hashing/v2.js.map +7 -1
  920. package/dist/commonjs/utils/headers.js +44 -33
  921. package/dist/commonjs/utils/headers.js.map +7 -1
  922. package/dist/commonjs/utils/hmac.js +28 -8
  923. package/dist/commonjs/utils/hmac.js.map +7 -1
  924. package/dist/commonjs/utils/nonStreamingOrderByMap.js +63 -52
  925. package/dist/commonjs/utils/nonStreamingOrderByMap.js.map +7 -1
  926. package/dist/commonjs/utils/offers.js +35 -13
  927. package/dist/commonjs/utils/offers.js.map +7 -1
  928. package/dist/commonjs/utils/patch.js +32 -12
  929. package/dist/commonjs/utils/patch.js.map +7 -1
  930. package/dist/commonjs/utils/strings.js +27 -7
  931. package/dist/commonjs/utils/strings.js.map +7 -1
  932. package/dist/commonjs/utils/supportedQueryFeaturesBuilder.js +36 -16
  933. package/dist/commonjs/utils/supportedQueryFeaturesBuilder.js.map +7 -1
  934. package/dist/commonjs/utils/time.js +38 -30
  935. package/dist/commonjs/utils/time.js.map +7 -1
  936. package/dist/commonjs/utils/tracing.js +32 -17
  937. package/dist/commonjs/utils/tracing.js.map +7 -1
  938. package/dist/commonjs/utils/typeChecks.js +49 -60
  939. package/dist/commonjs/utils/typeChecks.js.map +7 -1
  940. package/dist/commonjs/utils/types.js +15 -5
  941. package/dist/commonjs/utils/types.js.map +7 -1
  942. package/dist/commonjs/utils/uint8.js +44 -24
  943. package/dist/commonjs/utils/uint8.js.map +7 -1
  944. package/dist/esm/PartitionKeyRangeFailoverInfo.d.ts +1 -1
  945. package/dist/esm/PartitionKeyRangeFailoverInfo.d.ts.map +1 -1
  946. package/dist/esm/PartitionKeyRangeFailoverInfo.js +0 -2
  947. package/dist/esm/PartitionKeyRangeFailoverInfo.js.map +1 -1
  948. package/dist/esm/bulk/index.d.ts +1 -1
  949. package/dist/esm/bulk/index.d.ts.map +1 -1
  950. package/dist/esm/bulk/index.js.map +1 -1
  951. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts +2 -2
  952. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  953. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  954. package/dist/esm/client/ChangeFeed/buildChangeFeedIterator.js.map +1 -1
  955. package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts +4 -4
  956. package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  957. package/dist/esm/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  958. package/dist/esm/client/ChangeFeed/index.d.ts +2 -2
  959. package/dist/esm/client/ChangeFeed/index.d.ts.map +1 -1
  960. package/dist/esm/client/ChangeFeed/index.js.map +1 -1
  961. package/dist/esm/client/ClientUtils.d.ts +1 -1
  962. package/dist/esm/client/ClientUtils.d.ts.map +1 -1
  963. package/dist/esm/client/ClientUtils.js.map +1 -1
  964. package/dist/esm/client/Conflict/index.d.ts +2 -2
  965. package/dist/esm/client/Conflict/index.d.ts.map +1 -1
  966. package/dist/esm/client/Conflict/index.js.map +1 -1
  967. package/dist/esm/client/Container/ContainerDefinition.d.ts +1 -1
  968. package/dist/esm/client/Container/ContainerDefinition.d.ts.map +1 -1
  969. package/dist/esm/client/Container/ContainerDefinition.js.map +1 -1
  970. package/dist/esm/client/Container/index.d.ts +4 -4
  971. package/dist/esm/client/Container/index.d.ts.map +1 -1
  972. package/dist/esm/client/Container/index.js.map +1 -1
  973. package/dist/esm/client/Database/index.d.ts +2 -2
  974. package/dist/esm/client/Database/index.d.ts.map +1 -1
  975. package/dist/esm/client/Database/index.js.map +1 -1
  976. package/dist/esm/client/Item/Items.d.ts.map +1 -1
  977. package/dist/esm/client/Item/Items.js.map +1 -1
  978. package/dist/esm/client/Item/index.d.ts +1 -1
  979. package/dist/esm/client/Item/index.d.ts.map +1 -1
  980. package/dist/esm/client/Item/index.js.map +1 -1
  981. package/dist/esm/client/Offer/index.d.ts +1 -1
  982. package/dist/esm/client/Offer/index.d.ts.map +1 -1
  983. package/dist/esm/client/Offer/index.js.map +1 -1
  984. package/dist/esm/client/Permission/index.d.ts +2 -2
  985. package/dist/esm/client/Permission/index.d.ts.map +1 -1
  986. package/dist/esm/client/Permission/index.js.map +1 -1
  987. package/dist/esm/client/StoredProcedure/index.d.ts +1 -1
  988. package/dist/esm/client/StoredProcedure/index.d.ts.map +1 -1
  989. package/dist/esm/client/StoredProcedure/index.js.map +1 -1
  990. package/dist/esm/client/Trigger/index.d.ts +1 -1
  991. package/dist/esm/client/Trigger/index.d.ts.map +1 -1
  992. package/dist/esm/client/Trigger/index.js.map +1 -1
  993. package/dist/esm/client/User/index.d.ts +1 -1
  994. package/dist/esm/client/User/index.d.ts.map +1 -1
  995. package/dist/esm/client/User/index.js.map +1 -1
  996. package/dist/esm/client/UserDefinedFunction/index.d.ts +1 -1
  997. package/dist/esm/client/UserDefinedFunction/index.d.ts.map +1 -1
  998. package/dist/esm/client/UserDefinedFunction/index.js.map +1 -1
  999. package/dist/esm/client/index.d.ts +1 -1
  1000. package/dist/esm/client/index.d.ts.map +1 -1
  1001. package/dist/esm/client/index.js +0 -1
  1002. package/dist/esm/client/index.js.map +1 -1
  1003. package/dist/esm/common/constants.js +1 -1
  1004. package/dist/esm/common/constants.js.map +1 -1
  1005. package/dist/esm/common/helper.d.ts +4 -4
  1006. package/dist/esm/common/helper.d.ts.map +1 -1
  1007. package/dist/esm/common/helper.js.map +1 -1
  1008. package/dist/esm/common/platform.d.ts +1 -1
  1009. package/dist/esm/common/platform.d.ts.map +1 -1
  1010. package/dist/esm/common/platform.js.map +1 -1
  1011. package/dist/esm/diagnostics/DiagnosticNodeInternal.d.ts +1 -1
  1012. package/dist/esm/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  1013. package/dist/esm/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  1014. package/dist/esm/documents/index.d.ts +4 -4
  1015. package/dist/esm/documents/index.d.ts.map +1 -1
  1016. package/dist/esm/documents/index.js +0 -4
  1017. package/dist/esm/documents/index.js.map +1 -1
  1018. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts +1 -1
  1019. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts.map +1 -1
  1020. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  1021. package/dist/esm/encryption/ClientEncryptionIncludedPath.d.ts +1 -1
  1022. package/dist/esm/encryption/ClientEncryptionIncludedPath.d.ts.map +1 -1
  1023. package/dist/esm/encryption/ClientEncryptionIncludedPath.js.map +1 -1
  1024. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts +4 -4
  1025. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts.map +1 -1
  1026. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  1027. package/dist/esm/encryption/ClientEncryptionKey/index.d.ts +2 -2
  1028. package/dist/esm/encryption/ClientEncryptionKey/index.d.ts.map +1 -1
  1029. package/dist/esm/encryption/ClientEncryptionKey/index.js.map +1 -1
  1030. package/dist/esm/encryption/EncryptionKeyResolver/index.d.ts +1 -1
  1031. package/dist/esm/encryption/EncryptionKeyResolver/index.d.ts.map +1 -1
  1032. package/dist/esm/encryption/EncryptionKeyResolver/index.js.map +1 -1
  1033. package/dist/esm/encryption/EncryptionQueryBuilder.d.ts +2 -2
  1034. package/dist/esm/encryption/EncryptionQueryBuilder.d.ts.map +1 -1
  1035. package/dist/esm/encryption/EncryptionQueryBuilder.js.map +1 -1
  1036. package/dist/esm/encryption/Serializers/BooleanSerializer.d.ts +1 -1
  1037. package/dist/esm/encryption/Serializers/BooleanSerializer.d.ts.map +1 -1
  1038. package/dist/esm/encryption/Serializers/BooleanSerializer.js.map +1 -1
  1039. package/dist/esm/encryption/Serializers/FloatSerializer.d.ts +1 -1
  1040. package/dist/esm/encryption/Serializers/FloatSerializer.d.ts.map +1 -1
  1041. package/dist/esm/encryption/Serializers/FloatSerializer.js.map +1 -1
  1042. package/dist/esm/encryption/Serializers/StringSerializer.d.ts +1 -1
  1043. package/dist/esm/encryption/Serializers/StringSerializer.d.ts.map +1 -1
  1044. package/dist/esm/encryption/Serializers/StringSerializer.js.map +1 -1
  1045. package/dist/esm/encryption/Serializers/index.d.ts +1 -1
  1046. package/dist/esm/encryption/Serializers/index.d.ts.map +1 -1
  1047. package/dist/esm/encryption/Serializers/index.js.map +1 -1
  1048. package/dist/esm/encryption/index.d.ts +5 -5
  1049. package/dist/esm/encryption/index.d.ts.map +1 -1
  1050. package/dist/esm/encryption/index.js.map +1 -1
  1051. package/dist/esm/globalPartitionEndpointManager.d.ts +2 -1
  1052. package/dist/esm/globalPartitionEndpointManager.d.ts.map +1 -1
  1053. package/dist/esm/globalPartitionEndpointManager.js.map +1 -1
  1054. package/dist/esm/index.d.ts +16 -16
  1055. package/dist/esm/index.d.ts.map +1 -1
  1056. package/dist/esm/index.js +1 -1
  1057. package/dist/esm/index.js.map +1 -1
  1058. package/dist/esm/queryExecutionContext/Aggregators/index.d.ts +1 -1
  1059. package/dist/esm/queryExecutionContext/Aggregators/index.d.ts.map +1 -1
  1060. package/dist/esm/queryExecutionContext/Aggregators/index.js.map +1 -1
  1061. package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +26 -18
  1062. package/dist/esm/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -1
  1063. package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +48 -25
  1064. package/dist/esm/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -1
  1065. package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +17 -26
  1066. package/dist/esm/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -1
  1067. package/dist/esm/queryExecutionContext/PartitionRangeManager.d.ts +8 -7
  1068. package/dist/esm/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -1
  1069. package/dist/esm/queryExecutionContext/PartitionRangeManager.js +13 -12
  1070. package/dist/esm/queryExecutionContext/PartitionRangeManager.js.map +1 -1
  1071. package/dist/esm/queryExecutionContext/index.d.ts +2 -2
  1072. package/dist/esm/queryExecutionContext/index.d.ts.map +1 -1
  1073. package/dist/esm/queryExecutionContext/index.js +0 -2
  1074. package/dist/esm/queryExecutionContext/index.js.map +1 -1
  1075. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +1 -1
  1076. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
  1077. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  1078. package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +0 -4
  1079. package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -1
  1080. package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +2 -10
  1081. package/dist/esm/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -1
  1082. package/dist/esm/request/hybridSearchQueryResult.d.ts +1 -1
  1083. package/dist/esm/request/hybridSearchQueryResult.d.ts.map +1 -1
  1084. package/dist/esm/request/hybridSearchQueryResult.js.map +1 -1
  1085. package/dist/esm/request/index.d.ts +8 -8
  1086. package/dist/esm/request/index.d.ts.map +1 -1
  1087. package/dist/esm/request/index.js +0 -1
  1088. package/dist/esm/request/index.js.map +1 -1
  1089. package/dist/esm/retry/endpointDiscoveryRetryPolicy.d.ts +1 -1
  1090. package/dist/esm/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
  1091. package/dist/esm/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  1092. package/dist/esm/retry/index.d.ts +1 -1
  1093. package/dist/esm/retry/index.d.ts.map +1 -1
  1094. package/dist/esm/retry/index.js +0 -3
  1095. package/dist/esm/retry/index.js.map +1 -1
  1096. package/dist/esm/retry/timeoutFailoverRetryPolicy.d.ts +1 -1
  1097. package/dist/esm/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  1098. package/dist/esm/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  1099. package/dist/esm/utils/hashing/hash.d.ts +1 -1
  1100. package/dist/esm/utils/hashing/hash.d.ts.map +1 -1
  1101. package/dist/esm/utils/hashing/hash.js.map +1 -1
  1102. package/dist/react-native/PartitionKeyRangeFailoverInfo.d.ts +1 -1
  1103. package/dist/react-native/PartitionKeyRangeFailoverInfo.d.ts.map +1 -1
  1104. package/dist/react-native/PartitionKeyRangeFailoverInfo.js +0 -2
  1105. package/dist/react-native/PartitionKeyRangeFailoverInfo.js.map +1 -1
  1106. package/dist/react-native/bulk/index.d.ts +1 -1
  1107. package/dist/react-native/bulk/index.d.ts.map +1 -1
  1108. package/dist/react-native/bulk/index.js.map +1 -1
  1109. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts +2 -2
  1110. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  1111. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  1112. package/dist/react-native/client/ChangeFeed/buildChangeFeedIterator.js.map +1 -1
  1113. package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts +4 -4
  1114. package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  1115. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  1116. package/dist/react-native/client/ChangeFeed/index.d.ts +2 -2
  1117. package/dist/react-native/client/ChangeFeed/index.d.ts.map +1 -1
  1118. package/dist/react-native/client/ChangeFeed/index.js.map +1 -1
  1119. package/dist/react-native/client/ClientUtils.d.ts +1 -1
  1120. package/dist/react-native/client/ClientUtils.d.ts.map +1 -1
  1121. package/dist/react-native/client/ClientUtils.js.map +1 -1
  1122. package/dist/react-native/client/Conflict/index.d.ts +2 -2
  1123. package/dist/react-native/client/Conflict/index.d.ts.map +1 -1
  1124. package/dist/react-native/client/Conflict/index.js.map +1 -1
  1125. package/dist/react-native/client/Container/ContainerDefinition.d.ts +1 -1
  1126. package/dist/react-native/client/Container/ContainerDefinition.d.ts.map +1 -1
  1127. package/dist/react-native/client/Container/ContainerDefinition.js.map +1 -1
  1128. package/dist/react-native/client/Container/index.d.ts +4 -4
  1129. package/dist/react-native/client/Container/index.d.ts.map +1 -1
  1130. package/dist/react-native/client/Container/index.js.map +1 -1
  1131. package/dist/react-native/client/Database/index.d.ts +2 -2
  1132. package/dist/react-native/client/Database/index.d.ts.map +1 -1
  1133. package/dist/react-native/client/Database/index.js.map +1 -1
  1134. package/dist/react-native/client/Item/Items.d.ts.map +1 -1
  1135. package/dist/react-native/client/Item/Items.js.map +1 -1
  1136. package/dist/react-native/client/Item/index.d.ts +1 -1
  1137. package/dist/react-native/client/Item/index.d.ts.map +1 -1
  1138. package/dist/react-native/client/Item/index.js.map +1 -1
  1139. package/dist/react-native/client/Offer/index.d.ts +1 -1
  1140. package/dist/react-native/client/Offer/index.d.ts.map +1 -1
  1141. package/dist/react-native/client/Offer/index.js.map +1 -1
  1142. package/dist/react-native/client/Permission/index.d.ts +2 -2
  1143. package/dist/react-native/client/Permission/index.d.ts.map +1 -1
  1144. package/dist/react-native/client/Permission/index.js.map +1 -1
  1145. package/dist/react-native/client/StoredProcedure/index.d.ts +1 -1
  1146. package/dist/react-native/client/StoredProcedure/index.d.ts.map +1 -1
  1147. package/dist/react-native/client/StoredProcedure/index.js.map +1 -1
  1148. package/dist/react-native/client/Trigger/index.d.ts +1 -1
  1149. package/dist/react-native/client/Trigger/index.d.ts.map +1 -1
  1150. package/dist/react-native/client/Trigger/index.js.map +1 -1
  1151. package/dist/react-native/client/User/index.d.ts +1 -1
  1152. package/dist/react-native/client/User/index.d.ts.map +1 -1
  1153. package/dist/react-native/client/User/index.js.map +1 -1
  1154. package/dist/react-native/client/UserDefinedFunction/index.d.ts +1 -1
  1155. package/dist/react-native/client/UserDefinedFunction/index.d.ts.map +1 -1
  1156. package/dist/react-native/client/UserDefinedFunction/index.js.map +1 -1
  1157. package/dist/react-native/client/index.d.ts +1 -1
  1158. package/dist/react-native/client/index.d.ts.map +1 -1
  1159. package/dist/react-native/client/index.js +0 -1
  1160. package/dist/react-native/client/index.js.map +1 -1
  1161. package/dist/react-native/common/constants.js +1 -1
  1162. package/dist/react-native/common/constants.js.map +1 -1
  1163. package/dist/react-native/common/helper.d.ts +4 -4
  1164. package/dist/react-native/common/helper.d.ts.map +1 -1
  1165. package/dist/react-native/common/helper.js.map +1 -1
  1166. package/dist/react-native/common/platform.d.ts +1 -1
  1167. package/dist/react-native/common/platform.d.ts.map +1 -1
  1168. package/dist/react-native/common/platform.js.map +1 -1
  1169. package/dist/react-native/diagnostics/DiagnosticNodeInternal.d.ts +1 -1
  1170. package/dist/react-native/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  1171. package/dist/react-native/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  1172. package/dist/react-native/documents/index.d.ts +4 -4
  1173. package/dist/react-native/documents/index.d.ts.map +1 -1
  1174. package/dist/react-native/documents/index.js +0 -4
  1175. package/dist/react-native/documents/index.js.map +1 -1
  1176. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts +1 -1
  1177. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.d.ts.map +1 -1
  1178. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  1179. package/dist/react-native/encryption/ClientEncryptionIncludedPath.d.ts +1 -1
  1180. package/dist/react-native/encryption/ClientEncryptionIncludedPath.d.ts.map +1 -1
  1181. package/dist/react-native/encryption/ClientEncryptionIncludedPath.js.map +1 -1
  1182. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts +4 -4
  1183. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.d.ts.map +1 -1
  1184. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  1185. package/dist/react-native/encryption/ClientEncryptionKey/index.d.ts +2 -2
  1186. package/dist/react-native/encryption/ClientEncryptionKey/index.d.ts.map +1 -1
  1187. package/dist/react-native/encryption/ClientEncryptionKey/index.js.map +1 -1
  1188. package/dist/react-native/encryption/EncryptionKeyResolver/index.d.ts +1 -1
  1189. package/dist/react-native/encryption/EncryptionKeyResolver/index.d.ts.map +1 -1
  1190. package/dist/react-native/encryption/EncryptionKeyResolver/index.js.map +1 -1
  1191. package/dist/react-native/encryption/EncryptionQueryBuilder.d.ts +2 -2
  1192. package/dist/react-native/encryption/EncryptionQueryBuilder.d.ts.map +1 -1
  1193. package/dist/react-native/encryption/EncryptionQueryBuilder.js.map +1 -1
  1194. package/dist/react-native/encryption/Serializers/BooleanSerializer.d.ts +1 -1
  1195. package/dist/react-native/encryption/Serializers/BooleanSerializer.d.ts.map +1 -1
  1196. package/dist/react-native/encryption/Serializers/BooleanSerializer.js.map +1 -1
  1197. package/dist/react-native/encryption/Serializers/FloatSerializer.d.ts +1 -1
  1198. package/dist/react-native/encryption/Serializers/FloatSerializer.d.ts.map +1 -1
  1199. package/dist/react-native/encryption/Serializers/FloatSerializer.js.map +1 -1
  1200. package/dist/react-native/encryption/Serializers/StringSerializer.d.ts +1 -1
  1201. package/dist/react-native/encryption/Serializers/StringSerializer.d.ts.map +1 -1
  1202. package/dist/react-native/encryption/Serializers/StringSerializer.js.map +1 -1
  1203. package/dist/react-native/encryption/Serializers/index.d.ts +1 -1
  1204. package/dist/react-native/encryption/Serializers/index.d.ts.map +1 -1
  1205. package/dist/react-native/encryption/Serializers/index.js.map +1 -1
  1206. package/dist/react-native/encryption/index.d.ts +5 -5
  1207. package/dist/react-native/encryption/index.d.ts.map +1 -1
  1208. package/dist/react-native/encryption/index.js.map +1 -1
  1209. package/dist/react-native/globalPartitionEndpointManager.d.ts +2 -1
  1210. package/dist/react-native/globalPartitionEndpointManager.d.ts.map +1 -1
  1211. package/dist/react-native/globalPartitionEndpointManager.js.map +1 -1
  1212. package/dist/react-native/index.d.ts +16 -16
  1213. package/dist/react-native/index.d.ts.map +1 -1
  1214. package/dist/react-native/index.js +1 -1
  1215. package/dist/react-native/index.js.map +1 -1
  1216. package/dist/react-native/queryExecutionContext/Aggregators/index.d.ts +1 -1
  1217. package/dist/react-native/queryExecutionContext/Aggregators/index.d.ts.map +1 -1
  1218. package/dist/react-native/queryExecutionContext/Aggregators/index.js.map +1 -1
  1219. package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js +26 -18
  1220. package/dist/react-native/queryExecutionContext/ContinuationTokenManager/BaseContinuationTokenManager.js.map +1 -1
  1221. package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js +48 -25
  1222. package/dist/react-native/queryExecutionContext/ContinuationTokenManager/OrderByQueryContinuationTokenManager.js.map +1 -1
  1223. package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js +17 -26
  1224. package/dist/react-native/queryExecutionContext/ContinuationTokenManager/ParallelQueryContinuationTokenManager.js.map +1 -1
  1225. package/dist/react-native/queryExecutionContext/PartitionRangeManager.d.ts +8 -7
  1226. package/dist/react-native/queryExecutionContext/PartitionRangeManager.d.ts.map +1 -1
  1227. package/dist/react-native/queryExecutionContext/PartitionRangeManager.js +13 -12
  1228. package/dist/react-native/queryExecutionContext/PartitionRangeManager.js.map +1 -1
  1229. package/dist/react-native/queryExecutionContext/index.d.ts +2 -2
  1230. package/dist/react-native/queryExecutionContext/index.d.ts.map +1 -1
  1231. package/dist/react-native/queryExecutionContext/index.js +0 -2
  1232. package/dist/react-native/queryExecutionContext/index.js.map +1 -1
  1233. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.d.ts +1 -1
  1234. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.d.ts.map +1 -1
  1235. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  1236. package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts +0 -4
  1237. package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.d.ts.map +1 -1
  1238. package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js +2 -10
  1239. package/dist/react-native/queryExecutionContext/queryFilteringStrategy/ParallelQueryRangeStrategy.js.map +1 -1
  1240. package/dist/react-native/request/hybridSearchQueryResult.d.ts +1 -1
  1241. package/dist/react-native/request/hybridSearchQueryResult.d.ts.map +1 -1
  1242. package/dist/react-native/request/hybridSearchQueryResult.js.map +1 -1
  1243. package/dist/react-native/request/index.d.ts +8 -8
  1244. package/dist/react-native/request/index.d.ts.map +1 -1
  1245. package/dist/react-native/request/index.js +0 -1
  1246. package/dist/react-native/request/index.js.map +1 -1
  1247. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.d.ts +1 -1
  1248. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.d.ts.map +1 -1
  1249. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  1250. package/dist/react-native/retry/index.d.ts +1 -1
  1251. package/dist/react-native/retry/index.d.ts.map +1 -1
  1252. package/dist/react-native/retry/index.js +0 -3
  1253. package/dist/react-native/retry/index.js.map +1 -1
  1254. package/dist/react-native/retry/timeoutFailoverRetryPolicy.d.ts +1 -1
  1255. package/dist/react-native/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  1256. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  1257. package/dist/react-native/utils/globalCrypto.d.ts +1 -1
  1258. package/dist/react-native/utils/globalCrypto.d.ts.map +1 -0
  1259. package/dist/react-native/utils/globalCrypto.js +1 -1
  1260. package/dist/react-native/utils/globalCrypto.js.map +1 -0
  1261. package/dist/react-native/utils/hashing/hash.d.ts +1 -1
  1262. package/dist/react-native/utils/hashing/hash.d.ts.map +1 -1
  1263. package/dist/react-native/utils/hashing/hash.js.map +1 -1
  1264. package/package.json +3 -20
  1265. package/dist/browser/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm-browser.d.mts.map +0 -1
  1266. package/dist/browser/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm-browser.mjs.map +0 -1
  1267. package/dist/browser/encryption/Cache/ProtectedDataEncryptionKeyCache-browser.d.mts.map +0 -1
  1268. package/dist/browser/encryption/Cache/ProtectedDataEncryptionKeyCache-browser.mjs.map +0 -1
  1269. package/dist/browser/encryption/EncryptionKey/DataEncryptionKey-browser.d.mts.map +0 -1
  1270. package/dist/browser/encryption/EncryptionKey/DataEncryptionKey-browser.mjs.map +0 -1
  1271. package/dist/browser/request/defaultAgent-browser.d.mts.map +0 -1
  1272. package/dist/browser/request/defaultAgent-browser.mjs.map +0 -1
  1273. package/dist/browser/utils/atob-browser.d.mts.map +0 -1
  1274. package/dist/browser/utils/atob-browser.mjs.map +0 -1
  1275. package/dist/browser/utils/digest-browser.d.mts.map +0 -1
  1276. package/dist/browser/utils/digest-browser.mjs.map +0 -1
  1277. package/dist/browser/utils/envUtils-browser.d.mts.map +0 -1
  1278. package/dist/browser/utils/envUtils-browser.mjs.map +0 -1
  1279. package/dist/browser/utils/hmac-browser.d.mts.map +0 -1
  1280. package/dist/browser/utils/hmac-browser.mjs.map +0 -1
  1281. package/dist/react-native/utils/globalCrypto-react-native.d.mts.map +0 -1
  1282. package/dist/react-native/utils/globalCrypto-react-native.mjs.map +0 -1
@@ -1,807 +1,851 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParallelQueryExecutionContextBase = exports.ParallelQueryExecutionContextBaseStates = void 0;
4
- const tslib_1 = require("tslib");
5
- // Copyright (c) Microsoft Corporation.
6
- // Licensed under the MIT License.
7
- const priorityqueuejs_1 = tslib_1.__importDefault(require("priorityqueuejs"));
8
- const semaphore_1 = tslib_1.__importDefault(require("semaphore"));
9
- const statusCodes_js_1 = require("../common/statusCodes.js");
10
- const ErrorResponse_js_1 = require("../request/ErrorResponse.js");
11
- const QueryRange_js_1 = require("../routing/QueryRange.js");
12
- const smartRoutingMapProvider_js_1 = require("../routing/smartRoutingMapProvider.js");
13
- const documentProducer_js_1 = require("./documentProducer.js");
14
- const headerUtils_js_1 = require("./headerUtils.js");
15
- const RidSkipCountFilter_js_1 = require("./queryFilteringStrategy/RidSkipCountFilter.js");
16
- const DiagnosticNodeInternal_js_1 = require("../diagnostics/DiagnosticNodeInternal.js");
17
- const parallelQueryResult_js_1 = require("./parallelQueryResult.js");
18
- /** @hidden */
19
- var ParallelQueryExecutionContextBaseStates;
20
- (function (ParallelQueryExecutionContextBaseStates) {
21
- ParallelQueryExecutionContextBaseStates["started"] = "started";
22
- ParallelQueryExecutionContextBaseStates["inProgress"] = "inProgress";
23
- ParallelQueryExecutionContextBaseStates["ended"] = "ended";
24
- })(ParallelQueryExecutionContextBaseStates || (exports.ParallelQueryExecutionContextBaseStates = ParallelQueryExecutionContextBaseStates = {}));
25
- /** @hidden */
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var parallelQueryExecutionContextBase_exports = {};
29
+ __export(parallelQueryExecutionContextBase_exports, {
30
+ ParallelQueryExecutionContextBase: () => ParallelQueryExecutionContextBase,
31
+ ParallelQueryExecutionContextBaseStates: () => ParallelQueryExecutionContextBaseStates
32
+ });
33
+ module.exports = __toCommonJS(parallelQueryExecutionContextBase_exports);
34
+ var import_priorityqueuejs = __toESM(require("priorityqueuejs"));
35
+ var import_semaphore = __toESM(require("semaphore"));
36
+ var import_statusCodes = require("../common/statusCodes.js");
37
+ var import_ErrorResponse = require("../request/ErrorResponse.js");
38
+ var import_QueryRange = require("../routing/QueryRange.js");
39
+ var import_smartRoutingMapProvider = require("../routing/smartRoutingMapProvider.js");
40
+ var import_documentProducer = require("./documentProducer.js");
41
+ var import_headerUtils = require("./headerUtils.js");
42
+ var import_RidSkipCountFilter = require("./queryFilteringStrategy/RidSkipCountFilter.js");
43
+ var import_DiagnosticNodeInternal = require("../diagnostics/DiagnosticNodeInternal.js");
44
+ var import_parallelQueryResult = require("./parallelQueryResult.js");
45
+ var ParallelQueryExecutionContextBaseStates = /* @__PURE__ */ ((ParallelQueryExecutionContextBaseStates2) => {
46
+ ParallelQueryExecutionContextBaseStates2["started"] = "started";
47
+ ParallelQueryExecutionContextBaseStates2["inProgress"] = "inProgress";
48
+ ParallelQueryExecutionContextBaseStates2["ended"] = "ended";
49
+ return ParallelQueryExecutionContextBaseStates2;
50
+ })(ParallelQueryExecutionContextBaseStates || {});
26
51
  class ParallelQueryExecutionContextBase {
27
- clientContext;
28
- collectionLink;
29
- query;
30
- options;
31
- partitionedQueryExecutionInfo;
32
- correlatedActivityId;
33
- rangeManager;
34
- queryProcessingStrategy;
35
- documentProducerComparator;
36
- err;
37
- state;
38
- static STATES = ParallelQueryExecutionContextBaseStates;
39
- routingProvider;
40
- requestContinuation;
41
- respHeaders;
42
- unfilledDocumentProducersQueue;
43
- bufferedDocumentProducersQueue;
44
- // TODO: update type of buffer from any --> generic can be used here
45
- buffer;
46
- partitionDataPatchMap = new Map();
47
- patchCounter = 0;
48
- updatedContinuationRanges = new Map();
49
- sem;
50
- diagnosticNodeWrapper;
51
- /**
52
- * Provides the ParallelQueryExecutionContextBase.
53
- * This is the base class that ParallelQueryExecutionContext and OrderByQueryExecutionContext will derive from.
54
- *
55
- * When handling a parallelized query, it instantiates one instance of
56
- * DocumentProcuder per target partition key range and aggregates the result of each.
57
- *
58
- * @param clientContext - The service endpoint to use to create the client.
59
- * @param collectionLink - The Collection Link
60
- * @param options - Represents the feed options.
61
- * @param partitionedQueryExecutionInfo - PartitionedQueryExecutionInfo
62
- * @hidden
63
- */
64
- constructor(clientContext, collectionLink, query, options, partitionedQueryExecutionInfo, correlatedActivityId, rangeManager, queryProcessingStrategy, documentProducerComparator) {
65
- this.clientContext = clientContext;
66
- this.collectionLink = collectionLink;
67
- this.query = query;
68
- this.options = options;
69
- this.partitionedQueryExecutionInfo = partitionedQueryExecutionInfo;
70
- this.correlatedActivityId = correlatedActivityId;
71
- this.rangeManager = rangeManager;
72
- this.queryProcessingStrategy = queryProcessingStrategy;
73
- this.documentProducerComparator = documentProducerComparator;
74
- this.clientContext = clientContext;
75
- this.collectionLink = collectionLink;
76
- this.query = query;
77
- this.options = options;
78
- this.partitionedQueryExecutionInfo = partitionedQueryExecutionInfo;
79
- this.correlatedActivityId = correlatedActivityId;
80
- this.diagnosticNodeWrapper = {
81
- consumed: false,
82
- diagnosticNode: new DiagnosticNodeInternal_js_1.DiagnosticNodeInternal(clientContext.diagnosticLevel, DiagnosticNodeInternal_js_1.DiagnosticNodeType.PARALLEL_QUERY_NODE, null),
83
- };
84
- this.diagnosticNodeWrapper.diagnosticNode.addData({ stateful: true });
85
- this.err = undefined;
86
- this.state = ParallelQueryExecutionContextBase.STATES.started;
87
- this.routingProvider = new smartRoutingMapProvider_js_1.SmartRoutingMapProvider(this.clientContext);
88
- this.buffer = [];
89
- this.requestContinuation = options
90
- ? options.continuationToken || options.continuation
91
- : undefined;
92
- // Validate continuation token usage immediately
93
- if (this.requestContinuation && !this.options.enableQueryControl) {
94
- throw new Error("Continuation tokens are supported when enableQueryControl is set true in FeedOptions");
95
- }
96
- // response headers of undergoing operation
97
- this.respHeaders = (0, headerUtils_js_1.getInitialHeader)();
98
- // Make priority queue for documentProducers
99
- this.unfilledDocumentProducersQueue = new priorityqueuejs_1.default((a, b) => this.compareDocumentProducersByRange(a, b));
100
- this.bufferedDocumentProducersQueue = new priorityqueuejs_1.default((a, b) => this.documentProducerComparator(b, a));
101
- // Creating the documentProducers
102
- this.sem = (0, semaphore_1.default)(1);
103
- this.sem.take(() => this._initializeDocumentProducers());
104
- }
105
- /**
106
- * Determine if there are still remaining resources to processs based on the value of the continuation
107
- * token or the elements remaining on the current batch in the QueryIterator.
108
- * @returns true if there is other elements to process in the ParallelQueryExecutionContextBase.
109
- */
110
- hasMoreResults() {
111
- return (!this.err &&
112
- (this.buffer.length > 0 || this.state !== ParallelQueryExecutionContextBase.STATES.ended));
113
- }
114
- /**
115
- * Fetches more results from the query execution context.
116
- * @param diagnosticNode - Optional diagnostic node for tracing.
117
- * @returns A promise that resolves to the fetched results.
118
- * @hidden
119
- */
120
- async fetchMore(diagnosticNode) {
121
- await this.bufferDocumentProducers(diagnosticNode);
122
- await this.fillBufferFromBufferQueue();
123
- return this.drainBufferedItems();
124
- }
125
- /**
126
- * Processes buffered document producers
127
- * @returns A promise that resolves when processing is complete.
128
- */
129
- async processBufferedDocumentProducers() {
130
- while (this.hasBufferedProducers() &&
131
- this.shouldProcessBufferedProducers(this.isUnfilledQueueEmpty())) {
132
- const producer = this.getNextBufferedProducer();
133
- if (!producer)
134
- break;
135
- await this.processDocumentProducer(producer);
136
- }
137
- }
138
- /**
139
- * Processes a single document producer using template method pattern.
140
- * Common structure with query-specific processing delegated to subclasses.
141
- */
142
- async processDocumentProducer(producer) {
143
- const response = await this.fetchFromProducer(producer);
144
- this._mergeWithActiveResponseHeaders(response.headers);
145
- if (response.result) {
146
- this.addToBuffer(response.result);
147
- this.handlePartitionMapping(producer, response.result);
148
- }
149
- // Handle producer lifecycle
150
- if (producer.peakNextItem() !== undefined) {
151
- this.requeueProducer(producer);
152
- }
153
- else if (producer.hasMoreResults()) {
154
- this.moveToUnfilledQueue(producer);
155
- }
156
- }
157
- /**
158
- * Handles partition mapping updates - implemented in base class using template method pattern.
159
- * Child classes provide query-specific parameters through abstract methods.
160
- */
161
- handlePartitionMapping(producer, result) {
162
- const itemCount = result?.length || 0;
163
- const continuationToken = this.getContinuationToken(producer);
164
- const mapping = {
165
- itemCount,
166
- partitionKeyRange: producer.targetPartitionKeyRange,
167
- continuationToken,
168
- };
169
- this.updatePartitionMapping(mapping);
170
- }
171
- /**
172
- * Gets the continuation token to use - implemented by subclasses.
173
- */
174
- getContinuationToken(producer) {
175
- const hasMoreBufferedItems = producer.peakNextItem() !== undefined;
176
- return hasMoreBufferedItems ? producer.previousContinuationToken : producer.continuationToken;
177
- }
178
- /**
179
- * Updates partition mapping - creates new entry or merges with existing for ORDER BY queries.
180
- */
181
- updatePartitionMapping(mapping) {
182
- const currentPatch = this.partitionDataPatchMap.get(this.patchCounter.toString());
183
- const isSamePartition = currentPatch?.partitionKeyRange?.id === mapping.partitionKeyRange.id;
184
- if (isSamePartition && currentPatch) {
185
- currentPatch.itemCount += mapping.itemCount;
186
- currentPatch.continuationToken = mapping.continuationToken;
187
- return;
188
- }
189
- // Create new partition mapping entry
190
- this.partitionDataPatchMap.set((++this.patchCounter).toString(), mapping);
191
- }
192
- /**
193
- * Checks if the unfilled queue is empty (used by ORDER BY for processing control).
194
- */
195
- isUnfilledQueueEmpty() {
196
- return this.unfilledDocumentProducersQueue.size() === 0;
197
- }
198
- /**
199
- * Initializes document producers and fills the priority queue.
200
- * Handles both continuation token and fresh query scenarios.
201
- */
202
- async _initializeDocumentProducers() {
203
- try {
204
- const targetPartitionRanges = await this._onTargetPartitionRanges();
205
- const documentProducers = this.requestContinuation
206
- ? await this._createDocumentProducersFromContinuation(targetPartitionRanges)
207
- : this._createDocumentProducersFromFresh(targetPartitionRanges);
208
- // Fill up our priority queue with documentProducers
209
- this._enqueueDocumentProducers(documentProducers);
210
- this.sem.leave();
211
- }
212
- catch (err) {
213
- this.err = err;
214
- this.sem.leave();
52
+ /**
53
+ * Provides the ParallelQueryExecutionContextBase.
54
+ * This is the base class that ParallelQueryExecutionContext and OrderByQueryExecutionContext will derive from.
55
+ *
56
+ * When handling a parallelized query, it instantiates one instance of
57
+ * DocumentProcuder per target partition key range and aggregates the result of each.
58
+ *
59
+ * @param clientContext - The service endpoint to use to create the client.
60
+ * @param collectionLink - The Collection Link
61
+ * @param options - Represents the feed options.
62
+ * @param partitionedQueryExecutionInfo - PartitionedQueryExecutionInfo
63
+ * @hidden
64
+ */
65
+ constructor(clientContext, collectionLink, query, options, partitionedQueryExecutionInfo, correlatedActivityId, rangeManager, queryProcessingStrategy, documentProducerComparator) {
66
+ this.clientContext = clientContext;
67
+ this.collectionLink = collectionLink;
68
+ this.query = query;
69
+ this.options = options;
70
+ this.partitionedQueryExecutionInfo = partitionedQueryExecutionInfo;
71
+ this.correlatedActivityId = correlatedActivityId;
72
+ this.rangeManager = rangeManager;
73
+ this.queryProcessingStrategy = queryProcessingStrategy;
74
+ this.documentProducerComparator = documentProducerComparator;
75
+ this.clientContext = clientContext;
76
+ this.collectionLink = collectionLink;
77
+ this.query = query;
78
+ this.options = options;
79
+ this.partitionedQueryExecutionInfo = partitionedQueryExecutionInfo;
80
+ this.correlatedActivityId = correlatedActivityId;
81
+ this.diagnosticNodeWrapper = {
82
+ consumed: false,
83
+ diagnosticNode: new import_DiagnosticNodeInternal.DiagnosticNodeInternal(
84
+ clientContext.diagnosticLevel,
85
+ import_DiagnosticNodeInternal.DiagnosticNodeType.PARALLEL_QUERY_NODE,
86
+ null
87
+ )
88
+ };
89
+ this.diagnosticNodeWrapper.diagnosticNode.addData({ stateful: true });
90
+ this.err = void 0;
91
+ this.state = ParallelQueryExecutionContextBase.STATES.started;
92
+ this.routingProvider = new import_smartRoutingMapProvider.SmartRoutingMapProvider(this.clientContext);
93
+ this.buffer = [];
94
+ this.requestContinuation = options ? options.continuationToken || options.continuation : void 0;
95
+ if (this.requestContinuation && !this.options.enableQueryControl) {
96
+ throw new Error(
97
+ "Continuation tokens are supported when enableQueryControl is set true in FeedOptions"
98
+ );
99
+ }
100
+ this.respHeaders = (0, import_headerUtils.getInitialHeader)();
101
+ this.unfilledDocumentProducersQueue = new import_priorityqueuejs.default(
102
+ (a, b) => this.compareDocumentProducersByRange(a, b)
103
+ );
104
+ this.bufferedDocumentProducersQueue = new import_priorityqueuejs.default(
105
+ (a, b) => this.documentProducerComparator(b, a)
106
+ );
107
+ this.sem = (0, import_semaphore.default)(1);
108
+ this.sem.take(() => this._initializeDocumentProducers());
109
+ }
110
+ err;
111
+ state;
112
+ static STATES = ParallelQueryExecutionContextBaseStates;
113
+ routingProvider;
114
+ requestContinuation;
115
+ respHeaders;
116
+ unfilledDocumentProducersQueue;
117
+ bufferedDocumentProducersQueue;
118
+ // TODO: update type of buffer from any --> generic can be used here
119
+ buffer;
120
+ partitionDataPatchMap = /* @__PURE__ */ new Map();
121
+ patchCounter = 0;
122
+ updatedContinuationRanges = /* @__PURE__ */ new Map();
123
+ sem;
124
+ diagnosticNodeWrapper;
125
+ /**
126
+ * Determine if there are still remaining resources to processs based on the value of the continuation
127
+ * token or the elements remaining on the current batch in the QueryIterator.
128
+ * @returns true if there is other elements to process in the ParallelQueryExecutionContextBase.
129
+ */
130
+ hasMoreResults() {
131
+ return !this.err && (this.buffer.length > 0 || this.state !== ParallelQueryExecutionContextBase.STATES.ended);
132
+ }
133
+ /**
134
+ * Fetches more results from the query execution context.
135
+ * @param diagnosticNode - Optional diagnostic node for tracing.
136
+ * @returns A promise that resolves to the fetched results.
137
+ * @hidden
138
+ */
139
+ async fetchMore(diagnosticNode) {
140
+ await this.bufferDocumentProducers(diagnosticNode);
141
+ await this.fillBufferFromBufferQueue();
142
+ return this.drainBufferedItems();
143
+ }
144
+ /**
145
+ * Processes buffered document producers
146
+ * @returns A promise that resolves when processing is complete.
147
+ */
148
+ async processBufferedDocumentProducers() {
149
+ while (this.hasBufferedProducers() && this.shouldProcessBufferedProducers(this.isUnfilledQueueEmpty())) {
150
+ const producer = this.getNextBufferedProducer();
151
+ if (!producer) break;
152
+ await this.processDocumentProducer(producer);
153
+ }
154
+ }
155
+ /**
156
+ * Processes a single document producer using template method pattern.
157
+ * Common structure with query-specific processing delegated to subclasses.
158
+ */
159
+ async processDocumentProducer(producer) {
160
+ const response = await this.fetchFromProducer(producer);
161
+ this._mergeWithActiveResponseHeaders(response.headers);
162
+ if (response.result) {
163
+ this.addToBuffer(response.result);
164
+ this.handlePartitionMapping(producer, response.result);
165
+ }
166
+ if (producer.peakNextItem() !== void 0) {
167
+ this.requeueProducer(producer);
168
+ } else if (producer.hasMoreResults()) {
169
+ this.moveToUnfilledQueue(producer);
170
+ }
171
+ }
172
+ /**
173
+ * Handles partition mapping updates - implemented in base class using template method pattern.
174
+ * Child classes provide query-specific parameters through abstract methods.
175
+ */
176
+ handlePartitionMapping(producer, result) {
177
+ const itemCount = result?.length || 0;
178
+ const continuationToken = this.getContinuationToken(producer);
179
+ const mapping = {
180
+ itemCount,
181
+ partitionKeyRange: producer.targetPartitionKeyRange,
182
+ continuationToken
183
+ };
184
+ this.updatePartitionMapping(mapping);
185
+ }
186
+ /**
187
+ * Gets the continuation token to use - implemented by subclasses.
188
+ */
189
+ getContinuationToken(producer) {
190
+ const hasMoreBufferedItems = producer.peakNextItem() !== void 0;
191
+ return hasMoreBufferedItems ? producer.previousContinuationToken : producer.continuationToken;
192
+ }
193
+ /**
194
+ * Updates partition mapping - creates new entry or merges with existing for ORDER BY queries.
195
+ */
196
+ updatePartitionMapping(mapping) {
197
+ const currentPatch = this.partitionDataPatchMap.get(this.patchCounter.toString());
198
+ const isSamePartition = currentPatch?.partitionKeyRange?.id === mapping.partitionKeyRange.id;
199
+ if (isSamePartition && currentPatch) {
200
+ currentPatch.itemCount += mapping.itemCount;
201
+ currentPatch.continuationToken = mapping.continuationToken;
202
+ return;
203
+ }
204
+ this.partitionDataPatchMap.set((++this.patchCounter).toString(), mapping);
205
+ }
206
+ /**
207
+ * Checks if the unfilled queue is empty (used by ORDER BY for processing control).
208
+ */
209
+ isUnfilledQueueEmpty() {
210
+ return this.unfilledDocumentProducersQueue.size() === 0;
211
+ }
212
+ /**
213
+ * Initializes document producers and fills the priority queue.
214
+ * Handles both continuation token and fresh query scenarios.
215
+ */
216
+ async _initializeDocumentProducers() {
217
+ try {
218
+ const targetPartitionRanges = await this._onTargetPartitionRanges();
219
+ const documentProducers = this.requestContinuation ? await this._createDocumentProducersFromContinuation(targetPartitionRanges) : this._createDocumentProducersFromFresh(targetPartitionRanges);
220
+ this._enqueueDocumentProducers(documentProducers);
221
+ this.sem.leave();
222
+ } catch (err) {
223
+ this.err = err;
224
+ this.sem.leave();
225
+ }
226
+ }
227
+ /**
228
+ * Creates document producers from continuation token scenario.
229
+ */
230
+ async _createDocumentProducersFromContinuation(targetPartitionRanges) {
231
+ const parsedToken = this._parseContinuationToken(this.requestContinuation);
232
+ const continuationRanges = await this._handlePartitionRangeChanges(parsedToken);
233
+ const additionalQueryInfo = this.queryProcessingStrategy.createAdditionalQueryInfo(parsedToken);
234
+ const filterResult = this.rangeManager.filterPartitionRanges(
235
+ targetPartitionRanges,
236
+ continuationRanges,
237
+ additionalQueryInfo
238
+ );
239
+ const rangeTokenPairs = filterResult.rangeTokenPairs;
240
+ const filterContext = this.queryProcessingStrategy.createFilterContext(parsedToken);
241
+ return rangeTokenPairs.map(
242
+ (rangeTokenPair) => this._createDocumentProducerFromRangeTokenPair(
243
+ rangeTokenPair,
244
+ continuationRanges,
245
+ filterContext
246
+ )
247
+ );
248
+ }
249
+ /**
250
+ * Creates document producers from fresh query scenario (no continuation token).
251
+ */
252
+ _createDocumentProducersFromFresh(targetPartitionRanges) {
253
+ return targetPartitionRanges.map(
254
+ (partitionTargetRange) => this._createTargetPartitionQueryExecutionContext(partitionTargetRange, void 0)
255
+ );
256
+ }
257
+ /**
258
+ * Creates a document producer from a range token pair (continuation token scenario).
259
+ */
260
+ _createDocumentProducerFromRangeTokenPair(rangeTokenPair, continuationRanges, filterContext) {
261
+ const partitionTargetRange = rangeTokenPair.range;
262
+ const continuationToken = rangeTokenPair.continuationToken;
263
+ const filterCondition = rangeTokenPair.filteringCondition || void 0;
264
+ const matchingContinuationRange = continuationRanges.find(
265
+ (cr) => cr.range.id === partitionTargetRange.id
266
+ );
267
+ const startEpk = matchingContinuationRange?.epkMin;
268
+ const endEpk = matchingContinuationRange?.epkMax;
269
+ const targetPartitionId = continuationRanges.length > 0 && continuationRanges[continuationRanges.length - 1].range ? continuationRanges[continuationRanges.length - 1].range.id : void 0;
270
+ const partitionFilterContext = this.queryProcessingStrategy.getPartitionFilterContext(
271
+ filterContext,
272
+ targetPartitionId,
273
+ partitionTargetRange.id
274
+ );
275
+ return this._createTargetPartitionQueryExecutionContext(
276
+ partitionTargetRange,
277
+ continuationToken,
278
+ startEpk,
279
+ endEpk,
280
+ !!(startEpk && endEpk),
281
+ // populateEpkRangeHeaders - true if both EPK values are present
282
+ filterCondition,
283
+ partitionFilterContext
284
+ );
285
+ }
286
+ /**
287
+ * Enqueues document producers into the unfilled queue.
288
+ */
289
+ _enqueueDocumentProducers(documentProducers) {
290
+ documentProducers.forEach((documentProducer) => {
291
+ try {
292
+ this.unfilledDocumentProducersQueue.enq(documentProducer);
293
+ } catch (e) {
294
+ this.err = e;
295
+ }
296
+ });
297
+ }
298
+ /**
299
+ * Checks if there are buffered document producers ready for processing.
300
+ * Encapsulates queue size checking.
301
+ */
302
+ hasBufferedProducers() {
303
+ return this.bufferedDocumentProducersQueue.size() > 0;
304
+ }
305
+ /**
306
+ * Gets the next buffered document producer for processing.
307
+ * Encapsulates queue dequeuing logic.
308
+ */
309
+ getNextBufferedProducer() {
310
+ if (this.bufferedDocumentProducersQueue.size() > 0) {
311
+ return this.bufferedDocumentProducersQueue.deq();
312
+ }
313
+ return void 0;
314
+ }
315
+ /**
316
+ * Adds items to the result buffer. Handles both single items and arrays.
317
+ */
318
+ addToBuffer(items) {
319
+ if (Array.isArray(items)) {
320
+ if (items.length > 0) {
321
+ this.buffer.push(...items);
322
+ }
323
+ } else if (items) {
324
+ this.buffer.push(items);
325
+ }
326
+ }
327
+ /**
328
+ * Moves a producer to the unfilled queue for later processing.
329
+ */
330
+ moveToUnfilledQueue(producer) {
331
+ this.unfilledDocumentProducersQueue.enq(producer);
332
+ }
333
+ /**
334
+ * Re-queues a producer to the buffered queue for further processing.
335
+ */
336
+ requeueProducer(producer) {
337
+ this.bufferedDocumentProducersQueue.enq(producer);
338
+ }
339
+ /**
340
+ * Compares two document producers based on their partition key ranges and EPK values.
341
+ * Primary comparison: minInclusive values for left-to-right range traversal
342
+ * Secondary comparison: EPK ranges when minInclusive values are identical
343
+ * @param a - First document producer
344
+ * @param b - Second document producer
345
+ * @returns Comparison result for priority queue ordering
346
+ * @hidden
347
+ */
348
+ compareDocumentProducersByRange(a, b) {
349
+ const aMinInclusive = a.targetPartitionKeyRange.minInclusive;
350
+ const bMinInclusive = b.targetPartitionKeyRange.minInclusive;
351
+ const minInclusiveComparison = bMinInclusive.localeCompare(aMinInclusive);
352
+ if (minInclusiveComparison === 0) {
353
+ const aMinEpk = a.startEpk;
354
+ const bMinEpk = b.startEpk;
355
+ if (aMinEpk && bMinEpk) {
356
+ return bMinEpk.localeCompare(aMinEpk);
357
+ }
358
+ }
359
+ return minInclusiveComparison;
360
+ }
361
+ /**
362
+ * Detects partition splits/merges by analyzing parsed continuation token ranges and comparing with current topology
363
+ * @param parsed - The continuation token containing range mappings to analyze
364
+ * @returns Array of processed ranges with EPK info
365
+ */
366
+ async _handlePartitionRangeChanges(parsed) {
367
+ const processedRanges = [];
368
+ const rangeMappings = parsed.rangeMappings;
369
+ if (!rangeMappings || rangeMappings.length === 0) {
370
+ return [];
371
+ }
372
+ for (const rangeWithToken of rangeMappings) {
373
+ const range = rangeWithToken.queryRange;
374
+ const queryRange = new import_QueryRange.QueryRange(
375
+ range.min,
376
+ range.max,
377
+ true,
378
+ // isMinInclusive - assumption: always true
379
+ false
380
+ // isMaxInclusive - assumption: always false (max is exclusive)
381
+ );
382
+ const rangeMin = queryRange.min;
383
+ const rangeMax = queryRange.max;
384
+ const overlappingRanges = await this.routingProvider.getOverlappingRanges(
385
+ this.collectionLink,
386
+ [queryRange],
387
+ this.getDiagnosticNode()
388
+ );
389
+ if (overlappingRanges.length === 0) {
390
+ continue;
391
+ } else if (overlappingRanges.length === 1) {
392
+ const currentRange = overlappingRanges[0];
393
+ if (currentRange.minInclusive !== rangeMin || currentRange.maxExclusive !== rangeMax) {
394
+ await this._handleContinuationTokenMerge(rangeWithToken, currentRange);
395
+ processedRanges.push({
396
+ range: currentRange,
397
+ continuationToken: rangeWithToken.continuationToken,
398
+ epkMin: rangeMin,
399
+ // Original range min becomes EPK min
400
+ epkMax: rangeMax
401
+ // Original range max becomes EPK max
402
+ });
403
+ } else {
404
+ processedRanges.push({
405
+ range: currentRange,
406
+ continuationToken: rangeWithToken.continuationToken
407
+ });
215
408
  }
216
- }
217
- /**
218
- * Creates document producers from continuation token scenario.
219
- */
220
- async _createDocumentProducersFromContinuation(targetPartitionRanges) {
221
- // Parse continuation token to get range mappings and check for split/merge scenarios
222
- const parsedToken = this._parseContinuationToken(this.requestContinuation);
223
- const continuationRanges = await this._handlePartitionRangeChanges(parsedToken);
224
- // Use strategy to create additional query info from parsed token
225
- const additionalQueryInfo = this.queryProcessingStrategy.createAdditionalQueryInfo(parsedToken);
226
- const filterResult = this.rangeManager.filterPartitionRanges(targetPartitionRanges, continuationRanges, additionalQueryInfo);
227
- // Extract ranges and tokens from the combined result
228
- const rangeTokenPairs = filterResult.rangeTokenPairs;
229
- // Use strategy to create filter context for continuation token processing
230
- const filterContext = this.queryProcessingStrategy.createFilterContext(parsedToken);
231
- return rangeTokenPairs.map((rangeTokenPair) => this._createDocumentProducerFromRangeTokenPair(rangeTokenPair, continuationRanges, filterContext));
232
- }
233
- /**
234
- * Creates document producers from fresh query scenario (no continuation token).
235
- */
236
- _createDocumentProducersFromFresh(targetPartitionRanges) {
237
- return targetPartitionRanges.map((partitionTargetRange) => this._createTargetPartitionQueryExecutionContext(partitionTargetRange, undefined));
238
- }
239
- /**
240
- * Creates a document producer from a range token pair (continuation token scenario).
241
- */
242
- _createDocumentProducerFromRangeTokenPair(rangeTokenPair, continuationRanges, filterContext) {
243
- const partitionTargetRange = rangeTokenPair.range;
244
- const continuationToken = rangeTokenPair.continuationToken;
245
- const filterCondition = rangeTokenPair.filteringCondition || undefined;
246
- // Find EPK ranges for this partition range from processed continuation response
247
- const matchingContinuationRange = continuationRanges.find((cr) => cr.range.id === partitionTargetRange.id);
248
- const startEpk = matchingContinuationRange?.epkMin;
249
- const endEpk = matchingContinuationRange?.epkMax;
250
- // Use strategy to determine partition-specific filter context
251
- const targetPartitionId = continuationRanges.length > 0 && continuationRanges[continuationRanges.length - 1].range
252
- ? continuationRanges[continuationRanges.length - 1].range.id
253
- : undefined;
254
- const partitionFilterContext = this.queryProcessingStrategy.getPartitionFilterContext(filterContext, targetPartitionId, partitionTargetRange.id);
255
- return this._createTargetPartitionQueryExecutionContext(partitionTargetRange, continuationToken, startEpk, endEpk, !!(startEpk && endEpk), // populateEpkRangeHeaders - true if both EPK values are present
256
- filterCondition, partitionFilterContext);
257
- }
258
- /**
259
- * Enqueues document producers into the unfilled queue.
260
- */
261
- _enqueueDocumentProducers(documentProducers) {
262
- documentProducers.forEach((documentProducer) => {
263
- try {
264
- this.unfilledDocumentProducersQueue.enq(documentProducer);
265
- }
266
- catch (e) {
267
- this.err = e;
268
- }
409
+ } else {
410
+ await this._handleContinuationTokenSplit(rangeWithToken, overlappingRanges);
411
+ overlappingRanges.forEach((rangeValue) => {
412
+ processedRanges.push({
413
+ range: rangeValue,
414
+ continuationToken: rangeWithToken.continuationToken
415
+ });
269
416
  });
270
- }
271
- /**
272
- * Checks if there are buffered document producers ready for processing.
273
- * Encapsulates queue size checking.
274
- */
275
- hasBufferedProducers() {
276
- return this.bufferedDocumentProducersQueue.size() > 0;
277
- }
278
- /**
279
- * Gets the next buffered document producer for processing.
280
- * Encapsulates queue dequeuing logic.
281
- */
282
- getNextBufferedProducer() {
283
- if (this.bufferedDocumentProducersQueue.size() > 0) {
284
- return this.bufferedDocumentProducersQueue.deq();
417
+ }
418
+ }
419
+ return processedRanges;
420
+ }
421
+ /**
422
+ * Parses the continuation token based on query type
423
+ * @param continuationToken - The continuation token string to parse
424
+ * @returns Parsed continuation token object (ORDER BY or Parallel query token)
425
+ * @throws ErrorResponse when continuation token is malformed or cannot be parsed
426
+ */
427
+ _parseContinuationToken(continuationToken) {
428
+ try {
429
+ return this.queryProcessingStrategy.parseContinuationToken(continuationToken);
430
+ } catch (e) {
431
+ throw new import_ErrorResponse.ErrorResponse(
432
+ `Invalid continuation token format. Expected token with rangeMappings property. Ensure the continuation token was generated by a compatible query and has not been modified.`
433
+ );
434
+ }
435
+ }
436
+ /**
437
+ * Handles partition merge scenario for continuation token ranges
438
+ */
439
+ async _handleContinuationTokenMerge(rangeWithToken, _newMergedRange) {
440
+ const rangeKey = `${rangeWithToken.queryRange.min}-${rangeWithToken.queryRange.max}`;
441
+ this.updatedContinuationRanges.set(rangeKey, {
442
+ oldRange: {
443
+ min: rangeWithToken.queryRange.min,
444
+ max: rangeWithToken.queryRange.max,
445
+ isMinInclusive: true,
446
+ // Assumption: min is always inclusive
447
+ isMaxInclusive: false
448
+ // Assumption: max is always exclusive
449
+ },
450
+ newRanges: [
451
+ {
452
+ min: rangeWithToken.queryRange.min,
453
+ max: rangeWithToken.queryRange.max,
454
+ isMinInclusive: true,
455
+ // Assumption: min is always inclusive
456
+ isMaxInclusive: false
457
+ // Assumption: max is always exclusive
285
458
  }
286
- return undefined;
287
- }
288
- /**
289
- * Adds items to the result buffer. Handles both single items and arrays.
290
- */
291
- addToBuffer(items) {
292
- if (Array.isArray(items)) {
293
- if (items.length > 0) {
294
- this.buffer.push(...items);
295
- }
459
+ ],
460
+ continuationToken: rangeWithToken.continuationToken
461
+ });
462
+ }
463
+ /**
464
+ * Handles partition split scenario for continuation token ranges
465
+ */
466
+ async _handleContinuationTokenSplit(rangeWithToken, overlappingRanges) {
467
+ const rangeKey = `${rangeWithToken.queryRange.min}-${rangeWithToken.queryRange.max}`;
468
+ this.updatedContinuationRanges.set(rangeKey, {
469
+ oldRange: {
470
+ min: rangeWithToken.queryRange.min,
471
+ max: rangeWithToken.queryRange.max,
472
+ isMinInclusive: true,
473
+ // Assumption: min is always inclusive
474
+ isMaxInclusive: false
475
+ // Assumption: max is always exclusive
476
+ },
477
+ newRanges: overlappingRanges.map((range) => ({
478
+ min: range.minInclusive,
479
+ max: range.maxExclusive,
480
+ isMinInclusive: true,
481
+ isMaxInclusive: false
482
+ })),
483
+ continuationToken: rangeWithToken.continuationToken
484
+ });
485
+ }
486
+ /**
487
+ * Handles partition merge scenario for continuation token ranges
488
+ */
489
+ _mergeWithActiveResponseHeaders(headers) {
490
+ (0, import_headerUtils.mergeHeaders)(this.respHeaders, headers);
491
+ }
492
+ _getAndResetActiveResponseHeaders() {
493
+ const ret = this.respHeaders;
494
+ this.respHeaders = (0, import_headerUtils.getInitialHeader)();
495
+ return ret;
496
+ }
497
+ getDiagnosticNode() {
498
+ return this.diagnosticNodeWrapper.diagnosticNode;
499
+ }
500
+ async _onTargetPartitionRanges() {
501
+ const parsedRanges = this.partitionedQueryExecutionInfo.queryRanges;
502
+ const queryRanges = parsedRanges.map((item) => import_QueryRange.QueryRange.parseFromDict(item));
503
+ return this.routingProvider.getOverlappingRanges(
504
+ this.collectionLink,
505
+ queryRanges,
506
+ this.getDiagnosticNode()
507
+ );
508
+ }
509
+ /**
510
+ * Gets the replacement ranges for a partitionkeyrange that has been split
511
+ */
512
+ async _getReplacementPartitionKeyRanges(documentProducer, diagnosticNode) {
513
+ const partitionKeyRange = documentProducer.targetPartitionKeyRange;
514
+ this.routingProvider = new import_smartRoutingMapProvider.SmartRoutingMapProvider(this.clientContext);
515
+ const queryRange = import_QueryRange.QueryRange.parsePartitionKeyRange(partitionKeyRange);
516
+ return this.routingProvider.getOverlappingRanges(
517
+ this.collectionLink,
518
+ [queryRange],
519
+ diagnosticNode
520
+ );
521
+ }
522
+ async _enqueueReplacementDocumentProducers(error, diagnosticNode, documentProducer) {
523
+ const replacementPartitionKeyRanges = await this._getReplacementPartitionKeyRanges(
524
+ documentProducer,
525
+ diagnosticNode
526
+ );
527
+ if (replacementPartitionKeyRanges.length === 0) {
528
+ throw error;
529
+ }
530
+ if (this.requestContinuation) {
531
+ this._updateContinuationTokenOnPartitionChange(
532
+ documentProducer,
533
+ replacementPartitionKeyRanges
534
+ );
535
+ }
536
+ if (replacementPartitionKeyRanges.length === 1) {
537
+ const replacementDocumentProducer = this._createTargetPartitionQueryExecutionContext(
538
+ replacementPartitionKeyRanges[0],
539
+ documentProducer.continuationToken,
540
+ documentProducer.startEpk,
541
+ documentProducer.endEpk,
542
+ true
543
+ );
544
+ this.unfilledDocumentProducersQueue.enq(replacementDocumentProducer);
545
+ } else {
546
+ const replacementDocumentProducers = [];
547
+ replacementPartitionKeyRanges.forEach((partitionKeyRange) => {
548
+ const queryRange = import_QueryRange.QueryRange.parsePartitionKeyRange(partitionKeyRange);
549
+ const replacementDocumentProducer = this._createTargetPartitionQueryExecutionContext(
550
+ partitionKeyRange,
551
+ documentProducer.continuationToken,
552
+ queryRange.min,
553
+ queryRange.max,
554
+ false
555
+ );
556
+ replacementDocumentProducers.push(replacementDocumentProducer);
557
+ });
558
+ replacementDocumentProducers.forEach((replacementDocumentProducer) => {
559
+ if (replacementDocumentProducer.hasMoreResults()) {
560
+ this.unfilledDocumentProducersQueue.enq(replacementDocumentProducer);
296
561
  }
297
- else if (items) {
298
- this.buffer.push(items);
562
+ });
563
+ }
564
+ }
565
+ _updateContinuationTokenOnPartitionChange(originalDocumentProducer, replacementPartitionKeyRanges) {
566
+ const rangeWithToken = this._createQueryRangeWithContinuationToken(originalDocumentProducer);
567
+ if (replacementPartitionKeyRanges.length === 1) {
568
+ this._handleContinuationTokenMerge(rangeWithToken, replacementPartitionKeyRanges[0]);
569
+ } else {
570
+ this._handleContinuationTokenSplit(rangeWithToken, replacementPartitionKeyRanges);
571
+ }
572
+ }
573
+ /**
574
+ * Creates a QueryRangeWithContinuationToken object from a DocumentProducer.
575
+ * Uses the DocumentProducer's target partition key range and continuation token.
576
+ * @param documentProducer - The DocumentProducer to convert
577
+ * @returns QueryRangeWithContinuationToken object for token operations
578
+ */
579
+ _createQueryRangeWithContinuationToken(documentProducer) {
580
+ const partitionRange = documentProducer.targetPartitionKeyRange;
581
+ const simplifiedQueryRange = {
582
+ min: documentProducer.startEpk || partitionRange.minInclusive,
583
+ max: documentProducer.endEpk || partitionRange.maxExclusive
584
+ };
585
+ return {
586
+ queryRange: simplifiedQueryRange,
587
+ continuationToken: documentProducer.continuationToken
588
+ };
589
+ }
590
+ static _needPartitionKeyRangeCacheRefresh(error) {
591
+ return error.code === import_statusCodes.StatusCodes.Gone && "substatus" in error && error["substatus"] === import_statusCodes.SubStatusCodes.PartitionKeyRangeGone;
592
+ }
593
+ /**
594
+ * Replaces the format placeholder in the rewritten query with the provided filter condition.
595
+ * Handles both string queries and SqlQuerySpec objects.
596
+ */
597
+ _replaceFormatPlaceholder(rewrittenQuery, formatPlaceHolder, filterCondition) {
598
+ const replacement = filterCondition ?? "true";
599
+ if (typeof rewrittenQuery === "object" && rewrittenQuery !== null && rewrittenQuery.query) {
600
+ return rewrittenQuery.query.replace(formatPlaceHolder, replacement);
601
+ }
602
+ return rewrittenQuery.replace(formatPlaceHolder, replacement);
603
+ }
604
+ /**
605
+ * Creates target partition range Query Execution Context
606
+ */
607
+ _createTargetPartitionQueryExecutionContext(partitionKeyTargetRange, continuationToken, startEpk, endEpk, populateEpkRangeHeaders, filterCondition, filterContext) {
608
+ const rewrittenQuery = this.partitionedQueryExecutionInfo.queryInfo?.rewrittenQuery;
609
+ let sqlQuerySpec;
610
+ const query = this.query;
611
+ if (typeof query === "string") {
612
+ sqlQuerySpec = { query };
613
+ } else {
614
+ sqlQuerySpec = query;
615
+ }
616
+ const formatPlaceHolder = "{documentdb-formattableorderbyquery-filter}";
617
+ if (rewrittenQuery) {
618
+ sqlQuerySpec = JSON.parse(JSON.stringify(sqlQuerySpec));
619
+ const replacedQuery = this._replaceFormatPlaceholder(
620
+ rewrittenQuery,
621
+ formatPlaceHolder,
622
+ filterCondition
623
+ );
624
+ sqlQuerySpec["query"] = replacedQuery;
625
+ }
626
+ const options = { ...this.options };
627
+ options.continuationToken = continuationToken;
628
+ let filter;
629
+ if (filterContext) {
630
+ filter = new import_RidSkipCountFilter.RidSkipCountFilter(filterContext);
631
+ }
632
+ return new import_documentProducer.DocumentProducer(
633
+ this.clientContext,
634
+ this.collectionLink,
635
+ sqlQuerySpec,
636
+ partitionKeyTargetRange,
637
+ options,
638
+ this.correlatedActivityId,
639
+ startEpk,
640
+ endEpk,
641
+ populateEpkRangeHeaders,
642
+ filter
643
+ );
644
+ }
645
+ async drainBufferedItems() {
646
+ return new Promise((resolve, reject) => {
647
+ this.sem.take(() => {
648
+ if (this.err) {
649
+ this.sem.leave();
650
+ this.err.headers = this._getAndResetActiveResponseHeaders();
651
+ reject(this.err);
652
+ return;
299
653
  }
300
- }
301
- /**
302
- * Moves a producer to the unfilled queue for later processing.
303
- */
304
- moveToUnfilledQueue(producer) {
305
- this.unfilledDocumentProducersQueue.enq(producer);
306
- }
307
- /**
308
- * Re-queues a producer to the buffered queue for further processing.
309
- */
310
- requeueProducer(producer) {
311
- this.bufferedDocumentProducersQueue.enq(producer);
312
- }
313
- /**
314
- * Compares two document producers based on their partition key ranges and EPK values.
315
- * Primary comparison: minInclusive values for left-to-right range traversal
316
- * Secondary comparison: EPK ranges when minInclusive values are identical
317
- * @param a - First document producer
318
- * @param b - Second document producer
319
- * @returns Comparison result for priority queue ordering
320
- * @hidden
321
- */
322
- compareDocumentProducersByRange(a, b) {
323
- const aMinInclusive = a.targetPartitionKeyRange.minInclusive;
324
- const bMinInclusive = b.targetPartitionKeyRange.minInclusive;
325
- const minInclusiveComparison = bMinInclusive.localeCompare(aMinInclusive);
326
- // If minInclusive values are the same, check minEPK ranges if they exist
327
- if (minInclusiveComparison === 0) {
328
- const aMinEpk = a.startEpk;
329
- const bMinEpk = b.startEpk;
330
- if (aMinEpk && bMinEpk) {
331
- return bMinEpk.localeCompare(aMinEpk);
332
- }
654
+ if (this.buffer.length === 0) {
655
+ this.sem.leave();
656
+ const partitionDataPatchMap2 = this.partitionDataPatchMap;
657
+ this.partitionDataPatchMap = /* @__PURE__ */ new Map();
658
+ this.patchCounter = 0;
659
+ const updatedContinuationRanges2 = Object.fromEntries(
660
+ this.updatedContinuationRanges
661
+ );
662
+ this.updatedContinuationRanges.clear();
663
+ const result2 = (0, import_parallelQueryResult.createParallelQueryResult)(
664
+ [],
665
+ partitionDataPatchMap2,
666
+ updatedContinuationRanges2,
667
+ void 0
668
+ );
669
+ return resolve({
670
+ result: this.state === ParallelQueryExecutionContextBase.STATES.ended ? void 0 : result2,
671
+ headers: this._getAndResetActiveResponseHeaders()
672
+ });
333
673
  }
334
- return minInclusiveComparison;
335
- }
336
- /**
337
- * Detects partition splits/merges by analyzing parsed continuation token ranges and comparing with current topology
338
- * @param parsed - The continuation token containing range mappings to analyze
339
- * @returns Array of processed ranges with EPK info
340
- */
341
- async _handlePartitionRangeChanges(parsed) {
342
- const processedRanges = [];
343
- // Extract range mappings from the already parsed token
344
- const rangeMappings = parsed.rangeMappings;
345
- if (!rangeMappings || rangeMappings.length === 0) {
346
- return [];
347
- }
348
- // Check each range mapping for potential splits/merges
349
- for (const rangeWithToken of rangeMappings) {
350
- // Create a new QueryRange instance from the simplified range data
351
- const range = rangeWithToken.queryRange;
352
- const queryRange = new QueryRange_js_1.QueryRange(range.min, range.max, true, // isMinInclusive - assumption: always true
353
- false);
354
- const rangeMin = queryRange.min;
355
- const rangeMax = queryRange.max;
356
- // Get current overlapping ranges for this continuation token range
357
- const overlappingRanges = await this.routingProvider.getOverlappingRanges(this.collectionLink, [queryRange], this.getDiagnosticNode());
358
- // Detect split/merge scenario based on the number of overlapping ranges
359
- if (overlappingRanges.length === 0) {
360
- continue;
361
- }
362
- else if (overlappingRanges.length === 1) {
363
- // Check if it's the same range (no change) or a merge scenario
364
- const currentRange = overlappingRanges[0];
365
- if (currentRange.minInclusive !== rangeMin || currentRange.maxExclusive !== rangeMax) {
366
- // Merge scenario - include EPK ranges from original continuation token range
367
- await this._handleContinuationTokenMerge(rangeWithToken, currentRange);
368
- processedRanges.push({
369
- range: currentRange,
370
- continuationToken: rangeWithToken.continuationToken,
371
- epkMin: rangeMin, // Original range min becomes EPK min
372
- epkMax: rangeMax, // Original range max becomes EPK max
373
- });
374
- }
375
- else {
376
- // Same range - no merge, no EPK ranges needed
377
- processedRanges.push({
378
- range: currentRange,
379
- continuationToken: rangeWithToken.continuationToken,
380
- });
381
- }
382
- }
383
- else {
384
- // Split scenario - one range from continuation token now maps to multiple ranges
385
- await this._handleContinuationTokenSplit(rangeWithToken, overlappingRanges);
386
- // Add all overlapping ranges with the same continuation token to processed ranges
387
- overlappingRanges.forEach((rangeValue) => {
388
- processedRanges.push({
389
- range: rangeValue,
390
- continuationToken: rangeWithToken.continuationToken,
391
- });
392
- });
393
- }
394
- }
395
- return processedRanges;
396
- }
397
- /**
398
- * Parses the continuation token based on query type
399
- * @param continuationToken - The continuation token string to parse
400
- * @returns Parsed continuation token object (ORDER BY or Parallel query token)
401
- * @throws ErrorResponse when continuation token is malformed or cannot be parsed
402
- */
403
- _parseContinuationToken(continuationToken) {
404
- try {
405
- return this.queryProcessingStrategy.parseContinuationToken(continuationToken);
406
- }
407
- catch (e) {
408
- throw new ErrorResponse_js_1.ErrorResponse(`Invalid continuation token format. Expected token with rangeMappings property. ` +
409
- `Ensure the continuation token was generated by a compatible query and has not been modified.`);
410
- }
411
- }
412
- /**
413
- * Handles partition merge scenario for continuation token ranges
414
- */
415
- async _handleContinuationTokenMerge(rangeWithToken, _newMergedRange) {
416
- const rangeKey = `${rangeWithToken.queryRange.min}-${rangeWithToken.queryRange.max}`;
417
- this.updatedContinuationRanges.set(rangeKey, {
418
- oldRange: {
419
- min: rangeWithToken.queryRange.min,
420
- max: rangeWithToken.queryRange.max,
421
- isMinInclusive: true, // Assumption: min is always inclusive
422
- isMaxInclusive: false, // Assumption: max is always exclusive
423
- },
424
- newRanges: [
425
- {
426
- min: rangeWithToken.queryRange.min,
427
- max: rangeWithToken.queryRange.max,
428
- isMinInclusive: true, // Assumption: min is always inclusive
429
- isMaxInclusive: false, // Assumption: max is always exclusive
430
- },
431
- ],
432
- continuationToken: rangeWithToken.continuationToken,
433
- });
434
- }
435
- /**
436
- * Handles partition split scenario for continuation token ranges
437
- */
438
- async _handleContinuationTokenSplit(rangeWithToken, overlappingRanges) {
439
- const rangeKey = `${rangeWithToken.queryRange.min}-${rangeWithToken.queryRange.max}`;
440
- this.updatedContinuationRanges.set(rangeKey, {
441
- oldRange: {
442
- min: rangeWithToken.queryRange.min,
443
- max: rangeWithToken.queryRange.max,
444
- isMinInclusive: true, // Assumption: min is always inclusive
445
- isMaxInclusive: false, // Assumption: max is always exclusive
446
- },
447
- newRanges: overlappingRanges.map((range) => ({
448
- min: range.minInclusive,
449
- max: range.maxExclusive,
450
- isMinInclusive: true,
451
- isMaxInclusive: false,
452
- })),
453
- continuationToken: rangeWithToken.continuationToken,
674
+ const bufferedResults = this.buffer;
675
+ this.buffer = [];
676
+ const partitionDataPatchMap = this.partitionDataPatchMap;
677
+ this.partitionDataPatchMap = /* @__PURE__ */ new Map();
678
+ this.patchCounter = 0;
679
+ const updatedContinuationRanges = Object.fromEntries(
680
+ this.updatedContinuationRanges
681
+ );
682
+ this.updatedContinuationRanges.clear();
683
+ this.sem.leave();
684
+ const result = (0, import_parallelQueryResult.createParallelQueryResult)(
685
+ bufferedResults,
686
+ partitionDataPatchMap,
687
+ updatedContinuationRanges,
688
+ void 0
689
+ );
690
+ return resolve({
691
+ result,
692
+ headers: this._getAndResetActiveResponseHeaders()
454
693
  });
455
- }
456
- /**
457
- * Handles partition merge scenario for continuation token ranges
458
- */
459
- _mergeWithActiveResponseHeaders(headers) {
460
- (0, headerUtils_js_1.mergeHeaders)(this.respHeaders, headers);
461
- }
462
- _getAndResetActiveResponseHeaders() {
463
- const ret = this.respHeaders;
464
- this.respHeaders = (0, headerUtils_js_1.getInitialHeader)();
465
- return ret;
466
- }
467
- getDiagnosticNode() {
468
- return this.diagnosticNodeWrapper.diagnosticNode;
469
- }
470
- async _onTargetPartitionRanges() {
471
- // invokes the callback when the target partition ranges are ready
472
- const parsedRanges = this.partitionedQueryExecutionInfo.queryRanges;
473
- const queryRanges = parsedRanges.map((item) => QueryRange_js_1.QueryRange.parseFromDict(item));
474
- return this.routingProvider.getOverlappingRanges(this.collectionLink, queryRanges, this.getDiagnosticNode());
475
- }
476
- /**
477
- * Gets the replacement ranges for a partitionkeyrange that has been split
478
- */
479
- async _getReplacementPartitionKeyRanges(documentProducer, diagnosticNode) {
480
- const partitionKeyRange = documentProducer.targetPartitionKeyRange;
481
- // Download the new routing map
482
- this.routingProvider = new smartRoutingMapProvider_js_1.SmartRoutingMapProvider(this.clientContext);
483
- // Get the queryRange that relates to this partitionKeyRange
484
- const queryRange = QueryRange_js_1.QueryRange.parsePartitionKeyRange(partitionKeyRange);
485
- return this.routingProvider.getOverlappingRanges(this.collectionLink, [queryRange], diagnosticNode);
486
- }
487
- async _enqueueReplacementDocumentProducers(error, diagnosticNode, documentProducer) {
488
- // Get the replacement ranges
489
- const replacementPartitionKeyRanges = await this._getReplacementPartitionKeyRanges(documentProducer, diagnosticNode);
490
- if (replacementPartitionKeyRanges.length === 0) {
491
- throw error;
492
- }
493
- if (this.requestContinuation) {
494
- // Update composite continuation token to handle partition split
495
- this._updateContinuationTokenOnPartitionChange(documentProducer, replacementPartitionKeyRanges);
694
+ });
695
+ });
696
+ }
697
+ /**
698
+ * Buffers document producers based on the maximum degree of parallelism.
699
+ * Moves document producers from the unfilled queue to the buffered queue.
700
+ * @param diagnosticNode - The diagnostic node for logging and tracing.
701
+ * @returns A promise that resolves when buffering is complete.
702
+ */
703
+ async bufferDocumentProducers(diagnosticNode) {
704
+ return new Promise((resolve, reject) => {
705
+ this.sem.take(async () => {
706
+ if (this.err) {
707
+ this.sem.leave();
708
+ reject(this.err);
709
+ return;
496
710
  }
497
- if (replacementPartitionKeyRanges.length === 1) {
498
- // Partition is gone due to Merge
499
- // Create the replacement documentProducer with populateEpkRangeHeaders Flag set to true to set startEpk and endEpk headers
500
- const replacementDocumentProducer = this._createTargetPartitionQueryExecutionContext(replacementPartitionKeyRanges[0], documentProducer.continuationToken, documentProducer.startEpk, documentProducer.endEpk, true);
501
- this.unfilledDocumentProducersQueue.enq(replacementDocumentProducer);
711
+ this.updateStates(this.err);
712
+ if (this.state === ParallelQueryExecutionContextBase.STATES.ended) {
713
+ this.sem.leave();
714
+ resolve();
715
+ return;
502
716
  }
503
- else {
504
- // Create the replacement documentProducers
505
- const replacementDocumentProducers = [];
506
- replacementPartitionKeyRanges.forEach((partitionKeyRange) => {
507
- const queryRange = QueryRange_js_1.QueryRange.parsePartitionKeyRange(partitionKeyRange);
508
- // Create replacment document producers with the parent's continuationToken
509
- const replacementDocumentProducer = this._createTargetPartitionQueryExecutionContext(partitionKeyRange, documentProducer.continuationToken, queryRange.min, queryRange.max, false);
510
- replacementDocumentProducers.push(replacementDocumentProducer);
511
- });
512
- // add document producers to the queue
513
- replacementDocumentProducers.forEach((replacementDocumentProducer) => {
514
- if (replacementDocumentProducer.hasMoreResults()) {
515
- this.unfilledDocumentProducersQueue.enq(replacementDocumentProducer);
516
- }
517
- });
518
- }
519
- }
520
- _updateContinuationTokenOnPartitionChange(originalDocumentProducer, replacementPartitionKeyRanges) {
521
- const rangeWithToken = this._createQueryRangeWithContinuationToken(originalDocumentProducer);
522
- if (replacementPartitionKeyRanges.length === 1) {
523
- this._handleContinuationTokenMerge(rangeWithToken, replacementPartitionKeyRanges[0]);
717
+ if (this.unfilledDocumentProducersQueue.size() === 0) {
718
+ this.sem.leave();
719
+ resolve();
720
+ return;
524
721
  }
525
- else {
526
- this._handleContinuationTokenSplit(rangeWithToken, replacementPartitionKeyRanges);
527
- }
528
- }
529
- /**
530
- * Creates a QueryRangeWithContinuationToken object from a DocumentProducer.
531
- * Uses the DocumentProducer's target partition key range and continuation token.
532
- * @param documentProducer - The DocumentProducer to convert
533
- * @returns QueryRangeWithContinuationToken object for token operations
534
- */
535
- _createQueryRangeWithContinuationToken(documentProducer) {
536
- const partitionRange = documentProducer.targetPartitionKeyRange;
537
- // Create a simplified QueryRange using the partition key range boundaries
538
- const simplifiedQueryRange = {
539
- min: documentProducer.startEpk || partitionRange.minInclusive,
540
- max: documentProducer.endEpk || partitionRange.maxExclusive,
541
- };
542
- return {
543
- queryRange: simplifiedQueryRange,
544
- continuationToken: documentProducer.continuationToken,
545
- };
546
- }
547
- static _needPartitionKeyRangeCacheRefresh(error) {
548
- // TODO: any error
549
- return (error.code === statusCodes_js_1.StatusCodes.Gone &&
550
- "substatus" in error &&
551
- error["substatus"] === statusCodes_js_1.SubStatusCodes.PartitionKeyRangeGone);
552
- }
553
- /**
554
- * Replaces the format placeholder in the rewritten query with the provided filter condition.
555
- * Handles both string queries and SqlQuerySpec objects.
556
- */
557
- _replaceFormatPlaceholder(rewrittenQuery, formatPlaceHolder, filterCondition) {
558
- const replacement = filterCondition ?? "true";
559
- // If rewrittenQuery has a query property, it's a SqlQuerySpec object
560
- if (typeof rewrittenQuery === "object" && rewrittenQuery !== null && rewrittenQuery.query) {
561
- return rewrittenQuery.query.replace(formatPlaceHolder, replacement);
562
- }
563
- // Otherwise, it's a string
564
- return rewrittenQuery.replace(formatPlaceHolder, replacement);
565
- }
566
- /**
567
- * Creates target partition range Query Execution Context
568
- */
569
- _createTargetPartitionQueryExecutionContext(partitionKeyTargetRange, continuationToken, startEpk, endEpk, populateEpkRangeHeaders, filterCondition, filterContext) {
570
- const rewrittenQuery = this.partitionedQueryExecutionInfo.queryInfo?.rewrittenQuery;
571
- let sqlQuerySpec;
572
- const query = this.query;
573
- if (typeof query === "string") {
574
- sqlQuerySpec = { query };
575
- }
576
- else {
577
- sqlQuerySpec = query;
578
- }
579
- const formatPlaceHolder = "{documentdb-formattableorderbyquery-filter}";
580
- if (rewrittenQuery) {
581
- sqlQuerySpec = JSON.parse(JSON.stringify(sqlQuerySpec));
582
- const replacedQuery = this._replaceFormatPlaceholder(rewrittenQuery, formatPlaceHolder, filterCondition);
583
- sqlQuerySpec["query"] = replacedQuery;
584
- }
585
- const options = { ...this.options };
586
- options.continuationToken = continuationToken;
587
- let filter;
588
- if (filterContext) {
589
- filter = new RidSkipCountFilter_js_1.RidSkipCountFilter(filterContext);
590
- }
591
- return new documentProducer_js_1.DocumentProducer(this.clientContext, this.collectionLink, sqlQuerySpec, partitionKeyTargetRange, options, this.correlatedActivityId, startEpk, endEpk, populateEpkRangeHeaders, filter);
592
- }
593
- async drainBufferedItems() {
594
- return new Promise((resolve, reject) => {
595
- this.sem.take(() => {
596
- if (this.err) {
597
- // if there is a prior error return error
598
- this.sem.leave();
599
- this.err.headers = this._getAndResetActiveResponseHeaders();
600
- reject(this.err);
601
- return;
602
- }
603
- // return undefined if there is no more results
604
- if (this.buffer.length === 0) {
605
- this.sem.leave();
606
- const partitionDataPatchMap = this.partitionDataPatchMap;
607
- this.partitionDataPatchMap = new Map();
608
- this.patchCounter = 0;
609
- // Get and reset updated continuation ranges
610
- const updatedContinuationRanges = Object.fromEntries(this.updatedContinuationRanges);
611
- this.updatedContinuationRanges.clear();
612
- const result = (0, parallelQueryResult_js_1.createParallelQueryResult)([], partitionDataPatchMap, updatedContinuationRanges, undefined);
613
- return resolve({
614
- result: this.state === ParallelQueryExecutionContextBase.STATES.ended ? undefined : result,
615
- headers: this._getAndResetActiveResponseHeaders(),
616
- });
617
- }
618
- // draing the entire buffer object and return that in result of return object
619
- const bufferedResults = this.buffer;
620
- this.buffer = [];
621
- // reset the patchToRangeMapping
622
- const partitionDataPatchMap = this.partitionDataPatchMap;
623
- this.partitionDataPatchMap = new Map();
624
- this.patchCounter = 0;
625
- // Get and reset updated continuation ranges
626
- const updatedContinuationRanges = Object.fromEntries(this.updatedContinuationRanges);
627
- this.updatedContinuationRanges.clear();
628
- // release the lock before returning
629
- this.sem.leave();
630
- const result = (0, parallelQueryResult_js_1.createParallelQueryResult)(bufferedResults, partitionDataPatchMap, updatedContinuationRanges, undefined);
631
- return resolve({
632
- result,
633
- headers: this._getAndResetActiveResponseHeaders(),
634
- });
635
- });
636
- });
637
- }
638
- /**
639
- * Buffers document producers based on the maximum degree of parallelism.
640
- * Moves document producers from the unfilled queue to the buffered queue.
641
- * @param diagnosticNode - The diagnostic node for logging and tracing.
642
- * @returns A promise that resolves when buffering is complete.
643
- */
644
- async bufferDocumentProducers(diagnosticNode) {
645
- return new Promise((resolve, reject) => {
646
- this.sem.take(async () => {
647
- if (this.err) {
648
- this.sem.leave();
649
- reject(this.err);
650
- return;
651
- }
652
- this.updateStates(this.err);
653
- if (this.state === ParallelQueryExecutionContextBase.STATES.ended) {
654
- this.sem.leave();
655
- resolve();
656
- return;
657
- }
658
- if (this.unfilledDocumentProducersQueue.size() === 0) {
659
- this.sem.leave();
660
- resolve();
661
- return;
662
- }
663
- try {
664
- const maxDegreeOfParallelism = this.options.maxDegreeOfParallelism === undefined ||
665
- this.options.maxDegreeOfParallelism < 1
666
- ? this.unfilledDocumentProducersQueue.size() // number of partitions
667
- : Math.min(this.options.maxDegreeOfParallelism, this.unfilledDocumentProducersQueue.size());
668
- const documentProducers = [];
669
- while (documentProducers.length < maxDegreeOfParallelism &&
670
- this.unfilledDocumentProducersQueue.size() > 0) {
671
- let documentProducer;
672
- try {
673
- documentProducer = this.unfilledDocumentProducersQueue.deq();
674
- }
675
- catch (e) {
676
- this.err = e;
677
- this.err.headers = this._getAndResetActiveResponseHeaders();
678
- reject(this.err);
679
- return;
680
- }
681
- documentProducers.push(documentProducer);
682
- }
683
- const bufferDocumentProducer = async (documentProducer) => {
684
- try {
685
- const headers = await documentProducer.bufferMore(diagnosticNode);
686
- this._mergeWithActiveResponseHeaders(headers);
687
- // Always track this document producer in patchToRangeMapping, even if it has no results
688
- // This ensures we maintain a record of all partition ranges that were scanned
689
- const nextItem = documentProducer.peakNextItem();
690
- if (nextItem !== undefined) {
691
- this.bufferedDocumentProducersQueue.enq(documentProducer);
692
- }
693
- else {
694
- // Track document producer with no results in patchToRangeMapping
695
- // This represents a scanned partition that yielded no results
696
- // IMPORTANT: Only include if continuation token is NOT null/exhausted
697
- // Document producers with no data in buffer and no continuation token are exhausted and should not be added to partitionDataPatchMap to prevent infinite loops in order by queries
698
- if (documentProducer.continuationToken &&
699
- documentProducer.continuationToken !== "" &&
700
- documentProducer.continuationToken.toLowerCase() !== "null") {
701
- const patchKey = `empty-${documentProducer.targetPartitionKeyRange.id}-${documentProducer.targetPartitionKeyRange.minInclusive}`;
702
- this.partitionDataPatchMap.set(patchKey, {
703
- itemCount: 0, // 0 items for empty result set
704
- partitionKeyRange: documentProducer.targetPartitionKeyRange,
705
- continuationToken: documentProducer.continuationToken,
706
- });
707
- }
708
- if (documentProducer.hasMoreResults()) {
709
- this.unfilledDocumentProducersQueue.enq(documentProducer);
710
- }
711
- }
712
- }
713
- catch (err) {
714
- if (ParallelQueryExecutionContextBase._needPartitionKeyRangeCacheRefresh(err)) {
715
- // We want the document producer enqueued
716
- // So that later parts of the code can repair the execution context
717
- // refresh the partition key ranges and ctreate new document producers and add it to the queue
718
- await this._enqueueReplacementDocumentProducers(err, diagnosticNode, documentProducer);
719
- resolve();
720
- }
721
- else {
722
- this.err = err;
723
- this.err.headers = this._getAndResetActiveResponseHeaders();
724
- reject(err);
725
- }
726
- }
727
- };
728
- try {
729
- await Promise.all(documentProducers.map((producer) => bufferDocumentProducer(producer)));
730
- }
731
- catch (err) {
732
- this.err = err;
733
- this.err.headers = this._getAndResetActiveResponseHeaders();
734
- reject(err);
735
- return;
736
- }
737
- resolve();
738
- }
739
- catch (err) {
740
- this.err = err;
741
- this.err.headers = this._getAndResetActiveResponseHeaders();
742
- reject(err);
743
- }
744
- finally {
745
- this.sem.leave();
746
- }
747
- });
748
- });
749
- }
750
- /**
751
- * Drains the buffer of filled document producers and appends their items to the main buffer.
752
- * Uses template method pattern - delegates actual processing to subclasses.
753
- * @returns A promise that resolves when the buffer is filled.
754
- */
755
- async fillBufferFromBufferQueue() {
756
- return new Promise((resolve, reject) => {
757
- this.sem.take(async () => {
758
- if (this.err) {
759
- // if there is a prior error return error
760
- this.sem.leave();
761
- this.err.headers = this._getAndResetActiveResponseHeaders();
762
- reject(this.err);
763
- return;
764
- }
765
- if (this.state === ParallelQueryExecutionContextBase.STATES.ended ||
766
- this.bufferedDocumentProducersQueue.size() === 0) {
767
- this.sem.leave();
768
- resolve();
769
- return;
770
- }
771
- try {
772
- await this.processBufferedDocumentProducers();
773
- this.updateStates(this.err);
774
- }
775
- catch (err) {
776
- this.err = err;
777
- this.err.headers = this._getAndResetActiveResponseHeaders();
778
- reject(this.err);
779
- return;
722
+ try {
723
+ const maxDegreeOfParallelism = this.options.maxDegreeOfParallelism === void 0 || this.options.maxDegreeOfParallelism < 1 ? this.unfilledDocumentProducersQueue.size() : Math.min(
724
+ this.options.maxDegreeOfParallelism,
725
+ this.unfilledDocumentProducersQueue.size()
726
+ );
727
+ const documentProducers = [];
728
+ while (documentProducers.length < maxDegreeOfParallelism && this.unfilledDocumentProducersQueue.size() > 0) {
729
+ let documentProducer;
730
+ try {
731
+ documentProducer = this.unfilledDocumentProducersQueue.deq();
732
+ } catch (e) {
733
+ this.err = e;
734
+ this.err.headers = this._getAndResetActiveResponseHeaders();
735
+ reject(this.err);
736
+ return;
737
+ }
738
+ documentProducers.push(documentProducer);
739
+ }
740
+ const bufferDocumentProducer = async (documentProducer) => {
741
+ try {
742
+ const headers = await documentProducer.bufferMore(diagnosticNode);
743
+ this._mergeWithActiveResponseHeaders(headers);
744
+ const nextItem = documentProducer.peakNextItem();
745
+ if (nextItem !== void 0) {
746
+ this.bufferedDocumentProducersQueue.enq(documentProducer);
747
+ } else {
748
+ if (documentProducer.continuationToken && documentProducer.continuationToken !== "" && documentProducer.continuationToken.toLowerCase() !== "null") {
749
+ const patchKey = `empty-${documentProducer.targetPartitionKeyRange.id}-${documentProducer.targetPartitionKeyRange.minInclusive}`;
750
+ this.partitionDataPatchMap.set(patchKey, {
751
+ itemCount: 0,
752
+ // 0 items for empty result set
753
+ partitionKeyRange: documentProducer.targetPartitionKeyRange,
754
+ continuationToken: documentProducer.continuationToken
755
+ });
780
756
  }
781
- finally {
782
- // release the lock before returning
783
- this.sem.leave();
757
+ if (documentProducer.hasMoreResults()) {
758
+ this.unfilledDocumentProducersQueue.enq(documentProducer);
784
759
  }
760
+ }
761
+ } catch (err) {
762
+ if (ParallelQueryExecutionContextBase._needPartitionKeyRangeCacheRefresh(err)) {
763
+ await this._enqueueReplacementDocumentProducers(
764
+ err,
765
+ diagnosticNode,
766
+ documentProducer
767
+ );
785
768
  resolve();
786
- return;
787
- });
788
- });
789
- }
790
- updateStates(error) {
791
- if (error) {
792
- this.err = error;
793
- this.state = ParallelQueryExecutionContextBase.STATES.ended;
769
+ } else {
770
+ this.err = err;
771
+ this.err.headers = this._getAndResetActiveResponseHeaders();
772
+ reject(err);
773
+ }
774
+ }
775
+ };
776
+ try {
777
+ await Promise.all(
778
+ documentProducers.map((producer) => bufferDocumentProducer(producer))
779
+ );
780
+ } catch (err) {
781
+ this.err = err;
782
+ this.err.headers = this._getAndResetActiveResponseHeaders();
783
+ reject(err);
794
784
  return;
785
+ }
786
+ resolve();
787
+ } catch (err) {
788
+ this.err = err;
789
+ this.err.headers = this._getAndResetActiveResponseHeaders();
790
+ reject(err);
791
+ } finally {
792
+ this.sem.leave();
795
793
  }
796
- if (this.state === ParallelQueryExecutionContextBase.STATES.started) {
797
- this.state = ParallelQueryExecutionContextBase.STATES.inProgress;
794
+ });
795
+ });
796
+ }
797
+ /**
798
+ * Drains the buffer of filled document producers and appends their items to the main buffer.
799
+ * Uses template method pattern - delegates actual processing to subclasses.
800
+ * @returns A promise that resolves when the buffer is filled.
801
+ */
802
+ async fillBufferFromBufferQueue() {
803
+ return new Promise((resolve, reject) => {
804
+ this.sem.take(async () => {
805
+ if (this.err) {
806
+ this.sem.leave();
807
+ this.err.headers = this._getAndResetActiveResponseHeaders();
808
+ reject(this.err);
809
+ return;
798
810
  }
799
- const hasNoActiveProducers = this.unfilledDocumentProducersQueue.size() === 0 &&
800
- this.bufferedDocumentProducersQueue.size() === 0;
801
- if (hasNoActiveProducers) {
802
- this.state = ParallelQueryExecutionContextBase.STATES.ended;
811
+ if (this.state === ParallelQueryExecutionContextBase.STATES.ended || this.bufferedDocumentProducersQueue.size() === 0) {
812
+ this.sem.leave();
813
+ resolve();
814
+ return;
803
815
  }
804
- }
816
+ try {
817
+ await this.processBufferedDocumentProducers();
818
+ this.updateStates(this.err);
819
+ } catch (err) {
820
+ this.err = err;
821
+ this.err.headers = this._getAndResetActiveResponseHeaders();
822
+ reject(this.err);
823
+ return;
824
+ } finally {
825
+ this.sem.leave();
826
+ }
827
+ resolve();
828
+ return;
829
+ });
830
+ });
831
+ }
832
+ updateStates(error) {
833
+ if (error) {
834
+ this.err = error;
835
+ this.state = ParallelQueryExecutionContextBase.STATES.ended;
836
+ return;
837
+ }
838
+ if (this.state === ParallelQueryExecutionContextBase.STATES.started) {
839
+ this.state = ParallelQueryExecutionContextBase.STATES.inProgress;
840
+ }
841
+ const hasNoActiveProducers = this.unfilledDocumentProducersQueue.size() === 0 && this.bufferedDocumentProducersQueue.size() === 0;
842
+ if (hasNoActiveProducers) {
843
+ this.state = ParallelQueryExecutionContextBase.STATES.ended;
844
+ }
845
+ }
805
846
  }
806
- exports.ParallelQueryExecutionContextBase = ParallelQueryExecutionContextBase;
807
- //# sourceMappingURL=parallelQueryExecutionContextBase.js.map
847
+ // Annotate the CommonJS export names for ESM import in node:
848
+ 0 && (module.exports = {
849
+ ParallelQueryExecutionContextBase,
850
+ ParallelQueryExecutionContextBaseStates
851
+ });