@azure/cosmos 4.5.0-alpha.20250718.3 → 4.5.0-alpha.20250730.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 (1172) hide show
  1. package/dist/browser/ChangeFeedIterator.js +17 -11
  2. package/dist/browser/ChangeFeedIterator.js.map +1 -1
  3. package/dist/browser/ChangeFeedResponse.js +8 -0
  4. package/dist/browser/ChangeFeedResponse.js.map +1 -1
  5. package/dist/browser/ClientContext.js +122 -29
  6. package/dist/browser/ClientContext.js.map +1 -1
  7. package/dist/browser/CosmosClient.js +34 -3
  8. package/dist/browser/CosmosClient.js.map +1 -1
  9. package/dist/browser/CosmosDiagnostics.js +3 -0
  10. package/dist/browser/CosmosDiagnostics.js.map +1 -1
  11. package/dist/browser/PartitionKeyRangeFailoverInfo.js +8 -5
  12. package/dist/browser/PartitionKeyRangeFailoverInfo.js.map +1 -1
  13. package/dist/browser/bulk/Batcher.js +13 -3
  14. package/dist/browser/bulk/Batcher.js.map +1 -1
  15. package/dist/browser/bulk/BulkHelper.js +26 -11
  16. package/dist/browser/bulk/BulkHelper.js.map +1 -1
  17. package/dist/browser/bulk/BulkResponse.js +22 -20
  18. package/dist/browser/bulk/BulkResponse.js.map +1 -1
  19. package/dist/browser/bulk/CongestionAlgorithm.js +11 -4
  20. package/dist/browser/bulk/CongestionAlgorithm.js.map +1 -1
  21. package/dist/browser/bulk/HelperPerPartition.js +14 -1
  22. package/dist/browser/bulk/HelperPerPartition.js.map +1 -1
  23. package/dist/browser/bulk/ItemOperationContext.js +4 -0
  24. package/dist/browser/bulk/ItemOperationContext.js.map +1 -1
  25. package/dist/browser/bulk/Limiter.js +27 -18
  26. package/dist/browser/bulk/Limiter.js.map +1 -1
  27. package/dist/browser/bulk/PartitionMetric.js +4 -0
  28. package/dist/browser/bulk/PartitionMetric.js.map +1 -1
  29. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  30. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  31. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js +16 -8
  32. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  33. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  34. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  35. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  36. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  37. package/dist/browser/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  38. package/dist/browser/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  39. package/dist/browser/client/ChangeFeed/ChangeFeedRange.js +20 -0
  40. package/dist/browser/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  41. package/dist/browser/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  42. package/dist/browser/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  43. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  44. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  45. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  46. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  47. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  48. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  49. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  50. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  51. package/dist/browser/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  52. package/dist/browser/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  53. package/dist/browser/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  54. package/dist/browser/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  55. package/dist/browser/client/ChangeFeed/FeedRange.js +8 -0
  56. package/dist/browser/client/ChangeFeed/FeedRange.js.map +1 -1
  57. package/dist/browser/client/ChangeFeed/FeedRangeQueue.js +1 -0
  58. package/dist/browser/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  59. package/dist/browser/client/ChangeFeed/changeFeedUtils.js +5 -5
  60. package/dist/browser/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  61. package/dist/browser/client/ClientUtils.js +1 -1
  62. package/dist/browser/client/ClientUtils.js.map +1 -1
  63. package/dist/browser/client/Conflict/Conflict.js +4 -0
  64. package/dist/browser/client/Conflict/Conflict.js.map +1 -1
  65. package/dist/browser/client/Conflict/ConflictResponse.js +2 -0
  66. package/dist/browser/client/Conflict/ConflictResponse.js.map +1 -1
  67. package/dist/browser/client/Conflict/Conflicts.js +2 -0
  68. package/dist/browser/client/Conflict/Conflicts.js.map +1 -1
  69. package/dist/browser/client/Container/Container.js +18 -3
  70. package/dist/browser/client/Container/Container.js.map +1 -1
  71. package/dist/browser/client/Container/ContainerResponse.js +2 -0
  72. package/dist/browser/client/Container/ContainerResponse.js.map +1 -1
  73. package/dist/browser/client/Container/Containers.js +4 -2
  74. package/dist/browser/client/Container/Containers.js.map +1 -1
  75. package/dist/browser/client/Database/Database.js +33 -0
  76. package/dist/browser/client/Database/Database.js.map +1 -1
  77. package/dist/browser/client/Database/DatabaseResponse.js +2 -0
  78. package/dist/browser/client/Database/DatabaseResponse.js.map +1 -1
  79. package/dist/browser/client/Database/Databases.js +3 -0
  80. package/dist/browser/client/Database/Databases.js.map +1 -1
  81. package/dist/browser/client/Item/Item.js +4 -0
  82. package/dist/browser/client/Item/Item.js.map +1 -1
  83. package/dist/browser/client/Item/ItemResponse.js +2 -0
  84. package/dist/browser/client/Item/ItemResponse.js.map +1 -1
  85. package/dist/browser/client/Item/Items.js +3 -0
  86. package/dist/browser/client/Item/Items.js.map +1 -1
  87. package/dist/browser/client/Offer/Offer.js +3 -0
  88. package/dist/browser/client/Offer/Offer.js.map +1 -1
  89. package/dist/browser/client/Offer/OfferResponse.js +2 -0
  90. package/dist/browser/client/Offer/OfferResponse.js.map +1 -1
  91. package/dist/browser/client/Offer/Offers.js +2 -0
  92. package/dist/browser/client/Offer/Offers.js.map +1 -1
  93. package/dist/browser/client/Permission/Permission.js +3 -0
  94. package/dist/browser/client/Permission/Permission.js.map +1 -1
  95. package/dist/browser/client/Permission/PermissionResponse.js +2 -0
  96. package/dist/browser/client/Permission/PermissionResponse.js.map +1 -1
  97. package/dist/browser/client/Permission/Permissions.js +2 -0
  98. package/dist/browser/client/Permission/Permissions.js.map +1 -1
  99. package/dist/browser/client/SasToken/SasTokenProperties.js +17 -0
  100. package/dist/browser/client/SasToken/SasTokenProperties.js.map +1 -1
  101. package/dist/browser/client/Script/Scripts.js +5 -0
  102. package/dist/browser/client/Script/Scripts.js.map +1 -1
  103. package/dist/browser/client/StoredProcedure/StoredProcedure.js +3 -0
  104. package/dist/browser/client/StoredProcedure/StoredProcedure.js.map +1 -1
  105. package/dist/browser/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  106. package/dist/browser/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  107. package/dist/browser/client/StoredProcedure/StoredProcedures.js +2 -0
  108. package/dist/browser/client/StoredProcedure/StoredProcedures.js.map +1 -1
  109. package/dist/browser/client/Trigger/Trigger.js +3 -0
  110. package/dist/browser/client/Trigger/Trigger.js.map +1 -1
  111. package/dist/browser/client/Trigger/TriggerResponse.js +2 -0
  112. package/dist/browser/client/Trigger/TriggerResponse.js.map +1 -1
  113. package/dist/browser/client/Trigger/Triggers.js +2 -0
  114. package/dist/browser/client/Trigger/Triggers.js.map +1 -1
  115. package/dist/browser/client/User/User.js +9 -0
  116. package/dist/browser/client/User/User.js.map +1 -1
  117. package/dist/browser/client/User/UserResponse.js +2 -0
  118. package/dist/browser/client/User/UserResponse.js.map +1 -1
  119. package/dist/browser/client/User/Users.js +2 -0
  120. package/dist/browser/client/User/Users.js.map +1 -1
  121. package/dist/browser/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  122. package/dist/browser/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  123. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  124. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  125. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  126. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  127. package/dist/browser/diagnostics/CosmosDiagnosticsContext.js +8 -7
  128. package/dist/browser/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  129. package/dist/browser/diagnostics/DiagnosticNodeInternal.js +26 -7
  130. package/dist/browser/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  131. package/dist/browser/diagnostics/DiagnosticWriter.js +1 -3
  132. package/dist/browser/diagnostics/DiagnosticWriter.js.map +1 -1
  133. package/dist/browser/diagnostics/index.js +2 -2
  134. package/dist/browser/diagnostics/index.js.map +1 -1
  135. package/dist/browser/documents/DatabaseAccount.js +20 -4
  136. package/dist/browser/documents/DatabaseAccount.js.map +1 -1
  137. package/dist/browser/documents/PartitionKey.js +1 -3
  138. package/dist/browser/documents/PartitionKey.js.map +1 -1
  139. package/dist/browser/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  140. package/dist/browser/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  141. package/dist/browser/encryption/Cache/EncryptionSettingsCache.js +2 -0
  142. package/dist/browser/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  143. package/dist/browser/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  144. package/dist/browser/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  145. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  146. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  147. package/dist/browser/encryption/EncryptionItemQueryIterator.js +24 -27
  148. package/dist/browser/encryption/EncryptionItemQueryIterator.js.map +1 -1
  149. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  150. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  151. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  152. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  153. package/dist/browser/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  154. package/dist/browser/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  155. package/dist/browser/encryption/EncryptionKeyStoreProvider.js +8 -1
  156. package/dist/browser/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  157. package/dist/browser/encryption/EncryptionManager.js +6 -0
  158. package/dist/browser/encryption/EncryptionManager.js.map +1 -1
  159. package/dist/browser/encryption/EncryptionProcessor.js +5 -0
  160. package/dist/browser/encryption/EncryptionProcessor.js.map +1 -1
  161. package/dist/browser/encryption/EncryptionQueryBuilder.js +2 -0
  162. package/dist/browser/encryption/EncryptionQueryBuilder.js.map +1 -1
  163. package/dist/browser/encryption/EncryptionSettingForProperty.js +6 -0
  164. package/dist/browser/encryption/EncryptionSettingForProperty.js.map +1 -1
  165. package/dist/browser/encryption/EncryptionSettings.js +6 -3
  166. package/dist/browser/encryption/EncryptionSettings.js.map +1 -1
  167. package/dist/browser/encryption/KeyEncryptionKey.js +4 -0
  168. package/dist/browser/encryption/KeyEncryptionKey.js.map +1 -1
  169. package/dist/browser/encryption/Serializers/StringSerializer.js +1 -1
  170. package/dist/browser/encryption/Serializers/StringSerializer.js.map +1 -1
  171. package/dist/browser/extractPartitionKey.js +2 -2
  172. package/dist/browser/extractPartitionKey.js.map +1 -1
  173. package/dist/browser/globalEndpointManager.js +21 -4
  174. package/dist/browser/globalEndpointManager.js.map +1 -1
  175. package/dist/browser/globalPartitionEndpointManager.js +8 -0
  176. package/dist/browser/globalPartitionEndpointManager.js.map +1 -1
  177. package/dist/browser/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  178. package/dist/browser/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  179. package/dist/browser/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  180. package/dist/browser/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  181. package/dist/browser/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  182. package/dist/browser/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  183. package/dist/browser/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  184. package/dist/browser/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  185. package/dist/browser/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  186. package/dist/browser/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  187. package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  188. package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  189. package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  190. package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  191. package/dist/browser/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  192. package/dist/browser/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  193. package/dist/browser/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  194. package/dist/browser/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  195. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  196. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  197. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  198. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  199. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  200. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  201. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  202. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  203. package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  204. package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  205. package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  206. package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  207. package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  208. package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  209. package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  210. package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  211. package/dist/browser/queryExecutionContext/FetchResult.js +4 -0
  212. package/dist/browser/queryExecutionContext/FetchResult.js.map +1 -1
  213. package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  214. package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  215. package/dist/browser/queryExecutionContext/documentProducer.js +34 -21
  216. package/dist/browser/queryExecutionContext/documentProducer.js.map +1 -1
  217. package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  218. package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  219. package/dist/browser/queryExecutionContext/orderByComparator.js +1 -0
  220. package/dist/browser/queryExecutionContext/orderByComparator.js.map +1 -1
  221. package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  222. package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  223. package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  224. package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  225. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  226. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  227. package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  228. package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  229. package/dist/browser/queryIterator.js +41 -33
  230. package/dist/browser/queryIterator.js.map +1 -1
  231. package/dist/browser/queryMetrics/clientSideMetrics.js +2 -1
  232. package/dist/browser/queryMetrics/clientSideMetrics.js.map +1 -1
  233. package/dist/browser/queryMetrics/queryMetrics.js +14 -1
  234. package/dist/browser/queryMetrics/queryMetrics.js.map +1 -1
  235. package/dist/browser/queryMetrics/queryPreparationTime.js +5 -1
  236. package/dist/browser/queryMetrics/queryPreparationTime.js.map +1 -1
  237. package/dist/browser/queryMetrics/runtimeExecutionTimes.js +4 -1
  238. package/dist/browser/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  239. package/dist/browser/queryMetrics/timeSpan.js +4 -3
  240. package/dist/browser/queryMetrics/timeSpan.js.map +1 -1
  241. package/dist/browser/request/ErrorResponse.js +19 -0
  242. package/dist/browser/request/ErrorResponse.js.map +1 -1
  243. package/dist/browser/request/FeedResponse.js +4 -0
  244. package/dist/browser/request/FeedResponse.js.map +1 -1
  245. package/dist/browser/request/RequestHandler.js +1 -2
  246. package/dist/browser/request/RequestHandler.js.map +1 -1
  247. package/dist/browser/request/ResourceResponse.js +5 -0
  248. package/dist/browser/request/ResourceResponse.js.map +1 -1
  249. package/dist/browser/request/TimeoutError.js +1 -1
  250. package/dist/browser/request/TimeoutError.js.map +1 -1
  251. package/dist/browser/request/hybridSearchQueryResult.js +5 -0
  252. package/dist/browser/request/hybridSearchQueryResult.js.map +1 -1
  253. package/dist/browser/request/request.js +5 -1
  254. package/dist/browser/request/request.js.map +1 -1
  255. package/dist/browser/retry/bulkExecutionRetryPolicy.js +5 -2
  256. package/dist/browser/retry/bulkExecutionRetryPolicy.js.map +1 -1
  257. package/dist/browser/retry/defaultRetryPolicy.js +4 -3
  258. package/dist/browser/retry/defaultRetryPolicy.js.map +1 -1
  259. package/dist/browser/retry/endpointDiscoveryRetryPolicy.js +11 -2
  260. package/dist/browser/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  261. package/dist/browser/retry/resourceThrottleRetryPolicy.js +20 -10
  262. package/dist/browser/retry/resourceThrottleRetryPolicy.js.map +1 -1
  263. package/dist/browser/retry/retryUtility.js +2 -3
  264. package/dist/browser/retry/retryUtility.js.map +1 -1
  265. package/dist/browser/retry/sessionRetryPolicy.js +8 -4
  266. package/dist/browser/retry/sessionRetryPolicy.js.map +1 -1
  267. package/dist/browser/retry/timeoutFailoverRetryPolicy.js +14 -4
  268. package/dist/browser/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  269. package/dist/browser/routing/QueryRange.js +4 -0
  270. package/dist/browser/routing/QueryRange.js.map +1 -1
  271. package/dist/browser/routing/inMemoryCollectionRoutingMap.js +4 -0
  272. package/dist/browser/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  273. package/dist/browser/routing/partitionKeyRangeCache.js +2 -0
  274. package/dist/browser/routing/partitionKeyRangeCache.js.map +1 -1
  275. package/dist/browser/routing/smartRoutingMapProvider.js +1 -0
  276. package/dist/browser/routing/smartRoutingMapProvider.js.map +1 -1
  277. package/dist/browser/session/VectorSessionToken.js +6 -2
  278. package/dist/browser/session/VectorSessionToken.js.map +1 -1
  279. package/dist/browser/session/sessionContainer.js +5 -3
  280. package/dist/browser/session/sessionContainer.js.map +1 -1
  281. package/dist/browser/utils/batch.js +15 -4
  282. package/dist/browser/utils/batch.js.map +1 -1
  283. package/dist/browser/utils/fixedSizePriorityQueue.js +4 -0
  284. package/dist/browser/utils/fixedSizePriorityQueue.js.map +1 -1
  285. package/dist/browser/utils/hashing/hash.js +1 -1
  286. package/dist/browser/utils/hashing/hash.js.map +1 -1
  287. package/dist/browser/utils/nonStreamingOrderByMap.js +2 -0
  288. package/dist/browser/utils/nonStreamingOrderByMap.js.map +1 -1
  289. package/dist/commonjs/ChangeFeedIterator.js +17 -11
  290. package/dist/commonjs/ChangeFeedIterator.js.map +1 -1
  291. package/dist/commonjs/ChangeFeedResponse.js +8 -0
  292. package/dist/commonjs/ChangeFeedResponse.js.map +1 -1
  293. package/dist/commonjs/ClientContext.js +122 -29
  294. package/dist/commonjs/ClientContext.js.map +1 -1
  295. package/dist/commonjs/CosmosClient.js +34 -3
  296. package/dist/commonjs/CosmosClient.js.map +1 -1
  297. package/dist/commonjs/CosmosDiagnostics.js +3 -0
  298. package/dist/commonjs/CosmosDiagnostics.js.map +1 -1
  299. package/dist/commonjs/PartitionKeyRangeFailoverInfo.js +8 -5
  300. package/dist/commonjs/PartitionKeyRangeFailoverInfo.js.map +1 -1
  301. package/dist/commonjs/bulk/Batcher.js +13 -3
  302. package/dist/commonjs/bulk/Batcher.js.map +1 -1
  303. package/dist/commonjs/bulk/BulkHelper.js +26 -11
  304. package/dist/commonjs/bulk/BulkHelper.js.map +1 -1
  305. package/dist/commonjs/bulk/BulkResponse.js +22 -20
  306. package/dist/commonjs/bulk/BulkResponse.js.map +1 -1
  307. package/dist/commonjs/bulk/CongestionAlgorithm.js +11 -4
  308. package/dist/commonjs/bulk/CongestionAlgorithm.js.map +1 -1
  309. package/dist/commonjs/bulk/HelperPerPartition.js +14 -1
  310. package/dist/commonjs/bulk/HelperPerPartition.js.map +1 -1
  311. package/dist/commonjs/bulk/ItemOperationContext.js +4 -0
  312. package/dist/commonjs/bulk/ItemOperationContext.js.map +1 -1
  313. package/dist/commonjs/bulk/Limiter.js +27 -18
  314. package/dist/commonjs/bulk/Limiter.js.map +1 -1
  315. package/dist/commonjs/bulk/PartitionMetric.js +4 -0
  316. package/dist/commonjs/bulk/PartitionMetric.js.map +1 -1
  317. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  318. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  319. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js +16 -8
  320. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  321. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  322. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  323. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  324. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  325. package/dist/commonjs/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  326. package/dist/commonjs/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  327. package/dist/commonjs/client/ChangeFeed/ChangeFeedRange.js +20 -0
  328. package/dist/commonjs/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  329. package/dist/commonjs/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  330. package/dist/commonjs/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  331. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  332. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  333. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  334. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  335. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  336. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  337. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  338. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  339. package/dist/commonjs/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  340. package/dist/commonjs/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  341. package/dist/commonjs/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  342. package/dist/commonjs/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  343. package/dist/commonjs/client/ChangeFeed/FeedRange.js +8 -0
  344. package/dist/commonjs/client/ChangeFeed/FeedRange.js.map +1 -1
  345. package/dist/commonjs/client/ChangeFeed/FeedRangeQueue.js +1 -0
  346. package/dist/commonjs/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  347. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js +5 -5
  348. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  349. package/dist/commonjs/client/ClientUtils.js +1 -1
  350. package/dist/commonjs/client/ClientUtils.js.map +1 -1
  351. package/dist/commonjs/client/Conflict/Conflict.js +4 -0
  352. package/dist/commonjs/client/Conflict/Conflict.js.map +1 -1
  353. package/dist/commonjs/client/Conflict/ConflictResponse.js +2 -0
  354. package/dist/commonjs/client/Conflict/ConflictResponse.js.map +1 -1
  355. package/dist/commonjs/client/Conflict/Conflicts.js +2 -0
  356. package/dist/commonjs/client/Conflict/Conflicts.js.map +1 -1
  357. package/dist/commonjs/client/Container/Container.js +18 -3
  358. package/dist/commonjs/client/Container/Container.js.map +1 -1
  359. package/dist/commonjs/client/Container/ContainerResponse.js +2 -0
  360. package/dist/commonjs/client/Container/ContainerResponse.js.map +1 -1
  361. package/dist/commonjs/client/Container/Containers.js +4 -2
  362. package/dist/commonjs/client/Container/Containers.js.map +1 -1
  363. package/dist/commonjs/client/Database/Database.js +33 -0
  364. package/dist/commonjs/client/Database/Database.js.map +1 -1
  365. package/dist/commonjs/client/Database/DatabaseResponse.js +2 -0
  366. package/dist/commonjs/client/Database/DatabaseResponse.js.map +1 -1
  367. package/dist/commonjs/client/Database/Databases.js +3 -0
  368. package/dist/commonjs/client/Database/Databases.js.map +1 -1
  369. package/dist/commonjs/client/Item/Item.js +4 -0
  370. package/dist/commonjs/client/Item/Item.js.map +1 -1
  371. package/dist/commonjs/client/Item/ItemResponse.js +2 -0
  372. package/dist/commonjs/client/Item/ItemResponse.js.map +1 -1
  373. package/dist/commonjs/client/Item/Items.js +3 -0
  374. package/dist/commonjs/client/Item/Items.js.map +1 -1
  375. package/dist/commonjs/client/Offer/Offer.js +3 -0
  376. package/dist/commonjs/client/Offer/Offer.js.map +1 -1
  377. package/dist/commonjs/client/Offer/OfferResponse.js +2 -0
  378. package/dist/commonjs/client/Offer/OfferResponse.js.map +1 -1
  379. package/dist/commonjs/client/Offer/Offers.js +2 -0
  380. package/dist/commonjs/client/Offer/Offers.js.map +1 -1
  381. package/dist/commonjs/client/Permission/Permission.js +3 -0
  382. package/dist/commonjs/client/Permission/Permission.js.map +1 -1
  383. package/dist/commonjs/client/Permission/PermissionResponse.js +2 -0
  384. package/dist/commonjs/client/Permission/PermissionResponse.js.map +1 -1
  385. package/dist/commonjs/client/Permission/Permissions.js +2 -0
  386. package/dist/commonjs/client/Permission/Permissions.js.map +1 -1
  387. package/dist/commonjs/client/SasToken/SasTokenProperties.js +17 -0
  388. package/dist/commonjs/client/SasToken/SasTokenProperties.js.map +1 -1
  389. package/dist/commonjs/client/Script/Scripts.js +5 -0
  390. package/dist/commonjs/client/Script/Scripts.js.map +1 -1
  391. package/dist/commonjs/client/StoredProcedure/StoredProcedure.js +3 -0
  392. package/dist/commonjs/client/StoredProcedure/StoredProcedure.js.map +1 -1
  393. package/dist/commonjs/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  394. package/dist/commonjs/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  395. package/dist/commonjs/client/StoredProcedure/StoredProcedures.js +2 -0
  396. package/dist/commonjs/client/StoredProcedure/StoredProcedures.js.map +1 -1
  397. package/dist/commonjs/client/Trigger/Trigger.js +3 -0
  398. package/dist/commonjs/client/Trigger/Trigger.js.map +1 -1
  399. package/dist/commonjs/client/Trigger/TriggerResponse.js +2 -0
  400. package/dist/commonjs/client/Trigger/TriggerResponse.js.map +1 -1
  401. package/dist/commonjs/client/Trigger/Triggers.js +2 -0
  402. package/dist/commonjs/client/Trigger/Triggers.js.map +1 -1
  403. package/dist/commonjs/client/User/User.js +9 -0
  404. package/dist/commonjs/client/User/User.js.map +1 -1
  405. package/dist/commonjs/client/User/UserResponse.js +2 -0
  406. package/dist/commonjs/client/User/UserResponse.js.map +1 -1
  407. package/dist/commonjs/client/User/Users.js +2 -0
  408. package/dist/commonjs/client/User/Users.js.map +1 -1
  409. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  410. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  411. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  412. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  413. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  414. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  415. package/dist/commonjs/diagnostics/CosmosDiagnosticsContext.js +8 -7
  416. package/dist/commonjs/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  417. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js +26 -7
  418. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  419. package/dist/commonjs/diagnostics/DiagnosticWriter.js +1 -3
  420. package/dist/commonjs/diagnostics/DiagnosticWriter.js.map +1 -1
  421. package/dist/commonjs/diagnostics/index.js +2 -2
  422. package/dist/commonjs/diagnostics/index.js.map +1 -1
  423. package/dist/commonjs/documents/DatabaseAccount.js +20 -4
  424. package/dist/commonjs/documents/DatabaseAccount.js.map +1 -1
  425. package/dist/commonjs/documents/PartitionKey.js +1 -3
  426. package/dist/commonjs/documents/PartitionKey.js.map +1 -1
  427. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -2
  428. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  429. package/dist/commonjs/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  430. package/dist/commonjs/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  431. package/dist/commonjs/encryption/Cache/EncryptionSettingsCache.js +2 -0
  432. package/dist/commonjs/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  433. package/dist/commonjs/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  434. package/dist/commonjs/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  435. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.js +5 -0
  436. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -1
  437. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  438. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  439. package/dist/commonjs/encryption/EncryptionItemQueryIterator.js +24 -27
  440. package/dist/commonjs/encryption/EncryptionItemQueryIterator.js.map +1 -1
  441. package/dist/commonjs/encryption/EncryptionKey/DataEncryptionKey.js +7 -2
  442. package/dist/commonjs/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -1
  443. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  444. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  445. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  446. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  447. package/dist/commonjs/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  448. package/dist/commonjs/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  449. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.js +8 -1
  450. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  451. package/dist/commonjs/encryption/EncryptionManager.js +6 -0
  452. package/dist/commonjs/encryption/EncryptionManager.js.map +1 -1
  453. package/dist/commonjs/encryption/EncryptionProcessor.js +5 -0
  454. package/dist/commonjs/encryption/EncryptionProcessor.js.map +1 -1
  455. package/dist/commonjs/encryption/EncryptionQueryBuilder.js +2 -0
  456. package/dist/commonjs/encryption/EncryptionQueryBuilder.js.map +1 -1
  457. package/dist/commonjs/encryption/EncryptionSettingForProperty.js +6 -0
  458. package/dist/commonjs/encryption/EncryptionSettingForProperty.js.map +1 -1
  459. package/dist/commonjs/encryption/EncryptionSettings.js +6 -3
  460. package/dist/commonjs/encryption/EncryptionSettings.js.map +1 -1
  461. package/dist/commonjs/encryption/KeyEncryptionKey.js +4 -0
  462. package/dist/commonjs/encryption/KeyEncryptionKey.js.map +1 -1
  463. package/dist/commonjs/encryption/Serializers/StringSerializer.js +1 -1
  464. package/dist/commonjs/encryption/Serializers/StringSerializer.js.map +1 -1
  465. package/dist/commonjs/extractPartitionKey.js +2 -2
  466. package/dist/commonjs/extractPartitionKey.js.map +1 -1
  467. package/dist/commonjs/globalEndpointManager.js +21 -4
  468. package/dist/commonjs/globalEndpointManager.js.map +1 -1
  469. package/dist/commonjs/globalPartitionEndpointManager.js +8 -0
  470. package/dist/commonjs/globalPartitionEndpointManager.js.map +1 -1
  471. package/dist/commonjs/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  472. package/dist/commonjs/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  473. package/dist/commonjs/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  474. package/dist/commonjs/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  475. package/dist/commonjs/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  476. package/dist/commonjs/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  477. package/dist/commonjs/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  478. package/dist/commonjs/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  479. package/dist/commonjs/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  480. package/dist/commonjs/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  481. package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  482. package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  483. package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  484. package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  485. package/dist/commonjs/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  486. package/dist/commonjs/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  487. package/dist/commonjs/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  488. package/dist/commonjs/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  489. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  490. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  491. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  492. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  493. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  494. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  495. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  496. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  497. package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  498. package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  499. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  500. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  501. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  502. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  503. package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  504. package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  505. package/dist/commonjs/queryExecutionContext/FetchResult.js +4 -0
  506. package/dist/commonjs/queryExecutionContext/FetchResult.js.map +1 -1
  507. package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  508. package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  509. package/dist/commonjs/queryExecutionContext/documentProducer.js +34 -21
  510. package/dist/commonjs/queryExecutionContext/documentProducer.js.map +1 -1
  511. package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  512. package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  513. package/dist/commonjs/queryExecutionContext/orderByComparator.js +1 -0
  514. package/dist/commonjs/queryExecutionContext/orderByComparator.js.map +1 -1
  515. package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  516. package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  517. package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  518. package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  519. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  520. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  521. package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  522. package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  523. package/dist/commonjs/queryIterator.js +41 -33
  524. package/dist/commonjs/queryIterator.js.map +1 -1
  525. package/dist/commonjs/queryMetrics/clientSideMetrics.js +2 -1
  526. package/dist/commonjs/queryMetrics/clientSideMetrics.js.map +1 -1
  527. package/dist/commonjs/queryMetrics/queryMetrics.js +14 -1
  528. package/dist/commonjs/queryMetrics/queryMetrics.js.map +1 -1
  529. package/dist/commonjs/queryMetrics/queryPreparationTime.js +5 -1
  530. package/dist/commonjs/queryMetrics/queryPreparationTime.js.map +1 -1
  531. package/dist/commonjs/queryMetrics/runtimeExecutionTimes.js +4 -1
  532. package/dist/commonjs/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  533. package/dist/commonjs/queryMetrics/timeSpan.js +4 -3
  534. package/dist/commonjs/queryMetrics/timeSpan.js.map +1 -1
  535. package/dist/commonjs/request/ErrorResponse.js +19 -0
  536. package/dist/commonjs/request/ErrorResponse.js.map +1 -1
  537. package/dist/commonjs/request/FeedResponse.js +4 -0
  538. package/dist/commonjs/request/FeedResponse.js.map +1 -1
  539. package/dist/commonjs/request/RequestHandler.js +1 -2
  540. package/dist/commonjs/request/RequestHandler.js.map +1 -1
  541. package/dist/commonjs/request/ResourceResponse.js +5 -0
  542. package/dist/commonjs/request/ResourceResponse.js.map +1 -1
  543. package/dist/commonjs/request/TimeoutError.js +1 -1
  544. package/dist/commonjs/request/TimeoutError.js.map +1 -1
  545. package/dist/commonjs/request/hybridSearchQueryResult.js +5 -0
  546. package/dist/commonjs/request/hybridSearchQueryResult.js.map +1 -1
  547. package/dist/commonjs/request/request.js +5 -1
  548. package/dist/commonjs/request/request.js.map +1 -1
  549. package/dist/commonjs/retry/bulkExecutionRetryPolicy.js +5 -2
  550. package/dist/commonjs/retry/bulkExecutionRetryPolicy.js.map +1 -1
  551. package/dist/commonjs/retry/defaultRetryPolicy.js +4 -3
  552. package/dist/commonjs/retry/defaultRetryPolicy.js.map +1 -1
  553. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js +11 -2
  554. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  555. package/dist/commonjs/retry/resourceThrottleRetryPolicy.js +20 -10
  556. package/dist/commonjs/retry/resourceThrottleRetryPolicy.js.map +1 -1
  557. package/dist/commonjs/retry/retryUtility.js +2 -3
  558. package/dist/commonjs/retry/retryUtility.js.map +1 -1
  559. package/dist/commonjs/retry/sessionRetryPolicy.js +8 -4
  560. package/dist/commonjs/retry/sessionRetryPolicy.js.map +1 -1
  561. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js +14 -4
  562. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  563. package/dist/commonjs/routing/QueryRange.js +4 -0
  564. package/dist/commonjs/routing/QueryRange.js.map +1 -1
  565. package/dist/commonjs/routing/inMemoryCollectionRoutingMap.js +4 -0
  566. package/dist/commonjs/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  567. package/dist/commonjs/routing/partitionKeyRangeCache.js +2 -0
  568. package/dist/commonjs/routing/partitionKeyRangeCache.js.map +1 -1
  569. package/dist/commonjs/routing/smartRoutingMapProvider.js +1 -0
  570. package/dist/commonjs/routing/smartRoutingMapProvider.js.map +1 -1
  571. package/dist/commonjs/session/VectorSessionToken.js +6 -2
  572. package/dist/commonjs/session/VectorSessionToken.js.map +1 -1
  573. package/dist/commonjs/session/sessionContainer.js +5 -3
  574. package/dist/commonjs/session/sessionContainer.js.map +1 -1
  575. package/dist/commonjs/tsdoc-metadata.json +1 -1
  576. package/dist/commonjs/utils/batch.js +15 -4
  577. package/dist/commonjs/utils/batch.js.map +1 -1
  578. package/dist/commonjs/utils/fixedSizePriorityQueue.js +4 -0
  579. package/dist/commonjs/utils/fixedSizePriorityQueue.js.map +1 -1
  580. package/dist/commonjs/utils/hashing/hash.js +1 -1
  581. package/dist/commonjs/utils/hashing/hash.js.map +1 -1
  582. package/dist/commonjs/utils/nonStreamingOrderByMap.js +2 -0
  583. package/dist/commonjs/utils/nonStreamingOrderByMap.js.map +1 -1
  584. package/dist/esm/ChangeFeedIterator.js +17 -11
  585. package/dist/esm/ChangeFeedIterator.js.map +1 -1
  586. package/dist/esm/ChangeFeedResponse.js +8 -0
  587. package/dist/esm/ChangeFeedResponse.js.map +1 -1
  588. package/dist/esm/ClientContext.js +122 -29
  589. package/dist/esm/ClientContext.js.map +1 -1
  590. package/dist/esm/CosmosClient.js +34 -3
  591. package/dist/esm/CosmosClient.js.map +1 -1
  592. package/dist/esm/CosmosDiagnostics.js +3 -0
  593. package/dist/esm/CosmosDiagnostics.js.map +1 -1
  594. package/dist/esm/PartitionKeyRangeFailoverInfo.js +8 -5
  595. package/dist/esm/PartitionKeyRangeFailoverInfo.js.map +1 -1
  596. package/dist/esm/bulk/Batcher.js +13 -3
  597. package/dist/esm/bulk/Batcher.js.map +1 -1
  598. package/dist/esm/bulk/BulkHelper.js +26 -11
  599. package/dist/esm/bulk/BulkHelper.js.map +1 -1
  600. package/dist/esm/bulk/BulkResponse.js +22 -20
  601. package/dist/esm/bulk/BulkResponse.js.map +1 -1
  602. package/dist/esm/bulk/CongestionAlgorithm.js +11 -4
  603. package/dist/esm/bulk/CongestionAlgorithm.js.map +1 -1
  604. package/dist/esm/bulk/HelperPerPartition.js +14 -1
  605. package/dist/esm/bulk/HelperPerPartition.js.map +1 -1
  606. package/dist/esm/bulk/ItemOperationContext.js +4 -0
  607. package/dist/esm/bulk/ItemOperationContext.js.map +1 -1
  608. package/dist/esm/bulk/Limiter.js +27 -18
  609. package/dist/esm/bulk/Limiter.js.map +1 -1
  610. package/dist/esm/bulk/PartitionMetric.js +4 -0
  611. package/dist/esm/bulk/PartitionMetric.js.map +1 -1
  612. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  613. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  614. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js +16 -8
  615. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  616. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  617. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  618. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  619. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  620. package/dist/esm/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  621. package/dist/esm/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  622. package/dist/esm/client/ChangeFeed/ChangeFeedRange.js +20 -0
  623. package/dist/esm/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  624. package/dist/esm/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  625. package/dist/esm/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  626. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  627. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  628. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  629. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  630. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  631. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  632. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  633. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  634. package/dist/esm/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  635. package/dist/esm/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  636. package/dist/esm/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  637. package/dist/esm/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  638. package/dist/esm/client/ChangeFeed/FeedRange.js +8 -0
  639. package/dist/esm/client/ChangeFeed/FeedRange.js.map +1 -1
  640. package/dist/esm/client/ChangeFeed/FeedRangeQueue.js +1 -0
  641. package/dist/esm/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  642. package/dist/esm/client/ChangeFeed/changeFeedUtils.js +5 -5
  643. package/dist/esm/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  644. package/dist/esm/client/ClientUtils.js +1 -1
  645. package/dist/esm/client/ClientUtils.js.map +1 -1
  646. package/dist/esm/client/Conflict/Conflict.js +4 -0
  647. package/dist/esm/client/Conflict/Conflict.js.map +1 -1
  648. package/dist/esm/client/Conflict/ConflictResponse.js +2 -0
  649. package/dist/esm/client/Conflict/ConflictResponse.js.map +1 -1
  650. package/dist/esm/client/Conflict/Conflicts.js +2 -0
  651. package/dist/esm/client/Conflict/Conflicts.js.map +1 -1
  652. package/dist/esm/client/Container/Container.js +18 -3
  653. package/dist/esm/client/Container/Container.js.map +1 -1
  654. package/dist/esm/client/Container/ContainerResponse.js +2 -0
  655. package/dist/esm/client/Container/ContainerResponse.js.map +1 -1
  656. package/dist/esm/client/Container/Containers.js +4 -2
  657. package/dist/esm/client/Container/Containers.js.map +1 -1
  658. package/dist/esm/client/Database/Database.js +33 -0
  659. package/dist/esm/client/Database/Database.js.map +1 -1
  660. package/dist/esm/client/Database/DatabaseResponse.js +2 -0
  661. package/dist/esm/client/Database/DatabaseResponse.js.map +1 -1
  662. package/dist/esm/client/Database/Databases.js +3 -0
  663. package/dist/esm/client/Database/Databases.js.map +1 -1
  664. package/dist/esm/client/Item/Item.js +4 -0
  665. package/dist/esm/client/Item/Item.js.map +1 -1
  666. package/dist/esm/client/Item/ItemResponse.js +2 -0
  667. package/dist/esm/client/Item/ItemResponse.js.map +1 -1
  668. package/dist/esm/client/Item/Items.js +3 -0
  669. package/dist/esm/client/Item/Items.js.map +1 -1
  670. package/dist/esm/client/Offer/Offer.js +3 -0
  671. package/dist/esm/client/Offer/Offer.js.map +1 -1
  672. package/dist/esm/client/Offer/OfferResponse.js +2 -0
  673. package/dist/esm/client/Offer/OfferResponse.js.map +1 -1
  674. package/dist/esm/client/Offer/Offers.js +2 -0
  675. package/dist/esm/client/Offer/Offers.js.map +1 -1
  676. package/dist/esm/client/Permission/Permission.js +3 -0
  677. package/dist/esm/client/Permission/Permission.js.map +1 -1
  678. package/dist/esm/client/Permission/PermissionResponse.js +2 -0
  679. package/dist/esm/client/Permission/PermissionResponse.js.map +1 -1
  680. package/dist/esm/client/Permission/Permissions.js +2 -0
  681. package/dist/esm/client/Permission/Permissions.js.map +1 -1
  682. package/dist/esm/client/SasToken/SasTokenProperties.js +17 -0
  683. package/dist/esm/client/SasToken/SasTokenProperties.js.map +1 -1
  684. package/dist/esm/client/Script/Scripts.js +5 -0
  685. package/dist/esm/client/Script/Scripts.js.map +1 -1
  686. package/dist/esm/client/StoredProcedure/StoredProcedure.js +3 -0
  687. package/dist/esm/client/StoredProcedure/StoredProcedure.js.map +1 -1
  688. package/dist/esm/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  689. package/dist/esm/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  690. package/dist/esm/client/StoredProcedure/StoredProcedures.js +2 -0
  691. package/dist/esm/client/StoredProcedure/StoredProcedures.js.map +1 -1
  692. package/dist/esm/client/Trigger/Trigger.js +3 -0
  693. package/dist/esm/client/Trigger/Trigger.js.map +1 -1
  694. package/dist/esm/client/Trigger/TriggerResponse.js +2 -0
  695. package/dist/esm/client/Trigger/TriggerResponse.js.map +1 -1
  696. package/dist/esm/client/Trigger/Triggers.js +2 -0
  697. package/dist/esm/client/Trigger/Triggers.js.map +1 -1
  698. package/dist/esm/client/User/User.js +9 -0
  699. package/dist/esm/client/User/User.js.map +1 -1
  700. package/dist/esm/client/User/UserResponse.js +2 -0
  701. package/dist/esm/client/User/UserResponse.js.map +1 -1
  702. package/dist/esm/client/User/Users.js +2 -0
  703. package/dist/esm/client/User/Users.js.map +1 -1
  704. package/dist/esm/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  705. package/dist/esm/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  706. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  707. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  708. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  709. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  710. package/dist/esm/diagnostics/CosmosDiagnosticsContext.js +8 -7
  711. package/dist/esm/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  712. package/dist/esm/diagnostics/DiagnosticNodeInternal.js +26 -7
  713. package/dist/esm/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  714. package/dist/esm/diagnostics/DiagnosticWriter.js +1 -3
  715. package/dist/esm/diagnostics/DiagnosticWriter.js.map +1 -1
  716. package/dist/esm/diagnostics/index.js +2 -2
  717. package/dist/esm/diagnostics/index.js.map +1 -1
  718. package/dist/esm/documents/DatabaseAccount.js +20 -4
  719. package/dist/esm/documents/DatabaseAccount.js.map +1 -1
  720. package/dist/esm/documents/PartitionKey.js +1 -3
  721. package/dist/esm/documents/PartitionKey.js.map +1 -1
  722. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -2
  723. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  724. package/dist/esm/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  725. package/dist/esm/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  726. package/dist/esm/encryption/Cache/EncryptionSettingsCache.js +2 -0
  727. package/dist/esm/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  728. package/dist/esm/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  729. package/dist/esm/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  730. package/dist/esm/encryption/Cache/ProtectedDataEncryptionKeyCache.js +5 -0
  731. package/dist/esm/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -1
  732. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  733. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  734. package/dist/esm/encryption/EncryptionItemQueryIterator.js +24 -27
  735. package/dist/esm/encryption/EncryptionItemQueryIterator.js.map +1 -1
  736. package/dist/esm/encryption/EncryptionKey/DataEncryptionKey.js +7 -2
  737. package/dist/esm/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -1
  738. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  739. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  740. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  741. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  742. package/dist/esm/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  743. package/dist/esm/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  744. package/dist/esm/encryption/EncryptionKeyStoreProvider.js +8 -1
  745. package/dist/esm/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  746. package/dist/esm/encryption/EncryptionManager.js +6 -0
  747. package/dist/esm/encryption/EncryptionManager.js.map +1 -1
  748. package/dist/esm/encryption/EncryptionProcessor.js +5 -0
  749. package/dist/esm/encryption/EncryptionProcessor.js.map +1 -1
  750. package/dist/esm/encryption/EncryptionQueryBuilder.js +2 -0
  751. package/dist/esm/encryption/EncryptionQueryBuilder.js.map +1 -1
  752. package/dist/esm/encryption/EncryptionSettingForProperty.js +6 -0
  753. package/dist/esm/encryption/EncryptionSettingForProperty.js.map +1 -1
  754. package/dist/esm/encryption/EncryptionSettings.js +6 -3
  755. package/dist/esm/encryption/EncryptionSettings.js.map +1 -1
  756. package/dist/esm/encryption/KeyEncryptionKey.js +4 -0
  757. package/dist/esm/encryption/KeyEncryptionKey.js.map +1 -1
  758. package/dist/esm/encryption/Serializers/StringSerializer.js +1 -1
  759. package/dist/esm/encryption/Serializers/StringSerializer.js.map +1 -1
  760. package/dist/esm/extractPartitionKey.js +2 -2
  761. package/dist/esm/extractPartitionKey.js.map +1 -1
  762. package/dist/esm/globalEndpointManager.js +21 -4
  763. package/dist/esm/globalEndpointManager.js.map +1 -1
  764. package/dist/esm/globalPartitionEndpointManager.js +8 -0
  765. package/dist/esm/globalPartitionEndpointManager.js.map +1 -1
  766. package/dist/esm/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  767. package/dist/esm/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  768. package/dist/esm/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  769. package/dist/esm/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  770. package/dist/esm/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  771. package/dist/esm/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  772. package/dist/esm/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  773. package/dist/esm/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  774. package/dist/esm/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  775. package/dist/esm/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  776. package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  777. package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  778. package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  779. package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  780. package/dist/esm/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  781. package/dist/esm/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  782. package/dist/esm/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  783. package/dist/esm/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  784. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  785. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  786. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  787. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  788. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  789. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  790. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  791. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  792. package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  793. package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  794. package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  795. package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  796. package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  797. package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  798. package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  799. package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  800. package/dist/esm/queryExecutionContext/FetchResult.js +4 -0
  801. package/dist/esm/queryExecutionContext/FetchResult.js.map +1 -1
  802. package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  803. package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  804. package/dist/esm/queryExecutionContext/documentProducer.js +34 -21
  805. package/dist/esm/queryExecutionContext/documentProducer.js.map +1 -1
  806. package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  807. package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  808. package/dist/esm/queryExecutionContext/orderByComparator.js +1 -0
  809. package/dist/esm/queryExecutionContext/orderByComparator.js.map +1 -1
  810. package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  811. package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  812. package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  813. package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  814. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  815. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  816. package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  817. package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  818. package/dist/esm/queryIterator.js +41 -33
  819. package/dist/esm/queryIterator.js.map +1 -1
  820. package/dist/esm/queryMetrics/clientSideMetrics.js +2 -1
  821. package/dist/esm/queryMetrics/clientSideMetrics.js.map +1 -1
  822. package/dist/esm/queryMetrics/queryMetrics.js +14 -1
  823. package/dist/esm/queryMetrics/queryMetrics.js.map +1 -1
  824. package/dist/esm/queryMetrics/queryPreparationTime.js +5 -1
  825. package/dist/esm/queryMetrics/queryPreparationTime.js.map +1 -1
  826. package/dist/esm/queryMetrics/runtimeExecutionTimes.js +4 -1
  827. package/dist/esm/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  828. package/dist/esm/queryMetrics/timeSpan.js +4 -3
  829. package/dist/esm/queryMetrics/timeSpan.js.map +1 -1
  830. package/dist/esm/request/ErrorResponse.js +19 -0
  831. package/dist/esm/request/ErrorResponse.js.map +1 -1
  832. package/dist/esm/request/FeedResponse.js +4 -0
  833. package/dist/esm/request/FeedResponse.js.map +1 -1
  834. package/dist/esm/request/RequestHandler.js +1 -2
  835. package/dist/esm/request/RequestHandler.js.map +1 -1
  836. package/dist/esm/request/ResourceResponse.js +5 -0
  837. package/dist/esm/request/ResourceResponse.js.map +1 -1
  838. package/dist/esm/request/TimeoutError.js +1 -1
  839. package/dist/esm/request/TimeoutError.js.map +1 -1
  840. package/dist/esm/request/hybridSearchQueryResult.js +5 -0
  841. package/dist/esm/request/hybridSearchQueryResult.js.map +1 -1
  842. package/dist/esm/request/request.js +5 -1
  843. package/dist/esm/request/request.js.map +1 -1
  844. package/dist/esm/retry/bulkExecutionRetryPolicy.js +5 -2
  845. package/dist/esm/retry/bulkExecutionRetryPolicy.js.map +1 -1
  846. package/dist/esm/retry/defaultRetryPolicy.js +4 -3
  847. package/dist/esm/retry/defaultRetryPolicy.js.map +1 -1
  848. package/dist/esm/retry/endpointDiscoveryRetryPolicy.js +11 -2
  849. package/dist/esm/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  850. package/dist/esm/retry/resourceThrottleRetryPolicy.js +20 -10
  851. package/dist/esm/retry/resourceThrottleRetryPolicy.js.map +1 -1
  852. package/dist/esm/retry/retryUtility.js +2 -3
  853. package/dist/esm/retry/retryUtility.js.map +1 -1
  854. package/dist/esm/retry/sessionRetryPolicy.js +8 -4
  855. package/dist/esm/retry/sessionRetryPolicy.js.map +1 -1
  856. package/dist/esm/retry/timeoutFailoverRetryPolicy.js +14 -4
  857. package/dist/esm/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  858. package/dist/esm/routing/QueryRange.js +4 -0
  859. package/dist/esm/routing/QueryRange.js.map +1 -1
  860. package/dist/esm/routing/inMemoryCollectionRoutingMap.js +4 -0
  861. package/dist/esm/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  862. package/dist/esm/routing/partitionKeyRangeCache.js +2 -0
  863. package/dist/esm/routing/partitionKeyRangeCache.js.map +1 -1
  864. package/dist/esm/routing/smartRoutingMapProvider.js +1 -0
  865. package/dist/esm/routing/smartRoutingMapProvider.js.map +1 -1
  866. package/dist/esm/session/VectorSessionToken.js +6 -2
  867. package/dist/esm/session/VectorSessionToken.js.map +1 -1
  868. package/dist/esm/session/sessionContainer.js +5 -3
  869. package/dist/esm/session/sessionContainer.js.map +1 -1
  870. package/dist/esm/utils/batch.js +15 -4
  871. package/dist/esm/utils/batch.js.map +1 -1
  872. package/dist/esm/utils/fixedSizePriorityQueue.js +4 -0
  873. package/dist/esm/utils/fixedSizePriorityQueue.js.map +1 -1
  874. package/dist/esm/utils/hashing/hash.js +1 -1
  875. package/dist/esm/utils/hashing/hash.js.map +1 -1
  876. package/dist/esm/utils/nonStreamingOrderByMap.js +2 -0
  877. package/dist/esm/utils/nonStreamingOrderByMap.js.map +1 -1
  878. package/dist/react-native/ChangeFeedIterator.js +17 -11
  879. package/dist/react-native/ChangeFeedIterator.js.map +1 -1
  880. package/dist/react-native/ChangeFeedResponse.js +8 -0
  881. package/dist/react-native/ChangeFeedResponse.js.map +1 -1
  882. package/dist/react-native/ClientContext.js +122 -29
  883. package/dist/react-native/ClientContext.js.map +1 -1
  884. package/dist/react-native/CosmosClient.js +34 -3
  885. package/dist/react-native/CosmosClient.js.map +1 -1
  886. package/dist/react-native/CosmosDiagnostics.js +3 -0
  887. package/dist/react-native/CosmosDiagnostics.js.map +1 -1
  888. package/dist/react-native/PartitionKeyRangeFailoverInfo.js +8 -5
  889. package/dist/react-native/PartitionKeyRangeFailoverInfo.js.map +1 -1
  890. package/dist/react-native/bulk/Batcher.js +13 -3
  891. package/dist/react-native/bulk/Batcher.js.map +1 -1
  892. package/dist/react-native/bulk/BulkHelper.js +26 -11
  893. package/dist/react-native/bulk/BulkHelper.js.map +1 -1
  894. package/dist/react-native/bulk/BulkResponse.js +22 -20
  895. package/dist/react-native/bulk/BulkResponse.js.map +1 -1
  896. package/dist/react-native/bulk/CongestionAlgorithm.js +11 -4
  897. package/dist/react-native/bulk/CongestionAlgorithm.js.map +1 -1
  898. package/dist/react-native/bulk/HelperPerPartition.js +14 -1
  899. package/dist/react-native/bulk/HelperPerPartition.js.map +1 -1
  900. package/dist/react-native/bulk/ItemOperationContext.js +4 -0
  901. package/dist/react-native/bulk/ItemOperationContext.js.map +1 -1
  902. package/dist/react-native/bulk/Limiter.js +27 -18
  903. package/dist/react-native/bulk/Limiter.js.map +1 -1
  904. package/dist/react-native/bulk/PartitionMetric.js +4 -0
  905. package/dist/react-native/bulk/PartitionMetric.js.map +1 -1
  906. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  907. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  908. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js +16 -8
  909. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  910. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  911. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  912. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  913. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  914. package/dist/react-native/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  915. package/dist/react-native/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  916. package/dist/react-native/client/ChangeFeed/ChangeFeedRange.js +20 -0
  917. package/dist/react-native/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  918. package/dist/react-native/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  919. package/dist/react-native/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  920. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  921. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  922. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  923. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  924. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  925. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  926. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  927. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  928. package/dist/react-native/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  929. package/dist/react-native/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  930. package/dist/react-native/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  931. package/dist/react-native/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  932. package/dist/react-native/client/ChangeFeed/FeedRange.js +8 -0
  933. package/dist/react-native/client/ChangeFeed/FeedRange.js.map +1 -1
  934. package/dist/react-native/client/ChangeFeed/FeedRangeQueue.js +1 -0
  935. package/dist/react-native/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  936. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js +5 -5
  937. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  938. package/dist/react-native/client/ClientUtils.js +1 -1
  939. package/dist/react-native/client/ClientUtils.js.map +1 -1
  940. package/dist/react-native/client/Conflict/Conflict.js +4 -0
  941. package/dist/react-native/client/Conflict/Conflict.js.map +1 -1
  942. package/dist/react-native/client/Conflict/ConflictResponse.js +2 -0
  943. package/dist/react-native/client/Conflict/ConflictResponse.js.map +1 -1
  944. package/dist/react-native/client/Conflict/Conflicts.js +2 -0
  945. package/dist/react-native/client/Conflict/Conflicts.js.map +1 -1
  946. package/dist/react-native/client/Container/Container.js +18 -3
  947. package/dist/react-native/client/Container/Container.js.map +1 -1
  948. package/dist/react-native/client/Container/ContainerResponse.js +2 -0
  949. package/dist/react-native/client/Container/ContainerResponse.js.map +1 -1
  950. package/dist/react-native/client/Container/Containers.js +4 -2
  951. package/dist/react-native/client/Container/Containers.js.map +1 -1
  952. package/dist/react-native/client/Database/Database.js +33 -0
  953. package/dist/react-native/client/Database/Database.js.map +1 -1
  954. package/dist/react-native/client/Database/DatabaseResponse.js +2 -0
  955. package/dist/react-native/client/Database/DatabaseResponse.js.map +1 -1
  956. package/dist/react-native/client/Database/Databases.js +3 -0
  957. package/dist/react-native/client/Database/Databases.js.map +1 -1
  958. package/dist/react-native/client/Item/Item.js +4 -0
  959. package/dist/react-native/client/Item/Item.js.map +1 -1
  960. package/dist/react-native/client/Item/ItemResponse.js +2 -0
  961. package/dist/react-native/client/Item/ItemResponse.js.map +1 -1
  962. package/dist/react-native/client/Item/Items.js +3 -0
  963. package/dist/react-native/client/Item/Items.js.map +1 -1
  964. package/dist/react-native/client/Offer/Offer.js +3 -0
  965. package/dist/react-native/client/Offer/Offer.js.map +1 -1
  966. package/dist/react-native/client/Offer/OfferResponse.js +2 -0
  967. package/dist/react-native/client/Offer/OfferResponse.js.map +1 -1
  968. package/dist/react-native/client/Offer/Offers.js +2 -0
  969. package/dist/react-native/client/Offer/Offers.js.map +1 -1
  970. package/dist/react-native/client/Permission/Permission.js +3 -0
  971. package/dist/react-native/client/Permission/Permission.js.map +1 -1
  972. package/dist/react-native/client/Permission/PermissionResponse.js +2 -0
  973. package/dist/react-native/client/Permission/PermissionResponse.js.map +1 -1
  974. package/dist/react-native/client/Permission/Permissions.js +2 -0
  975. package/dist/react-native/client/Permission/Permissions.js.map +1 -1
  976. package/dist/react-native/client/SasToken/SasTokenProperties.js +17 -0
  977. package/dist/react-native/client/SasToken/SasTokenProperties.js.map +1 -1
  978. package/dist/react-native/client/Script/Scripts.js +5 -0
  979. package/dist/react-native/client/Script/Scripts.js.map +1 -1
  980. package/dist/react-native/client/StoredProcedure/StoredProcedure.js +3 -0
  981. package/dist/react-native/client/StoredProcedure/StoredProcedure.js.map +1 -1
  982. package/dist/react-native/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  983. package/dist/react-native/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  984. package/dist/react-native/client/StoredProcedure/StoredProcedures.js +2 -0
  985. package/dist/react-native/client/StoredProcedure/StoredProcedures.js.map +1 -1
  986. package/dist/react-native/client/Trigger/Trigger.js +3 -0
  987. package/dist/react-native/client/Trigger/Trigger.js.map +1 -1
  988. package/dist/react-native/client/Trigger/TriggerResponse.js +2 -0
  989. package/dist/react-native/client/Trigger/TriggerResponse.js.map +1 -1
  990. package/dist/react-native/client/Trigger/Triggers.js +2 -0
  991. package/dist/react-native/client/Trigger/Triggers.js.map +1 -1
  992. package/dist/react-native/client/User/User.js +9 -0
  993. package/dist/react-native/client/User/User.js.map +1 -1
  994. package/dist/react-native/client/User/UserResponse.js +2 -0
  995. package/dist/react-native/client/User/UserResponse.js.map +1 -1
  996. package/dist/react-native/client/User/Users.js +2 -0
  997. package/dist/react-native/client/User/Users.js.map +1 -1
  998. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  999. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  1000. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  1001. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  1002. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  1003. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  1004. package/dist/react-native/diagnostics/CosmosDiagnosticsContext.js +8 -7
  1005. package/dist/react-native/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  1006. package/dist/react-native/diagnostics/DiagnosticNodeInternal.js +26 -7
  1007. package/dist/react-native/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  1008. package/dist/react-native/diagnostics/DiagnosticWriter.js +1 -3
  1009. package/dist/react-native/diagnostics/DiagnosticWriter.js.map +1 -1
  1010. package/dist/react-native/diagnostics/index.js +2 -2
  1011. package/dist/react-native/diagnostics/index.js.map +1 -1
  1012. package/dist/react-native/documents/DatabaseAccount.js +20 -4
  1013. package/dist/react-native/documents/DatabaseAccount.js.map +1 -1
  1014. package/dist/react-native/documents/PartitionKey.js +1 -3
  1015. package/dist/react-native/documents/PartitionKey.js.map +1 -1
  1016. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -2
  1017. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  1018. package/dist/react-native/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  1019. package/dist/react-native/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  1020. package/dist/react-native/encryption/Cache/EncryptionSettingsCache.js +2 -0
  1021. package/dist/react-native/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  1022. package/dist/react-native/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  1023. package/dist/react-native/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  1024. package/dist/react-native/encryption/Cache/ProtectedDataEncryptionKeyCache.js +5 -0
  1025. package/dist/react-native/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -1
  1026. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  1027. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  1028. package/dist/react-native/encryption/EncryptionItemQueryIterator.js +24 -27
  1029. package/dist/react-native/encryption/EncryptionItemQueryIterator.js.map +1 -1
  1030. package/dist/react-native/encryption/EncryptionKey/DataEncryptionKey.js +7 -2
  1031. package/dist/react-native/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -1
  1032. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  1033. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  1034. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  1035. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  1036. package/dist/react-native/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  1037. package/dist/react-native/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  1038. package/dist/react-native/encryption/EncryptionKeyStoreProvider.js +8 -1
  1039. package/dist/react-native/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  1040. package/dist/react-native/encryption/EncryptionManager.js +6 -0
  1041. package/dist/react-native/encryption/EncryptionManager.js.map +1 -1
  1042. package/dist/react-native/encryption/EncryptionProcessor.js +5 -0
  1043. package/dist/react-native/encryption/EncryptionProcessor.js.map +1 -1
  1044. package/dist/react-native/encryption/EncryptionQueryBuilder.js +2 -0
  1045. package/dist/react-native/encryption/EncryptionQueryBuilder.js.map +1 -1
  1046. package/dist/react-native/encryption/EncryptionSettingForProperty.js +6 -0
  1047. package/dist/react-native/encryption/EncryptionSettingForProperty.js.map +1 -1
  1048. package/dist/react-native/encryption/EncryptionSettings.js +6 -3
  1049. package/dist/react-native/encryption/EncryptionSettings.js.map +1 -1
  1050. package/dist/react-native/encryption/KeyEncryptionKey.js +4 -0
  1051. package/dist/react-native/encryption/KeyEncryptionKey.js.map +1 -1
  1052. package/dist/react-native/encryption/Serializers/StringSerializer.js +1 -1
  1053. package/dist/react-native/encryption/Serializers/StringSerializer.js.map +1 -1
  1054. package/dist/react-native/extractPartitionKey.js +2 -2
  1055. package/dist/react-native/extractPartitionKey.js.map +1 -1
  1056. package/dist/react-native/globalEndpointManager.js +21 -4
  1057. package/dist/react-native/globalEndpointManager.js.map +1 -1
  1058. package/dist/react-native/globalPartitionEndpointManager.js +8 -0
  1059. package/dist/react-native/globalPartitionEndpointManager.js.map +1 -1
  1060. package/dist/react-native/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  1061. package/dist/react-native/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  1062. package/dist/react-native/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  1063. package/dist/react-native/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  1064. package/dist/react-native/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  1065. package/dist/react-native/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  1066. package/dist/react-native/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  1067. package/dist/react-native/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  1068. package/dist/react-native/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  1069. package/dist/react-native/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  1070. package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  1071. package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  1072. package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  1073. package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  1074. package/dist/react-native/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  1075. package/dist/react-native/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  1076. package/dist/react-native/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  1077. package/dist/react-native/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  1078. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  1079. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  1080. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  1081. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  1082. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  1083. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  1084. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  1085. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  1086. package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  1087. package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  1088. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  1089. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  1090. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  1091. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  1092. package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  1093. package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  1094. package/dist/react-native/queryExecutionContext/FetchResult.js +4 -0
  1095. package/dist/react-native/queryExecutionContext/FetchResult.js.map +1 -1
  1096. package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  1097. package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  1098. package/dist/react-native/queryExecutionContext/documentProducer.js +34 -21
  1099. package/dist/react-native/queryExecutionContext/documentProducer.js.map +1 -1
  1100. package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  1101. package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  1102. package/dist/react-native/queryExecutionContext/orderByComparator.js +1 -0
  1103. package/dist/react-native/queryExecutionContext/orderByComparator.js.map +1 -1
  1104. package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  1105. package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  1106. package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  1107. package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  1108. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  1109. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  1110. package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  1111. package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  1112. package/dist/react-native/queryIterator.js +41 -33
  1113. package/dist/react-native/queryIterator.js.map +1 -1
  1114. package/dist/react-native/queryMetrics/clientSideMetrics.js +2 -1
  1115. package/dist/react-native/queryMetrics/clientSideMetrics.js.map +1 -1
  1116. package/dist/react-native/queryMetrics/queryMetrics.js +14 -1
  1117. package/dist/react-native/queryMetrics/queryMetrics.js.map +1 -1
  1118. package/dist/react-native/queryMetrics/queryPreparationTime.js +5 -1
  1119. package/dist/react-native/queryMetrics/queryPreparationTime.js.map +1 -1
  1120. package/dist/react-native/queryMetrics/runtimeExecutionTimes.js +4 -1
  1121. package/dist/react-native/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  1122. package/dist/react-native/queryMetrics/timeSpan.js +4 -3
  1123. package/dist/react-native/queryMetrics/timeSpan.js.map +1 -1
  1124. package/dist/react-native/request/ErrorResponse.js +19 -0
  1125. package/dist/react-native/request/ErrorResponse.js.map +1 -1
  1126. package/dist/react-native/request/FeedResponse.js +4 -0
  1127. package/dist/react-native/request/FeedResponse.js.map +1 -1
  1128. package/dist/react-native/request/RequestHandler.js +1 -2
  1129. package/dist/react-native/request/RequestHandler.js.map +1 -1
  1130. package/dist/react-native/request/ResourceResponse.js +5 -0
  1131. package/dist/react-native/request/ResourceResponse.js.map +1 -1
  1132. package/dist/react-native/request/TimeoutError.js +1 -1
  1133. package/dist/react-native/request/TimeoutError.js.map +1 -1
  1134. package/dist/react-native/request/hybridSearchQueryResult.js +5 -0
  1135. package/dist/react-native/request/hybridSearchQueryResult.js.map +1 -1
  1136. package/dist/react-native/request/request.js +5 -1
  1137. package/dist/react-native/request/request.js.map +1 -1
  1138. package/dist/react-native/retry/bulkExecutionRetryPolicy.js +5 -2
  1139. package/dist/react-native/retry/bulkExecutionRetryPolicy.js.map +1 -1
  1140. package/dist/react-native/retry/defaultRetryPolicy.js +4 -3
  1141. package/dist/react-native/retry/defaultRetryPolicy.js.map +1 -1
  1142. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js +11 -2
  1143. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  1144. package/dist/react-native/retry/resourceThrottleRetryPolicy.js +20 -10
  1145. package/dist/react-native/retry/resourceThrottleRetryPolicy.js.map +1 -1
  1146. package/dist/react-native/retry/retryUtility.js +2 -3
  1147. package/dist/react-native/retry/retryUtility.js.map +1 -1
  1148. package/dist/react-native/retry/sessionRetryPolicy.js +8 -4
  1149. package/dist/react-native/retry/sessionRetryPolicy.js.map +1 -1
  1150. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js +14 -4
  1151. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  1152. package/dist/react-native/routing/QueryRange.js +4 -0
  1153. package/dist/react-native/routing/QueryRange.js.map +1 -1
  1154. package/dist/react-native/routing/inMemoryCollectionRoutingMap.js +4 -0
  1155. package/dist/react-native/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  1156. package/dist/react-native/routing/partitionKeyRangeCache.js +2 -0
  1157. package/dist/react-native/routing/partitionKeyRangeCache.js.map +1 -1
  1158. package/dist/react-native/routing/smartRoutingMapProvider.js +1 -0
  1159. package/dist/react-native/routing/smartRoutingMapProvider.js.map +1 -1
  1160. package/dist/react-native/session/VectorSessionToken.js +6 -2
  1161. package/dist/react-native/session/VectorSessionToken.js.map +1 -1
  1162. package/dist/react-native/session/sessionContainer.js +5 -3
  1163. package/dist/react-native/session/sessionContainer.js.map +1 -1
  1164. package/dist/react-native/utils/batch.js +15 -4
  1165. package/dist/react-native/utils/batch.js.map +1 -1
  1166. package/dist/react-native/utils/fixedSizePriorityQueue.js +4 -0
  1167. package/dist/react-native/utils/fixedSizePriorityQueue.js.map +1 -1
  1168. package/dist/react-native/utils/hashing/hash.js +1 -1
  1169. package/dist/react-native/utils/hashing/hash.js.map +1 -1
  1170. package/dist/react-native/utils/nonStreamingOrderByMap.js +2 -0
  1171. package/dist/react-native/utils/nonStreamingOrderByMap.js.map +1 -1
  1172. package/package.json +2 -2
