@azure/cosmos 4.5.0-alpha.20250717.1 → 4.5.0-alpha.20250729.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1219) 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.d.ts.map +1 -1
  8. package/dist/browser/CosmosClient.js +37 -3
  9. package/dist/browser/CosmosClient.js.map +1 -1
  10. package/dist/browser/CosmosDiagnostics.js +3 -0
  11. package/dist/browser/CosmosDiagnostics.js.map +1 -1
  12. package/dist/browser/PartitionKeyRangeFailoverInfo.js +8 -5
  13. package/dist/browser/PartitionKeyRangeFailoverInfo.js.map +1 -1
  14. package/dist/browser/bulk/Batcher.js +13 -3
  15. package/dist/browser/bulk/Batcher.js.map +1 -1
  16. package/dist/browser/bulk/BulkHelper.js +26 -11
  17. package/dist/browser/bulk/BulkHelper.js.map +1 -1
  18. package/dist/browser/bulk/BulkResponse.js +22 -20
  19. package/dist/browser/bulk/BulkResponse.js.map +1 -1
  20. package/dist/browser/bulk/CongestionAlgorithm.js +11 -4
  21. package/dist/browser/bulk/CongestionAlgorithm.js.map +1 -1
  22. package/dist/browser/bulk/HelperPerPartition.js +14 -1
  23. package/dist/browser/bulk/HelperPerPartition.js.map +1 -1
  24. package/dist/browser/bulk/ItemOperationContext.js +4 -0
  25. package/dist/browser/bulk/ItemOperationContext.js.map +1 -1
  26. package/dist/browser/bulk/Limiter.js +27 -18
  27. package/dist/browser/bulk/Limiter.js.map +1 -1
  28. package/dist/browser/bulk/PartitionMetric.js +4 -0
  29. package/dist/browser/bulk/PartitionMetric.js.map +1 -1
  30. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  31. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  32. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  33. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js +20 -8
  34. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  35. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  36. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  37. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  38. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  39. package/dist/browser/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  40. package/dist/browser/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  41. package/dist/browser/client/ChangeFeed/ChangeFeedRange.js +20 -0
  42. package/dist/browser/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  43. package/dist/browser/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  44. package/dist/browser/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  45. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  46. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  47. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  48. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  49. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  50. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  51. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  52. package/dist/browser/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  53. package/dist/browser/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  54. package/dist/browser/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  55. package/dist/browser/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  56. package/dist/browser/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  57. package/dist/browser/client/ChangeFeed/FeedRange.js +8 -0
  58. package/dist/browser/client/ChangeFeed/FeedRange.js.map +1 -1
  59. package/dist/browser/client/ChangeFeed/FeedRangeQueue.js +1 -0
  60. package/dist/browser/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  61. package/dist/browser/client/ChangeFeed/changeFeedUtils.js +5 -5
  62. package/dist/browser/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  63. package/dist/browser/client/ClientUtils.js +1 -1
  64. package/dist/browser/client/ClientUtils.js.map +1 -1
  65. package/dist/browser/client/Conflict/Conflict.js +4 -0
  66. package/dist/browser/client/Conflict/Conflict.js.map +1 -1
  67. package/dist/browser/client/Conflict/ConflictResponse.js +2 -0
  68. package/dist/browser/client/Conflict/ConflictResponse.js.map +1 -1
  69. package/dist/browser/client/Conflict/Conflicts.js +2 -0
  70. package/dist/browser/client/Conflict/Conflicts.js.map +1 -1
  71. package/dist/browser/client/Container/Container.js +18 -3
  72. package/dist/browser/client/Container/Container.js.map +1 -1
  73. package/dist/browser/client/Container/ContainerResponse.js +2 -0
  74. package/dist/browser/client/Container/ContainerResponse.js.map +1 -1
  75. package/dist/browser/client/Container/Containers.js +4 -2
  76. package/dist/browser/client/Container/Containers.js.map +1 -1
  77. package/dist/browser/client/Database/Database.js +33 -0
  78. package/dist/browser/client/Database/Database.js.map +1 -1
  79. package/dist/browser/client/Database/DatabaseResponse.js +2 -0
  80. package/dist/browser/client/Database/DatabaseResponse.js.map +1 -1
  81. package/dist/browser/client/Database/Databases.js +3 -0
  82. package/dist/browser/client/Database/Databases.js.map +1 -1
  83. package/dist/browser/client/Item/Item.js +4 -0
  84. package/dist/browser/client/Item/Item.js.map +1 -1
  85. package/dist/browser/client/Item/ItemResponse.js +2 -0
  86. package/dist/browser/client/Item/ItemResponse.js.map +1 -1
  87. package/dist/browser/client/Item/Items.d.ts.map +1 -1
  88. package/dist/browser/client/Item/Items.js +12 -0
  89. package/dist/browser/client/Item/Items.js.map +1 -1
  90. package/dist/browser/client/Offer/Offer.js +3 -0
  91. package/dist/browser/client/Offer/Offer.js.map +1 -1
  92. package/dist/browser/client/Offer/OfferResponse.js +2 -0
  93. package/dist/browser/client/Offer/OfferResponse.js.map +1 -1
  94. package/dist/browser/client/Offer/Offers.js +2 -0
  95. package/dist/browser/client/Offer/Offers.js.map +1 -1
  96. package/dist/browser/client/Permission/Permission.js +3 -0
  97. package/dist/browser/client/Permission/Permission.js.map +1 -1
  98. package/dist/browser/client/Permission/PermissionResponse.js +2 -0
  99. package/dist/browser/client/Permission/PermissionResponse.js.map +1 -1
  100. package/dist/browser/client/Permission/Permissions.js +2 -0
  101. package/dist/browser/client/Permission/Permissions.js.map +1 -1
  102. package/dist/browser/client/SasToken/SasTokenProperties.js +17 -0
  103. package/dist/browser/client/SasToken/SasTokenProperties.js.map +1 -1
  104. package/dist/browser/client/Script/Scripts.js +5 -0
  105. package/dist/browser/client/Script/Scripts.js.map +1 -1
  106. package/dist/browser/client/StoredProcedure/StoredProcedure.js +3 -0
  107. package/dist/browser/client/StoredProcedure/StoredProcedure.js.map +1 -1
  108. package/dist/browser/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  109. package/dist/browser/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  110. package/dist/browser/client/StoredProcedure/StoredProcedures.js +2 -0
  111. package/dist/browser/client/StoredProcedure/StoredProcedures.js.map +1 -1
  112. package/dist/browser/client/Trigger/Trigger.js +3 -0
  113. package/dist/browser/client/Trigger/Trigger.js.map +1 -1
  114. package/dist/browser/client/Trigger/TriggerResponse.js +2 -0
  115. package/dist/browser/client/Trigger/TriggerResponse.js.map +1 -1
  116. package/dist/browser/client/Trigger/Triggers.js +2 -0
  117. package/dist/browser/client/Trigger/Triggers.js.map +1 -1
  118. package/dist/browser/client/User/User.js +9 -0
  119. package/dist/browser/client/User/User.js.map +1 -1
  120. package/dist/browser/client/User/UserResponse.js +2 -0
  121. package/dist/browser/client/User/UserResponse.js.map +1 -1
  122. package/dist/browser/client/User/Users.js +2 -0
  123. package/dist/browser/client/User/Users.js.map +1 -1
  124. package/dist/browser/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  125. package/dist/browser/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  126. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  127. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  128. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  129. package/dist/browser/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  130. package/dist/browser/diagnostics/CosmosDiagnosticsContext.js +8 -7
  131. package/dist/browser/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  132. package/dist/browser/diagnostics/DiagnosticNodeInternal.js +26 -7
  133. package/dist/browser/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  134. package/dist/browser/diagnostics/DiagnosticWriter.js +1 -3
  135. package/dist/browser/diagnostics/DiagnosticWriter.js.map +1 -1
  136. package/dist/browser/diagnostics/index.js +2 -2
  137. package/dist/browser/diagnostics/index.js.map +1 -1
  138. package/dist/browser/documents/DatabaseAccount.js +20 -4
  139. package/dist/browser/documents/DatabaseAccount.js.map +1 -1
  140. package/dist/browser/documents/PartitionKey.js +1 -3
  141. package/dist/browser/documents/PartitionKey.js.map +1 -1
  142. package/dist/browser/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  143. package/dist/browser/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  144. package/dist/browser/encryption/Cache/EncryptionSettingsCache.js +2 -0
  145. package/dist/browser/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  146. package/dist/browser/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  147. package/dist/browser/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  148. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  149. package/dist/browser/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  150. package/dist/browser/encryption/EncryptionItemQueryIterator.js +24 -27
  151. package/dist/browser/encryption/EncryptionItemQueryIterator.js.map +1 -1
  152. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  153. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  154. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  155. package/dist/browser/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  156. package/dist/browser/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  157. package/dist/browser/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  158. package/dist/browser/encryption/EncryptionKeyStoreProvider.d.ts.map +1 -1
  159. package/dist/browser/encryption/EncryptionKeyStoreProvider.js +10 -2
  160. package/dist/browser/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  161. package/dist/browser/encryption/EncryptionManager.js +6 -0
  162. package/dist/browser/encryption/EncryptionManager.js.map +1 -1
  163. package/dist/browser/encryption/EncryptionProcessor.js +5 -0
  164. package/dist/browser/encryption/EncryptionProcessor.js.map +1 -1
  165. package/dist/browser/encryption/EncryptionQueryBuilder.js +2 -0
  166. package/dist/browser/encryption/EncryptionQueryBuilder.js.map +1 -1
  167. package/dist/browser/encryption/EncryptionSettingForProperty.js +6 -0
  168. package/dist/browser/encryption/EncryptionSettingForProperty.js.map +1 -1
  169. package/dist/browser/encryption/EncryptionSettings.js +6 -3
  170. package/dist/browser/encryption/EncryptionSettings.js.map +1 -1
  171. package/dist/browser/encryption/KeyEncryptionKey.js +4 -0
  172. package/dist/browser/encryption/KeyEncryptionKey.js.map +1 -1
  173. package/dist/browser/encryption/Serializers/StringSerializer.js +1 -1
  174. package/dist/browser/encryption/Serializers/StringSerializer.js.map +1 -1
  175. package/dist/browser/extractPartitionKey.js +2 -2
  176. package/dist/browser/extractPartitionKey.js.map +1 -1
  177. package/dist/browser/globalEndpointManager.js +21 -4
  178. package/dist/browser/globalEndpointManager.js.map +1 -1
  179. package/dist/browser/globalPartitionEndpointManager.d.ts.map +1 -1
  180. package/dist/browser/globalPartitionEndpointManager.js +16 -9
  181. package/dist/browser/globalPartitionEndpointManager.js.map +1 -1
  182. package/dist/browser/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  183. package/dist/browser/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  184. package/dist/browser/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  185. package/dist/browser/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  186. package/dist/browser/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  187. package/dist/browser/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  188. package/dist/browser/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  189. package/dist/browser/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  190. package/dist/browser/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  191. package/dist/browser/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  192. package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  193. package/dist/browser/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  194. package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  195. package/dist/browser/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  196. package/dist/browser/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  197. package/dist/browser/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  198. package/dist/browser/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  199. package/dist/browser/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  200. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  201. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  202. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  203. package/dist/browser/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  204. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  205. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  206. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  207. package/dist/browser/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  208. package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  209. package/dist/browser/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  210. package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  211. package/dist/browser/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  212. package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  213. package/dist/browser/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  214. package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  215. package/dist/browser/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  216. package/dist/browser/queryExecutionContext/FetchResult.js +4 -0
  217. package/dist/browser/queryExecutionContext/FetchResult.js.map +1 -1
  218. package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  219. package/dist/browser/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  220. package/dist/browser/queryExecutionContext/documentProducer.js +34 -21
  221. package/dist/browser/queryExecutionContext/documentProducer.js.map +1 -1
  222. package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  223. package/dist/browser/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  224. package/dist/browser/queryExecutionContext/orderByComparator.js +1 -0
  225. package/dist/browser/queryExecutionContext/orderByComparator.js.map +1 -1
  226. package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  227. package/dist/browser/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  228. package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  229. package/dist/browser/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  230. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  231. package/dist/browser/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  232. package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  233. package/dist/browser/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  234. package/dist/browser/queryIterator.js +41 -33
  235. package/dist/browser/queryIterator.js.map +1 -1
  236. package/dist/browser/queryMetrics/clientSideMetrics.js +2 -1
  237. package/dist/browser/queryMetrics/clientSideMetrics.js.map +1 -1
  238. package/dist/browser/queryMetrics/queryMetrics.js +14 -1
  239. package/dist/browser/queryMetrics/queryMetrics.js.map +1 -1
  240. package/dist/browser/queryMetrics/queryPreparationTime.js +5 -1
  241. package/dist/browser/queryMetrics/queryPreparationTime.js.map +1 -1
  242. package/dist/browser/queryMetrics/runtimeExecutionTimes.js +4 -1
  243. package/dist/browser/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  244. package/dist/browser/queryMetrics/timeSpan.js +4 -3
  245. package/dist/browser/queryMetrics/timeSpan.js.map +1 -1
  246. package/dist/browser/request/ErrorResponse.js +19 -0
  247. package/dist/browser/request/ErrorResponse.js.map +1 -1
  248. package/dist/browser/request/FeedResponse.js +4 -0
  249. package/dist/browser/request/FeedResponse.js.map +1 -1
  250. package/dist/browser/request/RequestHandler.js +1 -2
  251. package/dist/browser/request/RequestHandler.js.map +1 -1
  252. package/dist/browser/request/ResourceResponse.js +5 -0
  253. package/dist/browser/request/ResourceResponse.js.map +1 -1
  254. package/dist/browser/request/TimeoutError.js +1 -1
  255. package/dist/browser/request/TimeoutError.js.map +1 -1
  256. package/dist/browser/request/hybridSearchQueryResult.js +5 -0
  257. package/dist/browser/request/hybridSearchQueryResult.js.map +1 -1
  258. package/dist/browser/request/request.d.ts.map +1 -1
  259. package/dist/browser/request/request.js +8 -4
  260. package/dist/browser/request/request.js.map +1 -1
  261. package/dist/browser/retry/bulkExecutionRetryPolicy.js +5 -2
  262. package/dist/browser/retry/bulkExecutionRetryPolicy.js.map +1 -1
  263. package/dist/browser/retry/defaultRetryPolicy.js +4 -3
  264. package/dist/browser/retry/defaultRetryPolicy.js.map +1 -1
  265. package/dist/browser/retry/endpointDiscoveryRetryPolicy.js +11 -2
  266. package/dist/browser/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  267. package/dist/browser/retry/resourceThrottleRetryPolicy.js +20 -10
  268. package/dist/browser/retry/resourceThrottleRetryPolicy.js.map +1 -1
  269. package/dist/browser/retry/retryUtility.js +2 -3
  270. package/dist/browser/retry/retryUtility.js.map +1 -1
  271. package/dist/browser/retry/sessionRetryPolicy.js +8 -4
  272. package/dist/browser/retry/sessionRetryPolicy.js.map +1 -1
  273. package/dist/browser/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  274. package/dist/browser/retry/timeoutFailoverRetryPolicy.js +17 -7
  275. package/dist/browser/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  276. package/dist/browser/routing/QueryRange.js +4 -0
  277. package/dist/browser/routing/QueryRange.js.map +1 -1
  278. package/dist/browser/routing/inMemoryCollectionRoutingMap.js +4 -0
  279. package/dist/browser/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  280. package/dist/browser/routing/partitionKeyRangeCache.js +2 -0
  281. package/dist/browser/routing/partitionKeyRangeCache.js.map +1 -1
  282. package/dist/browser/routing/smartRoutingMapProvider.js +1 -0
  283. package/dist/browser/routing/smartRoutingMapProvider.js.map +1 -1
  284. package/dist/browser/session/VectorSessionToken.js +6 -2
  285. package/dist/browser/session/VectorSessionToken.js.map +1 -1
  286. package/dist/browser/session/sessionContainer.js +5 -3
  287. package/dist/browser/session/sessionContainer.js.map +1 -1
  288. package/dist/browser/utils/batch.js +15 -4
  289. package/dist/browser/utils/batch.js.map +1 -1
  290. package/dist/browser/utils/fixedSizePriorityQueue.js +4 -0
  291. package/dist/browser/utils/fixedSizePriorityQueue.js.map +1 -1
  292. package/dist/browser/utils/hashing/hash.js +1 -1
  293. package/dist/browser/utils/hashing/hash.js.map +1 -1
  294. package/dist/browser/utils/nonStreamingOrderByMap.js +2 -0
  295. package/dist/browser/utils/nonStreamingOrderByMap.js.map +1 -1
  296. package/dist/browser/utils/time.d.ts +8 -0
  297. package/dist/browser/utils/time.d.ts.map +1 -1
  298. package/dist/browser/utils/time.js +19 -0
  299. package/dist/browser/utils/time.js.map +1 -1
  300. package/dist/commonjs/ChangeFeedIterator.js +17 -11
  301. package/dist/commonjs/ChangeFeedIterator.js.map +1 -1
  302. package/dist/commonjs/ChangeFeedResponse.js +8 -0
  303. package/dist/commonjs/ChangeFeedResponse.js.map +1 -1
  304. package/dist/commonjs/ClientContext.js +122 -29
  305. package/dist/commonjs/ClientContext.js.map +1 -1
  306. package/dist/commonjs/CosmosClient.d.ts.map +1 -1
  307. package/dist/commonjs/CosmosClient.js +37 -3
  308. package/dist/commonjs/CosmosClient.js.map +1 -1
  309. package/dist/commonjs/CosmosDiagnostics.js +3 -0
  310. package/dist/commonjs/CosmosDiagnostics.js.map +1 -1
  311. package/dist/commonjs/PartitionKeyRangeFailoverInfo.js +8 -5
  312. package/dist/commonjs/PartitionKeyRangeFailoverInfo.js.map +1 -1
  313. package/dist/commonjs/bulk/Batcher.js +13 -3
  314. package/dist/commonjs/bulk/Batcher.js.map +1 -1
  315. package/dist/commonjs/bulk/BulkHelper.js +26 -11
  316. package/dist/commonjs/bulk/BulkHelper.js.map +1 -1
  317. package/dist/commonjs/bulk/BulkResponse.js +22 -20
  318. package/dist/commonjs/bulk/BulkResponse.js.map +1 -1
  319. package/dist/commonjs/bulk/CongestionAlgorithm.js +11 -4
  320. package/dist/commonjs/bulk/CongestionAlgorithm.js.map +1 -1
  321. package/dist/commonjs/bulk/HelperPerPartition.js +14 -1
  322. package/dist/commonjs/bulk/HelperPerPartition.js.map +1 -1
  323. package/dist/commonjs/bulk/ItemOperationContext.js +4 -0
  324. package/dist/commonjs/bulk/ItemOperationContext.js.map +1 -1
  325. package/dist/commonjs/bulk/Limiter.js +27 -18
  326. package/dist/commonjs/bulk/Limiter.js.map +1 -1
  327. package/dist/commonjs/bulk/PartitionMetric.js +4 -0
  328. package/dist/commonjs/bulk/PartitionMetric.js.map +1 -1
  329. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  330. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  331. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  332. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js +20 -8
  333. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  334. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  335. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  336. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  337. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  338. package/dist/commonjs/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  339. package/dist/commonjs/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  340. package/dist/commonjs/client/ChangeFeed/ChangeFeedRange.js +20 -0
  341. package/dist/commonjs/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  342. package/dist/commonjs/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  343. package/dist/commonjs/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  344. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  345. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  346. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  347. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  348. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  349. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  350. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  351. package/dist/commonjs/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  352. package/dist/commonjs/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  353. package/dist/commonjs/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  354. package/dist/commonjs/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  355. package/dist/commonjs/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  356. package/dist/commonjs/client/ChangeFeed/FeedRange.js +8 -0
  357. package/dist/commonjs/client/ChangeFeed/FeedRange.js.map +1 -1
  358. package/dist/commonjs/client/ChangeFeed/FeedRangeQueue.js +1 -0
  359. package/dist/commonjs/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  360. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js +5 -5
  361. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  362. package/dist/commonjs/client/ClientUtils.js +1 -1
  363. package/dist/commonjs/client/ClientUtils.js.map +1 -1
  364. package/dist/commonjs/client/Conflict/Conflict.js +4 -0
  365. package/dist/commonjs/client/Conflict/Conflict.js.map +1 -1
  366. package/dist/commonjs/client/Conflict/ConflictResponse.js +2 -0
  367. package/dist/commonjs/client/Conflict/ConflictResponse.js.map +1 -1
  368. package/dist/commonjs/client/Conflict/Conflicts.js +2 -0
  369. package/dist/commonjs/client/Conflict/Conflicts.js.map +1 -1
  370. package/dist/commonjs/client/Container/Container.js +18 -3
  371. package/dist/commonjs/client/Container/Container.js.map +1 -1
  372. package/dist/commonjs/client/Container/ContainerResponse.js +2 -0
  373. package/dist/commonjs/client/Container/ContainerResponse.js.map +1 -1
  374. package/dist/commonjs/client/Container/Containers.js +4 -2
  375. package/dist/commonjs/client/Container/Containers.js.map +1 -1
  376. package/dist/commonjs/client/Database/Database.js +33 -0
  377. package/dist/commonjs/client/Database/Database.js.map +1 -1
  378. package/dist/commonjs/client/Database/DatabaseResponse.js +2 -0
  379. package/dist/commonjs/client/Database/DatabaseResponse.js.map +1 -1
  380. package/dist/commonjs/client/Database/Databases.js +3 -0
  381. package/dist/commonjs/client/Database/Databases.js.map +1 -1
  382. package/dist/commonjs/client/Item/Item.js +4 -0
  383. package/dist/commonjs/client/Item/Item.js.map +1 -1
  384. package/dist/commonjs/client/Item/ItemResponse.js +2 -0
  385. package/dist/commonjs/client/Item/ItemResponse.js.map +1 -1
  386. package/dist/commonjs/client/Item/Items.d.ts.map +1 -1
  387. package/dist/commonjs/client/Item/Items.js +12 -0
  388. package/dist/commonjs/client/Item/Items.js.map +1 -1
  389. package/dist/commonjs/client/Offer/Offer.js +3 -0
  390. package/dist/commonjs/client/Offer/Offer.js.map +1 -1
  391. package/dist/commonjs/client/Offer/OfferResponse.js +2 -0
  392. package/dist/commonjs/client/Offer/OfferResponse.js.map +1 -1
  393. package/dist/commonjs/client/Offer/Offers.js +2 -0
  394. package/dist/commonjs/client/Offer/Offers.js.map +1 -1
  395. package/dist/commonjs/client/Permission/Permission.js +3 -0
  396. package/dist/commonjs/client/Permission/Permission.js.map +1 -1
  397. package/dist/commonjs/client/Permission/PermissionResponse.js +2 -0
  398. package/dist/commonjs/client/Permission/PermissionResponse.js.map +1 -1
  399. package/dist/commonjs/client/Permission/Permissions.js +2 -0
  400. package/dist/commonjs/client/Permission/Permissions.js.map +1 -1
  401. package/dist/commonjs/client/SasToken/SasTokenProperties.js +17 -0
  402. package/dist/commonjs/client/SasToken/SasTokenProperties.js.map +1 -1
  403. package/dist/commonjs/client/Script/Scripts.js +5 -0
  404. package/dist/commonjs/client/Script/Scripts.js.map +1 -1
  405. package/dist/commonjs/client/StoredProcedure/StoredProcedure.js +3 -0
  406. package/dist/commonjs/client/StoredProcedure/StoredProcedure.js.map +1 -1
  407. package/dist/commonjs/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  408. package/dist/commonjs/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  409. package/dist/commonjs/client/StoredProcedure/StoredProcedures.js +2 -0
  410. package/dist/commonjs/client/StoredProcedure/StoredProcedures.js.map +1 -1
  411. package/dist/commonjs/client/Trigger/Trigger.js +3 -0
  412. package/dist/commonjs/client/Trigger/Trigger.js.map +1 -1
  413. package/dist/commonjs/client/Trigger/TriggerResponse.js +2 -0
  414. package/dist/commonjs/client/Trigger/TriggerResponse.js.map +1 -1
  415. package/dist/commonjs/client/Trigger/Triggers.js +2 -0
  416. package/dist/commonjs/client/Trigger/Triggers.js.map +1 -1
  417. package/dist/commonjs/client/User/User.js +9 -0
  418. package/dist/commonjs/client/User/User.js.map +1 -1
  419. package/dist/commonjs/client/User/UserResponse.js +2 -0
  420. package/dist/commonjs/client/User/UserResponse.js.map +1 -1
  421. package/dist/commonjs/client/User/Users.js +2 -0
  422. package/dist/commonjs/client/User/Users.js.map +1 -1
  423. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  424. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  425. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  426. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  427. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  428. package/dist/commonjs/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  429. package/dist/commonjs/diagnostics/CosmosDiagnosticsContext.js +8 -7
  430. package/dist/commonjs/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  431. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js +26 -7
  432. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  433. package/dist/commonjs/diagnostics/DiagnosticWriter.js +1 -3
  434. package/dist/commonjs/diagnostics/DiagnosticWriter.js.map +1 -1
  435. package/dist/commonjs/diagnostics/index.js +2 -2
  436. package/dist/commonjs/diagnostics/index.js.map +1 -1
  437. package/dist/commonjs/documents/DatabaseAccount.js +20 -4
  438. package/dist/commonjs/documents/DatabaseAccount.js.map +1 -1
  439. package/dist/commonjs/documents/PartitionKey.js +1 -3
  440. package/dist/commonjs/documents/PartitionKey.js.map +1 -1
  441. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -2
  442. package/dist/commonjs/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  443. package/dist/commonjs/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  444. package/dist/commonjs/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  445. package/dist/commonjs/encryption/Cache/EncryptionSettingsCache.js +2 -0
  446. package/dist/commonjs/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  447. package/dist/commonjs/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  448. package/dist/commonjs/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  449. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.d.ts.map +1 -1
  450. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.js +7 -1
  451. package/dist/commonjs/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -1
  452. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  453. package/dist/commonjs/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  454. package/dist/commonjs/encryption/EncryptionItemQueryIterator.js +24 -27
  455. package/dist/commonjs/encryption/EncryptionItemQueryIterator.js.map +1 -1
  456. package/dist/commonjs/encryption/EncryptionKey/DataEncryptionKey.js +7 -2
  457. package/dist/commonjs/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -1
  458. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  459. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  460. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  461. package/dist/commonjs/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  462. package/dist/commonjs/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  463. package/dist/commonjs/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  464. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.d.ts.map +1 -1
  465. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.js +10 -2
  466. package/dist/commonjs/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  467. package/dist/commonjs/encryption/EncryptionManager.js +6 -0
  468. package/dist/commonjs/encryption/EncryptionManager.js.map +1 -1
  469. package/dist/commonjs/encryption/EncryptionProcessor.js +5 -0
  470. package/dist/commonjs/encryption/EncryptionProcessor.js.map +1 -1
  471. package/dist/commonjs/encryption/EncryptionQueryBuilder.js +2 -0
  472. package/dist/commonjs/encryption/EncryptionQueryBuilder.js.map +1 -1
  473. package/dist/commonjs/encryption/EncryptionSettingForProperty.js +6 -0
  474. package/dist/commonjs/encryption/EncryptionSettingForProperty.js.map +1 -1
  475. package/dist/commonjs/encryption/EncryptionSettings.js +6 -3
  476. package/dist/commonjs/encryption/EncryptionSettings.js.map +1 -1
  477. package/dist/commonjs/encryption/KeyEncryptionKey.js +4 -0
  478. package/dist/commonjs/encryption/KeyEncryptionKey.js.map +1 -1
  479. package/dist/commonjs/encryption/Serializers/StringSerializer.js +1 -1
  480. package/dist/commonjs/encryption/Serializers/StringSerializer.js.map +1 -1
  481. package/dist/commonjs/extractPartitionKey.js +2 -2
  482. package/dist/commonjs/extractPartitionKey.js.map +1 -1
  483. package/dist/commonjs/globalEndpointManager.js +21 -4
  484. package/dist/commonjs/globalEndpointManager.js.map +1 -1
  485. package/dist/commonjs/globalPartitionEndpointManager.d.ts.map +1 -1
  486. package/dist/commonjs/globalPartitionEndpointManager.js +16 -9
  487. package/dist/commonjs/globalPartitionEndpointManager.js.map +1 -1
  488. package/dist/commonjs/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  489. package/dist/commonjs/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  490. package/dist/commonjs/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  491. package/dist/commonjs/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  492. package/dist/commonjs/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  493. package/dist/commonjs/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  494. package/dist/commonjs/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  495. package/dist/commonjs/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  496. package/dist/commonjs/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  497. package/dist/commonjs/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  498. package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  499. package/dist/commonjs/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  500. package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  501. package/dist/commonjs/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  502. package/dist/commonjs/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  503. package/dist/commonjs/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  504. package/dist/commonjs/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  505. package/dist/commonjs/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  506. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  507. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  508. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  509. package/dist/commonjs/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  510. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  511. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  512. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  513. package/dist/commonjs/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  514. package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  515. package/dist/commonjs/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  516. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  517. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  518. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  519. package/dist/commonjs/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  520. package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  521. package/dist/commonjs/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  522. package/dist/commonjs/queryExecutionContext/FetchResult.js +4 -0
  523. package/dist/commonjs/queryExecutionContext/FetchResult.js.map +1 -1
  524. package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  525. package/dist/commonjs/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  526. package/dist/commonjs/queryExecutionContext/documentProducer.js +34 -21
  527. package/dist/commonjs/queryExecutionContext/documentProducer.js.map +1 -1
  528. package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  529. package/dist/commonjs/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  530. package/dist/commonjs/queryExecutionContext/orderByComparator.js +1 -0
  531. package/dist/commonjs/queryExecutionContext/orderByComparator.js.map +1 -1
  532. package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  533. package/dist/commonjs/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  534. package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  535. package/dist/commonjs/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  536. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  537. package/dist/commonjs/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  538. package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  539. package/dist/commonjs/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  540. package/dist/commonjs/queryIterator.js +41 -33
  541. package/dist/commonjs/queryIterator.js.map +1 -1
  542. package/dist/commonjs/queryMetrics/clientSideMetrics.js +2 -1
  543. package/dist/commonjs/queryMetrics/clientSideMetrics.js.map +1 -1
  544. package/dist/commonjs/queryMetrics/queryMetrics.js +14 -1
  545. package/dist/commonjs/queryMetrics/queryMetrics.js.map +1 -1
  546. package/dist/commonjs/queryMetrics/queryPreparationTime.js +5 -1
  547. package/dist/commonjs/queryMetrics/queryPreparationTime.js.map +1 -1
  548. package/dist/commonjs/queryMetrics/runtimeExecutionTimes.js +4 -1
  549. package/dist/commonjs/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  550. package/dist/commonjs/queryMetrics/timeSpan.js +4 -3
  551. package/dist/commonjs/queryMetrics/timeSpan.js.map +1 -1
  552. package/dist/commonjs/request/ErrorResponse.js +19 -0
  553. package/dist/commonjs/request/ErrorResponse.js.map +1 -1
  554. package/dist/commonjs/request/FeedResponse.js +4 -0
  555. package/dist/commonjs/request/FeedResponse.js.map +1 -1
  556. package/dist/commonjs/request/RequestHandler.js +1 -2
  557. package/dist/commonjs/request/RequestHandler.js.map +1 -1
  558. package/dist/commonjs/request/ResourceResponse.js +5 -0
  559. package/dist/commonjs/request/ResourceResponse.js.map +1 -1
  560. package/dist/commonjs/request/TimeoutError.js +1 -1
  561. package/dist/commonjs/request/TimeoutError.js.map +1 -1
  562. package/dist/commonjs/request/hybridSearchQueryResult.js +5 -0
  563. package/dist/commonjs/request/hybridSearchQueryResult.js.map +1 -1
  564. package/dist/commonjs/request/request.d.ts.map +1 -1
  565. package/dist/commonjs/request/request.js +8 -4
  566. package/dist/commonjs/request/request.js.map +1 -1
  567. package/dist/commonjs/retry/bulkExecutionRetryPolicy.js +5 -2
  568. package/dist/commonjs/retry/bulkExecutionRetryPolicy.js.map +1 -1
  569. package/dist/commonjs/retry/defaultRetryPolicy.js +4 -3
  570. package/dist/commonjs/retry/defaultRetryPolicy.js.map +1 -1
  571. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js +11 -2
  572. package/dist/commonjs/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  573. package/dist/commonjs/retry/resourceThrottleRetryPolicy.js +20 -10
  574. package/dist/commonjs/retry/resourceThrottleRetryPolicy.js.map +1 -1
  575. package/dist/commonjs/retry/retryUtility.js +2 -3
  576. package/dist/commonjs/retry/retryUtility.js.map +1 -1
  577. package/dist/commonjs/retry/sessionRetryPolicy.js +8 -4
  578. package/dist/commonjs/retry/sessionRetryPolicy.js.map +1 -1
  579. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  580. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js +17 -7
  581. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  582. package/dist/commonjs/routing/QueryRange.js +4 -0
  583. package/dist/commonjs/routing/QueryRange.js.map +1 -1
  584. package/dist/commonjs/routing/inMemoryCollectionRoutingMap.js +4 -0
  585. package/dist/commonjs/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  586. package/dist/commonjs/routing/partitionKeyRangeCache.js +2 -0
  587. package/dist/commonjs/routing/partitionKeyRangeCache.js.map +1 -1
  588. package/dist/commonjs/routing/smartRoutingMapProvider.js +1 -0
  589. package/dist/commonjs/routing/smartRoutingMapProvider.js.map +1 -1
  590. package/dist/commonjs/session/VectorSessionToken.js +6 -2
  591. package/dist/commonjs/session/VectorSessionToken.js.map +1 -1
  592. package/dist/commonjs/session/sessionContainer.js +5 -3
  593. package/dist/commonjs/session/sessionContainer.js.map +1 -1
  594. package/dist/commonjs/tsdoc-metadata.json +11 -11
  595. package/dist/commonjs/utils/batch.js +15 -4
  596. package/dist/commonjs/utils/batch.js.map +1 -1
  597. package/dist/commonjs/utils/fixedSizePriorityQueue.js +4 -0
  598. package/dist/commonjs/utils/fixedSizePriorityQueue.js.map +1 -1
  599. package/dist/commonjs/utils/hashing/hash.js +1 -1
  600. package/dist/commonjs/utils/hashing/hash.js.map +1 -1
  601. package/dist/commonjs/utils/nonStreamingOrderByMap.js +2 -0
  602. package/dist/commonjs/utils/nonStreamingOrderByMap.js.map +1 -1
  603. package/dist/commonjs/utils/time.d.ts +8 -0
  604. package/dist/commonjs/utils/time.d.ts.map +1 -1
  605. package/dist/commonjs/utils/time.js +20 -0
  606. package/dist/commonjs/utils/time.js.map +1 -1
  607. package/dist/esm/ChangeFeedIterator.js +17 -11
  608. package/dist/esm/ChangeFeedIterator.js.map +1 -1
  609. package/dist/esm/ChangeFeedResponse.js +8 -0
  610. package/dist/esm/ChangeFeedResponse.js.map +1 -1
  611. package/dist/esm/ClientContext.js +122 -29
  612. package/dist/esm/ClientContext.js.map +1 -1
  613. package/dist/esm/CosmosClient.d.ts.map +1 -1
  614. package/dist/esm/CosmosClient.js +37 -3
  615. package/dist/esm/CosmosClient.js.map +1 -1
  616. package/dist/esm/CosmosDiagnostics.js +3 -0
  617. package/dist/esm/CosmosDiagnostics.js.map +1 -1
  618. package/dist/esm/PartitionKeyRangeFailoverInfo.js +8 -5
  619. package/dist/esm/PartitionKeyRangeFailoverInfo.js.map +1 -1
  620. package/dist/esm/bulk/Batcher.js +13 -3
  621. package/dist/esm/bulk/Batcher.js.map +1 -1
  622. package/dist/esm/bulk/BulkHelper.js +26 -11
  623. package/dist/esm/bulk/BulkHelper.js.map +1 -1
  624. package/dist/esm/bulk/BulkResponse.js +22 -20
  625. package/dist/esm/bulk/BulkResponse.js.map +1 -1
  626. package/dist/esm/bulk/CongestionAlgorithm.js +11 -4
  627. package/dist/esm/bulk/CongestionAlgorithm.js.map +1 -1
  628. package/dist/esm/bulk/HelperPerPartition.js +14 -1
  629. package/dist/esm/bulk/HelperPerPartition.js.map +1 -1
  630. package/dist/esm/bulk/ItemOperationContext.js +4 -0
  631. package/dist/esm/bulk/ItemOperationContext.js.map +1 -1
  632. package/dist/esm/bulk/Limiter.js +27 -18
  633. package/dist/esm/bulk/Limiter.js.map +1 -1
  634. package/dist/esm/bulk/PartitionMetric.js +4 -0
  635. package/dist/esm/bulk/PartitionMetric.js.map +1 -1
  636. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  637. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  638. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  639. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js +20 -8
  640. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  641. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  642. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  643. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  644. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  645. package/dist/esm/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  646. package/dist/esm/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  647. package/dist/esm/client/ChangeFeed/ChangeFeedRange.js +20 -0
  648. package/dist/esm/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  649. package/dist/esm/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  650. package/dist/esm/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  651. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  652. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  653. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  654. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  655. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  656. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  657. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  658. package/dist/esm/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  659. package/dist/esm/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  660. package/dist/esm/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  661. package/dist/esm/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  662. package/dist/esm/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  663. package/dist/esm/client/ChangeFeed/FeedRange.js +8 -0
  664. package/dist/esm/client/ChangeFeed/FeedRange.js.map +1 -1
  665. package/dist/esm/client/ChangeFeed/FeedRangeQueue.js +1 -0
  666. package/dist/esm/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  667. package/dist/esm/client/ChangeFeed/changeFeedUtils.js +5 -5
  668. package/dist/esm/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  669. package/dist/esm/client/ClientUtils.js +1 -1
  670. package/dist/esm/client/ClientUtils.js.map +1 -1
  671. package/dist/esm/client/Conflict/Conflict.js +4 -0
  672. package/dist/esm/client/Conflict/Conflict.js.map +1 -1
  673. package/dist/esm/client/Conflict/ConflictResponse.js +2 -0
  674. package/dist/esm/client/Conflict/ConflictResponse.js.map +1 -1
  675. package/dist/esm/client/Conflict/Conflicts.js +2 -0
  676. package/dist/esm/client/Conflict/Conflicts.js.map +1 -1
  677. package/dist/esm/client/Container/Container.js +18 -3
  678. package/dist/esm/client/Container/Container.js.map +1 -1
  679. package/dist/esm/client/Container/ContainerResponse.js +2 -0
  680. package/dist/esm/client/Container/ContainerResponse.js.map +1 -1
  681. package/dist/esm/client/Container/Containers.js +4 -2
  682. package/dist/esm/client/Container/Containers.js.map +1 -1
  683. package/dist/esm/client/Database/Database.js +33 -0
  684. package/dist/esm/client/Database/Database.js.map +1 -1
  685. package/dist/esm/client/Database/DatabaseResponse.js +2 -0
  686. package/dist/esm/client/Database/DatabaseResponse.js.map +1 -1
  687. package/dist/esm/client/Database/Databases.js +3 -0
  688. package/dist/esm/client/Database/Databases.js.map +1 -1
  689. package/dist/esm/client/Item/Item.js +4 -0
  690. package/dist/esm/client/Item/Item.js.map +1 -1
  691. package/dist/esm/client/Item/ItemResponse.js +2 -0
  692. package/dist/esm/client/Item/ItemResponse.js.map +1 -1
  693. package/dist/esm/client/Item/Items.d.ts.map +1 -1
  694. package/dist/esm/client/Item/Items.js +12 -0
  695. package/dist/esm/client/Item/Items.js.map +1 -1
  696. package/dist/esm/client/Offer/Offer.js +3 -0
  697. package/dist/esm/client/Offer/Offer.js.map +1 -1
  698. package/dist/esm/client/Offer/OfferResponse.js +2 -0
  699. package/dist/esm/client/Offer/OfferResponse.js.map +1 -1
  700. package/dist/esm/client/Offer/Offers.js +2 -0
  701. package/dist/esm/client/Offer/Offers.js.map +1 -1
  702. package/dist/esm/client/Permission/Permission.js +3 -0
  703. package/dist/esm/client/Permission/Permission.js.map +1 -1
  704. package/dist/esm/client/Permission/PermissionResponse.js +2 -0
  705. package/dist/esm/client/Permission/PermissionResponse.js.map +1 -1
  706. package/dist/esm/client/Permission/Permissions.js +2 -0
  707. package/dist/esm/client/Permission/Permissions.js.map +1 -1
  708. package/dist/esm/client/SasToken/SasTokenProperties.js +17 -0
  709. package/dist/esm/client/SasToken/SasTokenProperties.js.map +1 -1
  710. package/dist/esm/client/Script/Scripts.js +5 -0
  711. package/dist/esm/client/Script/Scripts.js.map +1 -1
  712. package/dist/esm/client/StoredProcedure/StoredProcedure.js +3 -0
  713. package/dist/esm/client/StoredProcedure/StoredProcedure.js.map +1 -1
  714. package/dist/esm/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  715. package/dist/esm/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  716. package/dist/esm/client/StoredProcedure/StoredProcedures.js +2 -0
  717. package/dist/esm/client/StoredProcedure/StoredProcedures.js.map +1 -1
  718. package/dist/esm/client/Trigger/Trigger.js +3 -0
  719. package/dist/esm/client/Trigger/Trigger.js.map +1 -1
  720. package/dist/esm/client/Trigger/TriggerResponse.js +2 -0
  721. package/dist/esm/client/Trigger/TriggerResponse.js.map +1 -1
  722. package/dist/esm/client/Trigger/Triggers.js +2 -0
  723. package/dist/esm/client/Trigger/Triggers.js.map +1 -1
  724. package/dist/esm/client/User/User.js +9 -0
  725. package/dist/esm/client/User/User.js.map +1 -1
  726. package/dist/esm/client/User/UserResponse.js +2 -0
  727. package/dist/esm/client/User/UserResponse.js.map +1 -1
  728. package/dist/esm/client/User/Users.js +2 -0
  729. package/dist/esm/client/User/Users.js.map +1 -1
  730. package/dist/esm/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  731. package/dist/esm/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  732. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  733. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  734. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  735. package/dist/esm/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  736. package/dist/esm/diagnostics/CosmosDiagnosticsContext.js +8 -7
  737. package/dist/esm/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  738. package/dist/esm/diagnostics/DiagnosticNodeInternal.js +26 -7
  739. package/dist/esm/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  740. package/dist/esm/diagnostics/DiagnosticWriter.js +1 -3
  741. package/dist/esm/diagnostics/DiagnosticWriter.js.map +1 -1
  742. package/dist/esm/diagnostics/index.js +2 -2
  743. package/dist/esm/diagnostics/index.js.map +1 -1
  744. package/dist/esm/documents/DatabaseAccount.js +20 -4
  745. package/dist/esm/documents/DatabaseAccount.js.map +1 -1
  746. package/dist/esm/documents/PartitionKey.js +1 -3
  747. package/dist/esm/documents/PartitionKey.js.map +1 -1
  748. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -2
  749. package/dist/esm/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  750. package/dist/esm/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  751. package/dist/esm/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  752. package/dist/esm/encryption/Cache/EncryptionSettingsCache.js +2 -0
  753. package/dist/esm/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  754. package/dist/esm/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  755. package/dist/esm/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  756. package/dist/esm/encryption/Cache/ProtectedDataEncryptionKeyCache.d.ts.map +1 -1
  757. package/dist/esm/encryption/Cache/ProtectedDataEncryptionKeyCache.js +7 -1
  758. package/dist/esm/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -1
  759. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  760. package/dist/esm/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  761. package/dist/esm/encryption/EncryptionItemQueryIterator.js +24 -27
  762. package/dist/esm/encryption/EncryptionItemQueryIterator.js.map +1 -1
  763. package/dist/esm/encryption/EncryptionKey/DataEncryptionKey.js +7 -2
  764. package/dist/esm/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -1
  765. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  766. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  767. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  768. package/dist/esm/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  769. package/dist/esm/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  770. package/dist/esm/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  771. package/dist/esm/encryption/EncryptionKeyStoreProvider.d.ts.map +1 -1
  772. package/dist/esm/encryption/EncryptionKeyStoreProvider.js +10 -2
  773. package/dist/esm/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  774. package/dist/esm/encryption/EncryptionManager.js +6 -0
  775. package/dist/esm/encryption/EncryptionManager.js.map +1 -1
  776. package/dist/esm/encryption/EncryptionProcessor.js +5 -0
  777. package/dist/esm/encryption/EncryptionProcessor.js.map +1 -1
  778. package/dist/esm/encryption/EncryptionQueryBuilder.js +2 -0
  779. package/dist/esm/encryption/EncryptionQueryBuilder.js.map +1 -1
  780. package/dist/esm/encryption/EncryptionSettingForProperty.js +6 -0
  781. package/dist/esm/encryption/EncryptionSettingForProperty.js.map +1 -1
  782. package/dist/esm/encryption/EncryptionSettings.js +6 -3
  783. package/dist/esm/encryption/EncryptionSettings.js.map +1 -1
  784. package/dist/esm/encryption/KeyEncryptionKey.js +4 -0
  785. package/dist/esm/encryption/KeyEncryptionKey.js.map +1 -1
  786. package/dist/esm/encryption/Serializers/StringSerializer.js +1 -1
  787. package/dist/esm/encryption/Serializers/StringSerializer.js.map +1 -1
  788. package/dist/esm/extractPartitionKey.js +2 -2
  789. package/dist/esm/extractPartitionKey.js.map +1 -1
  790. package/dist/esm/globalEndpointManager.js +21 -4
  791. package/dist/esm/globalEndpointManager.js.map +1 -1
  792. package/dist/esm/globalPartitionEndpointManager.d.ts.map +1 -1
  793. package/dist/esm/globalPartitionEndpointManager.js +16 -9
  794. package/dist/esm/globalPartitionEndpointManager.js.map +1 -1
  795. package/dist/esm/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  796. package/dist/esm/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  797. package/dist/esm/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  798. package/dist/esm/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  799. package/dist/esm/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  800. package/dist/esm/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  801. package/dist/esm/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  802. package/dist/esm/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  803. package/dist/esm/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  804. package/dist/esm/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  805. package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  806. package/dist/esm/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  807. package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  808. package/dist/esm/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  809. package/dist/esm/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  810. package/dist/esm/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  811. package/dist/esm/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  812. package/dist/esm/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  813. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  814. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  815. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  816. package/dist/esm/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  817. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  818. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  819. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  820. package/dist/esm/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  821. package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  822. package/dist/esm/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  823. package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  824. package/dist/esm/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  825. package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  826. package/dist/esm/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  827. package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  828. package/dist/esm/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  829. package/dist/esm/queryExecutionContext/FetchResult.js +4 -0
  830. package/dist/esm/queryExecutionContext/FetchResult.js.map +1 -1
  831. package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  832. package/dist/esm/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  833. package/dist/esm/queryExecutionContext/documentProducer.js +34 -21
  834. package/dist/esm/queryExecutionContext/documentProducer.js.map +1 -1
  835. package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  836. package/dist/esm/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  837. package/dist/esm/queryExecutionContext/orderByComparator.js +1 -0
  838. package/dist/esm/queryExecutionContext/orderByComparator.js.map +1 -1
  839. package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  840. package/dist/esm/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  841. package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  842. package/dist/esm/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  843. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  844. package/dist/esm/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  845. package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  846. package/dist/esm/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  847. package/dist/esm/queryIterator.js +41 -33
  848. package/dist/esm/queryIterator.js.map +1 -1
  849. package/dist/esm/queryMetrics/clientSideMetrics.js +2 -1
  850. package/dist/esm/queryMetrics/clientSideMetrics.js.map +1 -1
  851. package/dist/esm/queryMetrics/queryMetrics.js +14 -1
  852. package/dist/esm/queryMetrics/queryMetrics.js.map +1 -1
  853. package/dist/esm/queryMetrics/queryPreparationTime.js +5 -1
  854. package/dist/esm/queryMetrics/queryPreparationTime.js.map +1 -1
  855. package/dist/esm/queryMetrics/runtimeExecutionTimes.js +4 -1
  856. package/dist/esm/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  857. package/dist/esm/queryMetrics/timeSpan.js +4 -3
  858. package/dist/esm/queryMetrics/timeSpan.js.map +1 -1
  859. package/dist/esm/request/ErrorResponse.js +19 -0
  860. package/dist/esm/request/ErrorResponse.js.map +1 -1
  861. package/dist/esm/request/FeedResponse.js +4 -0
  862. package/dist/esm/request/FeedResponse.js.map +1 -1
  863. package/dist/esm/request/RequestHandler.js +1 -2
  864. package/dist/esm/request/RequestHandler.js.map +1 -1
  865. package/dist/esm/request/ResourceResponse.js +5 -0
  866. package/dist/esm/request/ResourceResponse.js.map +1 -1
  867. package/dist/esm/request/TimeoutError.js +1 -1
  868. package/dist/esm/request/TimeoutError.js.map +1 -1
  869. package/dist/esm/request/hybridSearchQueryResult.js +5 -0
  870. package/dist/esm/request/hybridSearchQueryResult.js.map +1 -1
  871. package/dist/esm/request/request.d.ts.map +1 -1
  872. package/dist/esm/request/request.js +8 -4
  873. package/dist/esm/request/request.js.map +1 -1
  874. package/dist/esm/retry/bulkExecutionRetryPolicy.js +5 -2
  875. package/dist/esm/retry/bulkExecutionRetryPolicy.js.map +1 -1
  876. package/dist/esm/retry/defaultRetryPolicy.js +4 -3
  877. package/dist/esm/retry/defaultRetryPolicy.js.map +1 -1
  878. package/dist/esm/retry/endpointDiscoveryRetryPolicy.js +11 -2
  879. package/dist/esm/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  880. package/dist/esm/retry/resourceThrottleRetryPolicy.js +20 -10
  881. package/dist/esm/retry/resourceThrottleRetryPolicy.js.map +1 -1
  882. package/dist/esm/retry/retryUtility.js +2 -3
  883. package/dist/esm/retry/retryUtility.js.map +1 -1
  884. package/dist/esm/retry/sessionRetryPolicy.js +8 -4
  885. package/dist/esm/retry/sessionRetryPolicy.js.map +1 -1
  886. package/dist/esm/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  887. package/dist/esm/retry/timeoutFailoverRetryPolicy.js +17 -7
  888. package/dist/esm/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  889. package/dist/esm/routing/QueryRange.js +4 -0
  890. package/dist/esm/routing/QueryRange.js.map +1 -1
  891. package/dist/esm/routing/inMemoryCollectionRoutingMap.js +4 -0
  892. package/dist/esm/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  893. package/dist/esm/routing/partitionKeyRangeCache.js +2 -0
  894. package/dist/esm/routing/partitionKeyRangeCache.js.map +1 -1
  895. package/dist/esm/routing/smartRoutingMapProvider.js +1 -0
  896. package/dist/esm/routing/smartRoutingMapProvider.js.map +1 -1
  897. package/dist/esm/session/VectorSessionToken.js +6 -2
  898. package/dist/esm/session/VectorSessionToken.js.map +1 -1
  899. package/dist/esm/session/sessionContainer.js +5 -3
  900. package/dist/esm/session/sessionContainer.js.map +1 -1
  901. package/dist/esm/utils/batch.js +15 -4
  902. package/dist/esm/utils/batch.js.map +1 -1
  903. package/dist/esm/utils/fixedSizePriorityQueue.js +4 -0
  904. package/dist/esm/utils/fixedSizePriorityQueue.js.map +1 -1
  905. package/dist/esm/utils/hashing/hash.js +1 -1
  906. package/dist/esm/utils/hashing/hash.js.map +1 -1
  907. package/dist/esm/utils/nonStreamingOrderByMap.js +2 -0
  908. package/dist/esm/utils/nonStreamingOrderByMap.js.map +1 -1
  909. package/dist/esm/utils/time.d.ts +8 -0
  910. package/dist/esm/utils/time.d.ts.map +1 -1
  911. package/dist/esm/utils/time.js +19 -0
  912. package/dist/esm/utils/time.js.map +1 -1
  913. package/dist/react-native/ChangeFeedIterator.js +17 -11
  914. package/dist/react-native/ChangeFeedIterator.js.map +1 -1
  915. package/dist/react-native/ChangeFeedResponse.js +8 -0
  916. package/dist/react-native/ChangeFeedResponse.js.map +1 -1
  917. package/dist/react-native/ClientContext.js +122 -29
  918. package/dist/react-native/ClientContext.js.map +1 -1
  919. package/dist/react-native/CosmosClient.d.ts.map +1 -1
  920. package/dist/react-native/CosmosClient.js +37 -3
  921. package/dist/react-native/CosmosClient.js.map +1 -1
  922. package/dist/react-native/CosmosDiagnostics.js +3 -0
  923. package/dist/react-native/CosmosDiagnostics.js.map +1 -1
  924. package/dist/react-native/PartitionKeyRangeFailoverInfo.js +8 -5
  925. package/dist/react-native/PartitionKeyRangeFailoverInfo.js.map +1 -1
  926. package/dist/react-native/bulk/Batcher.js +13 -3
  927. package/dist/react-native/bulk/Batcher.js.map +1 -1
  928. package/dist/react-native/bulk/BulkHelper.js +26 -11
  929. package/dist/react-native/bulk/BulkHelper.js.map +1 -1
  930. package/dist/react-native/bulk/BulkResponse.js +22 -20
  931. package/dist/react-native/bulk/BulkResponse.js.map +1 -1
  932. package/dist/react-native/bulk/CongestionAlgorithm.js +11 -4
  933. package/dist/react-native/bulk/CongestionAlgorithm.js.map +1 -1
  934. package/dist/react-native/bulk/HelperPerPartition.js +14 -1
  935. package/dist/react-native/bulk/HelperPerPartition.js.map +1 -1
  936. package/dist/react-native/bulk/ItemOperationContext.js +4 -0
  937. package/dist/react-native/bulk/ItemOperationContext.js.map +1 -1
  938. package/dist/react-native/bulk/Limiter.js +27 -18
  939. package/dist/react-native/bulk/Limiter.js.map +1 -1
  940. package/dist/react-native/bulk/PartitionMetric.js +4 -0
  941. package/dist/react-native/bulk/PartitionMetric.js.map +1 -1
  942. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js +26 -15
  943. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  944. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  945. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js +20 -8
  946. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  947. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorBuilder.js +12 -9
  948. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorBuilder.js.map +1 -1
  949. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorResponse.js +9 -0
  950. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorResponse.js.map +1 -1
  951. package/dist/react-native/client/ChangeFeed/ChangeFeedPolicy.js +1 -0
  952. package/dist/react-native/client/ChangeFeed/ChangeFeedPolicy.js.map +1 -1
  953. package/dist/react-native/client/ChangeFeed/ChangeFeedRange.js +20 -0
  954. package/dist/react-native/client/ChangeFeed/ChangeFeedRange.js.map +1 -1
  955. package/dist/react-native/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js +1 -0
  956. package/dist/react-native/client/ChangeFeed/ChangeFeedRetentionTimeSpan.js.map +1 -1
  957. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromBeginning.js +1 -0
  958. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromBeginning.js.map +1 -1
  959. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromContinuation.js +1 -0
  960. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromContinuation.js.map +1 -1
  961. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromNow.js +1 -0
  962. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromNow.js.map +1 -1
  963. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromTime.js +2 -0
  964. package/dist/react-native/client/ChangeFeed/ChangeFeedStartFromTime.js.map +1 -1
  965. package/dist/react-native/client/ChangeFeed/CompositeContinuationToken.js +8 -0
  966. package/dist/react-native/client/ChangeFeed/CompositeContinuationToken.js.map +1 -1
  967. package/dist/react-native/client/ChangeFeed/ContinuationTokenForPartitionKey.js +12 -0
  968. package/dist/react-native/client/ChangeFeed/ContinuationTokenForPartitionKey.js.map +1 -1
  969. package/dist/react-native/client/ChangeFeed/FeedRange.js +8 -0
  970. package/dist/react-native/client/ChangeFeed/FeedRange.js.map +1 -1
  971. package/dist/react-native/client/ChangeFeed/FeedRangeQueue.js +1 -0
  972. package/dist/react-native/client/ChangeFeed/FeedRangeQueue.js.map +1 -1
  973. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js +5 -5
  974. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  975. package/dist/react-native/client/ClientUtils.js +1 -1
  976. package/dist/react-native/client/ClientUtils.js.map +1 -1
  977. package/dist/react-native/client/Conflict/Conflict.js +4 -0
  978. package/dist/react-native/client/Conflict/Conflict.js.map +1 -1
  979. package/dist/react-native/client/Conflict/ConflictResponse.js +2 -0
  980. package/dist/react-native/client/Conflict/ConflictResponse.js.map +1 -1
  981. package/dist/react-native/client/Conflict/Conflicts.js +2 -0
  982. package/dist/react-native/client/Conflict/Conflicts.js.map +1 -1
  983. package/dist/react-native/client/Container/Container.js +18 -3
  984. package/dist/react-native/client/Container/Container.js.map +1 -1
  985. package/dist/react-native/client/Container/ContainerResponse.js +2 -0
  986. package/dist/react-native/client/Container/ContainerResponse.js.map +1 -1
  987. package/dist/react-native/client/Container/Containers.js +4 -2
  988. package/dist/react-native/client/Container/Containers.js.map +1 -1
  989. package/dist/react-native/client/Database/Database.js +33 -0
  990. package/dist/react-native/client/Database/Database.js.map +1 -1
  991. package/dist/react-native/client/Database/DatabaseResponse.js +2 -0
  992. package/dist/react-native/client/Database/DatabaseResponse.js.map +1 -1
  993. package/dist/react-native/client/Database/Databases.js +3 -0
  994. package/dist/react-native/client/Database/Databases.js.map +1 -1
  995. package/dist/react-native/client/Item/Item.js +4 -0
  996. package/dist/react-native/client/Item/Item.js.map +1 -1
  997. package/dist/react-native/client/Item/ItemResponse.js +2 -0
  998. package/dist/react-native/client/Item/ItemResponse.js.map +1 -1
  999. package/dist/react-native/client/Item/Items.d.ts.map +1 -1
  1000. package/dist/react-native/client/Item/Items.js +12 -0
  1001. package/dist/react-native/client/Item/Items.js.map +1 -1
  1002. package/dist/react-native/client/Offer/Offer.js +3 -0
  1003. package/dist/react-native/client/Offer/Offer.js.map +1 -1
  1004. package/dist/react-native/client/Offer/OfferResponse.js +2 -0
  1005. package/dist/react-native/client/Offer/OfferResponse.js.map +1 -1
  1006. package/dist/react-native/client/Offer/Offers.js +2 -0
  1007. package/dist/react-native/client/Offer/Offers.js.map +1 -1
  1008. package/dist/react-native/client/Permission/Permission.js +3 -0
  1009. package/dist/react-native/client/Permission/Permission.js.map +1 -1
  1010. package/dist/react-native/client/Permission/PermissionResponse.js +2 -0
  1011. package/dist/react-native/client/Permission/PermissionResponse.js.map +1 -1
  1012. package/dist/react-native/client/Permission/Permissions.js +2 -0
  1013. package/dist/react-native/client/Permission/Permissions.js.map +1 -1
  1014. package/dist/react-native/client/SasToken/SasTokenProperties.js +17 -0
  1015. package/dist/react-native/client/SasToken/SasTokenProperties.js.map +1 -1
  1016. package/dist/react-native/client/Script/Scripts.js +5 -0
  1017. package/dist/react-native/client/Script/Scripts.js.map +1 -1
  1018. package/dist/react-native/client/StoredProcedure/StoredProcedure.js +3 -0
  1019. package/dist/react-native/client/StoredProcedure/StoredProcedure.js.map +1 -1
  1020. package/dist/react-native/client/StoredProcedure/StoredProcedureResponse.js +4 -0
  1021. package/dist/react-native/client/StoredProcedure/StoredProcedureResponse.js.map +1 -1
  1022. package/dist/react-native/client/StoredProcedure/StoredProcedures.js +2 -0
  1023. package/dist/react-native/client/StoredProcedure/StoredProcedures.js.map +1 -1
  1024. package/dist/react-native/client/Trigger/Trigger.js +3 -0
  1025. package/dist/react-native/client/Trigger/Trigger.js.map +1 -1
  1026. package/dist/react-native/client/Trigger/TriggerResponse.js +2 -0
  1027. package/dist/react-native/client/Trigger/TriggerResponse.js.map +1 -1
  1028. package/dist/react-native/client/Trigger/Triggers.js +2 -0
  1029. package/dist/react-native/client/Trigger/Triggers.js.map +1 -1
  1030. package/dist/react-native/client/User/User.js +9 -0
  1031. package/dist/react-native/client/User/User.js.map +1 -1
  1032. package/dist/react-native/client/User/UserResponse.js +2 -0
  1033. package/dist/react-native/client/User/UserResponse.js.map +1 -1
  1034. package/dist/react-native/client/User/Users.js +2 -0
  1035. package/dist/react-native/client/User/Users.js.map +1 -1
  1036. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunction.js +3 -0
  1037. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunction.js.map +1 -1
  1038. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctionResponse.js +2 -0
  1039. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctionResponse.js.map +1 -1
  1040. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctions.js +2 -0
  1041. package/dist/react-native/client/UserDefinedFunction/UserDefinedFunctions.js.map +1 -1
  1042. package/dist/react-native/diagnostics/CosmosDiagnosticsContext.js +8 -7
  1043. package/dist/react-native/diagnostics/CosmosDiagnosticsContext.js.map +1 -1
  1044. package/dist/react-native/diagnostics/DiagnosticNodeInternal.js +26 -7
  1045. package/dist/react-native/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  1046. package/dist/react-native/diagnostics/DiagnosticWriter.js +1 -3
  1047. package/dist/react-native/diagnostics/DiagnosticWriter.js.map +1 -1
  1048. package/dist/react-native/diagnostics/index.js +2 -2
  1049. package/dist/react-native/diagnostics/index.js.map +1 -1
  1050. package/dist/react-native/documents/DatabaseAccount.js +20 -4
  1051. package/dist/react-native/documents/DatabaseAccount.js.map +1 -1
  1052. package/dist/react-native/documents/PartitionKey.js +1 -3
  1053. package/dist/react-native/documents/PartitionKey.js.map +1 -1
  1054. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js +8 -2
  1055. package/dist/react-native/encryption/AeadAes256CbcHmacSha256Algorithm/AeadAes256CbcHmacSha256Algorithm.js.map +1 -1
  1056. package/dist/react-native/encryption/Cache/ClientEncryptionKeyPropertiesCache.js +2 -0
  1057. package/dist/react-native/encryption/Cache/ClientEncryptionKeyPropertiesCache.js.map +1 -1
  1058. package/dist/react-native/encryption/Cache/EncryptionSettingsCache.js +2 -0
  1059. package/dist/react-native/encryption/Cache/EncryptionSettingsCache.js.map +1 -1
  1060. package/dist/react-native/encryption/Cache/KeyEncryptionKeyCache.js +2 -0
  1061. package/dist/react-native/encryption/Cache/KeyEncryptionKeyCache.js.map +1 -1
  1062. package/dist/react-native/encryption/Cache/ProtectedDataEncryptionKeyCache.d.ts.map +1 -1
  1063. package/dist/react-native/encryption/Cache/ProtectedDataEncryptionKeyCache.js +7 -1
  1064. package/dist/react-native/encryption/Cache/ProtectedDataEncryptionKeyCache.js.map +1 -1
  1065. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js +2 -0
  1066. package/dist/react-native/encryption/ClientEncryptionKey/ClientEncryptionKeyResponse.js.map +1 -1
  1067. package/dist/react-native/encryption/EncryptionItemQueryIterator.js +24 -27
  1068. package/dist/react-native/encryption/EncryptionItemQueryIterator.js.map +1 -1
  1069. package/dist/react-native/encryption/EncryptionKey/DataEncryptionKey.js +7 -2
  1070. package/dist/react-native/encryption/EncryptionKey/DataEncryptionKey.js.map +1 -1
  1071. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts +0 -1
  1072. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.d.ts.map +1 -1
  1073. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.js +2 -0
  1074. package/dist/react-native/encryption/EncryptionKey/ProtectedDataEncryptionKey.js.map +1 -1
  1075. package/dist/react-native/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js +6 -5
  1076. package/dist/react-native/encryption/EncryptionKeyResolver/AzureKeyVaultEncryptionKeyResolver.js.map +1 -1
  1077. package/dist/react-native/encryption/EncryptionKeyStoreProvider.d.ts.map +1 -1
  1078. package/dist/react-native/encryption/EncryptionKeyStoreProvider.js +10 -2
  1079. package/dist/react-native/encryption/EncryptionKeyStoreProvider.js.map +1 -1
  1080. package/dist/react-native/encryption/EncryptionManager.js +6 -0
  1081. package/dist/react-native/encryption/EncryptionManager.js.map +1 -1
  1082. package/dist/react-native/encryption/EncryptionProcessor.js +5 -0
  1083. package/dist/react-native/encryption/EncryptionProcessor.js.map +1 -1
  1084. package/dist/react-native/encryption/EncryptionQueryBuilder.js +2 -0
  1085. package/dist/react-native/encryption/EncryptionQueryBuilder.js.map +1 -1
  1086. package/dist/react-native/encryption/EncryptionSettingForProperty.js +6 -0
  1087. package/dist/react-native/encryption/EncryptionSettingForProperty.js.map +1 -1
  1088. package/dist/react-native/encryption/EncryptionSettings.js +6 -3
  1089. package/dist/react-native/encryption/EncryptionSettings.js.map +1 -1
  1090. package/dist/react-native/encryption/KeyEncryptionKey.js +4 -0
  1091. package/dist/react-native/encryption/KeyEncryptionKey.js.map +1 -1
  1092. package/dist/react-native/encryption/Serializers/StringSerializer.js +1 -1
  1093. package/dist/react-native/encryption/Serializers/StringSerializer.js.map +1 -1
  1094. package/dist/react-native/extractPartitionKey.js +2 -2
  1095. package/dist/react-native/extractPartitionKey.js.map +1 -1
  1096. package/dist/react-native/globalEndpointManager.js +21 -4
  1097. package/dist/react-native/globalEndpointManager.js.map +1 -1
  1098. package/dist/react-native/globalPartitionEndpointManager.d.ts.map +1 -1
  1099. package/dist/react-native/globalPartitionEndpointManager.js +16 -9
  1100. package/dist/react-native/globalPartitionEndpointManager.js.map +1 -1
  1101. package/dist/react-native/queryExecutionContext/Aggregators/AverageAggregator.js +2 -0
  1102. package/dist/react-native/queryExecutionContext/Aggregators/AverageAggregator.js.map +1 -1
  1103. package/dist/react-native/queryExecutionContext/Aggregators/CountAggregator.js +1 -0
  1104. package/dist/react-native/queryExecutionContext/Aggregators/CountAggregator.js.map +1 -1
  1105. package/dist/react-native/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js +1 -0
  1106. package/dist/react-native/queryExecutionContext/Aggregators/GlobalStatisticsAggregator.js.map +1 -1
  1107. package/dist/react-native/queryExecutionContext/Aggregators/MakeListAggregator.js +1 -0
  1108. package/dist/react-native/queryExecutionContext/Aggregators/MakeListAggregator.js.map +1 -1
  1109. package/dist/react-native/queryExecutionContext/Aggregators/MakeSetAggregator.js +1 -0
  1110. package/dist/react-native/queryExecutionContext/Aggregators/MakeSetAggregator.js.map +1 -1
  1111. package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js +2 -0
  1112. package/dist/react-native/queryExecutionContext/Aggregators/MaxAggregator.js.map +1 -1
  1113. package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js +2 -0
  1114. package/dist/react-native/queryExecutionContext/Aggregators/MinAggregator.js.map +1 -1
  1115. package/dist/react-native/queryExecutionContext/Aggregators/StaticValueAggregator.js +1 -0
  1116. package/dist/react-native/queryExecutionContext/Aggregators/StaticValueAggregator.js.map +1 -1
  1117. package/dist/react-native/queryExecutionContext/Aggregators/SumAggregator.js +1 -0
  1118. package/dist/react-native/queryExecutionContext/Aggregators/SumAggregator.js.map +1 -1
  1119. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js +5 -3
  1120. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByEndpointComponent.js.map +1 -1
  1121. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js +6 -3
  1122. package/dist/react-native/queryExecutionContext/EndpointComponent/GroupByValueEndpointComponent.js.map +1 -1
  1123. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js +23 -7
  1124. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByDistinctEndpointComponent.js.map +1 -1
  1125. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js +14 -6
  1126. package/dist/react-native/queryExecutionContext/EndpointComponent/NonStreamingOrderByEndpointComponent.js.map +1 -1
  1127. package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js +3 -0
  1128. package/dist/react-native/queryExecutionContext/EndpointComponent/OffsetLimitEndpointComponent.js.map +1 -1
  1129. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js +2 -0
  1130. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderByEndpointComponent.js.map +1 -1
  1131. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js +2 -0
  1132. package/dist/react-native/queryExecutionContext/EndpointComponent/OrderedDistinctEndpointComponent.js.map +1 -1
  1133. package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js +2 -0
  1134. package/dist/react-native/queryExecutionContext/EndpointComponent/UnorderedDistinctEndpointComponent.js.map +1 -1
  1135. package/dist/react-native/queryExecutionContext/FetchResult.js +4 -0
  1136. package/dist/react-native/queryExecutionContext/FetchResult.js.map +1 -1
  1137. package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js +14 -2
  1138. package/dist/react-native/queryExecutionContext/defaultQueryExecutionContext.js.map +1 -1
  1139. package/dist/react-native/queryExecutionContext/documentProducer.js +34 -21
  1140. package/dist/react-native/queryExecutionContext/documentProducer.js.map +1 -1
  1141. package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js +41 -27
  1142. package/dist/react-native/queryExecutionContext/hybridQueryExecutionContext.js.map +1 -1
  1143. package/dist/react-native/queryExecutionContext/orderByComparator.js +1 -0
  1144. package/dist/react-native/queryExecutionContext/orderByComparator.js.map +1 -1
  1145. package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js +1 -0
  1146. package/dist/react-native/queryExecutionContext/orderByDocumentProducerComparator.js.map +1 -1
  1147. package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js +1 -0
  1148. package/dist/react-native/queryExecutionContext/orderByQueryExecutionContext.js.map +1 -1
  1149. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js +20 -2
  1150. package/dist/react-native/queryExecutionContext/parallelQueryExecutionContextBase.js.map +1 -1
  1151. package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js +14 -4
  1152. package/dist/react-native/queryExecutionContext/pipelinedQueryExecutionContext.js.map +1 -1
  1153. package/dist/react-native/queryIterator.js +41 -33
  1154. package/dist/react-native/queryIterator.js.map +1 -1
  1155. package/dist/react-native/queryMetrics/clientSideMetrics.js +2 -1
  1156. package/dist/react-native/queryMetrics/clientSideMetrics.js.map +1 -1
  1157. package/dist/react-native/queryMetrics/queryMetrics.js +14 -1
  1158. package/dist/react-native/queryMetrics/queryMetrics.js.map +1 -1
  1159. package/dist/react-native/queryMetrics/queryPreparationTime.js +5 -1
  1160. package/dist/react-native/queryMetrics/queryPreparationTime.js.map +1 -1
  1161. package/dist/react-native/queryMetrics/runtimeExecutionTimes.js +4 -1
  1162. package/dist/react-native/queryMetrics/runtimeExecutionTimes.js.map +1 -1
  1163. package/dist/react-native/queryMetrics/timeSpan.js +4 -3
  1164. package/dist/react-native/queryMetrics/timeSpan.js.map +1 -1
  1165. package/dist/react-native/request/ErrorResponse.js +19 -0
  1166. package/dist/react-native/request/ErrorResponse.js.map +1 -1
  1167. package/dist/react-native/request/FeedResponse.js +4 -0
  1168. package/dist/react-native/request/FeedResponse.js.map +1 -1
  1169. package/dist/react-native/request/RequestHandler.js +1 -2
  1170. package/dist/react-native/request/RequestHandler.js.map +1 -1
  1171. package/dist/react-native/request/ResourceResponse.js +5 -0
  1172. package/dist/react-native/request/ResourceResponse.js.map +1 -1
  1173. package/dist/react-native/request/TimeoutError.js +1 -1
  1174. package/dist/react-native/request/TimeoutError.js.map +1 -1
  1175. package/dist/react-native/request/hybridSearchQueryResult.js +5 -0
  1176. package/dist/react-native/request/hybridSearchQueryResult.js.map +1 -1
  1177. package/dist/react-native/request/request.d.ts.map +1 -1
  1178. package/dist/react-native/request/request.js +8 -4
  1179. package/dist/react-native/request/request.js.map +1 -1
  1180. package/dist/react-native/retry/bulkExecutionRetryPolicy.js +5 -2
  1181. package/dist/react-native/retry/bulkExecutionRetryPolicy.js.map +1 -1
  1182. package/dist/react-native/retry/defaultRetryPolicy.js +4 -3
  1183. package/dist/react-native/retry/defaultRetryPolicy.js.map +1 -1
  1184. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js +11 -2
  1185. package/dist/react-native/retry/endpointDiscoveryRetryPolicy.js.map +1 -1
  1186. package/dist/react-native/retry/resourceThrottleRetryPolicy.js +20 -10
  1187. package/dist/react-native/retry/resourceThrottleRetryPolicy.js.map +1 -1
  1188. package/dist/react-native/retry/retryUtility.js +2 -3
  1189. package/dist/react-native/retry/retryUtility.js.map +1 -1
  1190. package/dist/react-native/retry/sessionRetryPolicy.js +8 -4
  1191. package/dist/react-native/retry/sessionRetryPolicy.js.map +1 -1
  1192. package/dist/react-native/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  1193. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js +17 -7
  1194. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  1195. package/dist/react-native/routing/QueryRange.js +4 -0
  1196. package/dist/react-native/routing/QueryRange.js.map +1 -1
  1197. package/dist/react-native/routing/inMemoryCollectionRoutingMap.js +4 -0
  1198. package/dist/react-native/routing/inMemoryCollectionRoutingMap.js.map +1 -1
  1199. package/dist/react-native/routing/partitionKeyRangeCache.js +2 -0
  1200. package/dist/react-native/routing/partitionKeyRangeCache.js.map +1 -1
  1201. package/dist/react-native/routing/smartRoutingMapProvider.js +1 -0
  1202. package/dist/react-native/routing/smartRoutingMapProvider.js.map +1 -1
  1203. package/dist/react-native/session/VectorSessionToken.js +6 -2
  1204. package/dist/react-native/session/VectorSessionToken.js.map +1 -1
  1205. package/dist/react-native/session/sessionContainer.js +5 -3
  1206. package/dist/react-native/session/sessionContainer.js.map +1 -1
  1207. package/dist/react-native/utils/batch.js +15 -4
  1208. package/dist/react-native/utils/batch.js.map +1 -1
  1209. package/dist/react-native/utils/fixedSizePriorityQueue.js +4 -0
  1210. package/dist/react-native/utils/fixedSizePriorityQueue.js.map +1 -1
  1211. package/dist/react-native/utils/hashing/hash.js +1 -1
  1212. package/dist/react-native/utils/hashing/hash.js.map +1 -1
  1213. package/dist/react-native/utils/nonStreamingOrderByMap.js +2 -0
  1214. package/dist/react-native/utils/nonStreamingOrderByMap.js.map +1 -1
  1215. package/dist/react-native/utils/time.d.ts +8 -0
  1216. package/dist/react-native/utils/time.d.ts.map +1 -1
  1217. package/dist/react-native/utils/time.js +19 -0
  1218. package/dist/react-native/utils/time.js.map +1 -1
  1219. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"batch.js","sourceRoot":"","sources":["../../../src/utils/batch.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAsFlC,oCAIC;AAuGD,kCAOC;AAgBD,8CAsCC;AA8BD,8DA4BC;AAMD,gEAEC;AAED,wDAgBC;AAED,kDAEC;AAoCD,sDA+DC;AAtbD,sEAAwF;AAcxF,oDAA+F;AAE/F,mDAAqD;AACrD,sDAAqD;AACrD,yDAAmD;AACnD,gDAA8C;AAgE9C,SAAgB,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;IAChE,MAAM,mBAAmB,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,WAAW,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/C,OAAO,mBAAmB,IAAI,WAAW,CAAC;AAC5C,CAAC;AAQY,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC;AAwFX,SAAgB,WAAW,CACzB,SAAoB;IAEpB,OAAO,CACL,SAAS,CAAC,aAAa,KAAK,OAAO;QAClC,SAA+B,CAAC,YAAY,KAAK,SAAS,CAC5D,CAAC;AACJ,CAAC;AACD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,iBAAiB,CAC/B,cAA8B,E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AI,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;;;AAsFlC,oCAIC;AAuGD,kCAOC;AAgBD,8CAsCC;AA8BD,8DA4BC;AAMD,gEAEC;AAED,wDAgBC;AAED,kDAEC;AAoCD,sDA+DC;AAtbD,sEAAwF;AAcxF,oDAA+F;AAE/F,mDAAqD;AACrD,sDAAqD;AACrD,yDAAmD;AACnD,gDAA8C;AAgE9C,SAAgB,YAAY,CAAC,GAAW,EAAE,GAAW,EAAE,GAAW;IAChE,MAAM,mBAAmB,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,WAAW,GAAG,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/C,OAAO,mBAAmB,IAAI,WAAW,CAAC;AAC5C,CAAC;AAQY,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC;AAwFX,SAAgB,WAAW,CACzB,SAAoB;IAEpB,OAAO,CACL,SAAS,CAAC,aAAa,KAAK,OAAO;QAClC,SAA+B,CAAC,YAAY,KAAK,SAAS,CAC5D,CAAC;AACJ,CAAC;AACD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,iBAAiB,CAC/B,cAA8B,EAC9B,UAAkC,EAClC,UAA0B,EAAE;IAK5B,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAE7C,IAAI,YAA0C,CAAC;IAC/C,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAA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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"]}
