@azure/cosmos 4.5.1 → 4.6.0

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 (323) hide show
  1. package/README.md +32 -0
  2. package/dist/browser/ClientContext.d.ts.map +1 -1
  3. package/dist/browser/ClientContext.js +110 -19
  4. package/dist/browser/ClientContext.js.map +1 -1
  5. package/dist/browser/CosmosClient.d.ts +13 -0
  6. package/dist/browser/CosmosClient.d.ts.map +1 -1
  7. package/dist/browser/CosmosClient.js +19 -3
  8. package/dist/browser/CosmosClient.js.map +1 -1
  9. package/dist/browser/CosmosClientOptions.d.ts.map +1 -1
  10. package/dist/browser/CosmosClientOptions.js.map +1 -1
  11. package/dist/browser/CosmosDiagnostics.d.ts +4 -0
  12. package/dist/browser/CosmosDiagnostics.d.ts.map +1 -1
  13. package/dist/browser/CosmosDiagnostics.js.map +1 -1
  14. package/dist/browser/GlobalEndpointManagerOptions.d.ts +2 -0
  15. package/dist/browser/GlobalEndpointManagerOptions.d.ts.map +1 -0
  16. package/dist/browser/GlobalEndpointManagerOptions.js +2 -0
  17. package/dist/browser/GlobalEndpointManagerOptions.js.map +1 -0
  18. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
  19. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js +3 -0
  20. package/dist/browser/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  21. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  22. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js +3 -0
  23. package/dist/browser/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  24. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +5 -0
  25. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
  26. package/dist/browser/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
  27. package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.d.ts +1 -0
  28. package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
  29. package/dist/browser/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
  30. package/dist/browser/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  31. package/dist/browser/client/ChangeFeed/changeFeedUtils.js +1 -0
  32. package/dist/browser/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  33. package/dist/browser/client/Item/Items.d.ts.map +1 -1
  34. package/dist/browser/client/Item/Items.js +5 -0
  35. package/dist/browser/client/Item/Items.js.map +1 -1
  36. package/dist/browser/common/constants.d.ts +4 -0
  37. package/dist/browser/common/constants.d.ts.map +1 -1
  38. package/dist/browser/common/constants.js +5 -1
  39. package/dist/browser/common/constants.js.map +1 -1
  40. package/dist/browser/common/helper.d.ts +6 -0
  41. package/dist/browser/common/helper.d.ts.map +1 -1
  42. package/dist/browser/common/helper.js +9 -1
  43. package/dist/browser/common/helper.js.map +1 -1
  44. package/dist/browser/common/platform.d.ts +1 -0
  45. package/dist/browser/common/platform.d.ts.map +1 -1
  46. package/dist/browser/common/platform.js +1 -3
  47. package/dist/browser/common/platform.js.map +1 -1
  48. package/dist/browser/diagnostics/DiagnosticNodeInternal.d.ts +1 -0
  49. package/dist/browser/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  50. package/dist/browser/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  51. package/dist/browser/documents/ConnectionPolicy.d.ts +10 -4
  52. package/dist/browser/documents/ConnectionPolicy.d.ts.map +1 -1
  53. package/dist/browser/documents/ConnectionPolicy.js +2 -2
  54. package/dist/browser/documents/ConnectionPolicy.js.map +1 -1
  55. package/dist/browser/documents/DatabaseAccount.d.ts +4 -0
  56. package/dist/browser/documents/DatabaseAccount.d.ts.map +1 -1
  57. package/dist/browser/documents/DatabaseAccount.js +9 -0
  58. package/dist/browser/documents/DatabaseAccount.js.map +1 -1
  59. package/dist/browser/globalEndpointManager.d.ts +8 -0
  60. package/dist/browser/globalEndpointManager.d.ts.map +1 -1
  61. package/dist/browser/globalEndpointManager.js +68 -6
  62. package/dist/browser/globalEndpointManager.js.map +1 -1
  63. package/dist/browser/globalPartitionEndpointManager.d.ts +0 -2
  64. package/dist/browser/globalPartitionEndpointManager.d.ts.map +1 -1
  65. package/dist/browser/globalPartitionEndpointManager.js +13 -9
  66. package/dist/browser/globalPartitionEndpointManager.js.map +1 -1
  67. package/dist/browser/request/RequestHandler.js +2 -2
  68. package/dist/browser/request/RequestHandler.js.map +1 -1
  69. package/dist/browser/request/SharedOptions.d.ts +5 -0
  70. package/dist/browser/request/SharedOptions.d.ts.map +1 -1
  71. package/dist/browser/request/SharedOptions.js.map +1 -1
  72. package/dist/browser/retry/retryUtility.d.ts.map +1 -1
  73. package/dist/browser/retry/retryUtility.js +17 -3
  74. package/dist/browser/retry/retryUtility.js.map +1 -1
  75. package/dist/browser/retry/timeoutFailoverRetryPolicy.d.ts +1 -2
  76. package/dist/browser/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  77. package/dist/browser/retry/timeoutFailoverRetryPolicy.js +4 -4
  78. package/dist/browser/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  79. package/dist/browser/utils/encode.d.ts +1 -1
  80. package/dist/browser/utils/encode.d.ts.map +1 -1
  81. package/dist/browser/utils/encode.js.map +1 -1
  82. package/dist/commonjs/ClientContext.d.ts.map +1 -1
  83. package/dist/commonjs/ClientContext.js +110 -19
  84. package/dist/commonjs/ClientContext.js.map +1 -1
  85. package/dist/commonjs/CosmosClient.d.ts +13 -0
  86. package/dist/commonjs/CosmosClient.d.ts.map +1 -1
  87. package/dist/commonjs/CosmosClient.js +19 -3
  88. package/dist/commonjs/CosmosClient.js.map +1 -1
  89. package/dist/commonjs/CosmosClientOptions.d.ts.map +1 -1
  90. package/dist/commonjs/CosmosClientOptions.js.map +1 -1
  91. package/dist/commonjs/CosmosDiagnostics.d.ts +4 -0
  92. package/dist/commonjs/CosmosDiagnostics.d.ts.map +1 -1
  93. package/dist/commonjs/CosmosDiagnostics.js.map +1 -1
  94. package/dist/commonjs/GlobalEndpointManagerOptions.d.ts +2 -0
  95. package/dist/commonjs/GlobalEndpointManagerOptions.d.ts.map +1 -0
  96. package/dist/commonjs/GlobalEndpointManagerOptions.js +3 -0
  97. package/dist/commonjs/GlobalEndpointManagerOptions.js.map +1 -0
  98. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
  99. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js +3 -0
  100. package/dist/commonjs/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  101. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  102. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js +3 -0
  103. package/dist/commonjs/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  104. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +5 -0
  105. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
  106. package/dist/commonjs/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
  107. package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.d.ts +1 -0
  108. package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
  109. package/dist/commonjs/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
  110. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  111. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js +1 -0
  112. package/dist/commonjs/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  113. package/dist/commonjs/client/Item/Items.d.ts.map +1 -1
  114. package/dist/commonjs/client/Item/Items.js +5 -0
  115. package/dist/commonjs/client/Item/Items.js.map +1 -1
  116. package/dist/commonjs/common/constants.d.ts +4 -0
  117. package/dist/commonjs/common/constants.d.ts.map +1 -1
  118. package/dist/commonjs/common/constants.js +6 -2
  119. package/dist/commonjs/common/constants.js.map +1 -1
  120. package/dist/commonjs/common/helper.d.ts +6 -0
  121. package/dist/commonjs/common/helper.d.ts.map +1 -1
  122. package/dist/commonjs/common/helper.js +9 -0
  123. package/dist/commonjs/common/helper.js.map +1 -1
  124. package/dist/commonjs/common/platform.d.ts +1 -0
  125. package/dist/commonjs/common/platform.d.ts.map +1 -1
  126. package/dist/commonjs/common/platform.js +1 -3
  127. package/dist/commonjs/common/platform.js.map +1 -1
  128. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.d.ts +1 -0
  129. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  130. package/dist/commonjs/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  131. package/dist/commonjs/documents/ConnectionPolicy.d.ts +10 -4
  132. package/dist/commonjs/documents/ConnectionPolicy.d.ts.map +1 -1
  133. package/dist/commonjs/documents/ConnectionPolicy.js +2 -2
  134. package/dist/commonjs/documents/ConnectionPolicy.js.map +1 -1
  135. package/dist/commonjs/documents/DatabaseAccount.d.ts +4 -0
  136. package/dist/commonjs/documents/DatabaseAccount.d.ts.map +1 -1
  137. package/dist/commonjs/documents/DatabaseAccount.js +9 -0
  138. package/dist/commonjs/documents/DatabaseAccount.js.map +1 -1
  139. package/dist/commonjs/globalEndpointManager.d.ts +8 -0
  140. package/dist/commonjs/globalEndpointManager.d.ts.map +1 -1
  141. package/dist/commonjs/globalEndpointManager.js +68 -6
  142. package/dist/commonjs/globalEndpointManager.js.map +1 -1
  143. package/dist/commonjs/globalPartitionEndpointManager.d.ts +0 -2
  144. package/dist/commonjs/globalPartitionEndpointManager.d.ts.map +1 -1
  145. package/dist/commonjs/globalPartitionEndpointManager.js +13 -9
  146. package/dist/commonjs/globalPartitionEndpointManager.js.map +1 -1
  147. package/dist/commonjs/request/RequestHandler.js +2 -2
  148. package/dist/commonjs/request/RequestHandler.js.map +1 -1
  149. package/dist/commonjs/request/SharedOptions.d.ts +5 -0
  150. package/dist/commonjs/request/SharedOptions.d.ts.map +1 -1
  151. package/dist/commonjs/request/SharedOptions.js.map +1 -1
  152. package/dist/commonjs/retry/retryUtility.d.ts.map +1 -1
  153. package/dist/commonjs/retry/retryUtility.js +17 -3
  154. package/dist/commonjs/retry/retryUtility.js.map +1 -1
  155. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.d.ts +1 -2
  156. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  157. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js +4 -4
  158. package/dist/commonjs/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  159. package/dist/commonjs/tsdoc-metadata.json +1 -1
  160. package/dist/commonjs/utils/encode.d.ts +1 -1
  161. package/dist/commonjs/utils/encode.d.ts.map +1 -1
  162. package/dist/commonjs/utils/encode.js.map +1 -1
  163. package/dist/esm/ClientContext.d.ts.map +1 -1
  164. package/dist/esm/ClientContext.js +110 -19
  165. package/dist/esm/ClientContext.js.map +1 -1
  166. package/dist/esm/CosmosClient.d.ts +13 -0
  167. package/dist/esm/CosmosClient.d.ts.map +1 -1
  168. package/dist/esm/CosmosClient.js +19 -3
  169. package/dist/esm/CosmosClient.js.map +1 -1
  170. package/dist/esm/CosmosClientOptions.d.ts.map +1 -1
  171. package/dist/esm/CosmosClientOptions.js.map +1 -1
  172. package/dist/esm/CosmosDiagnostics.d.ts +4 -0
  173. package/dist/esm/CosmosDiagnostics.d.ts.map +1 -1
  174. package/dist/esm/CosmosDiagnostics.js.map +1 -1
  175. package/dist/esm/GlobalEndpointManagerOptions.d.ts +2 -0
  176. package/dist/esm/GlobalEndpointManagerOptions.d.ts.map +1 -0
  177. package/dist/esm/GlobalEndpointManagerOptions.js +2 -0
  178. package/dist/esm/GlobalEndpointManagerOptions.js.map +1 -0
  179. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
  180. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js +3 -0
  181. package/dist/esm/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  182. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  183. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js +3 -0
  184. package/dist/esm/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  185. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +5 -0
  186. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
  187. package/dist/esm/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
  188. package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.d.ts +1 -0
  189. package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
  190. package/dist/esm/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
  191. package/dist/esm/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  192. package/dist/esm/client/ChangeFeed/changeFeedUtils.js +1 -0
  193. package/dist/esm/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  194. package/dist/esm/client/Item/Items.d.ts.map +1 -1
  195. package/dist/esm/client/Item/Items.js +5 -0
  196. package/dist/esm/client/Item/Items.js.map +1 -1
  197. package/dist/esm/common/constants.d.ts +4 -0
  198. package/dist/esm/common/constants.d.ts.map +1 -1
  199. package/dist/esm/common/constants.js +5 -1
  200. package/dist/esm/common/constants.js.map +1 -1
  201. package/dist/esm/common/helper.d.ts +6 -0
  202. package/dist/esm/common/helper.d.ts.map +1 -1
  203. package/dist/esm/common/helper.js +9 -1
  204. package/dist/esm/common/helper.js.map +1 -1
  205. package/dist/esm/common/platform.d.ts +1 -0
  206. package/dist/esm/common/platform.d.ts.map +1 -1
  207. package/dist/esm/common/platform.js +1 -3
  208. package/dist/esm/common/platform.js.map +1 -1
  209. package/dist/esm/diagnostics/DiagnosticNodeInternal.d.ts +1 -0
  210. package/dist/esm/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  211. package/dist/esm/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  212. package/dist/esm/documents/ConnectionPolicy.d.ts +10 -4
  213. package/dist/esm/documents/ConnectionPolicy.d.ts.map +1 -1
  214. package/dist/esm/documents/ConnectionPolicy.js +2 -2
  215. package/dist/esm/documents/ConnectionPolicy.js.map +1 -1
  216. package/dist/esm/documents/DatabaseAccount.d.ts +4 -0
  217. package/dist/esm/documents/DatabaseAccount.d.ts.map +1 -1
  218. package/dist/esm/documents/DatabaseAccount.js +9 -0
  219. package/dist/esm/documents/DatabaseAccount.js.map +1 -1
  220. package/dist/esm/globalEndpointManager.d.ts +8 -0
  221. package/dist/esm/globalEndpointManager.d.ts.map +1 -1
  222. package/dist/esm/globalEndpointManager.js +68 -6
  223. package/dist/esm/globalEndpointManager.js.map +1 -1
  224. package/dist/esm/globalPartitionEndpointManager.d.ts +0 -2
  225. package/dist/esm/globalPartitionEndpointManager.d.ts.map +1 -1
  226. package/dist/esm/globalPartitionEndpointManager.js +13 -9
  227. package/dist/esm/globalPartitionEndpointManager.js.map +1 -1
  228. package/dist/esm/request/RequestHandler.js +2 -2
  229. package/dist/esm/request/RequestHandler.js.map +1 -1
  230. package/dist/esm/request/SharedOptions.d.ts +5 -0
  231. package/dist/esm/request/SharedOptions.d.ts.map +1 -1
  232. package/dist/esm/request/SharedOptions.js.map +1 -1
  233. package/dist/esm/retry/retryUtility.d.ts.map +1 -1
  234. package/dist/esm/retry/retryUtility.js +17 -3
  235. package/dist/esm/retry/retryUtility.js.map +1 -1
  236. package/dist/esm/retry/timeoutFailoverRetryPolicy.d.ts +1 -2
  237. package/dist/esm/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  238. package/dist/esm/retry/timeoutFailoverRetryPolicy.js +4 -4
  239. package/dist/esm/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  240. package/dist/esm/utils/encode.d.ts +1 -1
  241. package/dist/esm/utils/encode.d.ts.map +1 -1
  242. package/dist/esm/utils/encode.js.map +1 -1
  243. package/dist/react-native/ClientContext.d.ts.map +1 -1
  244. package/dist/react-native/ClientContext.js +110 -19
  245. package/dist/react-native/ClientContext.js.map +1 -1
  246. package/dist/react-native/CosmosClient.d.ts +13 -0
  247. package/dist/react-native/CosmosClient.d.ts.map +1 -1
  248. package/dist/react-native/CosmosClient.js +19 -3
  249. package/dist/react-native/CosmosClient.js.map +1 -1
  250. package/dist/react-native/CosmosClientOptions.d.ts.map +1 -1
  251. package/dist/react-native/CosmosClientOptions.js.map +1 -1
  252. package/dist/react-native/CosmosDiagnostics.d.ts +4 -0
  253. package/dist/react-native/CosmosDiagnostics.d.ts.map +1 -1
  254. package/dist/react-native/CosmosDiagnostics.js.map +1 -1
  255. package/dist/react-native/GlobalEndpointManagerOptions.d.ts +2 -0
  256. package/dist/react-native/GlobalEndpointManagerOptions.d.ts.map +1 -0
  257. package/dist/react-native/GlobalEndpointManagerOptions.js +2 -0
  258. package/dist/react-native/GlobalEndpointManagerOptions.js.map +1 -0
  259. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.d.ts.map +1 -1
  260. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js +3 -0
  261. package/dist/react-native/client/ChangeFeed/ChangeFeedForEpkRange.js.map +1 -1
  262. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.d.ts.map +1 -1
  263. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js +3 -0
  264. package/dist/react-native/client/ChangeFeed/ChangeFeedForPartitionKey.js.map +1 -1
  265. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts +5 -0
  266. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.d.ts.map +1 -1
  267. package/dist/react-native/client/ChangeFeed/ChangeFeedIteratorOptions.js.map +1 -1
  268. package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.d.ts +1 -0
  269. package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.d.ts.map +1 -1
  270. package/dist/react-native/client/ChangeFeed/InternalChangeFeedOptions.js.map +1 -1
  271. package/dist/react-native/client/ChangeFeed/changeFeedUtils.d.ts.map +1 -1
  272. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js +1 -0
  273. package/dist/react-native/client/ChangeFeed/changeFeedUtils.js.map +1 -1
  274. package/dist/react-native/client/Item/Items.d.ts.map +1 -1
  275. package/dist/react-native/client/Item/Items.js +5 -0
  276. package/dist/react-native/client/Item/Items.js.map +1 -1
  277. package/dist/react-native/common/constants.d.ts +4 -0
  278. package/dist/react-native/common/constants.d.ts.map +1 -1
  279. package/dist/react-native/common/constants.js +5 -1
  280. package/dist/react-native/common/constants.js.map +1 -1
  281. package/dist/react-native/common/helper.d.ts +6 -0
  282. package/dist/react-native/common/helper.d.ts.map +1 -1
  283. package/dist/react-native/common/helper.js +9 -1
  284. package/dist/react-native/common/helper.js.map +1 -1
  285. package/dist/react-native/common/platform.d.ts +1 -0
  286. package/dist/react-native/common/platform.d.ts.map +1 -1
  287. package/dist/react-native/common/platform.js +1 -3
  288. package/dist/react-native/common/platform.js.map +1 -1
  289. package/dist/react-native/diagnostics/DiagnosticNodeInternal.d.ts +1 -0
  290. package/dist/react-native/diagnostics/DiagnosticNodeInternal.d.ts.map +1 -1
  291. package/dist/react-native/diagnostics/DiagnosticNodeInternal.js.map +1 -1
  292. package/dist/react-native/documents/ConnectionPolicy.d.ts +10 -4
  293. package/dist/react-native/documents/ConnectionPolicy.d.ts.map +1 -1
  294. package/dist/react-native/documents/ConnectionPolicy.js +2 -2
  295. package/dist/react-native/documents/ConnectionPolicy.js.map +1 -1
  296. package/dist/react-native/documents/DatabaseAccount.d.ts +4 -0
  297. package/dist/react-native/documents/DatabaseAccount.d.ts.map +1 -1
  298. package/dist/react-native/documents/DatabaseAccount.js +9 -0
  299. package/dist/react-native/documents/DatabaseAccount.js.map +1 -1
  300. package/dist/react-native/globalEndpointManager.d.ts +8 -0
  301. package/dist/react-native/globalEndpointManager.d.ts.map +1 -1
  302. package/dist/react-native/globalEndpointManager.js +68 -6
  303. package/dist/react-native/globalEndpointManager.js.map +1 -1
  304. package/dist/react-native/globalPartitionEndpointManager.d.ts +0 -2
  305. package/dist/react-native/globalPartitionEndpointManager.d.ts.map +1 -1
  306. package/dist/react-native/globalPartitionEndpointManager.js +13 -9
  307. package/dist/react-native/globalPartitionEndpointManager.js.map +1 -1
  308. package/dist/react-native/request/RequestHandler.js +2 -2
  309. package/dist/react-native/request/RequestHandler.js.map +1 -1
  310. package/dist/react-native/request/SharedOptions.d.ts +5 -0
  311. package/dist/react-native/request/SharedOptions.d.ts.map +1 -1
  312. package/dist/react-native/request/SharedOptions.js.map +1 -1
  313. package/dist/react-native/retry/retryUtility.d.ts.map +1 -1
  314. package/dist/react-native/retry/retryUtility.js +17 -3
  315. package/dist/react-native/retry/retryUtility.js.map +1 -1
  316. package/dist/react-native/retry/timeoutFailoverRetryPolicy.d.ts +1 -2
  317. package/dist/react-native/retry/timeoutFailoverRetryPolicy.d.ts.map +1 -1
  318. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js +4 -4
  319. package/dist/react-native/retry/timeoutFailoverRetryPolicy.js.map +1 -1
  320. package/dist/react-native/utils/encode.d.ts +1 -1
  321. package/dist/react-native/utils/encode.d.ts.map +1 -1
  322. package/dist/react-native/utils/encode.js.map +1 -1
  323. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"RequestHandler.js","sourceRoot":"","sources":["../../../src/request/RequestHandler.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,kEAAqF;AACrF,iDAA+D;AAC/D,yDAAiE;AACjE,oDAAgE;AAChE,+EAAyD;AACzD,uDAAwE;AACxE,yDAAmD;AACnD,6CAA4C;AAG5C,uDAAiD;AACjD,8DAAsE;AAEtE,0CAAmD;AAEnD,wFAA8E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AED;;GAEG;AACH,KAAK,UAAU,OAAO,CACpB,cAA8B,EAC9B,cAAsC;IAEtC,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;QACxB,cAAc,CAAC,IAAI,GAAG,IAAA,yBAAY,EAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IAED,OAAO,IAAA,mCAAkB,EACvB,KAAK,EAAE,SAAiC,EAAE,EAAE;QAC1C,OAAO,YAAY,CAAC,OAAO,CAAC;YAC1B,cAAc,EAAE,SAAS;YACzB,cAAc;YACd,cAAc;SACf,CAAC,CAAC;IACL,CAAC,EACD,cAAc,EACd,8CAAkB,CAAC,gBAAgB,CACpC,CAAC;AACJ,CAAC;AAEY,QAAA,cAAc,GAAG;IAC5B,OAAO;CACR,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { createPipelineRequest, createHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { isReadRequest, prepareURL } from \"../common/index.js\";\nimport { Constants, ResourceType } from \"../common/constants.js\";\nimport { executePlugins, PluginOn } from \"../plugins/Plugin.js\";\nimport * as RetryUtility from \"../retry/retryUtility.js\";\nimport { defaultHttpAgent, defaultHttpsAgent } from \"./defaultAgent.js\";\nimport { ErrorResponse } from \"./ErrorResponse.js\";\nimport { bodyFromData } from \"./request.js\";\nimport type { RequestContext } from \"./RequestContext.js\";\nimport type { Response as CosmosResponse } from \"./Response.js\";\nimport { TimeoutError } from \"./TimeoutError.js\";\nimport { getCachedDefaultHttpClient } from \"../utils/cachedClient.js\";\nimport type { AzureLogger } from \"@azure/logger\";\nimport { createClientLogger } from \"@azure/logger\";\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { DiagnosticNodeType } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { addDiagnosticChild } from \"../utils/diagnostics.js\";\nimport { getCurrentTimestampInMs } from \"../utils/time.js\";\n\nconst logger: AzureLogger = createClientLogger(\"RequestHandler\");\n\nasync function executeRequest(\n diagnosticNode: DiagnosticNodeInternal,\n requestContext: RequestContext,\n): Promise<CosmosResponse<any>> {\n return executePlugins(diagnosticNode, requestContext, httpRequest, PluginOn.request);\n}\n\n/**\n * @hidden\n */\nasync function httpRequest(\n requestContext: RequestContext,\n diagnosticNode: DiagnosticNodeInternal,\n): Promise<{\n headers: any;\n result: any;\n code: number;\n substatus: number;\n}> {\n const controller = new AbortController();\n const signal = controller.signal;\n\n // Wrap users passed abort events and call our own internal abort()\n const userSignal = requestContext.options && requestContext.options.abortSignal;\n if (userSignal) {\n if (userSignal.aborted) {\n controller.abort();\n } else {\n userSignal.addEventListener(\"abort\", () => {\n controller.abort();\n });\n }\n }\n\n let requestTimeout = requestContext.connectionPolicy.requestTimeout;\n // If the request is a read request and partition level failover or circuit breaker is enabled,\n // set a shorter timeout to allow for quicker failover in case of partition unavailability.\n // This is to ensure that read requests can quickly failover to another partition if the current one is unavailable.\n if (\n (requestContext.connectionPolicy.enablePartitionLevelFailover ||\n requestContext.connectionPolicy.enablePartitionLevelCircuitBreaker) &&\n requestContext.partitionKeyRangeId &&\n requestContext.resourceType === ResourceType.item &&\n isReadRequest(requestContext.operationType)\n ) {\n requestTimeout = Math.min(\n requestContext.connectionPolicy.requestTimeout,\n Constants.RequestTimeoutForReadsInMs,\n );\n }\n const timeout = setTimeout(() => {\n controller.abort();\n }, requestTimeout);\n\n let response: PipelineResponse;\n\n if (requestContext.body) {\n requestContext.body = bodyFromData(requestContext.body);\n }\n\n const httpsClient = requestContext.httpClient ?? getCachedDefaultHttpClient();\n const url = prepareURL(requestContext.endpoint, requestContext.path);\n const reqHeaders = createHttpHeaders(requestContext.headers as any);\n const pipelineRequest = createPipelineRequest({\n url,\n headers: reqHeaders,\n method: requestContext.method,\n abortSignal: signal,\n body: requestContext.body,\n });\n if (requestContext.requestAgent) {\n pipelineRequest.agent = requestContext.requestAgent;\n } else {\n const parsedUrl = new URL(url);\n pipelineRequest.agent = parsedUrl.protocol === \"http:\" ? defaultHttpAgent : defaultHttpsAgent;\n pipelineRequest.allowInsecureConnection = parsedUrl.protocol === \"http:\";\n }\n\n const startTimeUTCInMs = getCurrentTimestampInMs();\n try {\n if (requestContext.pipeline) {\n response = await requestContext.pipeline.sendRequest(httpsClient, pipelineRequest);\n } else {\n response = await httpsClient.sendRequest(pipelineRequest);\n }\n } catch (error: any) {\n if (error.name === \"AbortError\") {\n // If the user passed signal caused the abort, cancel the timeout and rethrow the error\n if (userSignal && userSignal.aborted === true) {\n clearTimeout(timeout);\n throw error;\n }\n throw new TimeoutError(\n `Timeout Error! Request took more than ${requestContext.connectionPolicy.requestTimeout} ms`,\n );\n }\n throw error;\n }\n\n clearTimeout(timeout);\n const result =\n response.status === 204 || response.status === 304 || response.bodyAsText === \"\"\n ? null\n : JSON.parse(response.bodyAsText);\n const responseHeaders = response.headers.toJSON();\n\n const substatus = responseHeaders[Constants.HttpHeaders.SubStatus]\n ? parseInt(responseHeaders[Constants.HttpHeaders.SubStatus], 10)\n : undefined;\n\n diagnosticNode.recordSuccessfulNetworkCall(\n startTimeUTCInMs,\n requestContext,\n response,\n substatus,\n url,\n );\n\n if (response.status >= 400) {\n const errorResponse: ErrorResponse = new ErrorResponse(result.message);\n logger.warning(\n response.status +\n \" \" +\n requestContext.endpoint +\n \" \" +\n requestContext.path +\n \" \" +\n result.message,\n );\n\n errorResponse.code = response.status;\n errorResponse.body = result;\n errorResponse.headers = responseHeaders;\n\n if (Constants.HttpHeaders.ActivityId in responseHeaders) {\n errorResponse.activityId = responseHeaders[Constants.HttpHeaders.ActivityId];\n }\n\n if (Constants.HttpHeaders.SubStatus in responseHeaders) {\n errorResponse.substatus = substatus;\n }\n\n if (Constants.HttpHeaders.RetryAfterInMs in responseHeaders) {\n errorResponse.retryAfterInMs = parseInt(\n responseHeaders[Constants.HttpHeaders.RetryAfterInMs],\n 10,\n );\n Object.defineProperty(errorResponse, \"retryAfterInMilliseconds\", {\n get: () => {\n return errorResponse.retryAfterInMs;\n },\n });\n }\n\n throw errorResponse;\n }\n return {\n headers: responseHeaders,\n result,\n code: response.status,\n substatus,\n };\n}\n\n/**\n * @hidden\n */\nasync function request<T>(\n requestContext: RequestContext,\n diagnosticNode: DiagnosticNodeInternal,\n): Promise<CosmosResponse<T>> {\n if (requestContext.body) {\n requestContext.body = bodyFromData(requestContext.body);\n if (!requestContext.body) {\n throw new Error(\"parameter data must be a javascript object, string, or Buffer\");\n }\n }\n\n return addDiagnosticChild(\n async (childNode: DiagnosticNodeInternal) => {\n return RetryUtility.execute({\n diagnosticNode: childNode,\n requestContext,\n executeRequest,\n });\n },\n diagnosticNode,\n DiagnosticNodeType.REQUEST_ATTEMPTS,\n );\n}\n\nexport const RequestHandler = {\n request,\n};\n"]}