@@ -64,7 +64,7 @@ export function prepareOperations(operationInput, definition, options = {}) {
64
64
  }
65
65
  }
66
66
  return {
67
- operation: Object.assign(Object.assign({}, operationInput), { partitionKey: JSON.stringify(partitionKey) }),
67
+ operation: { ...operationInput, partitionKey: JSON.stringify(partitionKey) },
68
68
  partitionKey,
69
69
  };
70
70
  }
@@ -92,17 +92,25 @@ function populateIdsIfNeeded(operationInput, options) {
92
92
  * @hidden
93
93
  */
94
94
  export function splitBatchBasedOnBodySize(originalBatch) {
95
- if ((originalBatch === null || originalBatch === void 0 ? void 0 : originalBatch.operations) === undefined || originalBatch.operations.length < 1)
95
+ if (originalBatch?.operations === undefined || originalBatch.operations.length < 1)
96
96
  return [];
97
97
  let currentBatchSize = calculateObjectSizeInBytes(originalBatch.operations[0]);
98
- let currentBatch = Object.assign(Object.assign({}, originalBatch), { operations: [originalBatch.operations[0]], indexes: [originalBatch.indexes[0]] });
98
+ let currentBatch = {
99
+ ...originalBatch,
100
+ operations: [originalBatch.operations[0]],
101
+ indexes: [originalBatch.indexes[0]],
102
+ };
99
103
  const processedBatches = [];
100
104
  processedBatches.push(currentBatch);
101
105
  for (let index = 1; index < originalBatch.operations.length; index++) {
102
106
  const operation = originalBatch.operations[index];
103
107
  const currentOpSize = calculateObjectSizeInBytes(operation);
104
108
  if (currentBatchSize + currentOpSize > Constants.DefaultMaxBulkRequestBodySizeInBytes) {
105
- currentBatch = Object.assign(Object.assign({}, originalBatch), { operations: [], indexes: [] });
109
+ currentBatch = {
110
+ ...originalBatch,
111
+ operations: [],
112
+ indexes: [],
113
+ };
106
114
  processedBatches.push(currentBatch);
107
115
  currentBatchSize = 0;
108
116
  }
@@ -133,6 +141,9 @@ export function isSuccessStatusCode(statusCode) {
133
141
  return statusCode >= 200 && statusCode <= 299;
134
142
  }
135
143
  export class TaskCompletionSource {
144
+ promise;
145
+ resolveFn;
146
+ rejectFn;
136
147
  constructor() {
137
148
  this.promise = new Promise((resolve, reject) => {
138
149
  this.resolveFn = resolve;
@@ -1 +1 @@
1
- {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../../src/utils/batch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAcxF,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAgE9C,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,GAA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;QACR,CAAC;QACD,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7B,IAAI,MAAM,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrD,SAAS,CAAC,EAAE,GAAG,MAAM,mBAAmB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBACtE,6BAA6B,EAAE,CAAC;YAClC,CAAC;YACD,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC;YACpC,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACtE,KAAK,MAAM,cAAc,IAAI,gBAAgB,EAAE,CAAC;gBAC9C,IAAI,OAAO,IAAI,cAAc,EAAE,CAAC;oBAC9B,IAAI,MAAM,mBAAmB,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;wBACnE,cAAc,CAAC,KAAK,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAC9D,cAAc,CAAC,IAAI,EACnB,cAAc,CAAC,KAAK,CACrB,CAAC;wBACF,6BAA6B,EAAE,CAAC;oBAClC,CAAC;gBACH,CAAC;YACH,CAAC;YACD,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC;AACtD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { JSONObject } from \"../queryExecutionContext/index.js\";\nimport { extractPartitionKeys, undefinedPartitionKey } from \"../extractPartitionKey.js\";\nimport type {\n CosmosDiagnostics,\n CosmosHeaders,\n DiagnosticNodeInternal,\n ErrorResponse,\n RequestOptions,\n StatusCode,\n} from \"../index.js\";\nimport type {\n PartitionKey,\n PartitionKeyDefinition,\n PrimitivePartitionKeyValue,\n} from \"../documents/index.js\";\nimport { NonePartitionKeyLiteral, convertToInternalPartitionKey } from \"../documents/index.js\";\nimport type { PatchRequestBody } from \"./patch.js\";\nimport { assertNotUndefined } from \"./typeChecks.js\";\nimport { bodyFromData } from \"../request/request.js\";\nimport { Constants } from \"../common/constants.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { ItemOperation } from \"../bulk/ItemOperation.js\";\nimport type { BulkResponse } from \"../bulk/index.js\";\nimport type { EncryptionProcessor } from \"../encryption/EncryptionProcessor.js\";\n\nexport type Operation =\n | CreateOperation\n | UpsertOperation\n | ReadOperation\n | DeleteOperation\n | ReplaceOperation\n | BulkPatchOperation;\n\nexport interface Batch {\n min: string;\n max: string;\n rangeId: string;\n indexes: number[];\n operations: Operation[];\n}\n\nexport type BulkOperationResponse = OperationResponse[] & { diagnostics: CosmosDiagnostics };\n\n/**\n * represents response for an operation in bulk with executeBulkOperations API\n */\nexport interface BulkOperationResult {\n /** the original operation input passed */\n operationInput: OperationInput;\n /** response from the backend for the item operation */\n response?: ExtendedOperationResponse;\n /** any exceptions are captured here */\n error?: ErrorResponse;\n}\n\n/**\n * response for a successful operation in bulk with executeBulkOperations API\n */\nexport interface ExtendedOperationResponse extends OperationResponse {\n /** activity id related to the operation */\n activityId?: string;\n /** session Token assigned to the result */\n sessionToken?: string;\n /** headers associated with the operation */\n headers?: CosmosHeaders;\n /** diagnostic details associated with operation */\n diagnostics: CosmosDiagnostics;\n}\n\nexport interface OperationResponse {\n statusCode: number;\n requestCharge: number;\n eTag?: string;\n resourceBody?: JSONObject;\n}\n\n/**\n * Options object used to modify bulk execution.\n * continueOnError (Default value: false) - Continues bulk execution when an operation fails ** NOTE THIS WILL DEFAULT TO TRUE IN the 4.0 RELEASE\n */\nexport interface BulkOptions {\n continueOnError?: boolean;\n}\n\nexport function isKeyInRange(min: string, max: string, key: string): boolean {\n const isAfterMinInclusive = key.localeCompare(min) >= 0;\n const isBeforeMax = key.localeCompare(max) < 0;\n return isAfterMinInclusive && isBeforeMax;\n}\n\nexport interface OperationBase {\n partitionKey?: string;\n ifMatch?: string;\n ifNoneMatch?: string;\n}\n\nexport const BulkOperationType = {\n Create: \"Create\",\n Upsert: \"Upsert\",\n Read: \"Read\",\n Delete: \"Delete\",\n Replace: \"Replace\",\n Patch: \"Patch\",\n} as const;\n\nexport type OperationInput =\n | CreateOperationInput\n | UpsertOperationInput\n | ReadOperationInput\n | DeleteOperationInput\n | ReplaceOperationInput\n | PatchOperationInput;\n\nexport interface CreateOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Create;\n resourceBody: JSONObject;\n}\n\nexport interface UpsertOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Upsert;\n resourceBody: JSONObject;\n}\n\nexport interface ReadOperationInput {\n partitionKey?: PartitionKey;\n operationType: typeof BulkOperationType.Read;\n id: string;\n}\n\nexport interface DeleteOperationInput {\n partitionKey?: PartitionKey;\n operationType: typeof BulkOperationType.Delete;\n id: string;\n}\n\nexport interface ReplaceOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Replace;\n resourceBody: JSONObject;\n id: string;\n}\n\nexport interface PatchOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Patch;\n resourceBody: PatchRequestBody;\n id: string;\n}\n\nexport type OperationWithItem = OperationBase & {\n resourceBody: JSONObject;\n};\n\nexport type CreateOperation = OperationWithItem & {\n operationType: typeof BulkOperationType.Create;\n};\n\nexport type UpsertOperation = OperationWithItem & {\n operationType: typeof BulkOperationType.Upsert;\n};\n\nexport type ReadOperation = OperationBase & {\n operationType: typeof BulkOperationType.Read;\n id: string;\n};\n\nexport type DeleteOperation = OperationBase & {\n operationType: typeof BulkOperationType.Delete;\n id: string;\n};\n\nexport type ReplaceOperation = OperationWithItem & {\n operationType: typeof BulkOperationType.Replace;\n id: string;\n};\n\nexport type BulkPatchOperation = OperationBase & {\n operationType: typeof BulkOperationType.Patch;\n id: string;\n};\n\nexport function hasResource(\n operation: Operation,\n): operation is CreateOperation | UpsertOperation | ReplaceOperation {\n return (\n operation.operationType !== \"Patch\" &&\n (operation as OperationWithItem).resourceBody !== undefined\n );\n}\n/**\n * Maps OperationInput to Operation by\n * - generating Ids if needed.\n * - choosing partitionKey which can be used to choose which batch this\n * operation should be part of. The order is -\n * 1. If the operationInput itself has partitionKey field set it is used.\n * 2. Other wise for create/replace/upsert it is extracted from resource body.\n * 3. For read/delete/patch type operations undefined partitionKey is used.\n * - Here one nuance is that, the partitionKey field inside Operation needs to\n * be serialized as a JSON string.\n * @param operationInput - OperationInput\n * @param definition - PartitionKeyDefinition\n * @param options - RequestOptions\n * @returns\n */\nexport function prepareOperations(\n operationInput: OperationInput,\n definition: PartitionKeyDefinition,\n options: RequestOptions = {},\n): {\n operation: Operation;\n partitionKey: PrimitivePartitionKeyValue[];\n} {\n populateIdsIfNeeded(operationInput, options);\n\n let partitionKey: PrimitivePartitionKeyValue[];\n if (Object.prototype.hasOwnProperty.call(operationInput, \"partitionKey\")) {\n if (operationInput.partitionKey === undefined) {\n partitionKey = definition.paths.map(() => NonePartitionKeyLiteral);\n } else {\n partitionKey = convertToInternalPartitionKey(operationInput.partitionKey);\n }\n } else {\n switch (operationInput.operationType) {\n case BulkOperationType.Create:\n case BulkOperationType.Replace:\n case BulkOperationType.Upsert:\n partitionKey = assertNotUndefined(\n extractPartitionKeys(operationInput.resourceBody, definition),\n \"Unexpected undefined Partition Key Found.\",\n );\n break;\n case BulkOperationType.Read:\n case BulkOperationType.Delete:\n case BulkOperationType.Patch:\n partitionKey = undefinedPartitionKey(definition);\n break;\n }\n }\n return {\n operation: { ...operationInput, partitionKey: JSON.stringify(partitionKey) } as Operation,\n partitionKey,\n };\n}\n\n/**\n * For operations requiring Id genrate random uuids.\n * @param operationInput - OperationInput to be checked.\n * @param options - RequestOptions\n */\nfunction populateIdsIfNeeded(operationInput: OperationInput, options: RequestOptions) {\n if (\n operationInput.operationType === BulkOperationType.Create ||\n operationInput.operationType === BulkOperationType.Upsert\n ) {\n if (\n (operationInput.resourceBody.id === undefined || operationInput.resourceBody.id === \"\") &&\n !options.disableAutomaticIdGeneration\n ) {\n operationInput.resourceBody.id = randomUUID();\n }\n }\n}\n\n/**\n * Splits a batch into array of batches based on cumulative size of its operations by making sure\n * cumulative size of an individual batch is not larger than {@link Constants.DefaultMaxBulkRequestBodySizeInBytes}.\n * If a single operation itself is larger than {@link Constants.DefaultMaxBulkRequestBodySizeInBytes}, that\n * operation would be moved into a batch containing only that operation.\n * @param originalBatch - A batch of operations needed to be checked.\n * @returns\n * @hidden\n */\nexport function splitBatchBasedOnBodySize(originalBatch: Batch): Batch[] {\n if (originalBatch?.operations === undefined || originalBatch.operations.length < 1) return [];\n let currentBatchSize = calculateObjectSizeInBytes(originalBatch.operations[0]);\n let currentBatch: Batch = {\n ...originalBatch,\n operations: [originalBatch.operations[0]],\n indexes: [originalBatch.indexes[0]],\n };\n const processedBatches: Batch[] = [];\n processedBatches.push(currentBatch);\n\n for (let index = 1; index < originalBatch.operations.length; index++) {\n const operation = originalBatch.operations[index];\n const currentOpSize = calculateObjectSizeInBytes(operation);\n if (currentBatchSize + currentOpSize > Constants.DefaultMaxBulkRequestBodySizeInBytes) {\n currentBatch = {\n ...originalBatch,\n operations: [],\n indexes: [],\n };\n processedBatches.push(currentBatch);\n currentBatchSize = 0;\n }\n currentBatch.operations.push(operation);\n currentBatch.indexes.push(originalBatch.indexes[index]);\n currentBatchSize += currentOpSize;\n }\n return processedBatches;\n}\n\n/**\n * Calculates size of an JSON object in bytes with utf-8 encoding.\n * @hidden\n */\nexport function calculateObjectSizeInBytes(obj: unknown): number {\n return new TextEncoder().encode(bodyFromData(obj as any)).length;\n}\n\nexport function decorateBatchOperation(\n operation: OperationInput,\n options: RequestOptions = {},\n): Operation {\n if (\n operation.operationType === BulkOperationType.Create ||\n operation.operationType === BulkOperationType.Upsert\n ) {\n if (\n (operation.resourceBody.id === undefined || operation.resourceBody.id === \"\") &&\n !options.disableAutomaticIdGeneration\n ) {\n operation.resourceBody.id = randomUUID();\n }\n }\n return operation as Operation;\n}\n\nexport function isSuccessStatusCode(statusCode: StatusCode): boolean {\n return statusCode >= 200 && statusCode <= 299;\n}\n\nexport type ExecuteCallback = (\n operations: ItemOperation[],\n diagnosticNode: DiagnosticNodeInternal,\n) => Promise<BulkResponse>;\nexport type RetryCallback = (\n operation: ItemOperation,\n diagnosticNode: DiagnosticNodeInternal,\n) => Promise<void>;\n\nexport class TaskCompletionSource<T> {\n private readonly promise: Promise<T>;\n private resolveFn!: (value: T) => void;\n private rejectFn!: (reason?: any) => void;\n\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this.resolveFn = resolve;\n this.rejectFn = reject;\n });\n }\n\n public get task(): Promise<T> {\n return this.promise;\n }\n\n public setResult(value: T): void {\n this.resolveFn(value);\n }\n\n public setException(error: Error): void {\n this.rejectFn(error);\n }\n}\n\nexport async function encryptOperationInput(\n encryptionProcessor: EncryptionProcessor,\n operation: OperationInput,\n totalPropertiesEncryptedCount: number,\n): Promise<{ operation: OperationInput; totalPropertiesEncryptedCount: number }> {\n if (Object.prototype.hasOwnProperty.call(operation, \"partitionKey\")) {\n const partitionKeyInternal = convertToInternalPartitionKey(operation.partitionKey);\n const { partitionKeyList, encryptedCount } =\n await encryptionProcessor.getEncryptedPartitionKeyValue(partitionKeyInternal);\n operation.partitionKey = partitionKeyList;\n totalPropertiesEncryptedCount += encryptedCount;\n }\n switch (operation.operationType) {\n case BulkOperationType.Create:\n case BulkOperationType.Upsert: {\n const { body, propertiesEncryptedCount } = await encryptionProcessor.encrypt(\n operation.resourceBody,\n );\n operation.resourceBody = body;\n totalPropertiesEncryptedCount += propertiesEncryptedCount;\n break;\n }\n case BulkOperationType.Read:\n case BulkOperationType.Delete:\n if (await encryptionProcessor.isPathEncrypted(\"/id\")) {\n operation.id = await encryptionProcessor.getEncryptedId(operation.id);\n totalPropertiesEncryptedCount++;\n }\n break;\n case BulkOperationType.Replace: {\n if (await encryptionProcessor.isPathEncrypted(\"/id\")) {\n operation.id = await encryptionProcessor.getEncryptedId(operation.id);\n totalPropertiesEncryptedCount++;\n }\n const { body, propertiesEncryptedCount } = await encryptionProcessor.encrypt(\n operation.resourceBody,\n );\n operation.resourceBody = body;\n totalPropertiesEncryptedCount += propertiesEncryptedCount;\n break;\n }\n case BulkOperationType.Patch: {\n if (await encryptionProcessor.isPathEncrypted(\"/id\")) {\n operation.id = await encryptionProcessor.getEncryptedId(operation.id);\n totalPropertiesEncryptedCount++;\n }\n const body = operation.resourceBody;\n const patchRequestBody = Array.isArray(body) ? body : body.operations;\n for (const patchOperation of patchRequestBody) {\n if (\"value\" in patchOperation) {\n if (await encryptionProcessor.isPathEncrypted(patchOperation.path)) {\n patchOperation.value = await encryptionProcessor.encryptProperty(\n patchOperation.path,\n patchOperation.value,\n );\n totalPropertiesEncryptedCount++;\n }\n }\n }\n break;\n }\n }\n return { operation, totalPropertiesEncryptedCount };\n}\n"]}
1
+ {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../../src/utils/batch.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAcxF,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAgE9C,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;IAChE,MAAM,mBAAmB,GAAG,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AI,wBAAwB,CAAC;YAC1D,MAAM;QACR,CAAC;QACD,KAAK,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7B,IAAI,MAAM,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrD,SAAS,CAAC,EAAE,GAAG,MAAM,mBAAmB,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;gBACtE,6BAA6B,EAAE,CAAC;YAClC,CAAC;YACD,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC;YACpC,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACtE,KAAK,MAAM,cAAc,IAAI,gBAAgB,EAAE,CAAC;gBAC9C,IAAI,OAAO,IAAI,cAAc,EAAE,CAAC;oBAC9B,IAAI,MAAM,mBAAmB,CAAC,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;wBACnE,cAAc,CAAC,KAAK,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAC9D,cAAc,CAAC,IAAI,EACnB,cAAc,CAAC,KAAK,CACrB,CAAC;wBACF,6BAA6B,EAAE,CAAC;oBAClC,CAAC;gBACH,CAAC;YACH,CAAC;YACD,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC;AACtD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { JSONObject } from \"../queryExecutionContext/index.js\";\nimport { extractPartitionKeys, undefinedPartitionKey } from \"../extractPartitionKey.js\";\nimport type {\n CosmosDiagnostics,\n CosmosHeaders,\n DiagnosticNodeInternal,\n ErrorResponse,\n RequestOptions,\n StatusCode,\n} from \"../index.js\";\nimport type {\n PartitionKey,\n PartitionKeyDefinition,\n PrimitivePartitionKeyValue,\n} from \"../documents/index.js\";\nimport { NonePartitionKeyLiteral, convertToInternalPartitionKey } from \"../documents/index.js\";\nimport type { PatchRequestBody } from \"./patch.js\";\nimport { assertNotUndefined } from \"./typeChecks.js\";\nimport { bodyFromData } from \"../request/request.js\";\nimport { Constants } from \"../common/constants.js\";\nimport { randomUUID } from \"@azure/core-util\";\nimport type { ItemOperation } from \"../bulk/ItemOperation.js\";\nimport type { BulkResponse } from \"../bulk/index.js\";\nimport type { EncryptionProcessor } from \"../encryption/EncryptionProcessor.js\";\n\nexport type Operation =\n | CreateOperation\n | UpsertOperation\n | ReadOperation\n | DeleteOperation\n | ReplaceOperation\n | BulkPatchOperation;\n\nexport interface Batch {\n min: string;\n max: string;\n rangeId: string;\n indexes: number[];\n operations: Operation[];\n}\n\nexport type BulkOperationResponse = OperationResponse[] & { diagnostics: CosmosDiagnostics };\n\n/**\n * represents response for an operation in bulk with executeBulkOperations API\n */\nexport interface BulkOperationResult {\n /** the original operation input passed */\n operationInput: OperationInput;\n /** response from the backend for the item operation */\n response?: ExtendedOperationResponse;\n /** any exceptions are captured here */\n error?: ErrorResponse;\n}\n\n/**\n * response for a successful operation in bulk with executeBulkOperations API\n */\nexport interface ExtendedOperationResponse extends OperationResponse {\n /** activity id related to the operation */\n activityId?: string;\n /** session Token assigned to the result */\n sessionToken?: string;\n /** headers associated with the operation */\n headers?: CosmosHeaders;\n /** diagnostic details associated with operation */\n diagnostics: CosmosDiagnostics;\n}\n\nexport interface OperationResponse {\n statusCode: number;\n requestCharge: number;\n eTag?: string;\n resourceBody?: JSONObject;\n}\n\n/**\n * Options object used to modify bulk execution.\n * continueOnError (Default value: false) - Continues bulk execution when an operation fails ** NOTE THIS WILL DEFAULT TO TRUE IN the 4.0 RELEASE\n */\nexport interface BulkOptions {\n continueOnError?: boolean;\n}\n\nexport function isKeyInRange(min: string, max: string, key: string): boolean {\n const isAfterMinInclusive = key.localeCompare(min) >= 0;\n const isBeforeMax = key.localeCompare(max) < 0;\n return isAfterMinInclusive && isBeforeMax;\n}\n\nexport interface OperationBase {\n partitionKey?: string;\n ifMatch?: string;\n ifNoneMatch?: string;\n}\n\nexport const BulkOperationType = {\n Create: \"Create\",\n Upsert: \"Upsert\",\n Read: \"Read\",\n Delete: \"Delete\",\n Replace: \"Replace\",\n Patch: \"Patch\",\n} as const;\n\nexport type OperationInput =\n | CreateOperationInput\n | UpsertOperationInput\n | ReadOperationInput\n | DeleteOperationInput\n | ReplaceOperationInput\n | PatchOperationInput;\n\nexport interface CreateOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Create;\n resourceBody: JSONObject;\n}\n\nexport interface UpsertOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Upsert;\n resourceBody: JSONObject;\n}\n\nexport interface ReadOperationInput {\n partitionKey?: PartitionKey;\n operationType: typeof BulkOperationType.Read;\n id: string;\n}\n\nexport interface DeleteOperationInput {\n partitionKey?: PartitionKey;\n operationType: typeof BulkOperationType.Delete;\n id: string;\n}\n\nexport interface ReplaceOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Replace;\n resourceBody: JSONObject;\n id: string;\n}\n\nexport interface PatchOperationInput {\n partitionKey?: PartitionKey;\n ifMatch?: string;\n ifNoneMatch?: string;\n operationType: typeof BulkOperationType.Patch;\n resourceBody: PatchRequestBody;\n id: string;\n}\n\nexport type OperationWithItem = OperationBase & {\n resourceBody: JSONObject;\n};\n\nexport type CreateOperation = OperationWithItem & {\n operationType: typeof BulkOperationType.Create;\n};\n\nexport type UpsertOperation = OperationWithItem & {\n operationType: typeof BulkOperationType.Upsert;\n};\n\nexport type ReadOperation = OperationBase & {\n operationType: typeof BulkOperationType.Read;\n id: string;\n};\n\nexport type DeleteOperation = OperationBase & {\n operationType: typeof BulkOperationType.Delete;\n id: string;\n};\n\nexport type ReplaceOperation = OperationWithItem & {\n operationType: typeof BulkOperationType.Replace;\n id: string;\n};\n\nexport type BulkPatchOperation = OperationBase & {\n operationType: typeof BulkOperationType.Patch;\n id: string;\n};\n\nexport function hasResource(\n operation: Operation,\n): operation is CreateOperation | UpsertOperation | ReplaceOperation {\n return (\n operation.operationType !== \"Patch\" &&\n (operation as OperationWithItem).resourceBody !== undefined\n );\n}\n/**\n * Maps OperationInput to Operation by\n * - generating Ids if needed.\n * - choosing partitionKey which can be used to choose which batch this\n * operation should be part of. The order is -\n * 1. If the operationInput itself has partitionKey field set it is used.\n * 2. Other wise for create/replace/upsert it is extracted from resource body.\n * 3. For read/delete/patch type operations undefined partitionKey is used.\n * - Here one nuance is that, the partitionKey field inside Operation needs to\n * be serialized as a JSON string.\n * @param operationInput - OperationInput\n * @param definition - PartitionKeyDefinition\n * @param options - RequestOptions\n * @returns\n */\nexport function prepareOperations(\n operationInput: OperationInput,\n definition: PartitionKeyDefinition,\n options: RequestOptions = {},\n): {\n operation: Operation;\n partitionKey: PrimitivePartitionKeyValue[];\n} {\n populateIdsIfNeeded(operationInput, options);\n\n let partitionKey: PrimitivePartitionKeyValue[];\n if (Object.prototype.hasOwnProperty.call(operationInput, \"partitionKey\")) {\n if (operationInput.partitionKey === undefined) {\n partitionKey = definition.paths.map(() => NonePartitionKeyLiteral);\n } else {\n partitionKey = convertToInternalPartitionKey(operationInput.partitionKey);\n }\n } else {\n switch (operationInput.operationType) {\n case BulkOperationType.Create:\n case BulkOperationType.Replace:\n case BulkOperationType.Upsert:\n partitionKey = assertNotUndefined(\n extractPartitionKeys(operationInput.resourceBody, definition),\n \"Unexpected undefined Partition Key Found.\",\n );\n break;\n case BulkOperationType.Read:\n case BulkOperationType.Delete:\n case BulkOperationType.Patch:\n partitionKey = undefinedPartitionKey(definition);\n break;\n }\n }\n return {\n operation: { ...operationInput, partitionKey: JSON.stringify(partitionKey) } as Operation,\n partitionKey,\n };\n}\n\n/**\n * For operations requiring Id genrate random uuids.\n * @param operationInput - OperationInput to be checked.\n * @param options - RequestOptions\n */\nfunction populateIdsIfNeeded(operationInput: OperationInput, options: RequestOptions) {\n if (\n operationInput.operationType === BulkOperationType.Create ||\n operationInput.operationType === BulkOperationType.Upsert\n ) {\n if (\n (operationInput.resourceBody.id === undefined || operationInput.resourceBody.id === \"\") &&\n !options.disableAutomaticIdGeneration\n ) {\n operationInput.resourceBody.id = randomUUID();\n }\n }\n}\n\n/**\n * Splits a batch into array of batches based on cumulative size of its operations by making sure\n * cumulative size of an individual batch is not larger than {@link Constants.DefaultMaxBulkRequestBodySizeInBytes}.\n * If a single operation itself is larger than {@link Constants.DefaultMaxBulkRequestBodySizeInBytes}, that\n * operation would be moved into a batch containing only that operation.\n * @param originalBatch - A batch of operations needed to be checked.\n * @returns\n * @hidden\n */\nexport function splitBatchBasedOnBodySize(originalBatch: Batch): Batch[] {\n if (originalBatch?.operations === undefined || originalBatch.operations.length < 1) return [];\n let currentBatchSize = calculateObjectSizeInBytes(originalBatch.operations[0]);\n let currentBatch: Batch = {\n ...originalBatch,\n operations: [originalBatch.operations[0]],\n indexes: [originalBatch.indexes[0]],\n };\n const processedBatches: Batch[] = [];\n processedBatches.push(currentBatch);\n\n for (let index = 1; index < originalBatch.operations.length; index++) {\n const operation = originalBatch.operations[index];\n const currentOpSize = calculateObjectSizeInBytes(operation);\n if (currentBatchSize + currentOpSize > Constants.DefaultMaxBulkRequestBodySizeInBytes) {\n currentBatch = {\n ...originalBatch,\n operations: [],\n indexes: [],\n };\n processedBatches.push(currentBatch);\n currentBatchSize = 0;\n }\n currentBatch.operations.push(operation);\n currentBatch.indexes.push(originalBatch.indexes[index]);\n currentBatchSize += currentOpSize;\n }\n return processedBatches;\n}\n\n/**\n * Calculates size of an JSON object in bytes with utf-8 encoding.\n * @hidden\n */\nexport function calculateObjectSizeInBytes(obj: unknown): number {\n return new TextEncoder().encode(bodyFromData(obj as any)).length;\n}\n\nexport function decorateBatchOperation(\n operation: OperationInput,\n options: RequestOptions = {},\n): Operation {\n if (\n operation.operationType === BulkOperationType.Create ||\n operation.operationType === BulkOperationType.Upsert\n ) {\n if (\n (operation.resourceBody.id === undefined || operation.resourceBody.id === \"\") &&\n !options.disableAutomaticIdGeneration\n ) {\n operation.resourceBody.id = randomUUID();\n }\n }\n return operation as Operation;\n}\n\nexport function isSuccessStatusCode(statusCode: StatusCode): boolean {\n return statusCode >= 200 && statusCode <= 299;\n}\n\nexport type ExecuteCallback = (\n operations: ItemOperation[],\n diagnosticNode: DiagnosticNodeInternal,\n) => Promise<BulkResponse>;\nexport type RetryCallback = (\n operation: ItemOperation,\n diagnosticNode: DiagnosticNodeInternal,\n) => Promise<void>;\n\nexport class TaskCompletionSource<T> {\n private readonly promise: Promise<T>;\n private resolveFn!: (value: T) => void;\n private rejectFn!: (reason?: any) => void;\n\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this.resolveFn = resolve;\n this.rejectFn = reject;\n });\n }\n\n public get task(): Promise<T> {\n return this.promise;\n }\n\n public setResult(value: T): void {\n this.resolveFn(value);\n }\n\n public setException(error: Error): void {\n this.rejectFn(error);\n }\n}\n\nexport async function encryptOperationInput(\n encryptionProcessor: EncryptionProcessor,\n operation: OperationInput,\n totalPropertiesEncryptedCount: number,\n): Promise<{ operation: OperationInput; totalPropertiesEncryptedCount: number }> {\n if (Object.prototype.hasOwnProperty.call(operation, \"partitionKey\")) {\n const partitionKeyInternal = convertToInternalPartitionKey(operation.partitionKey);\n const { partitionKeyList, encryptedCount } =\n await encryptionProcessor.getEncryptedPartitionKeyValue(partitionKeyInternal);\n operation.partitionKey = partitionKeyList;\n totalPropertiesEncryptedCount += encryptedCount;\n }\n switch (operation.operationType) {\n case BulkOperationType.Create:\n case BulkOperationType.Upsert: {\n const { body, propertiesEncryptedCount } = await encryptionProcessor.encrypt(\n operation.resourceBody,\n );\n operation.resourceBody = body;\n totalPropertiesEncryptedCount += propertiesEncryptedCount;\n break;\n }\n case BulkOperationType.Read:\n case BulkOperationType.Delete:\n if (await encryptionProcessor.isPathEncrypted(\"/id\")) {\n operation.id = await encryptionProcessor.getEncryptedId(operation.id);\n totalPropertiesEncryptedCount++;\n }\n break;\n case BulkOperationType.Replace: {\n if (await encryptionProcessor.isPathEncrypted(\"/id\")) {\n operation.id = await encryptionProcessor.getEncryptedId(operation.id);\n totalPropertiesEncryptedCount++;\n }\n const { body, propertiesEncryptedCount } = await encryptionProcessor.encrypt(\n operation.resourceBody,\n );\n operation.resourceBody = body;\n totalPropertiesEncryptedCount += propertiesEncryptedCount;\n break;\n }\n case BulkOperationType.Patch: {\n if (await encryptionProcessor.isPathEncrypted(\"/id\")) {\n operation.id = await encryptionProcessor.getEncryptedId(operation.id);\n totalPropertiesEncryptedCount++;\n }\n const body = operation.resourceBody;\n const patchRequestBody = Array.isArray(body) ? body : body.operations;\n for (const patchOperation of patchRequestBody) {\n if (\"value\" in patchOperation) {\n if (await encryptionProcessor.isPathEncrypted(patchOperation.path)) {\n patchOperation.value = await encryptionProcessor.encryptProperty(\n patchOperation.path,\n patchOperation.value,\n );\n totalPropertiesEncryptedCount++;\n }\n }\n }\n break;\n }\n }\n return { operation, totalPropertiesEncryptedCount };\n}\n"]}
@@ -2,6 +2,10 @@
2
2
  // Licensed under the MIT License.
3
3
  import PriorityQueue from "priorityqueuejs";
4
4
  export class FixedSizePriorityQueue {
5
+ pq;
6
+ // The compare function should return a positive number if a is greater than b, a negative number if a is less than b, and 0 if a is equal to b.
7
+ compareFn;
8
+ pqMaxSize;
5
9
  constructor(compareFn, pqMaxSize) {
6
10
  this.compareFn = compareFn;
7
11
  this.pq = new PriorityQueue(this.compareFn);
@@ -1 +1 @@
1
- {"version":3,"file":"fixedSizePriorityQueue.js","sourceRoot":"","sources":["../../../src/utils/fixedSizePriorityQueue.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,sBAAsB;IAMjC,YAAY,SAAiC,EAAE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AED,8GAA8G;IAC9G,wFAAwF;IACjF,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,sBAAsB,CAC1C,CAAC,CAAI,EAAE,CAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EACrC,IAAI,CAAC,SAAS,CACf,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1B,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport PriorityQueue from \"priorityqueuejs\";\n\nexport class FixedSizePriorityQueue<T> {\n private pq: PriorityQueue<T>;\n // The compare function should return a positive number if a is greater than b, a negative number if a is less than b, and 0 if a is equal to b.\n private compareFn: (a: T, b: T) => number;\n private pqMaxSize: number;\n\n constructor(compareFn: (a: T, b: T) => number, pqMaxSize: number) {\n this.compareFn = compareFn;\n this.pq = new PriorityQueue<T>(this.compareFn);\n this.pqMaxSize = pqMaxSize;\n }\n\n public enqueue(item: T): void {\n if (this.pq.size() < this.pqMaxSize) {\n this.pq.enq(item);\n } else {\n const topItem = this.pq.peek();\n if (this.compareFn(topItem, item) > 0) {\n this.pq.deq();\n this.pq.enq(item);\n }\n }\n }\n\n public dequeue(): T {\n return this.pq.deq();\n }\n\n public size(): number {\n return this.pq.size();\n }\n\n public isEmpty(): boolean {\n return this.pq.isEmpty();\n }\n\n public peek(): T {\n return this.pq.peek();\n }\n\n public getTopElements(): T[] {\n const elements: T[] = [];\n while (!this.pq.isEmpty()) {\n elements.unshift(this.pq.deq());\n }\n return elements;\n }\n\n // Create a new instance of FixedSizePriorityQueue with a reversed compare function and the same maximum size.\n // Enqueue all elements from the current priority queue into the reverse priority queue.\n public reverse(): FixedSizePriorityQueue<T> {\n const reversePQ = new FixedSizePriorityQueue<T>(\n (a: T, b: T) => -this.compareFn(a, b),\n this.pqMaxSize,\n );\n while (!this.pq.isEmpty()) {\n reversePQ.enqueue(this.pq.deq());\n }\n return reversePQ;\n }\n}\n"]}
1
+ {"version":3,"file":"fixedSizePriorityQueue.js","sourceRoot":"","sources":["../../../src/utils/fixedSizePriorityQueue.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,sBAAsB;IACzB,EAAE,CAAmB;IAC7B,gJAAgJ;IACxI,SAAS,CAAyB;IAClC,SAAS,CAAS;IAE1B,YAAY,SAAiC,EAAE,SAAiB;QAC9D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,EAAE,GAAG,IAAI,aAAa,CAAI,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,OAAO,CAAC,IAAO;QACpB,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;gBACd,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;IACvB,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAEM,cAAc;QACnB,MAAM,QAAQ,GAAQ,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1B,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,8GAA8G;IAC9G,wFAAwF;IACjF,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,sBAAsB,CAC1C,CAAC,CAAI,EAAE,CAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EACrC,IAAI,CAAC,SAAS,CACf,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1B,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport PriorityQueue from \"priorityqueuejs\";\n\nexport class FixedSizePriorityQueue<T> {\n private pq: PriorityQueue<T>;\n // The compare function should return a positive number if a is greater than b, a negative number if a is less than b, and 0 if a is equal to b.\n private compareFn: (a: T, b: T) => number;\n private pqMaxSize: number;\n\n constructor(compareFn: (a: T, b: T) => number, pqMaxSize: number) {\n this.compareFn = compareFn;\n this.pq = new PriorityQueue<T>(this.compareFn);\n this.pqMaxSize = pqMaxSize;\n }\n\n public enqueue(item: T): void {\n if (this.pq.size() < this.pqMaxSize) {\n this.pq.enq(item);\n } else {\n const topItem = this.pq.peek();\n if (this.compareFn(topItem, item) > 0) {\n this.pq.deq();\n this.pq.enq(item);\n }\n }\n }\n\n public dequeue(): T {\n return this.pq.deq();\n }\n\n public size(): number {\n return this.pq.size();\n }\n\n public isEmpty(): boolean {\n return this.pq.isEmpty();\n }\n\n public peek(): T {\n return this.pq.peek();\n }\n\n public getTopElements(): T[] {\n const elements: T[] = [];\n while (!this.pq.isEmpty()) {\n elements.unshift(this.pq.deq());\n }\n return elements;\n }\n\n // Create a new instance of FixedSizePriorityQueue with a reversed compare function and the same maximum size.\n // Enqueue all elements from the current priority queue into the reverse priority queue.\n public reverse(): FixedSizePriorityQueue<T> {\n const reversePQ = new FixedSizePriorityQueue<T>(\n (a: T, b: T) => -this.compareFn(a, b),\n this.pqMaxSize,\n );\n while (!this.pq.isEmpty()) {\n reversePQ.enqueue(this.pq.deq());\n }\n return reversePQ;\n }\n}\n"]}
@@ -12,7 +12,7 @@ import { hashV2PartitionKey } from "./v2.js";
12
12
  * @returns
13
13
  */
14
14
  export function hashPartitionKey(partitionKey, partitionDefinition) {
15
- const kind = (partitionDefinition === null || partitionDefinition === void 0 ? void 0 : partitionDefinition.kind) || PartitionKeyKind.Hash; // Default value.
15
+ const kind = partitionDefinition?.kind || PartitionKeyKind.Hash; // Default value.
16
16
  const isV2 = partitionDefinition &&
17
17
  partitionDefinition.version &&
18
18
  partitionDefinition.version === PartitionKeyDefinitionVersion.V2;
@@ -1 +1 @@
1
- {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../src/utils/hashing/hash.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,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,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACpE,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PartitionKeyRange } from \"../../client/index.js\";\nimport type { PartitionKeyDefinition, PrimitivePartitionKeyValue } from \"../../documents/index.js\";\nimport { PartitionKeyDefinitionVersion, PartitionKeyKind } from \"../../documents/index.js\";\nimport { isKeyInRange } from \"../batch.js\";\nimport { hashMultiHashPartitionKey } from \"./multiHash.js\";\nimport { hashV1PartitionKey } from \"./v1.js\";\nimport { hashV2PartitionKey } from \"./v2.js\";\n\n/**\n * Generate hash of a PartitonKey based on it PartitionKeyDefinition.\n * @param partitionKey - to be hashed.\n * @param partitionDefinition - container's partitionKey definition\n * @returns\n */\nexport function hashPartitionKey(\n partitionKey: PrimitivePartitionKeyValue[],\n partitionDefinition: PartitionKeyDefinition,\n): string {\n const kind: PartitionKeyKind = partitionDefinition?.kind || PartitionKeyKind.Hash; // Default value.\n const isV2 =\n partitionDefinition &&\n partitionDefinition.version &&\n partitionDefinition.version === PartitionKeyDefinitionVersion.V2;\n switch (kind) {\n case PartitionKeyKind.Hash:\n return isV2 ? hashV2PartitionKey(partitionKey) : hashV1PartitionKey(partitionKey);\n case PartitionKeyKind.MultiHash:\n return hashMultiHashPartitionKey(partitionKey);\n }\n}\n\nexport function binarySearchOnPartitionKeyRanges(\n partitionKeyRanges: PartitionKeyRange[],\n hashedPartitionKey: string,\n): string | undefined {\n let low = 0;\n let high = partitionKeyRanges.length - 1;\n\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const range = partitionKeyRanges[mid];\n\n if (isKeyInRange(range.minInclusive, range.maxExclusive, hashedPartitionKey)) {\n return range.id;\n } else if (hashedPartitionKey.localeCompare(range.minInclusive) < 0) {\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../src/utils/hashing/hash.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,YAA0C,EAC1C,mBAA2C;IAE3C,MAAM,IAAI,GAAqB,mBAAmB,EAAE,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB;IACpG,MAAM,IAAI,GACR,mBAAmB;QACnB,mBAAmB,CAAC,OAAO;QAC3B,mBAAmB,CAAC,OAAO,KAAK,6BAA6B,CAAC,EAAE,CAAC;IACnE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,gBAAgB,CAAC,IAAI;YACxB,OAAO,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACpF,KAAK,gBAAgB,CAAC,SAAS;YAC7B,OAAO,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,kBAAuC,EACvC,kBAA0B;IAE1B,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,IAAI,GAAG,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;IAEzC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAEtC,IAAI,YAAY,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAAE,CAAC;YAC7E,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,CAAC;aAAM,IAAI,kBAAkB,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACpE,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PartitionKeyRange } from \"../../client/index.js\";\nimport type { PartitionKeyDefinition, PrimitivePartitionKeyValue } from \"../../documents/index.js\";\nimport { PartitionKeyDefinitionVersion, PartitionKeyKind } from \"../../documents/index.js\";\nimport { isKeyInRange } from \"../batch.js\";\nimport { hashMultiHashPartitionKey } from \"./multiHash.js\";\nimport { hashV1PartitionKey } from \"./v1.js\";\nimport { hashV2PartitionKey } from \"./v2.js\";\n\n/**\n * Generate hash of a PartitonKey based on it PartitionKeyDefinition.\n * @param partitionKey - to be hashed.\n * @param partitionDefinition - container's partitionKey definition\n * @returns\n */\nexport function hashPartitionKey(\n partitionKey: PrimitivePartitionKeyValue[],\n partitionDefinition: PartitionKeyDefinition,\n): string {\n const kind: PartitionKeyKind = partitionDefinition?.kind || PartitionKeyKind.Hash; // Default value.\n const isV2 =\n partitionDefinition &&\n partitionDefinition.version &&\n partitionDefinition.version === PartitionKeyDefinitionVersion.V2;\n switch (kind) {\n case PartitionKeyKind.Hash:\n return isV2 ? hashV2PartitionKey(partitionKey) : hashV1PartitionKey(partitionKey);\n case PartitionKeyKind.MultiHash:\n return hashMultiHashPartitionKey(partitionKey);\n }\n}\n\nexport function binarySearchOnPartitionKeyRanges(\n partitionKeyRanges: PartitionKeyRange[],\n hashedPartitionKey: string,\n): string | undefined {\n let low = 0;\n let high = partitionKeyRanges.length - 1;\n\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const range = partitionKeyRanges[mid];\n\n if (isKeyInRange(range.minInclusive, range.maxExclusive, hashedPartitionKey)) {\n return range.id;\n } else if (hashedPartitionKey.localeCompare(range.minInclusive) < 0) {\n high = mid - 1;\n } else {\n low = mid + 1;\n }\n }\n return undefined;\n}\n"]}
@@ -4,6 +4,8 @@
4
4
  * Stores the most favourable distinct result from a set of nonStreamingOrderBy results.
5
5
  */
6
6
  export class NonStreamingOrderByMap {
7
+ map;
8
+ compareFn;
7
9
  constructor(compareFn) {
8
10
  this.compareFn = compareFn;
9
11
  this.map = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"nonStreamingOrderByMap.js","sourceRoot":"","sources":["../../../src/utils/nonStreamingOrderByMap.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAIjC,YAAY,SAAyD;QACnE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IAClC,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,KAAQ;QAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,gDAAgD;YAChD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,oIAAoI;YACpI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;gBACzC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IAEM,GAAG,CAAC,GAAW;QACpB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,SAAS,CAAC;QAEzC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD;;OAEG;IACI,oBAAoB;QACzB,MAAM,GAAG,GAAQ,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACpC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAEO,cAAc,CAAC,IAAmB,EAAE,IAAmB;QAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvC,IAAI,GAAG,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAEzB,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;IACvB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Stores the most favourable distinct result from a set of nonStreamingOrderBy results.\n */\nexport class NonStreamingOrderByMap<T> {\n private map: Map<string, T>;\n private compareFn: (a: T | undefined, b: T | undefined) => number;\n\n constructor(compareFn: (a: T | undefined, b: T | undefined) => number) {\n this.compareFn = compareFn;\n this.map = new Map<string, T>();\n }\n\n public set(key: string, value: T): void {\n if (!this.map.has(key)) {\n // If the key is not present in the map, add it.\n this.map.set(key, value);\n } else {\n // If the key is present in the map, compare the similarity score of the new value with the old value. Keep the more favourable one.\n const oldValue = this.map.get(key);\n if (this.replaceResults(oldValue, value)) {\n this.map.set(key, value);\n }\n }\n }\n\n public get(key: string): T | undefined {\n if (!this.map.has(key)) return undefined;\n\n return this.map.get(key);\n }\n /**\n * Returns all the values in the map and resets the map.\n */\n public getAllValuesAndReset(): T[] {\n const res: T[] = [];\n for (const [key, value] of this.map) {\n res.push(value);\n this.map.delete(key);\n }\n return res;\n }\n\n private replaceResults(res1: T | undefined, res2: T | undefined): boolean {\n const res = this.compareFn(res1, res2);\n if (res < 0) return true;\n\n return false;\n }\n\n public size(): number {\n return this.map.size;\n }\n}\n"]}
1
+ {"version":3,"file":"nonStreamingOrderByMap.js","sourceRoot":"","sources":["../../../src/utils/nonStreamingOrderByMap.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IACzB,GAAG,CAAiB;IACpB,SAAS,CAAiD;IAElE,YAAY,SAAyD;QACnE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IAClC,CAAC;IAEM,GAAG,CAAC,GAAW,EAAE,KAAQ;QAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,gDAAgD;YAChD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,oIAAoI;YACpI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;gBACzC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IAEM,GAAG,CAAC,GAAW;QACpB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,SAAS,CAAC;QAEzC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD;;OAEG;IACI,oBAAoB;QACzB,MAAM,GAAG,GAAQ,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACpC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAEO,cAAc,CAAC,IAAmB,EAAE,IAAmB;QAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvC,IAAI,GAAG,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAEzB,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;IACvB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Stores the most favourable distinct result from a set of nonStreamingOrderBy results.\n */\nexport class NonStreamingOrderByMap<T> {\n private map: Map<string, T>;\n private compareFn: (a: T | undefined, b: T | undefined) => number;\n\n constructor(compareFn: (a: T | undefined, b: T | undefined) => number) {\n this.compareFn = compareFn;\n this.map = new Map<string, T>();\n }\n\n public set(key: string, value: T): void {\n if (!this.map.has(key)) {\n // If the key is not present in the map, add it.\n this.map.set(key, value);\n } else {\n // If the key is present in the map, compare the similarity score of the new value with the old value. Keep the more favourable one.\n const oldValue = this.map.get(key);\n if (this.replaceResults(oldValue, value)) {\n this.map.set(key, value);\n }\n }\n }\n\n public get(key: string): T | undefined {\n if (!this.map.has(key)) return undefined;\n\n return this.map.get(key);\n }\n /**\n * Returns all the values in the map and resets the map.\n */\n public getAllValuesAndReset(): T[] {\n const res: T[] = [];\n for (const [key, value] of this.map) {\n res.push(value);\n this.map.delete(key);\n }\n return res;\n }\n\n private replaceResults(res1: T | undefined, res2: T | undefined): boolean {\n const res = this.compareFn(res1, res2);\n if (res < 0) return true;\n\n return false;\n }\n\n public size(): number {\n return this.map.size;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/cosmos",
3
- "version": "4.5.0-alpha.20250718.3",
3
+ "version": "4.5.0-alpha.20250730.2",
4
4
  "description": "Microsoft Azure Cosmos DB Service Node.js SDK for NOSQL API",
5
5
  "sdk-type": "client",
6
6
  "keywords": [
@@ -137,7 +137,7 @@
137
137
  },
138
138
  "type": "module",
139
139
  "tshy": {
140
- "project": "./tsconfig.src.json",
140
+ "project": "./tsconfig.src.build.json",
141
141
  "exports": {
142
142
  "./package.json": "./package.json",
143
143
  ".": "./src/index.ts"