@@ -6,6 +6,10 @@ const tslib_1 = require("tslib");
6
6
  // Licensed under the MIT License.
7
7
  const priorityqueuejs_1 = tslib_1.__importDefault(require("priorityqueuejs"));
8
8
  class FixedSizePriorityQueue {
9
+ pq;
10
+ // 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.
11
+ compareFn;
12
+ pqMaxSize;
9
13
  constructor(compareFn, pqMaxSize) {
10
14
  this.compareFn = compareFn;
11
15
  this.pq = new priorityqueuejs_1.default(this.compareFn);
@@ -1 +1 @@
1
- {"version":3,"file":"fixedSizePriorityQueue.js","sourceRoot":"","sources":["../../../src/utils/fixedSizePriorityQueue.ts"],"names":[],"mappings":";;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,8EAA4C;AAE5C,MAAa,sBAAsB;IAMjC,YAAY,SAAiC,EAAE,SAAiB;QAC9D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,EAAE,GAAG,IAAI,yBAAa,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;AA5DD,wDA4DC","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,8EAA4C;AAE5C,MAAa,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,yBAAa,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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AAC;YAC1B,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5DD,wDA4DC","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"]}
@@ -16,7 +16,7 @@ const v2_js_1 = require("./v2.js");
16
16
  * @returns
17
17
  */
18
18
  function hashPartitionKey(partitionKey, partitionDefinition) {
19
- const kind = (partitionDefinition === null || partitionDefinition === void 0 ? void 0 : partitionDefinition.kind) || index_js_1.PartitionKeyKind.Hash; // Default value.
19
+ const kind = partitionDefinition?.kind || index_js_1.PartitionKeyKind.Hash; // Default value.
20
20
  const isV2 = partitionDefinition &&
21
21
  partitionDefinition.version &&
22
22
  partitionDefinition.version === index_js_1.PartitionKeyDefinitionVersion.V2;
@@ -1 +1 @@
1
- {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../src/utils/hashing/hash.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAgBlC,4CAeC;AAED,4EAoBC;AAjDD,uDAA2F;AAC3F,0CAA2C;AAC3C,iDAA2D;AAC3D,mCAA6C;AAC7C,mCAA6C;AAE7C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,YAA0C,EAC1C,mBAA2C;IAE3C,MAAM,IAAI,GAAqB,CAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,IAAI,KAAI,2BAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB;IACpG,MAAM,IAAI,GACR,mBAAmB;QACnB,mBAAmB,CAAC,OAAO;QAC3B,mBAAmB,CAAC,OAAO,KAAK,wCAA6B,CAAC,EAAE,CAAC;IACnE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,2BAAgB,CAAC,IAAI;YACxB,OAAO,IAAI,CAAC,CAAC,CAAC,IAAA,0BAAkB,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAkB,EAAC,YAAY,CAAC,CAAC;QACpF,KAAK,2BAAgB,CAAC,SAAS;YAC7B,OAAO,IAAA,wCAAyB,EAAC,YAAY,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,SAAgB,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,IAAA,uBAAY,EAAC,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"]}
1
+ {"version":3,"file":"hash.js","sourceRoot":"","sources":["../../../../src/utils/hashing/hash.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAgBlC,4CAeC;AAED,4EAoBC;AAjDD,uDAA2F;AAC3F,0CAA2C;AAC3C,iDAA2D;AAC3D,mCAA6C;AAC7C,mCAA6C;AAE7C;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,YAA0C,EAC1C,mBAA2C;IAE3C,MAAM,IAAI,GAAqB,mBAAmB,EAAE,IAAI,IAAI,2BAAgB,CAAC,IAAI,CAAC,CAAC,iBAAiB;IACpG,MAAM,IAAI,GACR,mBAAmB;QACnB,mBAAmB,CAAC,OAAO;QAC3B,mBAAmB,CAAC,OAAO,KAAK,wCAA6B,CAAC,EAAE,CAAC;IACnE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,2BAAgB,CAAC,IAAI;YACxB,OAAO,IAAI,CAAC,CAAC,CAAC,IAAA,0BAAkB,EAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAkB,EAAC,YAAY,CAAC,CAAC;QACpF,KAAK,2BAAgB,CAAC,SAAS;YAC7B,OAAO,IAAA,wCAAyB,EAAC,YAAY,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,SAAgB,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,IAAA,uBAAY,EAAC,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"]}
@@ -7,6 +7,8 @@ exports.NonStreamingOrderByMap = void 0;
7
7
  * Stores the most favourable distinct result from a set of nonStreamingOrderBy results.
8
8
  */
9
9
  class NonStreamingOrderByMap {
10
+ map;
11
+ compareFn;
10
12
  constructor(compareFn) {
11
13
  this.compareFn = compareFn;
12
14
  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,MAAa,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,IA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DAiDC","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,MAAa,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;AAjDD,wDAiDC","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"]}
@@ -4,4 +4,12 @@
4
4
  * @returns
5
5
  */
6
6
  export declare function getCurrentTimestampInMs(): number;
7
+ /**
8
+ * @hidden
9
+ * Utility function to start a background task that runs at specified intervals.
10
+ * @param action - A function that returns a Promise, representing the task to be executed.
11
+ * @param intervalMs - The interval in milliseconds at which the task should run.
12
+ * @returns A NodeJS.Timeout object representing the timer for the background task.
13
+ */
14
+ export declare function startBackgroundTask(action: () => Promise<void>, intervalMs: number): NodeJS.Timeout;
7
15
  //# sourceMappingURL=time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/utils/time.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/utils/time.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC3B,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC,OAAO,CAWhB"}
@@ -3,6 +3,7 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.getCurrentTimestampInMs = getCurrentTimestampInMs;
6
+ exports.startBackgroundTask = startBackgroundTask;
6
7
  /**
7
8
  * @hidden
8
9
  * Utility function to get currentTime in UTC milliseconds.
@@ -11,4 +12,23 @@ exports.getCurrentTimestampInMs = getCurrentTimestampInMs;
11
12
  function getCurrentTimestampInMs() {
12
13
  return Date.now();
13
14
  }
15
+ /**
16
+ * @hidden
17
+ * Utility function to start a background task that runs at specified intervals.
18
+ * @param action - A function that returns a Promise, representing the task to be executed.
19
+ * @param intervalMs - The interval in milliseconds at which the task should run.
20
+ * @returns A NodeJS.Timeout object representing the timer for the background task.
21
+ */
22
+ function startBackgroundTask(action, intervalMs) {
23
+ const timer = setInterval(() => {
24
+ (async () => {
25
+ await action();
26
+ })();
27
+ }, intervalMs);
28
+ // Unref the timer if available to prevent it from keeping the Node.js event loop alive
29
+ if (timer.unref && typeof timer.unref === "function") {
30
+ timer.unref();
31
+ }
32
+ return timer;
33
+ }
14
34
  //# sourceMappingURL=time.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/utils/time.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAQlC,0DAEC;AARD;;;;GAIG;AAEH,SAAgB,uBAAuB;IACrC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @hidden\n * Utility function to get currentTime in UTC milliseconds.\n * @returns\n */\n\nexport function getCurrentTimestampInMs(): number {\n return Date.now();\n}\n"]}
1
+ {"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/utils/time.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAQlC,0DAEC;AASD,kDAcC;AA/BD;;;;GAIG;AAEH,SAAgB,uBAAuB;IACrC,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC;AACpB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,MAA2B,EAC3B,UAAkB;IAElB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,CAAC,KAAK,IAAI,EAAE;YACV,MAAM,MAAM,EAAE,CAAC;QACjB,CAAC,CAAC,EAAE,CAAC;IACP,CAAC,EAAE,UAAU,CAAC,CAAC;IACf,uFAAuF;IACvF,IAAI,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QACrD,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @hidden\n * Utility function to get currentTime in UTC milliseconds.\n * @returns\n */\n\nexport function getCurrentTimestampInMs(): number {\n return Date.now();\n}\n\n/**\n * @hidden\n * Utility function to start a background task that runs at specified intervals.\n * @param action - A function that returns a Promise, representing the task to be executed.\n * @param intervalMs - The interval in milliseconds at which the task should run.\n * @returns A NodeJS.Timeout object representing the timer for the background task.\n */\nexport function startBackgroundTask(\n action: () => Promise<void>,\n intervalMs: number,\n): NodeJS.Timeout {\n const timer = setInterval(() => {\n (async () => {\n await action();\n })();\n }, intervalMs);\n // Unref the timer if available to prevent it from keeping the Node.js event loop alive\n if (timer.unref && typeof timer.unref === \"function\") {\n timer.unref();\n }\n return timer;\n}\n"]}
@@ -1,4 +1,3 @@
1
- import { __asyncGenerator, __await } from "tslib";
2
1
  import { ChangeFeedResponse } from "./ChangeFeedResponse.js";
3
2
  import { Constants, ResourceType, StatusCodes } from "./common/index.js";
4
3
  import { getEmptyCosmosDiagnostics, withDiagnostics } from "./utils/diagnostics.js";
@@ -8,6 +7,16 @@ import { getEmptyCosmosDiagnostics, withDiagnostics } from "./utils/diagnostics.
8
7
  * Use `Items.changeFeed()` to get an instance of the iterator.
9
8
  */
10
9
  export class ChangeFeedIterator {
10
+ clientContext;
11
+ resourceId;
12
+ resourceLink;
13
+ partitionKey;
14
+ changeFeedOptions;
15
+ static IfNoneMatchAllHeaderValue = "*";
16
+ nextIfNoneMatch;
17
+ ifModifiedSince;
18
+ lastStatusCode;
19
+ isPartitionSpecified;
11
20
  /**
12
21
  * @internal
13
22
  */
@@ -49,15 +58,13 @@ export class ChangeFeedIterator {
49
58
  /**
50
59
  * Gets an async iterator which will yield pages of results from Azure Cosmos DB.
51
60
  */
52
- getAsyncIterator() {
53
- return __asyncGenerator(this, arguments, function* getAsyncIterator_1() {
54
- do {
55
- const result = yield __await(this.fetchNext());
56
- if (result.count > 0) {
57
- yield yield __await(result);
58
- }
59
- } while (this.hasMoreResults);
60
- });
61
+ async *getAsyncIterator() {
62
+ do {
63
+ const result = await this.fetchNext();
64
+ if (result.count > 0) {
65
+ yield result;
66
+ }
67
+ } while (this.hasMoreResults);
61
68
  }
62
69
  /**
63
70
  * Read feed and retrieves the next page of results in Azure Cosmos DB.
@@ -103,5 +110,4 @@ export class ChangeFeedIterator {
103
110
  return new ChangeFeedResponse(response.result, response.result ? response.result.length : 0, response.code, response.headers, getEmptyCosmosDiagnostics());
104
111
  }
105
112
  }
106
- ChangeFeedIterator.IfNoneMatchAllHeaderValue = "*";
107
113
  //# sourceMappingURL=ChangeFeedIterator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChangeFeedIterator.js","sourceRoot":"","sources":["../../src/ChangeFeedIterator.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,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BAC5B,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,WAAW;gBACvC,SAAS,EAAE,IAAI,CAAC,eAAe;aAChC,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;QAC3F,CAAC;QAED,MAAM,QAAQ,GAAkC,MAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAI;YACrF,IAAI,EAAE,IAAI,CAAC,YAAY;YACvB,YAAY,EAAE,YAAY,CAAC,IAAI;YAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,WAAW;YACpB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,cAAc,EAAE,cAAc;SAC/B,CAAkB,CAAC,CAAC,0EAA0E;QAE/F,OAAO,IAAI,kBAAkB,CAC3B,QAAQ,CAAC,MAAM,EACf,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC5C,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,OAAO,EAChB,yBAAyB,EAAE,CAC5B,CAAC;IACJ,CAAC;;AAzHuB,4CAAyB,GAAG,GAAG,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\nimport type { ChangeFeedOptions } from \"./ChangeFeedOptions.js\";\nimport { ChangeFeedResponse } from \"./ChangeFeedResponse.js\";\nimport type { Resource } from \"./client/index.js\";\nimport type { ClientContext } from \"./ClientContext.js\";\nimport { Constants, ResourceType, StatusCodes } from \"./common/index.js\";\nimport type { DiagnosticNodeInternal } from \"./diagnostics/DiagnosticNodeInternal.js\";\nimport type { PartitionKey } from \"./documents/index.js\";\nimport type { FeedOptions } from \"./request/index.js\";\nimport type { Response } from \"./request/index.js\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"./utils/diagnostics.js\";\n\n/**\n * Provides iterator for change feed.\n *\n * Use `Items.changeFeed()` to get an instance of the iterator.\n */\nexport class ChangeFeedIterator<T> {\n private static readonly IfNoneMatchAllHeaderValue = \"*\";\n private nextIfNoneMatch: string;\n private ifModifiedSince: string;\n private lastStatusCode: number;\n private isPartitionSpecified: boolean;\n\n /**\n * @internal\n */\n constructor(\n private clientContext: ClientContext,\n private resourceId: string,\n private resourceLink: string,\n private partitionKey: PartitionKey,\n private changeFeedOptions: ChangeFeedOptions,\n ) {\n // partition key XOR partition key range id\n const partitionKeyValid = partitionKey !== undefined;\n this.isPartitionSpecified = partitionKeyValid;\n\n let canUseStartFromBeginning = true;\n if (changeFeedOptions.continuation) {\n this.nextIfNoneMatch = changeFeedOptions.continuation;\n canUseStartFromBeginning = false;\n }\n\n if (changeFeedOptions.startTime) {\n // .toUTCString() is platform specific, but most platforms use RFC 1123.\n // In ECMAScript 2018, this was standardized to RFC 1123.\n // See for more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString\n this.ifModifiedSince = changeFeedOptions.startTime.toUTCString();\n canUseStartFromBeginning = false;\n }\n\n if (canUseStartFromBeginning && !changeFeedOptions.startFromBeginning) {\n this.nextIfNoneMatch = ChangeFeedIterator.IfNoneMatchAllHeaderValue;\n }\n }\n\n /**\n * Gets a value indicating whether there are potentially additional results that can be retrieved.\n *\n * Initially returns true. This value is set based on whether the last execution returned a continuation token.\n *\n * @returns Boolean value representing if whether there are potentially additional results that can be retrieved.\n */\n get hasMoreResults(): boolean {\n return this.lastStatusCode !== StatusCodes.NotModified;\n }\n\n /**\n * Gets an async iterator which will yield pages of results from Azure Cosmos DB.\n */\n public async *getAsyncIterator(): AsyncIterable<ChangeFeedResponse<Array<T & Resource>>> {\n do {\n const result = await this.fetchNext();\n if (result.count > 0) {\n yield result;\n }\n } while (this.hasMoreResults);\n }\n\n /**\n * Read feed and retrieves the next page of results in Azure Cosmos DB.\n */\n public async fetchNext(): Promise<ChangeFeedResponse<Array<T & Resource>>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const response = await this.getFeedResponse(diagnosticNode);\n this.lastStatusCode = response.statusCode;\n this.nextIfNoneMatch = response.headers[Constants.HttpHeaders.ETag];\n return response;\n }, this.clientContext);\n }\n\n private async getFeedResponse(\n diagnosticNode: DiagnosticNodeInternal,\n ): Promise<ChangeFeedResponse<Array<T & Resource>>> {\n if (!this.isPartitionSpecified) {\n throw new Error(\n \"Container is partitioned, but no partition key or partition key range id was specified.\",\n );\n }\n const feedOptions: FeedOptions = { initialHeaders: {}, useIncrementalFeed: true };\n\n if (typeof this.changeFeedOptions.maxItemCount === \"number\") {\n feedOptions.maxItemCount = this.changeFeedOptions.maxItemCount;\n }\n\n if (this.changeFeedOptions.sessionToken) {\n feedOptions.sessionToken = this.changeFeedOptions.sessionToken;\n }\n\n if (this.nextIfNoneMatch) {\n feedOptions.accessCondition = {\n type: Constants.HttpHeaders.IfNoneMatch,\n condition: this.nextIfNoneMatch,\n };\n }\n\n if (this.ifModifiedSince) {\n feedOptions.initialHeaders[Constants.HttpHeaders.IfModifiedSince] = this.ifModifiedSince;\n }\n\n const response: Response<Array<T & Resource>> = await (this.clientContext.queryFeed<T>({\n path: this.resourceLink,\n resourceType: ResourceType.item,\n resourceId: this.resourceId,\n resultFn: (result) => (result ? result.Documents : []),\n query: undefined,\n options: feedOptions,\n partitionKey: this.partitionKey,\n diagnosticNode: diagnosticNode,\n }) as Promise<any>); // TODO: some funky issues with query feed. Probably need to change it up.\n\n return new ChangeFeedResponse(\n response.result,\n response.result ? response.result.length : 0,\n response.code,\n response.headers,\n getEmpt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AAC,OAAO,EAChB,yBAAyB,EAAE,CAC5B,CAAC;IACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\nimport type { ChangeFeedOptions } from \"./ChangeFeedOptions.js\";\nimport { ChangeFeedResponse } from \"./ChangeFeedResponse.js\";\nimport type { Resource } from \"./client/index.js\";\nimport type { ClientContext } from \"./ClientContext.js\";\nimport { Constants, ResourceType, StatusCodes } from \"./common/index.js\";\nimport type { DiagnosticNodeInternal } from \"./diagnostics/DiagnosticNodeInternal.js\";\nimport type { PartitionKey } from \"./documents/index.js\";\nimport type { FeedOptions } from \"./request/index.js\";\nimport type { Response } from \"./request/index.js\";\nimport { getEmptyCosmosDiagnostics, withDiagnostics } from \"./utils/diagnostics.js\";\n\n/**\n * Provides iterator for change feed.\n *\n * Use `Items.changeFeed()` to get an instance of the iterator.\n */\nexport class ChangeFeedIterator<T> {\n private static readonly IfNoneMatchAllHeaderValue = \"*\";\n private nextIfNoneMatch: string;\n private ifModifiedSince: string;\n private lastStatusCode: number;\n private isPartitionSpecified: boolean;\n\n /**\n * @internal\n */\n constructor(\n private clientContext: ClientContext,\n private resourceId: string,\n private resourceLink: string,\n private partitionKey: PartitionKey,\n private changeFeedOptions: ChangeFeedOptions,\n ) {\n // partition key XOR partition key range id\n const partitionKeyValid = partitionKey !== undefined;\n this.isPartitionSpecified = partitionKeyValid;\n\n let canUseStartFromBeginning = true;\n if (changeFeedOptions.continuation) {\n this.nextIfNoneMatch = changeFeedOptions.continuation;\n canUseStartFromBeginning = false;\n }\n\n if (changeFeedOptions.startTime) {\n // .toUTCString() is platform specific, but most platforms use RFC 1123.\n // In ECMAScript 2018, this was standardized to RFC 1123.\n // See for more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString\n this.ifModifiedSince = changeFeedOptions.startTime.toUTCString();\n canUseStartFromBeginning = false;\n }\n\n if (canUseStartFromBeginning && !changeFeedOptions.startFromBeginning) {\n this.nextIfNoneMatch = ChangeFeedIterator.IfNoneMatchAllHeaderValue;\n }\n }\n\n /**\n * Gets a value indicating whether there are potentially additional results that can be retrieved.\n *\n * Initially returns true. This value is set based on whether the last execution returned a continuation token.\n *\n * @returns Boolean value representing if whether there are potentially additional results that can be retrieved.\n */\n get hasMoreResults(): boolean {\n return this.lastStatusCode !== StatusCodes.NotModified;\n }\n\n /**\n * Gets an async iterator which will yield pages of results from Azure Cosmos DB.\n */\n public async *getAsyncIterator(): AsyncIterable<ChangeFeedResponse<Array<T & Resource>>> {\n do {\n const result = await this.fetchNext();\n if (result.count > 0) {\n yield result;\n }\n } while (this.hasMoreResults);\n }\n\n /**\n * Read feed and retrieves the next page of results in Azure Cosmos DB.\n */\n public async fetchNext(): Promise<ChangeFeedResponse<Array<T & Resource>>> {\n return withDiagnostics(async (diagnosticNode: DiagnosticNodeInternal) => {\n const response = await this.getFeedResponse(diagnosticNode);\n this.lastStatusCode = response.statusCode;\n this.nextIfNoneMatch = response.headers[Constants.HttpHeaders.ETag];\n return response;\n }, this.clientContext);\n }\n\n private async getFeedResponse(\n diagnosticNode: DiagnosticNodeInternal,\n ): Promise<ChangeFeedResponse<Array<T & Resource>>> {\n if (!this.isPartitionSpecified) {\n throw new Error(\n \"Container is partitioned, but no partition key or partition key range id was specified.\",\n );\n }\n const feedOptions: FeedOptions = { initialHeaders: {}, useIncrementalFeed: true };\n\n if (typeof this.changeFeedOptions.maxItemCount === \"number\") {\n feedOptions.maxItemCount = this.changeFeedOptions.maxItemCount;\n }\n\n if (this.changeFeedOptions.sessionToken) {\n feedOptions.sessionToken = this.changeFeedOptions.sessionToken;\n }\n\n if (this.nextIfNoneMatch) {\n feedOptions.accessCondition = {\n type: Constants.HttpHeaders.IfNoneMatch,\n condition: this.nextIfNoneMatch,\n };\n }\n\n if (this.ifModifiedSince) {\n feedOptions.initialHeaders[Constants.HttpHeaders.IfModifiedSince] = this.ifModifiedSince;\n }\n\n const response: Response<Array<T & Resource>> = await (this.clientContext.queryFeed<T>({\n path: this.resourceLink,\n resourceType: ResourceType.item,\n resourceId: this.resourceId,\n resultFn: (result) => (result ? result.Documents : []),\n query: undefined,\n options: feedOptions,\n partitionKey: this.partitionKey,\n diagnosticNode: diagnosticNode,\n }) as Promise<any>); // TODO: some funky issues with query feed. Probably need to change it up.\n\n return new ChangeFeedResponse(\n response.result,\n response.result ? response.result.length : 0,\n response.code,\n response.headers,\n getEmptyCosmosDiagnostics(),\n );\n }\n}\n"]}
@@ -3,6 +3,10 @@ import { Constants } from "./common/index.js";
3
3
  * A single response page from the Azure Cosmos DB Change Feed
4
4
  */
5
5
  export class ChangeFeedResponse {
6
+ result;
7
+ count;
8
+ statusCode;
9
+ diagnostics;
6
10
  /**
7
11
  * @internal
8
12
  */
@@ -64,5 +68,9 @@ export class ChangeFeedResponse {
64
68
  get etag() {
65
69
  return this.headers[Constants.HttpHeaders.ETag];
66
70
  }
71
+ /**
72
+ * Response headers of the response from Azure Cosmos DB
73
+ */
74
+ headers;
67
75
  }
68
76
  //# sourceMappingURL=ChangeFeedResponse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChangeFeedResponse.js","sourceRoot":"","sources":["../../src/ChangeFeedResponse.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;OAEG;IACH;IACE;;OAEG;IACa,MAAS;IACzB;;OAEG;IACa,KAAa;IAC7B;;OAEG;IACa,UAAkB,EAClC,OAAsB,EACN,WAA8B;QAV9B,WAAM,GAAN,MAAM,CAAG;QAIT,UAAK,GAAL,KAAK,CAAQ;QAIb,eAAU,GAAV,UAAU,CAAQ;QAElB,gBAAW,GAAX,WAAW,CAAmB;QAE9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;OAQG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CAMF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { CosmosDiagnostics } from \"./CosmosDiagnostics.js\";\nimport { Constants } from \"./common/index.js\";\nimport type { CosmosHeaders } from \"./queryExecutionContext/index.js\";\n\n/**\n * A single response page from the Azure Cosmos DB Change Feed\n */\nexport class ChangeFeedResponse<T> {\n /**\n * @internal\n */\n constructor(\n /**\n * Gets the items returned in the response from Azure Cosmos DB\n */\n public readonly result: T,\n /**\n * Gets the number of items returned in the response from Azure Cosmos DB\n */\n public readonly count: number,\n /**\n * Gets the status code of the response from Azure Cosmos DB\n */\n public readonly statusCode: number,\n headers: CosmosHeaders,\n public readonly diagnostics: CosmosDiagnostics,\n ) {\n this.headers = Object.freeze(headers);\n }\n\n /**\n * Gets the request charge for this request from the Azure Cosmos DB service.\n */\n public get requestCharge(): number {\n const rus = this.headers[Constants.HttpHeaders.RequestCharge];\n return rus ? parseInt(rus, 10) : null;\n }\n\n /**\n * Gets the activity ID for the request from the Azure Cosmos DB service.\n */\n public get activityId(): string {\n return this.headers[Constants.HttpHeaders.ActivityId];\n }\n\n /**\n * Gets the continuation token to be used for continuing enumeration of the Azure Cosmos DB service.\n *\n * This is equivalent to the `etag` property.\n */\n public get continuation(): string {\n return this.etag;\n }\n\n /**\n * Gets the session token for use in session consistency reads from the Azure Cosmos DB service.\n */\n public get sessionToken(): string {\n return this.headers[Constants.HttpHeaders.SessionToken];\n }\n\n /**\n * Gets the entity tag associated with last transaction in the Azure Cosmos DB service,\n * which can be used as If-Non-Match Access condition for ReadFeed REST request or\n * `continuation` property of `ChangeFeedOptions` parameter for\n * `Items.changeFeed()`\n * to get feed changes since the transaction specified by this entity tag.\n *\n * This is equivalent to the `continuation` property.\n */\n public get etag(): string {\n return this.headers[Constants.HttpHeaders.ETag];\n }\n\n /**\n * Response headers of the response from Azure Cosmos DB\n */\n public headers: CosmosHeaders;\n}\n"]}
1
+ {"version":3,"file":"ChangeFeedResponse.js","sourceRoot":"","sources":["../../src/ChangeFeedResponse.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAQX;IAIA;IAIA;IAEA;IAjBlB;;OAEG;IACH;IACE;;OAEG;IACa,MAAS;IACzB;;OAEG;IACa,KAAa;IAC7B;;OAEG;IACa,UAAkB,EAClC,OAAsB,EACN,WAA8B;QAV9B,WAAM,GAAN,MAAM,CAAG;QAIT,UAAK,GAAL,KAAK,CAAQ;QAIb,eAAU,GAAV,UAAU,CAAQ;QAElB,gBAAW,GAAX,WAAW,CAAmB;QAE9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,aAAa;QACtB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;OAQG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACI,OAAO,CAAgB;CAC/B","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { CosmosDiagnostics } from \"./CosmosDiagnostics.js\";\nimport { Constants } from \"./common/index.js\";\nimport type { CosmosHeaders } from \"./queryExecutionContext/index.js\";\n\n/**\n * A single response page from the Azure Cosmos DB Change Feed\n */\nexport class ChangeFeedResponse<T> {\n /**\n * @internal\n */\n constructor(\n /**\n * Gets the items returned in the response from Azure Cosmos DB\n */\n public readonly result: T,\n /**\n * Gets the number of items returned in the response from Azure Cosmos DB\n */\n public readonly count: number,\n /**\n * Gets the status code of the response from Azure Cosmos DB\n */\n public readonly statusCode: number,\n headers: CosmosHeaders,\n public readonly diagnostics: CosmosDiagnostics,\n ) {\n this.headers = Object.freeze(headers);\n }\n\n /**\n * Gets the request charge for this request from the Azure Cosmos DB service.\n */\n public get requestCharge(): number {\n const rus = this.headers[Constants.HttpHeaders.RequestCharge];\n return rus ? parseInt(rus, 10) : null;\n }\n\n /**\n * Gets the activity ID for the request from the Azure Cosmos DB service.\n */\n public get activityId(): string {\n return this.headers[Constants.HttpHeaders.ActivityId];\n }\n\n /**\n * Gets the continuation token to be used for continuing enumeration of the Azure Cosmos DB service.\n *\n * This is equivalent to the `etag` property.\n */\n public get continuation(): string {\n return this.etag;\n }\n\n /**\n * Gets the session token for use in session consistency reads from the Azure Cosmos DB service.\n */\n public get sessionToken(): string {\n return this.headers[Constants.HttpHeaders.SessionToken];\n }\n\n /**\n * Gets the entity tag associated with last transaction in the Azure Cosmos DB service,\n * which can be used as If-Non-Match Access condition for ReadFeed REST request or\n * `continuation` property of `ChangeFeedOptions` parameter for\n * `Items.changeFeed()`\n * to get feed changes since the transaction specified by this entity tag.\n *\n * This is equivalent to the `continuation` property.\n */\n public get etag(): string {\n return this.headers[Constants.HttpHeaders.ETag];\n }\n\n /**\n * Response headers of the response from Azure Cosmos DB\n */\n public headers: CosmosHeaders;\n}\n"]}