1
+ {"version":3,"file":"RequestHandler.js","sourceRoot":"","sources":["../../../src/request/RequestHandler.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAGlC,kEAAqF;AACrF,iDAA+D;AAC/D,yDAAiE;AACjE,oDAAgE;AAChE,+EAAyD;AACzD,uDAAwE;AACxE,yDAAmD;AACnD,6CAA4C;AAG5C,uDAAiD;AACjD,8DAAsE;AAEtE,0CAAmD;AAEnD,wFAA8E;AAC9E,4DAA6D;AAC7D,8CAA2D;AAE3D,MAAM,MAAM,GAAgB,IAAA,2BAAkB,EAAC,gBAAgB,CAAC,CAAC;AAEjE,KAAK,UAAU,cAAc,CAC3B,cAAsC,EACtC,cAA8B;IAE9B,OAAO,IAAA,0BAAc,EAAC,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAQ,CAAC,OAAO,CAAC,CAAC;AACvF,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,WAAW,CACxB,cAA8B,EAC9B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A,mCAAkB,EACvB,KAAK,EAAE,SAAiC,EAAE,EAAE;QAC1C,OAAO,YAAY,CAAC,OAAO,CAAC;YAC1B,cAAc,EAAE,SAAS;YACzB,cAAc;YACd,cAAc;SACf,CAAC,CAAC;IACL,CAAC,EACD,cAAc,EACd,8CAAkB,CAAC,gBAAgB,CACpC,CAAC;AACJ,CAAC;AAEY,QAAA,cAAc,GAAG;IAC5B,OAAO;CACR,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { createPipelineRequest, createHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport { isReadRequest, prepareURL } from \"../common/index.js\";\nimport { Constants, ResourceType } from \"../common/constants.js\";\nimport { executePlugins, PluginOn } from \"../plugins/Plugin.js\";\nimport * as RetryUtility from \"../retry/retryUtility.js\";\nimport { defaultHttpAgent, defaultHttpsAgent } from \"./defaultAgent.js\";\nimport { ErrorResponse } from \"./ErrorResponse.js\";\nimport { bodyFromData } from \"./request.js\";\nimport type { RequestContext } from \"./RequestContext.js\";\nimport type { Response as CosmosResponse } from \"./Response.js\";\nimport { TimeoutError } from \"./TimeoutError.js\";\nimport { getCachedDefaultHttpClient } from \"../utils/cachedClient.js\";\nimport type { AzureLogger } from \"@azure/logger\";\nimport { createClientLogger } from \"@azure/logger\";\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { DiagnosticNodeType } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { addDiagnosticChild } from \"../utils/diagnostics.js\";\nimport { getCurrentTimestampInMs } from \"../utils/time.js\";\n\nconst logger: AzureLogger = createClientLogger(\"RequestHandler\");\n\nasync function executeRequest(\n diagnosticNode: DiagnosticNodeInternal,\n requestContext: RequestContext,\n): Promise<CosmosResponse<any>> {\n return executePlugins(diagnosticNode, requestContext, httpRequest, PluginOn.request);\n}\n\n/**\n * @hidden\n */\nasync function httpRequest(\n requestContext: RequestContext,\n diagnosticNode: DiagnosticNodeInternal,\n): Promise<{\n headers: any;\n result: any;\n code: number;\n substatus: number;\n}> {\n const controller = new AbortController();\n const signal = controller.signal;\n\n // Wrap users passed abort events and call our own internal abort()\n const userSignal = requestContext.options && requestContext.options.abortSignal;\n if (userSignal) {\n if (userSignal.aborted) {\n controller.abort();\n } else {\n userSignal.addEventListener(\"abort\", () => {\n controller.abort();\n });\n }\n }\n\n let requestTimeout = requestContext.connectionPolicy.requestTimeout;\n // If the request is a read request and partition level failover or circuit breaker is enabled,\n // set a shorter timeout to allow for quicker failover in case of partition unavailability.\n // This is to ensure that read requests can quickly failover to another partition if the current one is unavailable.\n if (\n (requestContext.globalEndpointManager.enablePartitionLevelFailover ||\n requestContext.globalEndpointManager.enablePartitionLevelCircuitBreaker) &&\n requestContext.partitionKeyRangeId &&\n requestContext.resourceType === ResourceType.item &&\n isReadRequest(requestContext.operationType)\n ) {\n requestTimeout = Math.min(\n requestContext.connectionPolicy.requestTimeout,\n Constants.RequestTimeoutForReadsInMs,\n );\n }\n const timeout = setTimeout(() => {\n controller.abort();\n }, requestTimeout);\n\n let response: PipelineResponse;\n\n if (requestContext.body) {\n requestContext.body = bodyFromData(requestContext.body);\n }\n\n const httpsClient = requestContext.httpClient ?? getCachedDefaultHttpClient();\n const url = prepareURL(requestContext.endpoint, requestContext.path);\n const reqHeaders = createHttpHeaders(requestContext.headers as any);\n const pipelineRequest = createPipelineRequest({\n url,\n headers: reqHeaders,\n method: requestContext.method,\n abortSignal: signal,\n body: requestContext.body,\n });\n if (requestContext.requestAgent) {\n pipelineRequest.agent = requestContext.requestAgent;\n } else {\n const parsedUrl = new URL(url);\n pipelineRequest.agent = parsedUrl.protocol === \"http:\" ? defaultHttpAgent : defaultHttpsAgent;\n pipelineRequest.allowInsecureConnection = parsedUrl.protocol === \"http:\";\n }\n\n const startTimeUTCInMs = getCurrentTimestampInMs();\n try {\n if (requestContext.pipeline) {\n response = await requestContext.pipeline.sendRequest(httpsClient, pipelineRequest);\n } else {\n response = await httpsClient.sendRequest(pipelineRequest);\n }\n } catch (error: any) {\n if (error.name === \"AbortError\") {\n // If the user passed signal caused the abort, cancel the timeout and rethrow the error\n if (userSignal && userSignal.aborted === true) {\n clearTimeout(timeout);\n throw error;\n }\n throw new TimeoutError(\n `Timeout Error! Request took more than ${requestContext.connectionPolicy.requestTimeout} ms`,\n );\n }\n throw error;\n }\n\n clearTimeout(timeout);\n const result =\n response.status === 204 || response.status === 304 || response.bodyAsText === \"\"\n ? null\n : JSON.parse(response.bodyAsText);\n const responseHeaders = response.headers.toJSON();\n\n const substatus = responseHeaders[Constants.HttpHeaders.SubStatus]\n ? parseInt(responseHeaders[Constants.HttpHeaders.SubStatus], 10)\n : undefined;\n\n diagnosticNode.recordSuccessfulNetworkCall(\n startTimeUTCInMs,\n requestContext,\n response,\n substatus,\n url,\n );\n\n if (response.status >= 400) {\n const errorResponse: ErrorResponse = new ErrorResponse(result.message);\n logger.warning(\n response.status +\n \" \" +\n requestContext.endpoint +\n \" \" +\n requestContext.path +\n \" \" +\n result.message,\n );\n\n errorResponse.code = response.status;\n errorResponse.body = result;\n errorResponse.headers = responseHeaders;\n\n if (Constants.HttpHeaders.ActivityId in responseHeaders) {\n errorResponse.activityId = responseHeaders[Constants.HttpHeaders.ActivityId];\n }\n\n if (Constants.HttpHeaders.SubStatus in responseHeaders) {\n errorResponse.substatus = substatus;\n }\n\n if (Constants.HttpHeaders.RetryAfterInMs in responseHeaders) {\n errorResponse.retryAfterInMs = parseInt(\n responseHeaders[Constants.HttpHeaders.RetryAfterInMs],\n 10,\n );\n Object.defineProperty(errorResponse, \"retryAfterInMilliseconds\", {\n get: () => {\n return errorResponse.retryAfterInMs;\n },\n });\n }\n\n throw errorResponse;\n }\n return {\n headers: responseHeaders,\n result,\n code: response.status,\n substatus,\n };\n}\n\n/**\n * @hidden\n */\nasync function request<T>(\n requestContext: RequestContext,\n diagnosticNode: DiagnosticNodeInternal,\n): Promise<CosmosResponse<T>> {\n if (requestContext.body) {\n requestContext.body = bodyFromData(requestContext.body);\n if (!requestContext.body) {\n throw new Error(\"parameter data must be a javascript object, string, or Buffer\");\n }\n }\n\n return addDiagnosticChild(\n async (childNode: DiagnosticNodeInternal) => {\n return RetryUtility.execute({\n diagnosticNode: childNode,\n requestContext,\n executeRequest,\n });\n },\n diagnosticNode,\n DiagnosticNodeType.REQUEST_ATTEMPTS,\n );\n}\n\nexport const RequestHandler = {\n request,\n};\n"]}
@@ -67,5 +67,10 @@ export interface SharedOptions {
67
67
  * to serve the request if regular provisioned RUs/second is exhausted.
68
68
  */
69
69
  disableRUPerMinuteUsage?: boolean;
70
+ /**
71
+ * Excludes one or more Azure regions for the operation.
72
+ * <p>This option is only applied when enableEndPointDiscovery is set to true.</p>
73
+ */
74
+ excludedLocations?: string[];
70
75
  }
71
76
  //# sourceMappingURL=SharedOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SharedOptions.d.ts","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4GAA4G;IAC5G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;;;;;OASG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAEzC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC"}
1
+ {"version":3,"file":"SharedOptions.d.ts","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,4GAA4G;IAC5G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;;;;;;;;OASG;IACH,+BAA+B,CAAC,EAAE,MAAM,CAAC;IAEzC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SharedOptions.js","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"dom\" />\nimport type { PriorityLevel } from \"../documents/PriorityLevel.js\";\nimport type { CosmosHeaders } from \"../index.js\";\n\n/**\n * Options that can be specified for a requested issued to the Azure Cosmos DB servers.=\n */\nexport interface SharedOptions {\n /** Enables/disables getting document container quota related stats for document container read requests. */\n sessionToken?: string;\n /** (Advanced use case) Initial headers to start with when sending requests to Cosmos */\n initialHeaders?: CosmosHeaders;\n /**\n * abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController\n * @example Cancel a read request\n * ```ts snippet:SharedOptionsAbortSignal\n * import { CosmosClient } from \"@azure/cosmos\";\n *\n * const endpoint = \"https://your-account.documents.azure.com\";\n * const key = \"<database account masterkey>\";\n * const client = new CosmosClient({ endpoint, key });\n *\n * const { database } = await client.databases.createIfNotExists({ id: \"Test Database\" });\n *\n * const { container } = await database.containers.createIfNotExists({ id: \"Test Container\" });\n *\n * const controller = new AbortController();\n * const results = container.items.query(\"SELECT * from c\", {\n * abortSignal: controller.signal,\n * });\n * ```\n */\n abortSignal?: AbortSignal;\n /**\n * Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link\n * com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the\n * integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the\n * consistency level is not set, this property is ignored.\n *\n * <p>Default value is null</p>\n *\n * <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>\n */\n maxIntegratedCacheStalenessInMs?: number;\n\n /**\n * Sets if integrated cache should be bypassed or enabled for the request in Azure CosmosDB service.\n *\n * <p>Default value is false. By default integrated cache is enabled</p>\n */\n bypassIntegratedCache?: boolean;\n\n /**\n * Priority Level (Low/High) for each request.\n * Low priority requests are always throttled before any high priority requests.\n *\n * <p>Default value is null. By default all requests are of High priority</p>\n */\n priorityLevel?: PriorityLevel;\n\n /**\n * Throughput Bucket for a request.\n *\n * <p>Default value is null. In this case, the request can use 100% of the partition throughput. </p>\n * For more information, visit [Cosmos DB throughput Bucketing](https://aka.ms/cosmsodb-bucketing).\n */\n throughputBucket?: number;\n\n /** Consistency level required by the client. */\n consistencyLevel?: string;\n\n /**\n * DisableRUPerMinuteUsage is used to enable/disable Request Units(RUs)/minute capacity\n * to serve the request if regular provisioned RUs/second is exhausted.\n */\n disableRUPerMinuteUsage?: boolean;\n}\n"]}
1
+ {"version":3,"file":"SharedOptions.js","sourceRoot":"","sources":["../../../src/request/SharedOptions.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"dom\" />\nimport type { PriorityLevel } from \"../documents/PriorityLevel.js\";\nimport type { CosmosHeaders } from \"../index.js\";\n\n/**\n * Options that can be specified for a requested issued to the Azure Cosmos DB servers.=\n */\nexport interface SharedOptions {\n /** Enables/disables getting document container quota related stats for document container read requests. */\n sessionToken?: string;\n /** (Advanced use case) Initial headers to start with when sending requests to Cosmos */\n initialHeaders?: CosmosHeaders;\n /**\n * abortSignal to pass to all underlying network requests created by this method call. See https://developer.mozilla.org/en-US/docs/Web/API/AbortController\n * @example Cancel a read request\n * ```ts snippet:SharedOptionsAbortSignal\n * import { CosmosClient } from \"@azure/cosmos\";\n *\n * const endpoint = \"https://your-account.documents.azure.com\";\n * const key = \"<database account masterkey>\";\n * const client = new CosmosClient({ endpoint, key });\n *\n * const { database } = await client.databases.createIfNotExists({ id: \"Test Database\" });\n *\n * const { container } = await database.containers.createIfNotExists({ id: \"Test Container\" });\n *\n * const controller = new AbortController();\n * const results = container.items.query(\"SELECT * from c\", {\n * abortSignal: controller.signal,\n * });\n * ```\n */\n abortSignal?: AbortSignal;\n /**\n * Sets the staleness value associated with the request in the Azure CosmosDB service. For requests where the {@link\n * com.azure.cosmos.ConsistencyLevel} is {@link com.azure.cosmos.ConsistencyLevel#EVENTUAL} or {@link com.azure.cosmos.ConsistencyLevel#SESSION}, responses from the\n * integrated cache are guaranteed to be no staler than value indicated by this maxIntegratedCacheStaleness. When the\n * consistency level is not set, this property is ignored.\n *\n * <p>Default value is null</p>\n *\n * <p>Cache Staleness is supported in milliseconds granularity. Anything smaller than milliseconds will be ignored.</p>\n */\n maxIntegratedCacheStalenessInMs?: number;\n\n /**\n * Sets if integrated cache should be bypassed or enabled for the request in Azure CosmosDB service.\n *\n * <p>Default value is false. By default integrated cache is enabled</p>\n */\n bypassIntegratedCache?: boolean;\n\n /**\n * Priority Level (Low/High) for each request.\n * Low priority requests are always throttled before any high priority requests.\n *\n * <p>Default value is null. By default all requests are of High priority</p>\n */\n priorityLevel?: PriorityLevel;\n\n /**\n * Throughput Bucket for a request.\n *\n * <p>Default value is null. In this case, the request can use 100% of the partition throughput. </p>\n * For more information, visit [Cosmos DB throughput Bucketing](https://aka.ms/cosmsodb-bucketing).\n */\n throughputBucket?: number;\n\n /** Consistency level required by the client. */\n consistencyLevel?: string;\n\n /**\n * DisableRUPerMinuteUsage is used to enable/disable Request Units(RUs)/minute capacity\n * to serve the request if regular provisioned RUs/second is exhausted.\n */\n disableRUPerMinuteUsage?: boolean;\n\n /**\n * Excludes one or more Azure regions for the operation.\n * <p>This option is only applied when enableEndPointDiscovery is set to true.</p>\n */\n excludedLocations?: string[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"retryUtility.d.ts","sourceRoot":"","sources":["../../../src/retry/retryUtility.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAEvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,C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AAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E;;GAEG;AACH,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,EAAE,sBAAsB,CAAC;IACvC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,EAAE,CACd,cAAc,EAAE,sBAAsB,EACtC,cAAc,EAAE,cAAc,KAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,aAAa;IACrB,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,2BAA2B,EAAE,2BAA2B,CAAC;IACzD,sBAAsB,EAAE,kBAAkB,CAAC;IAC3C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,0BAA0B,EAAE,0BAA0B,CAAC;CACxD;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,EAC5B,cAAc,EACd,YAAgC,EAChC,aAAa,EACb,cAAc,EACd,cAAc,GACf,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAwJtC"}
@@ -28,7 +28,7 @@ async function execute({ diagnosticNode, retryContext = { retryCount: 0 }, retry
28
28
  resourceThrottleRetryPolicy: new resourceThrottleRetryPolicy_js_1.ResourceThrottleRetryPolicy(requestContext.connectionPolicy.retryOptions ?? {}),
29
29
  sessionReadRetryPolicy: new sessionRetryPolicy_js_1.SessionRetryPolicy(requestContext.globalEndpointManager, requestContext.resourceType, requestContext.operationType, requestContext.connectionPolicy),
30
30
  defaultRetryPolicy: new defaultRetryPolicy_js_1.DefaultRetryPolicy(requestContext.operationType),
31
- timeoutFailoverRetryPolicy: new timeoutFailoverRetryPolicy_js_1.TimeoutFailoverRetryPolicy(requestContext.globalEndpointManager, requestContext.headers, requestContext.method, requestContext.resourceType, requestContext.operationType, requestContext.connectionPolicy.enableEndpointDiscovery, requestContext.connectionPolicy.enablePartitionLevelFailover, requestContext.globalPartitionEndpointManager),
31
+ timeoutFailoverRetryPolicy: new timeoutFailoverRetryPolicy_js_1.TimeoutFailoverRetryPolicy(requestContext.globalEndpointManager, requestContext.headers, requestContext.method, requestContext.resourceType, requestContext.operationType, requestContext.connectionPolicy.enableEndpointDiscovery, requestContext.globalPartitionEndpointManager),
32
32
  };
33
33
  }
34
34
  if (retryContext && retryContext.clearSessionTokenNotAvailable) {
@@ -36,10 +36,24 @@ async function execute({ diagnosticNode, retryContext = { retryCount: 0 }, retry
36
36
  delete requestContext.headers["x-ms-session-token"];
37
37
  }
38
38
  if (retryContext && retryContext.retryLocationServerIndex) {
39
- requestContext.endpoint = await requestContext.globalEndpointManager.resolveServiceEndpoint(localDiagnosticNode, requestContext.resourceType, requestContext.operationType, retryContext.retryLocationServerIndex);
39
+ requestContext.endpoint =
40
+ await requestContext.globalEndpointManager.resolveServiceEndpointInternal({
41
+ diagnosticNode: localDiagnosticNode,
42
+ resourceType: requestContext.resourceType,
43
+ operationType: requestContext.operationType,
44
+ startServiceEndpointIndex: retryContext.retryLocationServerIndex,
45
+ excludedLocations: requestContext.options?.excludedLocations,
46
+ });
40
47
  }
41
48
  else {
42
- requestContext.endpoint = await requestContext.globalEndpointManager.resolveServiceEndpoint(localDiagnosticNode, requestContext.resourceType, requestContext.operationType);
49
+ requestContext.endpoint =
50
+ await requestContext.globalEndpointManager.resolveServiceEndpointInternal({
51
+ diagnosticNode: localDiagnosticNode,
52
+ resourceType: requestContext.resourceType,
53
+ operationType: requestContext.operationType,
54
+ startServiceEndpointIndex: 0,
55
+ excludedLocations: requestContext.options?.excludedLocations,
56
+ });
43
57
  }
44
58
  const startTimeUTCInMs = (0, time_js_1.getCurrentTimestampInMs)();
45
59
  const correlatedActivityId = requestContext.headers[constants_js_1.Constants.HttpHeaders.CorrelatedActivityId];
@@ -1 +1 @@
1
- {"version":3,"file":"retryUtility.js","sourceRoot":"","sources":["../../../src/retry/retryUtility.ts"],"names":[],"mapp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oBACb,cAAc;oBACd,cAAc;oBACd,cAAc;oBACd,YAAY;oBACZ,aAAa;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC,EACD,cAAc,EACd,8CAAkB,CAAC,YAAY,CAChC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,cAA8B;IACnD,OAAO,CACL,cAAc,CAAC,aAAa,KAAK,OAAO;QACxC,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAC7D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Constants } from \"../common/constants.js\";\nimport { sleep } from \"../common/helper.js\";\nimport { StatusCodes, SubStatusCodes } from \"../common/statusCodes.js\";\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { DiagnosticNodeType } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../request/index.js\";\nimport type { RequestContext } from \"../request/RequestContext.js\";\nimport { TimeoutErrorCode } from \"../request/TimeoutError.js\";\nimport { addDiagnosticChild } from \"../utils/diagnostics.js\";\nimport { getCurrentTimestampInMs } from \"../utils/time.js\";\nimport { DefaultRetryPolicy } from \"./defaultRetryPolicy.js\";\nimport { EndpointDiscoveryRetryPolicy } from \"./endpointDiscoveryRetryPolicy.js\";\nimport { ResourceThrottleRetryPolicy } from \"./resourceThrottleRetryPolicy.js\";\nimport type { RetryContext } from \"./RetryContext.js\";\nimport type { RetryPolicy } from \"./RetryPolicy.js\";\nimport { SessionRetryPolicy } from \"./sessionRetryPolicy.js\";\nimport { TimeoutFailoverRetryPolicy } from \"./timeoutFailoverRetryPolicy.js\";\n\n/**\n * @hidden\n */\ninterface ExecuteArgs {\n retryContext?: RetryContext;\n diagnosticNode: DiagnosticNodeInternal;\n retryPolicies?: RetryPolicies;\n requestContext: RequestContext;\n executeRequest: (\n diagnosticNode: DiagnosticNodeInternal,\n requestContext: RequestContext,\n ) => Promise<Response<any>>;\n}\n\n/**\n * @hidden\n */\ninterface RetryPolicies {\n endpointDiscoveryRetryPolicy: EndpointDiscoveryRetryPolicy;\n resourceThrottleRetryPolicy: ResourceThrottleRetryPolicy;\n sessionReadRetryPolicy: SessionRetryPolicy;\n defaultRetryPolicy: DefaultRetryPolicy;\n timeoutFailoverRetryPolicy: TimeoutFailoverRetryPolicy;\n}\n\n/**\n * @hidden\n */\nexport async function execute({\n diagnosticNode,\n retryContext = { retryCount: 0 },\n retryPolicies,\n requestContext,\n executeRequest,\n}: ExecuteArgs): Promise<Response<any>> {\n // TODO: any response\n return addDiagnosticChild(\n async (localDiagnosticNode: DiagnosticNodeInternal) => {\n localDiagnosticNode.addData({ requestAttempNumber: retryContext.retryCount });\n if (!retryPolicies) {\n retryPolicies = {\n endpointDiscoveryRetryPolicy: new EndpointDiscoveryRetryPolicy(\n requestContext.globalEndpointManager,\n requestContext.resourceType,\n requestContext.operationType,\n requestContext.globalPartitionEndpointManager,\n ),\n resourceThrottleRetryPolicy: new ResourceThrottleRetryPolicy(\n requestContext.connectionPolicy.retryOptions ?? {},\n ),\n sessionReadRetryPolicy: new SessionRetryPolicy(\n requestContext.globalEndpointManager,\n requestContext.resourceType,\n requestContext.operationType,\n requestContext.connectionPolicy,\n ),\n defaultRetryPolicy: new DefaultRetryPolicy(requestContext.operationType),\n timeoutFailoverRetryPolicy: new TimeoutFailoverRetryPolicy(\n requestContext.globalEndpointManager,\n requestContext.headers,\n requestContext.method,\n requestContext.resourceType,\n requestContext.operationType,\n requestContext.connectionPolicy.enableEndpointDiscovery,\n requestContext.connectionPolicy.enablePartitionLevelFailover,\n requestContext.globalPartitionEndpointManager,\n ),\n };\n }\n if (retryContext && retryContext.clearSessionTokenNotAvailable) {\n requestContext.client.clearSessionToken(requestContext.path);\n delete requestContext.headers[\"x-ms-session-token\"];\n }\n if (retryContext && retryContext.retryLocationServerIndex) {\n requestContext.endpoint = await requestContext.globalEndpointManager.resolveServiceEndpoint(\n localDiagnosticNode,\n requestContext.resourceType,\n requestContext.operationType,\n retryContext.retryLocationServerIndex,\n );\n } else {\n requestContext.endpoint = await requestContext.globalEndpointManager.resolveServiceEndpoint(\n localDiagnosticNode,\n requestContext.resourceType,\n requestContext.operationType,\n );\n }\n const startTimeUTCInMs = getCurrentTimestampInMs();\n const correlatedActivityId =\n requestContext.headers[Constants.HttpHeaders.CorrelatedActivityId];\n\n if (requestContext.globalPartitionEndpointManager) {\n // Try partition level location override\n // This is used to override the partition level location for the request\n // if there has been a partition level failover\n requestContext =\n await requestContext.globalPartitionEndpointManager.tryAddPartitionLevelLocationOverride(\n requestContext,\n localDiagnosticNode,\n );\n }\n\n try {\n const response = await executeRequest(localDiagnosticNode, requestContext);\n response.headers[Constants.ThrottleRetryCount] =\n retryPolicies.resourceThrottleRetryPolicy.currentRetryAttemptCount;\n response.headers[Constants.ThrottleRetryWaitTimeInMs] =\n retryPolicies.resourceThrottleRetryPolicy.cummulativeWaitTimeinMs;\n if (correlatedActivityId) {\n response.headers[Constants.HttpHeaders.CorrelatedActivityId] = correlatedActivityId;\n }\n return response;\n } catch (err: any) {\n // TODO: any error\n let retryPolicy: RetryPolicy = null;\n const headers = err.headers || {};\n if (correlatedActivityId) {\n headers[Constants.HttpHeaders.CorrelatedActivityId] = correlatedActivityId;\n }\n\n if (\n err.code === StatusCodes.ENOTFOUND ||\n err.code === \"REQUEST_SEND_ERROR\" ||\n (err.code === StatusCodes.Forbidden &&\n (err.substatus === SubStatusCodes.DatabaseAccountNotFound ||\n err.substatus === SubStatusCodes.WriteForbidden))\n ) {\n retryPolicy = retryPolicies.endpointDiscoveryRetryPolicy;\n } else if (err.code === StatusCodes.TooManyRequests && !isBulkRequest(requestContext)) {\n retryPolicy = retryPolicies.resourceThrottleRetryPolicy;\n } else if (\n err.code === StatusCodes.NotFound &&\n err.substatus === SubStatusCodes.ReadSessionNotAvailable\n ) {\n retryPolicy = retryPolicies.sessionReadRetryPolicy;\n } else if (err.code === StatusCodes.ServiceUnavailable || err.code === TimeoutErrorCode) {\n retryPolicy = retryPolicies.timeoutFailoverRetryPolicy;\n } else {\n retryPolicy = retryPolicies.defaultRetryPolicy;\n }\n const results = await retryPolicy.shouldRetry(\n err,\n localDiagnosticNode,\n retryContext,\n requestContext.endpoint,\n requestContext,\n );\n if (!results) {\n headers[Constants.ThrottleRetryCount] =\n retryPolicies.resourceThrottleRetryPolicy.currentRetryAttemptCount;\n headers[Constants.ThrottleRetryWaitTimeInMs] =\n retryPolicies.resourceThrottleRetryPolicy.cummulativeWaitTimeinMs;\n err.headers = { ...err.headers, ...headers };\n throw err;\n } else {\n requestContext.retryCount++;\n const newUrl = (results as any)[1]; // TODO: any hack\n if (newUrl !== undefined) {\n requestContext.endpoint = newUrl;\n }\n localDiagnosticNode.recordFailedNetworkCall(\n startTimeUTCInMs,\n requestContext,\n retryContext.retryCount,\n err.code,\n err.subsstatusCode,\n headers,\n );\n await sleep(retryPolicy.retryAfterInMs);\n return execute({\n diagnosticNode,\n executeRequest,\n requestContext,\n retryContext,\n retryPolicies,\n });\n }\n }\n },\n diagnosticNode,\n DiagnosticNodeType.HTTP_REQUEST,\n );\n}\n\n/**\n * @hidden\n */\nfunction isBulkRequest(requestContext: RequestContext): boolean {\n return (\n requestContext.operationType === \"batch\" &&\n !requestContext.headers[Constants.HttpHeaders.IsBatchAtomic]\n );\n}\n"]}
1
+ {"version":3,"file":"retryUtility.js","sourceRoot":"","sources":["../../../src/retry/retryUtility.ts"],"names":[],"mappings":";;AAgDA,0BA8JC;AA9MD,uCAAuC;AACvC,kCAAkC;AAClC,yDAAmD;AACnD,mDAA4C;AAC5C,6DAAuE;AAEvE,wFAA8E;AAG9E,gEAA8D;AAC9D,4DAA6D;AAC7D,8CAA2D;AAC3D,mEAA6D;AAC7D,uFAAiF;AACjF,qFAA+E;AAG/E,mEAA6D;AAC7D,mFAA6E;AA2B7E;;GAEG;AACI,KAAK,UAAU,OAAO,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AAa;iBACd,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC,EACD,cAAc,EACd,8CAAkB,CAAC,YAAY,CAChC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,cAA8B;IACnD,OAAO,CACL,cAAc,CAAC,aAAa,KAAK,OAAO;QACxC,CAAC,cAAc,CAAC,OAAO,CAAC,wBAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAC7D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Constants } from \"../common/constants.js\";\nimport { sleep } from \"../common/helper.js\";\nimport { StatusCodes, SubStatusCodes } from \"../common/statusCodes.js\";\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { DiagnosticNodeType } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport type { Response } from \"../request/index.js\";\nimport type { RequestContext } from \"../request/RequestContext.js\";\nimport { TimeoutErrorCode } from \"../request/TimeoutError.js\";\nimport { addDiagnosticChild } from \"../utils/diagnostics.js\";\nimport { getCurrentTimestampInMs } from \"../utils/time.js\";\nimport { DefaultRetryPolicy } from \"./defaultRetryPolicy.js\";\nimport { EndpointDiscoveryRetryPolicy } from \"./endpointDiscoveryRetryPolicy.js\";\nimport { ResourceThrottleRetryPolicy } from \"./resourceThrottleRetryPolicy.js\";\nimport type { RetryContext } from \"./RetryContext.js\";\nimport type { RetryPolicy } from \"./RetryPolicy.js\";\nimport { SessionRetryPolicy } from \"./sessionRetryPolicy.js\";\nimport { TimeoutFailoverRetryPolicy } from \"./timeoutFailoverRetryPolicy.js\";\n\n/**\n * @hidden\n */\ninterface ExecuteArgs {\n retryContext?: RetryContext;\n diagnosticNode: DiagnosticNodeInternal;\n retryPolicies?: RetryPolicies;\n requestContext: RequestContext;\n executeRequest: (\n diagnosticNode: DiagnosticNodeInternal,\n requestContext: RequestContext,\n ) => Promise<Response<any>>;\n}\n\n/**\n * @hidden\n */\ninterface RetryPolicies {\n endpointDiscoveryRetryPolicy: EndpointDiscoveryRetryPolicy;\n resourceThrottleRetryPolicy: ResourceThrottleRetryPolicy;\n sessionReadRetryPolicy: SessionRetryPolicy;\n defaultRetryPolicy: DefaultRetryPolicy;\n timeoutFailoverRetryPolicy: TimeoutFailoverRetryPolicy;\n}\n\n/**\n * @hidden\n */\nexport async function execute({\n diagnosticNode,\n retryContext = { retryCount: 0 },\n retryPolicies,\n requestContext,\n executeRequest,\n}: ExecuteArgs): Promise<Response<any>> {\n // TODO: any response\n return addDiagnosticChild(\n async (localDiagnosticNode: DiagnosticNodeInternal) => {\n localDiagnosticNode.addData({ requestAttempNumber: retryContext.retryCount });\n if (!retryPolicies) {\n retryPolicies = {\n endpointDiscoveryRetryPolicy: new EndpointDiscoveryRetryPolicy(\n requestContext.globalEndpointManager,\n requestContext.resourceType,\n requestContext.operationType,\n requestContext.globalPartitionEndpointManager,\n ),\n resourceThrottleRetryPolicy: new ResourceThrottleRetryPolicy(\n requestContext.connectionPolicy.retryOptions ?? {},\n ),\n sessionReadRetryPolicy: new SessionRetryPolicy(\n requestContext.globalEndpointManager,\n requestContext.resourceType,\n requestContext.operationType,\n requestContext.connectionPolicy,\n ),\n defaultRetryPolicy: new DefaultRetryPolicy(requestContext.operationType),\n timeoutFailoverRetryPolicy: new TimeoutFailoverRetryPolicy(\n requestContext.globalEndpointManager,\n requestContext.headers,\n requestContext.method,\n requestContext.resourceType,\n requestContext.operationType,\n requestContext.connectionPolicy.enableEndpointDiscovery,\n requestContext.globalPartitionEndpointManager,\n ),\n };\n }\n if (retryContext && retryContext.clearSessionTokenNotAvailable) {\n requestContext.client.clearSessionToken(requestContext.path);\n delete requestContext.headers[\"x-ms-session-token\"];\n }\n if (retryContext && retryContext.retryLocationServerIndex) {\n requestContext.endpoint =\n await requestContext.globalEndpointManager.resolveServiceEndpointInternal({\n diagnosticNode: localDiagnosticNode,\n resourceType: requestContext.resourceType,\n operationType: requestContext.operationType,\n startServiceEndpointIndex: retryContext.retryLocationServerIndex,\n excludedLocations: requestContext.options?.excludedLocations,\n });\n } else {\n requestContext.endpoint =\n await requestContext.globalEndpointManager.resolveServiceEndpointInternal({\n diagnosticNode: localDiagnosticNode,\n resourceType: requestContext.resourceType,\n operationType: requestContext.operationType,\n startServiceEndpointIndex: 0,\n excludedLocations: requestContext.options?.excludedLocations,\n });\n }\n const startTimeUTCInMs = getCurrentTimestampInMs();\n const correlatedActivityId =\n requestContext.headers[Constants.HttpHeaders.CorrelatedActivityId];\n\n if (requestContext.globalPartitionEndpointManager) {\n // Try partition level location override\n // This is used to override the partition level location for the request\n // if there has been a partition level failover\n requestContext =\n await requestContext.globalPartitionEndpointManager.tryAddPartitionLevelLocationOverride(\n requestContext,\n localDiagnosticNode,\n );\n }\n\n try {\n const response = await executeRequest(localDiagnosticNode, requestContext);\n response.headers[Constants.ThrottleRetryCount] =\n retryPolicies.resourceThrottleRetryPolicy.currentRetryAttemptCount;\n response.headers[Constants.ThrottleRetryWaitTimeInMs] =\n retryPolicies.resourceThrottleRetryPolicy.cummulativeWaitTimeinMs;\n if (correlatedActivityId) {\n response.headers[Constants.HttpHeaders.CorrelatedActivityId] = correlatedActivityId;\n }\n return response;\n } catch (err: any) {\n // TODO: any error\n let retryPolicy: RetryPolicy = null;\n const headers = err.headers || {};\n if (correlatedActivityId) {\n headers[Constants.HttpHeaders.CorrelatedActivityId] = correlatedActivityId;\n }\n\n if (\n err.code === StatusCodes.ENOTFOUND ||\n err.code === \"REQUEST_SEND_ERROR\" ||\n (err.code === StatusCodes.Forbidden &&\n (err.substatus === SubStatusCodes.DatabaseAccountNotFound ||\n err.substatus === SubStatusCodes.WriteForbidden))\n ) {\n retryPolicy = retryPolicies.endpointDiscoveryRetryPolicy;\n } else if (err.code === StatusCodes.TooManyRequests && !isBulkRequest(requestContext)) {\n retryPolicy = retryPolicies.resourceThrottleRetryPolicy;\n } else if (\n err.code === StatusCodes.NotFound &&\n err.substatus === SubStatusCodes.ReadSessionNotAvailable\n ) {\n retryPolicy = retryPolicies.sessionReadRetryPolicy;\n } else if (err.code === StatusCodes.ServiceUnavailable || err.code === TimeoutErrorCode) {\n retryPolicy = retryPolicies.timeoutFailoverRetryPolicy;\n } else {\n retryPolicy = retryPolicies.defaultRetryPolicy;\n }\n const results = await retryPolicy.shouldRetry(\n err,\n localDiagnosticNode,\n retryContext,\n requestContext.endpoint,\n requestContext,\n );\n if (!results) {\n headers[Constants.ThrottleRetryCount] =\n retryPolicies.resourceThrottleRetryPolicy.currentRetryAttemptCount;\n headers[Constants.ThrottleRetryWaitTimeInMs] =\n retryPolicies.resourceThrottleRetryPolicy.cummulativeWaitTimeinMs;\n err.headers = { ...err.headers, ...headers };\n throw err;\n } else {\n requestContext.retryCount++;\n const newUrl = (results as any)[1]; // TODO: any hack\n if (newUrl !== undefined) {\n requestContext.endpoint = newUrl;\n }\n localDiagnosticNode.recordFailedNetworkCall(\n startTimeUTCInMs,\n requestContext,\n retryContext.retryCount,\n err.code,\n err.subsstatusCode,\n headers,\n );\n await sleep(retryPolicy.retryAfterInMs);\n return execute({\n diagnosticNode,\n executeRequest,\n requestContext,\n retryContext,\n retryPolicies,\n });\n }\n }\n },\n diagnosticNode,\n DiagnosticNodeType.HTTP_REQUEST,\n );\n}\n\n/**\n * @hidden\n */\nfunction isBulkRequest(requestContext: RequestContext): boolean {\n return (\n requestContext.operationType === \"batch\" &&\n !requestContext.headers[Constants.HttpHeaders.IsBatchAtomic]\n );\n}\n"]}
@@ -21,7 +21,6 @@ export declare class TimeoutFailoverRetryPolicy implements RetryPolicy {
21
21
  private resourceType;
22
22
  private operationType;
23
23
  private enableEndPointDiscovery;
24
- private enablePartitionLevelFailover;
25
24
  private globalPartitionEndpointManager?;
26
25
  private maxRetryAttemptCount;
27
26
  private maxServiceUnavailableRetryCount;
@@ -29,7 +28,7 @@ export declare class TimeoutFailoverRetryPolicy implements RetryPolicy {
29
28
  failoverRetryCount: number;
30
29
  request: any;
31
30
  locationEndpoint: any;
32
- constructor(globalEndpointManager: GlobalEndpointManager, headers: CosmosHeaders, methodType: HTTPMethod, resourceType: ResourceType, operationType: OperationType, enableEndPointDiscovery: boolean, enablePartitionLevelFailover: boolean, globalPartitionEndpointManager?: GlobalPartitionEndpointManager);
31
+ constructor(globalEndpointManager: GlobalEndpointManager, headers: CosmosHeaders, methodType: HTTPMethod, resourceType: ResourceType, operationType: OperationType, enableEndPointDiscovery: boolean, globalPartitionEndpointManager?: GlobalPartitionEndpointManager);
33
32
  /**
34
33
  * Checks if a timeout request is valid for the timeout failover retry policy.
35
34
  * A valid request should be a data plane, metadata, or query plan request.
@@ -1 +1 @@
1
- {"version":3,"file":"timeoutFailoverRetryPolicy.d.ts","sourceRoot":"","sources":["../../../src/retry/timeoutFailoverRetryPolicy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF;;;;;;GAMG;AACH,qBAAa,0BAA2B,YAAW,WAAW;IAS1D,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,aAAa;I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AAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEtF;;;;;;GAMG;AACH,qBAAa,0BAA2B,YAAW,WAAW;IAS1D,OAAO,CAAC,qBAAqB;IAC7B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,uBAAuB;IAC/B,OAAO,CAAC,8BAA8B,CAAC;IAdzC,OAAO,CAAC,oBAAoB,CAAO;IACnC,OAAO,CAAC,+BAA+B,CAAK;IACrC,cAAc,SAAK;IACnB,kBAAkB,SAAK;IACvB,OAAO,EAAE,GAAG,CAAC;IACb,gBAAgB,EAAE,GAAG,CAAC;gBAGnB,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,uBAAuB,EAAE,OAAO,EAChC,8BAA8B,CAAC,EAAE,8BAA8B;IAGzE;;;;OAIG;IACH,OAAO,CAAC,6BAA6B;IASxB,WAAW,CACtB,GAAG,EAAE,aAAa,EAClB,cAAc,EAAE,sBAAsB,EACtC,YAAY,CAAC,EAAE,YAAY,EAC3B,gBAAgB,CAAC,EAAE,MAAM,EACzB,cAAc,CAAC,EAAE,cAAc,GAC9B,OAAO,CAAC,OAAO,CAAC;IAsDnB;;;;OAIG;YACW,iBAAiB;CAyBhC"}
@@ -19,7 +19,6 @@ class TimeoutFailoverRetryPolicy {
19
19
  resourceType;
20
20
  operationType;
21
21
  enableEndPointDiscovery;
22
- enablePartitionLevelFailover;
23
22
  globalPartitionEndpointManager;
24
23
  maxRetryAttemptCount = 120;
25
24
  maxServiceUnavailableRetryCount = 1;
@@ -27,14 +26,13 @@ class TimeoutFailoverRetryPolicy {
27
26
  failoverRetryCount = 0;
28
27
  request;
29
28
  locationEndpoint;
30
- constructor(globalEndpointManager, headers, methodType, resourceType, operationType, enableEndPointDiscovery, enablePartitionLevelFailover, globalPartitionEndpointManager) {
29
+ constructor(globalEndpointManager, headers, methodType, resourceType, operationType, enableEndPointDiscovery, globalPartitionEndpointManager) {
31
30
  this.globalEndpointManager = globalEndpointManager;
32
31
  this.headers = headers;
33
32
  this.methodType = methodType;
34
33
  this.resourceType = resourceType;
35
34
  this.operationType = operationType;
36
35
  this.enableEndPointDiscovery = enableEndPointDiscovery;
37
- this.enablePartitionLevelFailover = enablePartitionLevelFailover;
38
36
  this.globalPartitionEndpointManager = globalPartitionEndpointManager;
39
37
  }
40
38
  /**
@@ -78,7 +76,9 @@ class TimeoutFailoverRetryPolicy {
78
76
  }
79
77
  const canUseMultipleWriteLocations = this.globalEndpointManager.canUseMultipleWriteLocations(this.resourceType, this.operationType);
80
78
  const readRequest = (0, index_js_1.isReadRequest)(this.operationType);
81
- if (!canUseMultipleWriteLocations && !readRequest && !this.enablePartitionLevelFailover) {
79
+ if (!canUseMultipleWriteLocations &&
80
+ !readRequest &&
81
+ !this.globalEndpointManager.enablePartitionLevelFailover) {
82
82
  // Write requests on single master cannot be retried if partition level failover is disabled.
83
83
  // This means there are no other regions available to serve the writes.
84
84
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"timeoutFailoverRetryPolicy.js","sourceRoot":"","sources":["../../../src/retry/timeoutFailoverRetryPolicy.ts"],"names":[],"mappings":";;;AAGA,6DAAuD;AAEvD,iDAA+D;AAE/D,yDAAmD;AAGnD,gEAA8D;AAK9D;;;;;;GAMG;AACH,MAAa,0BAA0B;IAS3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAfF,oBAAoB,GAAG,GAAG,CAAC;IAC3B,+BAA+B,GAAG,CAAC,CAAC;IACrC,cAAc,GAAG,CAAC,CAAC;IACnB,kBAAkB,GAAG,CAAC,CAAC;IACvB,OAA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CAAC,uBAAuB,CAAC;QACnF,MAAM,WAAW,GAAG,IAAA,wBAAa,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtD,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,wGAAwG;QACxG,IAAI,uBAAuB,KAAK,CAAC,EAAE,CAAC;YAClC,yFAAyF;YACzF,aAAa,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,sIAAsI;YACtI,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,CAAC;gBAC7E,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACpD,aAAa,GAAG,kBAAkB,GAAG,gBAAgB,CAAC,MAAM,CAAC;gBAC/D,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,CAAC;gBAC/E,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtD,aAAa,GAAG,kBAAkB,GAAG,iBAAiB,CAAC,MAAM,CAAC;gBAChE,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AAvHD,gEAuHC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { RetryPolicy } from \"./RetryPolicy.js\";\nimport { StatusCodes } from \"../common/statusCodes.js\";\nimport type { GlobalEndpointManager } from \"../globalEndpointManager.js\";\nimport { HTTPMethod, isReadRequest } from \"../common/index.js\";\nimport type { OperationType, ResourceType } from \"../common/constants.js\";\nimport { Constants } from \"../common/constants.js\";\nimport type { RetryContext } from \"./RetryContext.js\";\nimport type { CosmosHeaders } from \"../queryExecutionContext/CosmosHeaders.js\";\nimport { TimeoutErrorCode } from \"../request/TimeoutError.js\";\nimport type { ErrorResponse, RequestContext } from \"../request/index.js\";\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { GlobalPartitionEndpointManager } from \"../globalPartitionEndpointManager.js\";\n\n/**\n * This class TimeoutFailoverRetryPolicy handles retries for read operations\n * (including data plane,metadata, and query plan) in case of request timeouts\n * (TimeoutError) or service unavailability (503 status code) by performing failover\n * and retrying on other regions.\n * @hidden\n */\nexport class TimeoutFailoverRetryPolicy implements RetryPolicy {\n private maxRetryAttemptCount = 120;\n private maxServiceUnavailableRetryCount = 1;\n public retryAfterInMs = 0;\n public failoverRetryCount = 0;\n public request: any;\n public locationEndpoint: any;\n\n constructor(\n private globalEndpointManager: GlobalEndpointManager,\n private headers: CosmosHeaders,\n private methodType: HTTPMethod,\n private resourceType: ResourceType,\n private operationType: OperationType,\n private enableEndPointDiscovery: boolean,\n private enablePartitionLevelFailover: boolean,\n private globalPartitionEndpointManager?: GlobalPartitionEndpointManager,\n ) {}\n\n /**\n * Checks if a timeout request is valid for the timeout failover retry policy.\n * A valid request should be a data plane, metadata, or query plan request.\n * @returns\n */\n private isValidRequestForTimeoutError(): boolean {\n const isQuery = Constants.HttpHeaders.IsQuery in this.headers;\n const isQueryPlan = Constants.HttpHeaders.IsQueryPlan in this.headers;\n if (this.methodType === HTTPMethod.get || isQuery || isQueryPlan) {\n return true;\n }\n return false;\n }\n\n public async shouldRetry(\n err: ErrorResponse,\n diagnosticNode: DiagnosticNodeInternal,\n retryContext?: RetryContext,\n locationEndpoint?: string,\n requestContext?: RequestContext,\n ): Promise<boolean> {\n if (!err) {\n return false;\n }\n if (!retryContext || !locationEndpoint) {\n return false;\n }\n if (!this.enableEndPointDiscovery) {\n return false;\n }\n // Mark the partition as unavailable.\n // Let the Retry logic decide if the request should be retried\n if (requestContext && this.globalPartitionEndpointManager) {\n await this.globalPartitionEndpointManager.tryPartitionLevelFailover(\n requestContext,\n diagnosticNode,\n );\n }\n // Check if the error is a timeout error (TimeoutErrorCode) and if it is not a valid HTTP network timeout request\n if (err.code === TimeoutErrorCode && !this.isValidRequestForTimeoutError()) {\n return false;\n }\n if (\n err.code === StatusCodes.ServiceUnavailable &&\n this.failoverRetryCount >= this.maxServiceUnavailableRetryCount\n ) {\n return false;\n }\n if (this.failoverRetryCount >= this.maxRetryAttemptCount) {\n return false;\n }\n const canUseMultipleWriteLocations = this.globalEndpointManager.canUseMultipleWriteLocations(\n this.resourceType,\n this.operationType,\n );\n const readRequest = isReadRequest(this.operationType);\n\n if (!canUseMultipleWriteLocations && !readRequest && !this.enablePartitionLevelFailover) {\n // Write requests on single master cannot be retried if partition level failover is disabled.\n // This means there are no other regions available to serve the writes.\n return false;\n }\n this.failoverRetryCount++;\n // Setting the retryLocationIndex to the next available location for retry.\n // The retryLocationIndex is determined based on the failoverRetryCount, starting from zero.\n retryContext.retryLocationServerIndex = await this.findEndpointIndex(this.failoverRetryCount);\n diagnosticNode.addData({ successfulRetryPolicy: \"timeout-failover\" });\n return true;\n }\n\n /**\n * Determines index of endpoint to be used for retry based upon failoverRetryCount and avalable locations\n * @param failoverRetryCount - count of failovers\n * @returns\n */\n private async findEndpointIndex(failoverRetryCount: number): Promise<number> {\n // count of preferred locations specified by user\n const preferredLocationsCount = this.globalEndpointManager.preferredLocationsCount;\n const readRequest = isReadRequest(this.operationType);\n let endpointIndex = 0;\n // If preferredLocationsCount is not zero, it indicates that the user has specified preferred locations.\n if (preferredLocationsCount !== 0) {\n // The endpointIndex is set based on the preferred location and the failover retry count.\n endpointIndex = failoverRetryCount % preferredLocationsCount;\n } else {\n // In the absence of preferred locations, the endpoint selection is based on the failover count and the number of available locations.\n if (readRequest) {\n const getReadEndpoints = await this.globalEndpointManager.getReadEndpoints();\n if (getReadEndpoints && getReadEndpoints.length > 0) {\n endpointIndex = failoverRetryCount % getReadEndpoints.length;\n }\n } else {\n const getWriteEndpoints = await this.globalEndpointManager.getWriteEndpoints();\n if (getWriteEndpoints && getWriteEndpoints.length > 0) {\n endpointIndex = failoverRetryCount % getWriteEndpoints.length;\n }\n }\n }\n return endpointIndex;\n }\n}\n"]}
1
+ {"version":3,"file":"timeoutFailoverRetryPolicy.js","sourceRoot":"","sources":["../../../src/retry/timeoutFailoverRetryPolicy.ts"],"names":[],"mappings":";;;AAGA,6DAAuD;AAEvD,iDAA+D;AAE/D,yDAAmD;AAGnD,gEAA8D;AAK9D;;;;;;GAMG;AACH,MAAa,0BAA0B;IAS3B;IACA;IACA;IACA;IACA;IACA;IACA;IAdF,oBAAoB,GAAG,GAAG,CAAC;IAC3B,+BAA+B,GAAG,CAAC,CAAC;IACrC,cAAc,GAAG,CAAC,CAAC;IACnB,kBAAkB,GAAG,CAAC,CAAC;IACvB,OAAO,CAAM;IACb,gBAAgB,CAAM;IAE7B,YACU,qBAA4C,EAC5C,OAAsB,EACtB,UAAsB,EACtB,YAA0B,EAC1B,aAA4B,EAC5B,uBAAgC,EAChC,8BAA+D;QAN/D,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,YAAO,GAAP,OAAO,CAAe;QACtB,eAAU,GAAV,UAAU,CAAY;QACtB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,kBAAa,GAAb,aAAa,CAAe;QAC5B,4BAAuB,GAAvB,uBAAuB,CAAS;QAChC,mCAA8B,GAA9B,8BAA8B,CAAiC;IACtE,CAAC;IAEJ;;;;OAIG;IACK,6BAA6B;QACnC,MAAM,OAAO,GAAG,wBAAS,CAAC,WAAW,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;QAC9D,MAAM,WAAW,GAAG,wBAAS,CAAC,WAAW,CAAC,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC;QACtE,IAAI,IAAI,CAAC,UAAU,KAAK,qBAAU,CAAC,GAAG,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;YACjE,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,KAAK,CAAC,WAAW,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;QACH,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AA1HD,gEA0HC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { RetryPolicy } from \"./RetryPolicy.js\";\nimport { StatusCodes } from \"../common/statusCodes.js\";\nimport type { GlobalEndpointManager } from \"../globalEndpointManager.js\";\nimport { HTTPMethod, isReadRequest } from \"../common/index.js\";\nimport type { OperationType, ResourceType } from \"../common/constants.js\";\nimport { Constants } from \"../common/constants.js\";\nimport type { RetryContext } from \"./RetryContext.js\";\nimport type { CosmosHeaders } from \"../queryExecutionContext/CosmosHeaders.js\";\nimport { TimeoutErrorCode } from \"../request/TimeoutError.js\";\nimport type { ErrorResponse, RequestContext } from \"../request/index.js\";\nimport type { DiagnosticNodeInternal } from \"../diagnostics/DiagnosticNodeInternal.js\";\nimport { GlobalPartitionEndpointManager } from \"../globalPartitionEndpointManager.js\";\n\n/**\n * This class TimeoutFailoverRetryPolicy handles retries for read operations\n * (including data plane,metadata, and query plan) in case of request timeouts\n * (TimeoutError) or service unavailability (503 status code) by performing failover\n * and retrying on other regions.\n * @hidden\n */\nexport class TimeoutFailoverRetryPolicy implements RetryPolicy {\n private maxRetryAttemptCount = 120;\n private maxServiceUnavailableRetryCount = 1;\n public retryAfterInMs = 0;\n public failoverRetryCount = 0;\n public request: any;\n public locationEndpoint: any;\n\n constructor(\n private globalEndpointManager: GlobalEndpointManager,\n private headers: CosmosHeaders,\n private methodType: HTTPMethod,\n private resourceType: ResourceType,\n private operationType: OperationType,\n private enableEndPointDiscovery: boolean,\n private globalPartitionEndpointManager?: GlobalPartitionEndpointManager,\n ) {}\n\n /**\n * Checks if a timeout request is valid for the timeout failover retry policy.\n * A valid request should be a data plane, metadata, or query plan request.\n * @returns\n */\n private isValidRequestForTimeoutError(): boolean {\n const isQuery = Constants.HttpHeaders.IsQuery in this.headers;\n const isQueryPlan = Constants.HttpHeaders.IsQueryPlan in this.headers;\n if (this.methodType === HTTPMethod.get || isQuery || isQueryPlan) {\n return true;\n }\n return false;\n }\n\n public async shouldRetry(\n err: ErrorResponse,\n diagnosticNode: DiagnosticNodeInternal,\n retryContext?: RetryContext,\n locationEndpoint?: string,\n requestContext?: RequestContext,\n ): Promise<boolean> {\n if (!err) {\n return false;\n }\n if (!retryContext || !locationEndpoint) {\n return false;\n }\n if (!this.enableEndPointDiscovery) {\n return false;\n }\n // Mark the partition as unavailable.\n // Let the Retry logic decide if the request should be retried\n if (requestContext && this.globalPartitionEndpointManager) {\n await this.globalPartitionEndpointManager.tryPartitionLevelFailover(\n requestContext,\n diagnosticNode,\n );\n }\n // Check if the error is a timeout error (TimeoutErrorCode) and if it is not a valid HTTP network timeout request\n if (err.code === TimeoutErrorCode && !this.isValidRequestForTimeoutError()) {\n return false;\n }\n if (\n err.code === StatusCodes.ServiceUnavailable &&\n this.failoverRetryCount >= this.maxServiceUnavailableRetryCount\n ) {\n return false;\n }\n if (this.failoverRetryCount >= this.maxRetryAttemptCount) {\n return false;\n }\n const canUseMultipleWriteLocations = this.globalEndpointManager.canUseMultipleWriteLocations(\n this.resourceType,\n this.operationType,\n );\n const readRequest = isReadRequest(this.operationType);\n\n if (\n !canUseMultipleWriteLocations &&\n !readRequest &&\n !this.globalEndpointManager.enablePartitionLevelFailover\n ) {\n // Write requests on single master cannot be retried if partition level failover is disabled.\n // This means there are no other regions available to serve the writes.\n return false;\n }\n this.failoverRetryCount++;\n // Setting the retryLocationIndex to the next available location for retry.\n // The retryLocationIndex is determined based on the failoverRetryCount, starting from zero.\n retryContext.retryLocationServerIndex = await this.findEndpointIndex(this.failoverRetryCount);\n diagnosticNode.addData({ successfulRetryPolicy: \"timeout-failover\" });\n return true;\n }\n\n /**\n * Determines index of endpoint to be used for retry based upon failoverRetryCount and avalable locations\n * @param failoverRetryCount - count of failovers\n * @returns\n */\n private async findEndpointIndex(failoverRetryCount: number): Promise<number> {\n // count of preferred locations specified by user\n const preferredLocationsCount = this.globalEndpointManager.preferredLocationsCount;\n const readRequest = isReadRequest(this.operationType);\n let endpointIndex = 0;\n // If preferredLocationsCount is not zero, it indicates that the user has specified preferred locations.\n if (preferredLocationsCount !== 0) {\n // The endpointIndex is set based on the preferred location and the failover retry count.\n endpointIndex = failoverRetryCount % preferredLocationsCount;\n } else {\n // In the absence of preferred locations, the endpoint selection is based on the failover count and the number of available locations.\n if (readRequest) {\n const getReadEndpoints = await this.globalEndpointManager.getReadEndpoints();\n if (getReadEndpoints && getReadEndpoints.length > 0) {\n endpointIndex = failoverRetryCount % getReadEndpoints.length;\n }\n } else {\n const getWriteEndpoints = await this.globalEndpointManager.getWriteEndpoints();\n if (getWriteEndpoints && getWriteEndpoints.length > 0) {\n endpointIndex = failoverRetryCount % getWriteEndpoints.length;\n }\n }\n }\n return endpointIndex;\n }\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.52.11"
8
+ "packageVersion": "7.53.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,3 +1,3 @@
1
- export declare function encodeUTF8(str: string): Uint8Array;
1
+ export declare function encodeUTF8(str: string): Uint8Array<ArrayBuffer>;
2
2
  export declare function encodeBase64(value: ArrayBuffer): string;
3
3
  //# sourceMappingURL=encode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/utils/encode.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAMlD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAYvD"}
1
+ {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/utils/encode.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,WAAW,CAAC,CAM/D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAYvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"encode.js","sourceRoot":"","sources":["../../../src/utils/encode.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAIlC,gCAMC;AAED,oCAYC;AAtBD,0BAA0B;AAE1B,SAAgB,UAAU,CAAC,GAAW;IACpC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,YAAY,CAAC,KAAkB;IAC7C,IAAI,UAAU,KAAK,OAAO,IAAI,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/// <reference lib=\"dom\"/>\n\nexport function encodeUTF8(str: string): Uint8Array {\n const bytes = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\n\nexport function encodeBase64(value: ArrayBuffer): string {\n if (\"function\" !== typeof btoa) {\n throw new Error(\"Your browser environment is missing the global `btoa` function\");\n }\n\n let binary = \"\";\n const bytes = new Uint8Array(value);\n const len = bytes.byteLength;\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n"]}
1
+ {"version":3,"file":"encode.js","sourceRoot":"","sources":["../../../src/utils/encode.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAIlC,gCAMC;AAED,oCAYC;AAtBD,0BAA0B;AAE1B,SAAgB,UAAU,CAAC,GAAW;IACpC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,YAAY,CAAC,KAAkB;IAC7C,IAAI,UAAU,KAAK,OAAO,IAAI,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/// <reference lib=\"dom\"/>\n\nexport function encodeUTF8(str: string): Uint8Array<ArrayBuffer> {\n const bytes = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n return bytes;\n}\n\nexport function encodeBase64(value: ArrayBuffer): string {\n if (\"function\" !== typeof btoa) {\n throw new Error(\"Your browser environment is missing the global `btoa` function\");\n }\n\n let binary = \"\";\n const bytes = new Uint8Array(value);\n const len = bytes.byteLength;\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ClientContext.d.ts","sourceRoot":"","sources":["../../src/ClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAa,UAAU,EAAiB,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG3F,OAAO,KAAK,EAAS,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAEL,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,KAAK,EAAyB,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAE5F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAMhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,OAAO,KAAK,EA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