@azure/core-amqp 4.4.0-beta.1 → 4.4.1-alpha.20250716.3

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 (343) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +3 -5
  3. package/dist/browser/ConnectionContextBase.js +1 -1
  4. package/dist/browser/ConnectionContextBase.js.map +1 -1
  5. package/dist/browser/amqpAnnotatedMessage.d.ts +1 -1
  6. package/dist/browser/amqpAnnotatedMessage.js +1 -2
  7. package/dist/browser/amqpAnnotatedMessage.js.map +1 -1
  8. package/dist/browser/auth/token.js +1 -1
  9. package/dist/browser/auth/token.js.map +1 -1
  10. package/dist/browser/auth/tokenProvider.d.ts +1 -1
  11. package/dist/browser/auth/tokenProvider.js +2 -2
  12. package/dist/browser/auth/tokenProvider.js.map +1 -1
  13. package/dist/browser/cbs.d.ts +3 -3
  14. package/dist/browser/cbs.js +2 -2
  15. package/dist/browser/cbs.js.map +1 -1
  16. package/dist/browser/connectionConfig/connectionConfig.d.ts +1 -1
  17. package/dist/browser/connectionConfig/connectionConfig.js +29 -10
  18. package/dist/browser/connectionConfig/connectionConfig.js.map +1 -1
  19. package/dist/browser/errors.d.ts +3 -1
  20. package/dist/browser/errors.js +3 -1
  21. package/dist/browser/errors.js.map +1 -1
  22. package/dist/browser/index.d.ts +0 -1
  23. package/dist/browser/index.js +1 -2
  24. package/dist/browser/index.js.map +1 -1
  25. package/dist/browser/internals.js +1 -1
  26. package/dist/browser/internals.js.map +1 -1
  27. package/dist/browser/log.js +1 -1
  28. package/dist/browser/log.js.map +1 -1
  29. package/dist/browser/messageHeader.d.ts +1 -1
  30. package/dist/browser/messageHeader.js +1 -1
  31. package/dist/browser/messageHeader.js.map +1 -1
  32. package/dist/browser/messageProperties.d.ts +1 -2
  33. package/dist/browser/messageProperties.js +1 -1
  34. package/dist/browser/messageProperties.js.map +1 -1
  35. package/dist/browser/requestResponseLink.d.ts +2 -2
  36. package/dist/browser/requestResponseLink.js +3 -3
  37. package/dist/browser/requestResponseLink.js.map +1 -1
  38. package/dist/browser/retry.d.ts +1 -1
  39. package/dist/browser/retry.js +5 -12
  40. package/dist/browser/retry.js.map +1 -1
  41. package/dist/browser/util/checkNetworkConnection-browser.mjs.map +1 -1
  42. package/dist/browser/util/checkNetworkConnection.common.d.ts +6 -0
  43. package/dist/browser/util/checkNetworkConnection.common.js +10 -0
  44. package/dist/browser/util/checkNetworkConnection.common.js.map +1 -0
  45. package/dist/browser/util/checkNetworkConnection.d.ts +1 -5
  46. package/dist/browser/util/checkNetworkConnection.js +2 -8
  47. package/dist/browser/util/constants.d.ts +0 -1
  48. package/dist/browser/util/constants.js +1 -2
  49. package/dist/browser/util/constants.js.map +1 -1
  50. package/dist/browser/util/hmacSha256-browser.mjs.map +1 -1
  51. package/dist/browser/util/hmacSha256.common.d.ts +2 -0
  52. package/dist/browser/util/hmacSha256.common.js +11 -0
  53. package/dist/browser/util/hmacSha256.common.js.map +1 -0
  54. package/dist/browser/util/hmacSha256.d.ts +1 -16
  55. package/dist/browser/util/hmacSha256.js +2 -9
  56. package/dist/browser/util/lock.d.ts +1 -1
  57. package/dist/browser/util/lock.js +1 -1
  58. package/dist/browser/util/lock.js.map +1 -1
  59. package/dist/browser/util/runtimeInfo-browser.mjs.map +1 -1
  60. package/dist/browser/util/runtimeInfo.js +1 -1
  61. package/dist/browser/util/typeGuards.d.ts +1 -1
  62. package/dist/browser/util/typeGuards.js +1 -1
  63. package/dist/browser/util/typeGuards.js.map +1 -1
  64. package/dist/browser/util/utils.d.ts +3 -3
  65. package/dist/browser/util/utils.js +1 -1
  66. package/dist/browser/util/utils.js.map +1 -1
  67. package/dist/commonjs/ConnectionContextBase.js +1 -1
  68. package/dist/commonjs/ConnectionContextBase.js.map +1 -1
  69. package/dist/commonjs/amqpAnnotatedMessage.d.ts +1 -1
  70. package/dist/commonjs/amqpAnnotatedMessage.js +1 -2
  71. package/dist/commonjs/amqpAnnotatedMessage.js.map +1 -1
  72. package/dist/commonjs/auth/token.js +1 -1
  73. package/dist/commonjs/auth/token.js.map +1 -1
  74. package/dist/commonjs/auth/tokenProvider.d.ts +1 -1
  75. package/dist/commonjs/auth/tokenProvider.js +3 -3
  76. package/dist/commonjs/auth/tokenProvider.js.map +1 -1
  77. package/dist/commonjs/cbs.d.ts +3 -3
  78. package/dist/commonjs/cbs.js +1 -1
  79. package/dist/commonjs/cbs.js.map +1 -1
  80. package/dist/commonjs/connectionConfig/connectionConfig.d.ts +1 -1
  81. package/dist/commonjs/connectionConfig/connectionConfig.js +31 -12
  82. package/dist/commonjs/connectionConfig/connectionConfig.js.map +1 -1
  83. package/dist/commonjs/errors.d.ts +3 -1
  84. package/dist/commonjs/errors.js +7 -5
  85. package/dist/commonjs/errors.js.map +1 -1
  86. package/dist/commonjs/index.d.ts +0 -1
  87. package/dist/commonjs/index.js +1 -2
  88. package/dist/commonjs/index.js.map +1 -1
  89. package/dist/commonjs/internals.js +1 -1
  90. package/dist/commonjs/internals.js.map +1 -1
  91. package/dist/commonjs/log.js +3 -3
  92. package/dist/commonjs/log.js.map +1 -1
  93. package/dist/commonjs/messageHeader.d.ts +1 -1
  94. package/dist/commonjs/messageHeader.js +1 -1
  95. package/dist/commonjs/messageHeader.js.map +1 -1
  96. package/dist/commonjs/messageProperties.d.ts +1 -2
  97. package/dist/commonjs/messageProperties.js +1 -1
  98. package/dist/commonjs/messageProperties.js.map +1 -1
  99. package/dist/commonjs/requestResponseLink.d.ts +2 -2
  100. package/dist/commonjs/requestResponseLink.js +4 -4
  101. package/dist/commonjs/requestResponseLink.js.map +1 -1
  102. package/dist/commonjs/retry.d.ts +1 -1
  103. package/dist/commonjs/retry.js +7 -14
  104. package/dist/commonjs/retry.js.map +1 -1
  105. package/dist/commonjs/tsdoc-metadata.json +1 -1
  106. package/dist/commonjs/util/checkNetworkConnection.common.d.ts +6 -0
  107. package/dist/commonjs/util/checkNetworkConnection.common.js +13 -0
  108. package/dist/commonjs/util/checkNetworkConnection.common.js.map +1 -0
  109. package/dist/commonjs/util/checkNetworkConnection.js +2 -3
  110. package/dist/commonjs/util/checkNetworkConnection.js.map +1 -1
  111. package/dist/commonjs/util/constants.d.ts +0 -1
  112. package/dist/commonjs/util/constants.js +1 -2
  113. package/dist/commonjs/util/constants.js.map +1 -1
  114. package/dist/commonjs/util/hmacSha256.common.d.ts +2 -0
  115. package/dist/commonjs/util/hmacSha256.common.js +14 -0
  116. package/dist/commonjs/util/hmacSha256.common.js.map +1 -0
  117. package/dist/commonjs/util/hmacSha256.js +2 -3
  118. package/dist/commonjs/util/hmacSha256.js.map +1 -1
  119. package/dist/commonjs/util/lock.d.ts +1 -1
  120. package/dist/commonjs/util/lock.js +1 -1
  121. package/dist/commonjs/util/lock.js.map +1 -1
  122. package/dist/commonjs/util/runtimeInfo.js +5 -6
  123. package/dist/commonjs/util/runtimeInfo.js.map +1 -1
  124. package/dist/commonjs/util/typeGuards.d.ts +1 -1
  125. package/dist/commonjs/util/typeGuards.js +2 -3
  126. package/dist/commonjs/util/typeGuards.js.map +1 -1
  127. package/dist/commonjs/util/utils.d.ts +3 -3
  128. package/dist/commonjs/util/utils.js +10 -10
  129. package/dist/commonjs/util/utils.js.map +1 -1
  130. package/dist/esm/ConnectionContextBase.js +1 -1
  131. package/dist/esm/ConnectionContextBase.js.map +1 -1
  132. package/dist/esm/amqpAnnotatedMessage.d.ts +1 -1
  133. package/dist/esm/amqpAnnotatedMessage.js +1 -2
  134. package/dist/esm/amqpAnnotatedMessage.js.map +1 -1
  135. package/dist/esm/auth/token.js +1 -1
  136. package/dist/esm/auth/token.js.map +1 -1
  137. package/dist/esm/auth/tokenProvider.d.ts +1 -1
  138. package/dist/esm/auth/tokenProvider.js +2 -2
  139. package/dist/esm/auth/tokenProvider.js.map +1 -1
  140. package/dist/esm/cbs.d.ts +3 -3
  141. package/dist/esm/cbs.js +2 -2
  142. package/dist/esm/cbs.js.map +1 -1
  143. package/dist/esm/connectionConfig/connectionConfig.d.ts +1 -1
  144. package/dist/esm/connectionConfig/connectionConfig.js +29 -10
  145. package/dist/esm/connectionConfig/connectionConfig.js.map +1 -1
  146. package/dist/esm/errors.d.ts +3 -1
  147. package/dist/esm/errors.js +3 -1
  148. package/dist/esm/errors.js.map +1 -1
  149. package/dist/esm/index.d.ts +0 -1
  150. package/dist/esm/index.js +1 -2
  151. package/dist/esm/index.js.map +1 -1
  152. package/dist/esm/internals.js +1 -1
  153. package/dist/esm/internals.js.map +1 -1
  154. package/dist/esm/log.js +1 -1
  155. package/dist/esm/log.js.map +1 -1
  156. package/dist/esm/messageHeader.d.ts +1 -1
  157. package/dist/esm/messageHeader.js +1 -1
  158. package/dist/esm/messageHeader.js.map +1 -1
  159. package/dist/esm/messageProperties.d.ts +1 -2
  160. package/dist/esm/messageProperties.js +1 -1
  161. package/dist/esm/messageProperties.js.map +1 -1
  162. package/dist/esm/requestResponseLink.d.ts +2 -2
  163. package/dist/esm/requestResponseLink.js +3 -3
  164. package/dist/esm/requestResponseLink.js.map +1 -1
  165. package/dist/esm/retry.d.ts +1 -1
  166. package/dist/esm/retry.js +5 -12
  167. package/dist/esm/retry.js.map +1 -1
  168. package/dist/esm/util/checkNetworkConnection.common.d.ts +6 -0
  169. package/dist/esm/util/checkNetworkConnection.common.js +10 -0
  170. package/dist/esm/util/checkNetworkConnection.common.js.map +1 -0
  171. package/dist/esm/util/checkNetworkConnection.js +1 -1
  172. package/dist/esm/util/checkNetworkConnection.js.map +1 -1
  173. package/dist/esm/util/constants.d.ts +0 -1
  174. package/dist/esm/util/constants.js +1 -2
  175. package/dist/esm/util/constants.js.map +1 -1
  176. package/dist/esm/util/hmacSha256.common.d.ts +2 -0
  177. package/dist/esm/util/hmacSha256.common.js +11 -0
  178. package/dist/esm/util/hmacSha256.common.js.map +1 -0
  179. package/dist/esm/util/hmacSha256.js +1 -1
  180. package/dist/esm/util/hmacSha256.js.map +1 -1
  181. package/dist/esm/util/lock.d.ts +1 -1
  182. package/dist/esm/util/lock.js +1 -1
  183. package/dist/esm/util/lock.js.map +1 -1
  184. package/dist/esm/util/runtimeInfo.js +2 -2
  185. package/dist/esm/util/runtimeInfo.js.map +1 -1
  186. package/dist/esm/util/typeGuards.d.ts +1 -1
  187. package/dist/esm/util/typeGuards.js +1 -1
  188. package/dist/esm/util/typeGuards.js.map +1 -1
  189. package/dist/esm/util/utils.d.ts +3 -3
  190. package/dist/esm/util/utils.js +1 -1
  191. package/dist/esm/util/utils.js.map +1 -1
  192. package/dist/react-native/ConnectionContextBase.js +1 -1
  193. package/dist/react-native/ConnectionContextBase.js.map +1 -1
  194. package/dist/react-native/amqpAnnotatedMessage.d.ts +1 -1
  195. package/dist/react-native/amqpAnnotatedMessage.js +1 -2
  196. package/dist/react-native/amqpAnnotatedMessage.js.map +1 -1
  197. package/dist/react-native/auth/token.js +1 -1
  198. package/dist/react-native/auth/token.js.map +1 -1
  199. package/dist/react-native/auth/tokenProvider.d.ts +1 -1
  200. package/dist/react-native/auth/tokenProvider.js +2 -2
  201. package/dist/react-native/auth/tokenProvider.js.map +1 -1
  202. package/dist/react-native/cbs.d.ts +3 -3
  203. package/dist/react-native/cbs.js +2 -2
  204. package/dist/react-native/cbs.js.map +1 -1
  205. package/dist/react-native/connectionConfig/connectionConfig.d.ts +1 -1
  206. package/dist/react-native/connectionConfig/connectionConfig.js +29 -10
  207. package/dist/react-native/connectionConfig/connectionConfig.js.map +1 -1
  208. package/dist/react-native/errors.d.ts +3 -1
  209. package/dist/react-native/errors.js +3 -1
  210. package/dist/react-native/errors.js.map +1 -1
  211. package/dist/react-native/index.d.ts +0 -1
  212. package/dist/react-native/index.js +1 -2
  213. package/dist/react-native/index.js.map +1 -1
  214. package/dist/react-native/internals.js +1 -1
  215. package/dist/react-native/internals.js.map +1 -1
  216. package/dist/react-native/log.js +1 -1
  217. package/dist/react-native/log.js.map +1 -1
  218. package/dist/react-native/messageHeader.d.ts +1 -1
  219. package/dist/react-native/messageHeader.js +1 -1
  220. package/dist/react-native/messageHeader.js.map +1 -1
  221. package/dist/react-native/messageProperties.d.ts +1 -2
  222. package/dist/react-native/messageProperties.js +1 -1
  223. package/dist/react-native/messageProperties.js.map +1 -1
  224. package/dist/react-native/requestResponseLink.d.ts +2 -2
  225. package/dist/react-native/requestResponseLink.js +3 -3
  226. package/dist/react-native/requestResponseLink.js.map +1 -1
  227. package/dist/react-native/retry.d.ts +1 -1
  228. package/dist/react-native/retry.js +5 -12
  229. package/dist/react-native/retry.js.map +1 -1
  230. package/dist/react-native/util/checkNetworkConnection-react-native.mjs.map +1 -0
  231. package/dist/react-native/util/checkNetworkConnection.common.d.ts +6 -0
  232. package/dist/react-native/util/checkNetworkConnection.common.js +10 -0
  233. package/dist/react-native/util/checkNetworkConnection.common.js.map +1 -0
  234. package/dist/react-native/util/checkNetworkConnection.d.ts +2 -6
  235. package/dist/react-native/util/checkNetworkConnection.js +3 -27
  236. package/dist/react-native/util/constants.d.ts +0 -1
  237. package/dist/react-native/util/constants.js +1 -2
  238. package/dist/react-native/util/constants.js.map +1 -1
  239. package/dist/react-native/util/hmacSha256-react-native.mjs.map +1 -0
  240. package/dist/react-native/util/hmacSha256.common.d.ts +2 -0
  241. package/dist/react-native/util/hmacSha256.common.js +11 -0
  242. package/dist/react-native/util/hmacSha256.common.js.map +1 -0
  243. package/dist/react-native/util/hmacSha256.d.ts +2 -2
  244. package/dist/react-native/util/hmacSha256.js +3 -7
  245. package/dist/react-native/util/lock.d.ts +1 -1
  246. package/dist/react-native/util/lock.js +1 -1
  247. package/dist/react-native/util/lock.js.map +1 -1
  248. package/dist/react-native/util/runtimeInfo-react-native.mjs.map +1 -1
  249. package/dist/react-native/util/runtimeInfo.js +2 -2
  250. package/dist/react-native/util/typeGuards.d.ts +1 -1
  251. package/dist/react-native/util/typeGuards.js +1 -1
  252. package/dist/react-native/util/typeGuards.js.map +1 -1
  253. package/dist/react-native/util/utils.d.ts +3 -3
  254. package/dist/react-native/util/utils.js +1 -1
  255. package/dist/react-native/util/utils.js.map +1 -1
  256. package/package.json +31 -35
  257. package/dist/browser/ConnectionContextBase.d.ts.map +0 -1
  258. package/dist/browser/amqpAnnotatedMessage.d.ts.map +0 -1
  259. package/dist/browser/auth/token.d.ts.map +0 -1
  260. package/dist/browser/auth/tokenProvider.d.ts.map +0 -1
  261. package/dist/browser/cbs.d.ts.map +0 -1
  262. package/dist/browser/connectionConfig/connectionConfig.d.ts.map +0 -1
  263. package/dist/browser/errors.d.ts.map +0 -1
  264. package/dist/browser/index.d.ts.map +0 -1
  265. package/dist/browser/internals.d.ts.map +0 -1
  266. package/dist/browser/log.d.ts.map +0 -1
  267. package/dist/browser/messageHeader.d.ts.map +0 -1
  268. package/dist/browser/messageProperties.d.ts.map +0 -1
  269. package/dist/browser/requestResponseLink.d.ts.map +0 -1
  270. package/dist/browser/retry.d.ts.map +0 -1
  271. package/dist/browser/util/checkNetworkConnection-browser.d.mts.map +0 -1
  272. package/dist/browser/util/constants.d.ts.map +0 -1
  273. package/dist/browser/util/hmacSha256-browser.d.mts.map +0 -1
  274. package/dist/browser/util/lock.d.ts.map +0 -1
  275. package/dist/browser/util/runtimeInfo-browser.d.mts.map +0 -1
  276. package/dist/browser/util/typeGuards.d.ts.map +0 -1
  277. package/dist/browser/util/utils.d.ts.map +0 -1
  278. package/dist/commonjs/ConnectionContextBase.d.ts.map +0 -1
  279. package/dist/commonjs/amqpAnnotatedMessage.d.ts.map +0 -1
  280. package/dist/commonjs/auth/token.d.ts.map +0 -1
  281. package/dist/commonjs/auth/tokenProvider.d.ts.map +0 -1
  282. package/dist/commonjs/cbs.d.ts.map +0 -1
  283. package/dist/commonjs/connectionConfig/connectionConfig.d.ts.map +0 -1
  284. package/dist/commonjs/errors.d.ts.map +0 -1
  285. package/dist/commonjs/index.d.ts.map +0 -1
  286. package/dist/commonjs/internals.d.ts.map +0 -1
  287. package/dist/commonjs/log.d.ts.map +0 -1
  288. package/dist/commonjs/messageHeader.d.ts.map +0 -1
  289. package/dist/commonjs/messageProperties.d.ts.map +0 -1
  290. package/dist/commonjs/requestResponseLink.d.ts.map +0 -1
  291. package/dist/commonjs/retry.d.ts.map +0 -1
  292. package/dist/commonjs/util/checkNetworkConnection.d.ts.map +0 -1
  293. package/dist/commonjs/util/constants.d.ts.map +0 -1
  294. package/dist/commonjs/util/hmacSha256.d.ts.map +0 -1
  295. package/dist/commonjs/util/lock.d.ts.map +0 -1
  296. package/dist/commonjs/util/runtimeInfo.d.ts.map +0 -1
  297. package/dist/commonjs/util/typeGuards.d.ts.map +0 -1
  298. package/dist/commonjs/util/utils.d.ts.map +0 -1
  299. package/dist/core-amqp.d.ts +0 -1521
  300. package/dist/esm/ConnectionContextBase.d.ts.map +0 -1
  301. package/dist/esm/amqpAnnotatedMessage.d.ts.map +0 -1
  302. package/dist/esm/auth/token.d.ts.map +0 -1
  303. package/dist/esm/auth/tokenProvider.d.ts.map +0 -1
  304. package/dist/esm/cbs.d.ts.map +0 -1
  305. package/dist/esm/connectionConfig/connectionConfig.d.ts.map +0 -1
  306. package/dist/esm/errors.d.ts.map +0 -1
  307. package/dist/esm/index.d.ts.map +0 -1
  308. package/dist/esm/internals.d.ts.map +0 -1
  309. package/dist/esm/log.d.ts.map +0 -1
  310. package/dist/esm/messageHeader.d.ts.map +0 -1
  311. package/dist/esm/messageProperties.d.ts.map +0 -1
  312. package/dist/esm/requestResponseLink.d.ts.map +0 -1
  313. package/dist/esm/retry.d.ts.map +0 -1
  314. package/dist/esm/util/checkNetworkConnection.d.ts.map +0 -1
  315. package/dist/esm/util/constants.d.ts.map +0 -1
  316. package/dist/esm/util/hmacSha256.d.ts.map +0 -1
  317. package/dist/esm/util/lock.d.ts.map +0 -1
  318. package/dist/esm/util/runtimeInfo.d.ts.map +0 -1
  319. package/dist/esm/util/typeGuards.d.ts.map +0 -1
  320. package/dist/esm/util/utils.d.ts.map +0 -1
  321. package/dist/react-native/ConnectionContextBase.d.ts.map +0 -1
  322. package/dist/react-native/amqpAnnotatedMessage.d.ts.map +0 -1
  323. package/dist/react-native/auth/token.d.ts.map +0 -1
  324. package/dist/react-native/auth/tokenProvider.d.ts.map +0 -1
  325. package/dist/react-native/cbs.d.ts.map +0 -1
  326. package/dist/react-native/connectionConfig/connectionConfig.d.ts.map +0 -1
  327. package/dist/react-native/errors.d.ts.map +0 -1
  328. package/dist/react-native/index.d.ts.map +0 -1
  329. package/dist/react-native/internals.d.ts.map +0 -1
  330. package/dist/react-native/log.d.ts.map +0 -1
  331. package/dist/react-native/messageHeader.d.ts.map +0 -1
  332. package/dist/react-native/messageProperties.d.ts.map +0 -1
  333. package/dist/react-native/requestResponseLink.d.ts.map +0 -1
  334. package/dist/react-native/retry.d.ts.map +0 -1
  335. package/dist/react-native/util/checkNetworkConnection.d.ts.map +0 -1
  336. package/dist/react-native/util/checkNetworkConnection.js.map +0 -1
  337. package/dist/react-native/util/constants.d.ts.map +0 -1
  338. package/dist/react-native/util/hmacSha256.d.ts.map +0 -1
  339. package/dist/react-native/util/hmacSha256.js.map +0 -1
  340. package/dist/react-native/util/lock.d.ts.map +0 -1
  341. package/dist/react-native/util/runtimeInfo-react-native.d.mts.map +0 -1
  342. package/dist/react-native/util/typeGuards.d.ts.map +0 -1
  343. package/dist/react-native/util/utils.d.ts.map +0 -1
@@ -1,1521 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- import { AbortSignalLike } from '@azure/abort-controller';
4
- import { AccessToken } from '@azure/core-auth';
5
- import { AzureLogger } from '@azure/logger';
6
- import { Connection } from 'rhea-promise';
7
- import { Message } from 'rhea-promise';
8
- import { MessageHeader } from 'rhea-promise';
9
- import { MessageProperties } from 'rhea-promise';
10
- import { NamedKeyCredential } from '@azure/core-auth';
11
- import { Receiver } from 'rhea-promise';
12
- import { ReceiverOptions } from 'rhea-promise';
13
- import { ReqResLink } from 'rhea-promise';
14
- import { SASCredential } from '@azure/core-auth';
15
- import { Sender } from 'rhea-promise';
16
- import { SenderOptions } from 'rhea-promise';
17
- import { Session } from 'rhea-promise';
18
- import { WebSocketImpl } from 'rhea-promise';
19
-
20
- /**
21
- * Describes the properties that must be provided while acquiring a lock.
22
- */
23
- export declare interface AcquireLockProperties {
24
- /**
25
- * An implementation of the `AbortSignalLike` interface to signal the request to cancel lock acquisition.
26
- * This only applies to the acquisition of a lock. Once the lock is acquired, the task is invoked and `acquire`
27
- * can no longer be cancelled.
28
- * This does not cancel running the task passed to `acquire()` if the lock has been acquired,
29
- * but will prevent it from running if cancelled before the task is invoked.
30
- */
31
- abortSignal: AbortSignalLike | undefined;
32
- /**
33
- * The allowed amount of time in milliseconds to acquire a lock.
34
- * If a lock isn't acquired within this time, the promise returned
35
- * by `acquire()` will be rejected with an Error.
36
- */
37
- timeoutInMs: number | undefined;
38
- }
39
-
40
- /**
41
- * Describes the AmqpAnnotatedMessage, part of the ServiceBusReceivedMessage(as `amqpAnnotatedMessage` property).
42
- */
43
- export declare interface AmqpAnnotatedMessage {
44
- /**
45
- * Describes the defined set of standard header properties of the message.
46
- */
47
- header?: AmqpMessageHeader;
48
- /**
49
- * Describes set of footer properties of the message.
50
- */
51
- footer?: {
52
- [key: string]: any;
53
- };
54
- /**
55
- * A dictionary containing message attributes that will be held in the message header
56
- */
57
- messageAnnotations?: {
58
- [key: string]: any;
59
- };
60
- /**
61
- * A dictionary used for delivery-specific
62
- * non-standard properties at the head of the message.
63
- */
64
- deliveryAnnotations?: {
65
- [key: string]: any;
66
- };
67
- /**
68
- * A dictionary containing application specific message properties.
69
- */
70
- applicationProperties?: {
71
- [key: string]: any;
72
- };
73
- /**
74
- * Describes the defined set of standard properties of the message.
75
- */
76
- properties?: AmqpMessageProperties;
77
- /**
78
- * The message body.
79
- */
80
- body: any;
81
- /**
82
- * The AMQP section where the data was decoded from.
83
- */
84
- bodyType?: "data" | "sequence" | "value";
85
- }
86
-
87
- /**
88
- * Describes the operations that can be performed on(or to get) the AmqpAnnotatedMessage.
89
- */
90
- export declare const AmqpAnnotatedMessage: {
91
- /**
92
- * Takes RheaMessage(`Message` type from "rhea") and returns it in the AmqpAnnotatedMessage format.
93
- */
94
- fromRheaMessage(msg: Message): AmqpAnnotatedMessage;
95
- /**
96
- * Takes AmqpAnnotatedMessage and returns it in the RheaMessage(`Message` type from "rhea") format.
97
- */
98
- toRheaMessage(msg: AmqpAnnotatedMessage): Message;
99
- };
100
-
101
- /**
102
- * Describes the defined set of standard header properties of the message.
103
- */
104
- export declare interface AmqpMessageHeader {
105
- /**
106
- * If this value is true, then this message has not been
107
- * acquired by any other link. If this value is false, then this message MAY have previously
108
- * been acquired by another link or links.
109
- */
110
- firstAcquirer?: boolean;
111
- /**
112
- * The number of prior unsuccessful delivery attempts.
113
- */
114
- deliveryCount?: number;
115
- /**
116
- * time to live in ms.
117
- */
118
- timeToLive?: number;
119
- /**
120
- * Specifies durability requirements.
121
- */
122
- durable?: boolean;
123
- /**
124
- * The relative message priority. Higher numbers indicate higher
125
- * priority messages.
126
- */
127
- priority?: number;
128
- }
129
-
130
- /**
131
- * Describes the operations that can be performed on the message header.
132
- */
133
- export declare const AmqpMessageHeader: {
134
- /**
135
- * Converts MessageHeader to RheaMessageHeader.
136
- *
137
- * @param props - Message header.
138
- * @returns RheaMessageHeader
139
- */
140
- toRheaMessageHeader(props: AmqpMessageHeader): MessageHeader;
141
- /**
142
- * Converts RheaMessageHeader to MessageHeader.
143
- *
144
- * @param props - Amqp Message Header
145
- * @returns MessageHeader.
146
- */
147
- fromRheaMessageHeader(props: MessageHeader): AmqpMessageHeader;
148
- };
149
-
150
- /**
151
- * Describes the defined set of standard properties of the message.
152
- */
153
- export declare interface AmqpMessageProperties {
154
- /**
155
- * The application message identifier that uniquely identifies a message.
156
- * The user is responsible for making sure that this is unique in the given context. Guids usually make a good fit.
157
- */
158
- messageId?: string | number | Buffer;
159
- /**
160
- * The address of the node to send replies to.
161
- */
162
- replyTo?: string;
163
- /**
164
- * The address of the node the message is destined for.
165
- */
166
- to?: string;
167
- /**
168
- * The id that can be used to mark or identify messages between clients.
169
- */
170
- correlationId?: string | number | Buffer;
171
- /**
172
- * MIME type for the message.
173
- */
174
- contentType?: string;
175
- /**
176
- * The content-encoding property is used as a modifier to the content-type.
177
- * When present, its value indicates what additional content encodings have been applied to the application-data.
178
- */
179
- contentEncoding?: string;
180
- /**
181
- * The time when this message is considered expired.
182
- */
183
- absoluteExpiryTime?: number;
184
- /**
185
- * The time this message was created.
186
- */
187
- creationTime?: number;
188
- /**
189
- * The group this message belongs to.
190
- */
191
- groupId?: string;
192
- /**
193
- * The sequence number of this message with its group.
194
- */
195
- groupSequence?: number;
196
- /**
197
- * The group the reply message belongs to.
198
- */
199
- replyToGroupId?: string;
200
- /**
201
- * A common field for summary information about the message
202
- * content and purpose.
203
- */
204
- subject?: string;
205
- }
206
-
207
- /**
208
- * Describes the operations that can be performed on the amqp message properties.
209
- */
210
- export declare const AmqpMessageProperties: {
211
- /**
212
- * Converts MessageProperties to RheaMessageProperties.
213
- * @param props - Message properties.
214
- * @returns RheaMessageProperties.
215
- */
216
- toRheaMessageProperties(props: AmqpMessageProperties): MessageProperties;
217
- /**
218
- * Converts RheaMessageProperties to MessageProperties.
219
- * @param props - Amqp message properties.
220
- * @returns MessageProperties.
221
- */
222
- fromRheaMessageProperties(props: MessageProperties): AmqpMessageProperties;
223
- };
224
-
225
- /**
226
- * CancellableAsyncLock provides a mechanism for forcing tasks using the same
227
- * 'key' to be executed serially.
228
- *
229
- * Pending tasks can be manually cancelled via an abortSignal or automatically
230
- * cancelled by reach a provided timeout value.
231
- */
232
- export declare interface CancellableAsyncLock {
233
- /**
234
- * Returns a promise that resolves to the value returned by the provided task function.
235
- * Only 1 task can be invoked at a time for a given `key` value.
236
- *
237
- * An acquire call can be cancelled via an `abortSignal`.
238
- * If cancelled, the promise will be rejected with an `AbortError`.
239
- *
240
- * `acquireTimeoutInMs` can also be provided to properties.
241
- * If the timeout is reached before the provided `task` is invoked,
242
- * then the promise will be rejected with an Error stating the task
243
- * timed out waiting to acquire a lock.
244
- *
245
- * @param key - All `acquire` calls are grouped by the provided `key`.
246
- * @param task - The function to invoke once the lock has been acquired.
247
- * @param properties - Additional properties to control the behavior of `acquire`.
248
- */
249
- acquire<T = void>(key: string, task: (...args: any[]) => Promise<T>, properties: AcquireLockProperties): Promise<T>;
250
- }
251
-
252
- /**
253
- * Describes the EventHub/ServiceBus Cbs client that talks to the $cbs endpoint over AMQP connection.
254
- */
255
- export declare class CbsClient {
256
- /**
257
- * CBS endpoint - "$cbs"
258
- */
259
- readonly endpoint: string;
260
- /**
261
- * CBS replyTo - The receiver link name that the service should reply to.
262
- */
263
- readonly replyTo: string;
264
- /**
265
- * The unique lock name per $cbs session per connection that is used to
266
- * acquire the lock for establishing a cbs session if one does not exist for an amqp connection.
267
- */
268
- readonly cbsLock: string;
269
- /**
270
- * The unique lock name per connection that is used to
271
- * acquire the lock for establishing an amqp connection if one does not exist.
272
- */
273
- readonly connectionLock: string;
274
- /**
275
- * The AMQP connection.
276
- */
277
- connection: Connection;
278
- /**
279
- * CBS sender, receiver on the same session.
280
- */
281
- private _cbsSenderReceiverLink?;
282
- /**
283
- * @param connection - The AMQP connection.
284
- * @param connectionLock - A unique string (usually a guid) per connection.
285
- */
286
- constructor(connection: Connection, connectionLock: string);
287
- /**
288
- * Creates a singleton instance of the CBS session if it hasn't been initialized previously on
289
- * the given connection.
290
- * @param options - Optional parameters that can be used to affect this method's behavior.
291
- * For example, `abortSignal` can be passed to allow cancelling an in-progress `init` invocation.
292
- * @returns Promise<void>.
293
- */
294
- init(options?: {
295
- abortSignal?: AbortSignalLike;
296
- timeoutInMs?: number;
297
- }): Promise<void>;
298
- /**
299
- * Negotiates the CBS claim with the EventHub/ServiceBus Service.
300
- * @param audience - The entity token audience for which the token is requested in one
301
- * of the following forms:
302
- *
303
- * - **ServiceBus**
304
- * - **Sender**
305
- * - `"sb://<yournamespace>.servicebus.windows.net/<queue-name>"`
306
- * - `"sb://<yournamespace>.servicebus.windows.net/<topic-name>"`
307
- *
308
- * - **Receiver**
309
- * - `"sb://<yournamespace>.servicebus.windows.net/<queue-name>"`
310
- * - `"sb://<yournamespace>.servicebus.windows.net/<topic-name>"`
311
- *
312
- * - **ManagementClient**
313
- * - `"sb://<your-namespace>.servicebus.windows.net/<queue-name>/$management"`.
314
- * - `"sb://<your-namespace>.servicebus.windows.net/<topic-name>/$management"`.
315
- *
316
- * - **EventHubs**
317
- * - **Sender**
318
- * - `"sb://<yournamespace>.servicebus.windows.net/<hubName>"`
319
- * - `"sb://<yournamespace>.servicebus.windows.net/<hubName>/Partitions/<partitionId>"`.
320
- *
321
- * - **Receiver**
322
- * - `"sb://<your-namespace>.servicebus.windows.net/<event-hub-name>/ConsumerGroups/<consumer-group-name>/Partitions/<partition-id>"`.
323
- *
324
- * - **ManagementClient**
325
- * - `"sb://<your-namespace>.servicebus.windows.net/<event-hub-name>/$management"`.
326
- * @param token - The token that needs to be sent in the put-token request.
327
- * @param tokenType - The type of token being used. For example, 'jwt' or 'servicebus.windows.net:sastoken'.
328
- * @param options - Optional parameters that can be used to affect this method's behavior.
329
- * For example, `abortSignal` can be passed to allow cancelling an in-progress `negotiateClaim` invocation.
330
- * @returns A Promise that resolves when $cbs authentication is successful
331
- * and rejects when an error occurs during $cbs authentication.
332
- */
333
- negotiateClaim(audience: string, token: string, tokenType: TokenType, options?: {
334
- abortSignal?: AbortSignalLike;
335
- timeoutInMs?: number;
336
- }): Promise<CbsResponse>;
337
- /**
338
- * Closes the AMQP cbs session to the EventHub/ServiceBus for this client,
339
- * returning a promise that will be resolved when disconnection is completed.
340
- * @returns
341
- */
342
- close(): Promise<void>;
343
- /**
344
- * Removes the AMQP cbs session to the EventHub/ServiceBus for this client,
345
- * @returns void
346
- */
347
- remove(): void;
348
- /**
349
- * Indicates whether the cbs sender receiver link is open or closed.
350
- * @returns `true` open, `false` closed.
351
- */
352
- isOpen(): boolean;
353
- private _fromRheaMessageResponse;
354
- }
355
-
356
- /**
357
- * Describes the CBS Response.
358
- */
359
- export declare interface CbsResponse {
360
- correlationId: string;
361
- statusCode: string;
362
- statusDescription: string;
363
- }
364
-
365
- /**
366
- * Maps the amqp error conditions to the Error names.
367
- */
368
- export declare enum ConditionErrorNameMapper {
369
- /**
370
- * Error is thrown when the address is already in use.
371
- */
372
- "com.microsoft:address-already-in-use" = "AddressAlreadyInUseError",
373
- /**
374
- * Error is thrown when the store lock is lost.
375
- */
376
- "com.microsoft:store-lock-lost" = "StoreLockLostError",
377
- /**
378
- * Error is thrown when a matching subscription is not found.
379
- */
380
- "com.microsoft:no-matching-subscription" = "NoMatchingSubscriptionError",
381
- /**
382
- * Error is thrown when an attempt is made to access a partition that is not owned by the
383
- * requesting entity.
384
- */
385
- "com.microsoft:partition-not-owned" = "PartitionNotOwnedError",
386
- /**
387
- * Error is thrown when access to publisher has been revoked.
388
- */
389
- "com.microsoft:publisher-revoked" = "PublisherRevokedError",
390
- /**
391
- * Error is thrown when an attempt is made to create an entity that already exists.
392
- */
393
- "com.microsoft:entity-already-exists" = "MessagingEntityAlreadyExistsError",
394
- /**
395
- * Error is thrown when trying to access/connect to a disabled messaging entity.
396
- */
397
- "com.microsoft:entity-disabled" = "MessagingEntityDisabledError",
398
- /**
399
- * Error is thrown when the lock on the message is lost.
400
- */
401
- "com.microsoft:message-lock-lost" = "MessageLockLostError",
402
- /**
403
- * Error is thrown when the lock on the Azure ServiceBus session is lost.
404
- */
405
- "com.microsoft:session-lock-lost" = "SessionLockLostError",
406
- /**
407
- * Error is thrown when the Azure ServiceBus session cannot be locked.
408
- */
409
- "com.microsoft:session-cannot-be-locked" = "SessionCannotBeLockedError",
410
- /**
411
- * Error is thrown when an internal server error occurred. You may have found a bug?
412
- */
413
- "amqp:internal-error" = "InternalServerError",// Retryable
414
- /**
415
- * Error for signaling general communication errors related to messaging operations.
416
- */
417
- "amqp:not-found" = "ServiceCommunicationError",
418
- /**
419
- * Error is thrown when the message is not found.
420
- */
421
- "com.microsoft:message-not-found" = "MessageNotFoundError",
422
- /**
423
- * Error is thrown when relay is not found.
424
- */
425
- "com.microsoft:relay-not-found" = "RelayNotFoundError",
426
- /**
427
- * Error is thrown when a feature is not implemented yet but the placeholder is present.
428
- */
429
- "amqp:not-implemented" = "NotImplementedError",
430
- /**
431
- * Error is thrown when an operation is attempted but is not allowed.
432
- */
433
- "amqp:not-allowed" = "InvalidOperationError",
434
- /**
435
- * Error is thrown the the Azure EventHub/ServiceBus quota has been exceeded.
436
- * Quotas are reset periodically, this operation will have to wait until then.
437
- * The messaging entity has reached its maximum allowable size.
438
- * This can happen if the maximum number of receivers (which is 5) has already
439
- * been opened on a per-consumer group level.
440
- */
441
- "amqp:resource-limit-exceeded" = "QuotaExceededError",
442
- /**
443
- * Error is thrown when the connection parameters are wrong and the server refused the connection.
444
- */
445
- "amqp:unauthorized-access" = "UnauthorizedError",
446
- /**
447
- * Error is thrown when the connection parameters are wrong and the server refused the connection.
448
- */
449
- "com.microsoft:auth-failed" = "UnauthorizedError",
450
- /**
451
- * Error is thrown when the service is unavailable. The operation should be retried.
452
- */
453
- "com.microsoft:timeout" = "ServiceUnavailableError",// Retryable
454
- /**
455
- * Error is thrown when no new messages are received for the specified time.
456
- */
457
- "com.microsoft:message-wait-timeout" = "MessageWaitTimeout",
458
- /**
459
- * Error is thrown when an argument has a value that is out of the admissible range.
460
- */
461
- "com.microsoft:argument-out-of-range" = "ArgumentOutOfRangeError",
462
- /**
463
- * Error is thrown when a condition that should have been met in order to execute an operation was not.
464
- */
465
- "amqp:precondition-failed" = "PreconditionFailedError",
466
- /**
467
- * Error is thrown when a condition that should have been met in order to execute an operation was not.
468
- */
469
- "com.microsoft:precondition-failed" = "PreconditionFailedError",
470
- /**
471
- * Error is thrown when data could not be decoded.
472
- */
473
- "amqp:decode-error" = "DecodeError",
474
- /**
475
- * Error is thrown when an invalid field was passed in a frame body, and the operation could not proceed.
476
- */
477
- "amqp:invalid-field" = "InvalidFieldError",
478
- /**
479
- * Error is thrown when the client attempted to work with a server entity to which it
480
- * has no access because another client is working with it.
481
- */
482
- "amqp:resource-locked" = "ResourceLockedError",
483
- /**
484
- * Error is thrown when a server entity the client is working with has been deleted.
485
- */
486
- "amqp:resource-deleted" = "ResourceDeletedError",
487
- /**
488
- * Error is thrown when the peer sent a frame that is not permitted in the current state.
489
- */
490
- "amqp:illegal-state" = "IllegalStateError",
491
- /**
492
- * Error is thrown when the peer cannot send a frame because the smallest encoding of
493
- * the performative with the currently valid values would be too large to fit within
494
- * a frame of the agreed maximum frame size.
495
- */
496
- "amqp:frame-size-too-small" = "FrameSizeTooSmallError",
497
- /**
498
- * Error is thrown when an operator intervened to detach for some reason.
499
- */
500
- "amqp:link:detach-forced" = "DetachForcedError",// Retryable
501
- /**
502
- * Error is thrown when the peer sent more message transfers than currently allowed on the link.
503
- */
504
- "amqp:link:transfer-limit-exceeded" = "TransferLimitExceededError",// Retryable
505
- /**
506
- * Error is thrown when the message sent is too large: the maximum size is 256Kb.
507
- */
508
- "amqp:link:message-size-exceeded" = "MessageTooLargeError",
509
- /**
510
- * Error is thrown when the address provided cannot be resolved to a terminus at the current container.
511
- */
512
- "amqp:link:redirect" = "LinkRedirectError",
513
- /**
514
- * Error is thrown when two or more instances connect to the same partition
515
- * with different epoch values.
516
- */
517
- "amqp:link:stolen" = "ReceiverDisconnectedError",
518
- /**
519
- * Error is thrown when the peer violated incoming window for the session.
520
- */
521
- "amqp:session:window-violation" = "SessionWindowViolationError",
522
- /**
523
- * Error is thrown when input was received for a link that was detached with an error.
524
- */
525
- "amqp:session:errant-link" = "ErrantLinkError",
526
- /**
527
- * Error is thrown when an attach was received using a handle that is already in use for an attached link.
528
- */
529
- "amqp:session:handle-in-use" = "HandleInUseError",
530
- /**
531
- * Error is thrown when a frame (other than attach) was received referencing a handle which is not
532
- * currently in use of an attached link.
533
- */
534
- "amqp:session:unattached-handle" = "UnattachedHandleError",
535
- /**
536
- * Error is thrown when an operator intervened to close the connection for some reason.
537
- */
538
- "amqp:connection:forced" = "ConnectionForcedError",// Retryable
539
- /**
540
- * Error is thrown when a valid frame header cannot be formed from the incoming byte stream.
541
- */
542
- "amqp:connection:framing-error" = "FramingError",
543
- /**
544
- * Error is thrown when the container is no longer available on the current connection.
545
- */
546
- "amqp:connection:redirect" = "ConnectionRedirectError",
547
- /**
548
- * Error is thrown when the server is busy. Callers should wait a while and retry the operation.
549
- */
550
- "com.microsoft:server-busy" = "ServerBusyError",// Retryable
551
- /**
552
- * Error is thrown when an incorrect argument was received.
553
- */
554
- "com.microsoft:argument-error" = "ArgumentError",
555
- /**
556
- * Error is thrown when server cancels the operation due to an internal issue.
557
- */
558
- "com.microsoft:operation-cancelled" = "OperationCancelledError",// Retryable
559
- /**
560
- * Error is thrown when the client sender does not have enough link credits to send the message.
561
- */
562
- "client.sender:not-enough-link-credit" = "SenderBusyError",// Retryable
563
- /**
564
- * Error is thrown when the client sender's link isn't ready
565
- */
566
- "client.sender:link-not-ready" = "SenderNotReadyError",// Retryable
567
- /**
568
- * Error is thrown when a low level system error is thrown by node.js.
569
- * {@link https://nodejs.org/dist/latest-v8.x/docs/api/all.html#errors_class_system_error}
570
- */
571
- "system:error" = "SystemError"
572
- }
573
-
574
- /**
575
- * Describes the connection config object that is created after parsing an EventHub or ServiceBus
576
- * connection string.
577
- */
578
- export declare interface ConnectionConfig {
579
- /**
580
- * The service bus endpoint
581
- * "sb://<yournamespace>.servicebus.windows.net/".
582
- */
583
- endpoint: string;
584
- /**
585
- * The DNS hostname or IP address of the service.
586
- * Typically of the form "<yournamespace>.servicebus.windows.net" unless connecting
587
- * to the service through an intermediary.
588
- */
589
- host: string;
590
- /**
591
- * The fully qualified name of the host to connect to.
592
- * This field can be used by AMQP proxies to determine the correct back-end service to
593
- * connect the client to.
594
- * Typically of the form "<yournamespace>.servicebus.windows.net".
595
- */
596
- amqpHostname?: string;
597
- /**
598
- * The port number.
599
- */
600
- port?: number;
601
- /**
602
- * The connection string.
603
- */
604
- connectionString: string;
605
- /**
606
- * The name/path of the entity (hub/queue/topic name) to which the
607
- * connection needs to happen.
608
- */
609
- entityPath?: string;
610
- /**
611
- * The name of the access key.
612
- */
613
- sharedAccessKeyName: string;
614
- /**
615
- * The secret value of the access key.
616
- */
617
- sharedAccessKey: string;
618
- /**
619
- * The WebSocket constructor used to create an AMQP connection
620
- * over a WebSocket. In browsers, the built-in WebSocket will be used by default. In Node, a
621
- * TCP socket will be used if a WebSocket constructor is not provided.
622
- */
623
- webSocket?: WebSocketImpl;
624
- /**
625
- * The path for the endpoint that accepts an AMQP
626
- * connection over WebSockets.
627
- */
628
- webSocketEndpointPath?: string;
629
- /**
630
- * Options to be passed to the WebSocket constructor
631
- */
632
- webSocketConstructorOptions?: any;
633
- /**
634
- * This should be true only if the connection string contains the slug ";UseDevelopmentEmulator=true"
635
- * and the endpoint is a loopback address.
636
- */
637
- useDevelopmentEmulator?: boolean;
638
- }
639
-
640
- /**
641
- * Describes the ConnectionConfig module
642
- */
643
- export declare const ConnectionConfig: {
644
- /**
645
- * Creates the connection config.
646
- * @param connectionString - The connection string for a given service like
647
- * EventHub/ServiceBus.
648
- * @param path - The name/path of the entity (hub name) to which the
649
- * connection needs to happen. This will override the EntityPath in the connectionString
650
- * if present.
651
- * @returns ConnectionConfig
652
- */
653
- create(connectionString: string, path?: string): ConnectionConfig;
654
- /**
655
- * Validates the properties of connection config.
656
- * @param config - The connection config to be validated.
657
- * @returns void
658
- */
659
- validate(config: ConnectionConfig, options?: ConnectionConfigOptions): void;
660
- };
661
-
662
- /**
663
- * Describes the options that can be provided while creating a connection config.
664
- */
665
- export declare interface ConnectionConfigOptions {
666
- /**
667
- * Indicates whether the entity path is required in the
668
- * connection config.
669
- */
670
- isEntityPathRequired?: boolean;
671
- }
672
-
673
- /**
674
- * Provides contextual information like the underlying amqp connection, cbs session, tokenProvider,
675
- * Connection config, data transformer, etc.
676
- */
677
- export declare interface ConnectionContextBase {
678
- /**
679
- * The EventHub connection config that is created after
680
- * parsing the connection string.
681
- */
682
- readonly config: ConnectionConfig;
683
- /**
684
- * The unique lock name per connection that is used to
685
- * acquire the lock for establishing an amqp connection per client if one does not exist.
686
- */
687
- connectionLock: string;
688
- /**
689
- * The unique lock name per connection that is used to
690
- * acquire the lock for negotiating cbs claim by an entity on that connection.
691
- */
692
- negotiateClaimLock: string;
693
- /**
694
- * The underlying AMQP connection.
695
- */
696
- connection: Connection;
697
- /**
698
- * The amqp connection id that uniquely identifies the
699
- * connection within a process.
700
- */
701
- connectionId: string;
702
- /**
703
- * Indicates whether the close() method was
704
- * called on the connection object.
705
- */
706
- wasConnectionCloseCalled: boolean;
707
- /**
708
- * A reference to the cbs session ($cbs endpoint) on the
709
- * underlying AMQP connection for the EventHub Client.
710
- */
711
- cbsSession: CbsClient;
712
- /**
713
- * Updates the context to use a new underlying AMQP connection and new cbs session.
714
- */
715
- refreshConnection: () => void;
716
- }
717
-
718
- export declare const ConnectionContextBase: {
719
- /**
720
- * Creates the base connection context.
721
- * @param parameters - Parameters to be provided to create
722
- * the base connection context.
723
- */
724
- create(parameters: CreateConnectionContextBaseParameters): ConnectionContextBase;
725
- };
726
-
727
- /**
728
- * Defines the properties that need to be set while establishing the AMQP connection.
729
- */
730
- export declare interface ConnectionProperties {
731
- /**
732
- * The name of the product that will be populated as the AMQP
733
- * connection property. Example: "MSJSClient".
734
- */
735
- product: string;
736
- /**
737
- * The version of the package/sdk that is making the AMQP connection.
738
- */
739
- version: string;
740
- /**
741
- * The userAgent that needs to be set as the AMQP connection
742
- * property. Example: `"/js-service-bus"` or `"/js-event-hubs,/js-event-processor-host=1.0.0"`.
743
- */
744
- userAgent: string;
745
- }
746
-
747
- export declare const Constants: {
748
- readonly associatedLinkName: "associated-link-name";
749
- readonly partitionKey: "x-opt-partition-key";
750
- readonly sequenceNumber: "x-opt-sequence-number";
751
- readonly enqueueSequenceNumber: "x-opt-enqueue-sequence-number";
752
- readonly enqueuedTime: "x-opt-enqueued-time";
753
- readonly scheduledEnqueueTime: "x-opt-scheduled-enqueue-time";
754
- readonly offset: "x-opt-offset";
755
- readonly lockedUntil: "x-opt-locked-until";
756
- readonly partitionIdName: "x-opt-partition-id";
757
- readonly publisher: "x-opt-publisher-name";
758
- readonly viaPartitionKey: "x-opt-via-partition-key";
759
- readonly deadLetterSource: "x-opt-deadletter-source";
760
- readonly messageState: "x-opt-message-state";
761
- readonly enqueuedTimeAnnotation: "amqp.annotation.x-opt-enqueued-time";
762
- readonly offsetAnnotation: "amqp.annotation.x-opt-offset";
763
- readonly sequenceNumberAnnotation: "amqp.annotation.x-opt-sequence-number";
764
- readonly guidSize: 16;
765
- readonly message: "message";
766
- readonly error: "error";
767
- readonly statusCode: "status-code";
768
- readonly statusDescription: "status-description";
769
- readonly errorCondition: "error-condition";
770
- readonly management: "$management";
771
- readonly partition: "partition";
772
- readonly partitionId: "partitionId";
773
- readonly readOperation: "READ";
774
- readonly TLS: "tls";
775
- readonly TCP: "tcp";
776
- readonly establishConnection: "establishConnection";
777
- readonly defaultConsumerGroup: "$default";
778
- readonly eventHub: "eventhub";
779
- readonly cbsEndpoint: "$cbs";
780
- readonly cbsReplyTo: "cbs";
781
- readonly operationPutToken: "put-token";
782
- readonly aadEventHubsAudience: "https://eventhubs.azure.net/";
783
- readonly aadEventHubsScope: "https://eventhubs.azure.net//.default";
784
- readonly aadServiceBusAudience: "https://servicebus.azure.net/";
785
- readonly aadServiceBusScope: "https://servicebus.azure.net//.default";
786
- readonly maxUserAgentLength: 512;
787
- readonly vendorString: "com.microsoft";
788
- readonly attachEpoch: "com.microsoft:epoch";
789
- readonly receiverIdentifierName: "com.microsoft:receiver-name";
790
- readonly enableReceiverRuntimeMetricName: "com.microsoft:enable-receiver-runtime-metric";
791
- readonly geoReplication: "com.microsoft:georeplication";
792
- readonly timespan: "com.microsoft:timespan";
793
- readonly uri: "com.microsoft:uri";
794
- readonly dateTimeOffset: "com.microsoft:datetime-offset";
795
- readonly sessionFilterName: "com.microsoft:session-filter";
796
- readonly receiverError: "receiver_error";
797
- readonly senderError: "sender_error";
798
- readonly sessionError: "session_error";
799
- readonly connectionError: "connection_error";
800
- readonly defaultOperationTimeoutInMs: 60000;
801
- readonly defaultConnectionIdleTimeoutInMs: 60000;
802
- readonly managementRequestKey: "managementRequest";
803
- readonly negotiateCbsKey: "negotiateCbs";
804
- readonly negotiateClaim: "negotiateClaim";
805
- readonly ensureContainerAndBlob: "ensureContainerAndBlob";
806
- readonly defaultPrefetchCount: 1000;
807
- readonly reconnectLimit: 100;
808
- readonly maxMessageIdLength: 128;
809
- readonly maxPartitionKeyLength: 128;
810
- readonly maxSessionIdLength: 128;
811
- readonly pathDelimiter: "/";
812
- readonly ruleNameMaximumLength: 50;
813
- readonly maximumSqlFilterStatementLength: 1024;
814
- readonly maximumSqlRuleActionStatementLength: 1024;
815
- readonly maxDeadLetterReasonLength: 4096;
816
- readonly maxDurationValue: 922337203685477;
817
- readonly minDurationValue: -922337203685477;
818
- readonly maxAbsoluteExpiryTime: number;
819
- readonly maxUint32Value: 4294967295;
820
- readonly aadTokenValidityMarginInMs: 5000;
821
- readonly connectionReconnectDelay: 300;
822
- readonly defaultMaxRetries: 3;
823
- readonly defaultMaxRetriesForConnection: 150;
824
- readonly defaultDelayBetweenOperationRetriesInMs: 30000;
825
- readonly defaultMaxDelayForExponentialRetryInMs: 90000;
826
- readonly receiverSettleMode: "receiver-settle-mode";
827
- readonly dispositionStatus: "disposition-status";
828
- readonly fromSequenceNumber: "from-sequence-number";
829
- readonly messageCount: "message-count";
830
- readonly enqueuedTimeUtc: "enqueued-time-utc";
831
- readonly lockTokens: "lock-tokens";
832
- readonly messageIdMapKey: "message-id";
833
- readonly sequenceNumberMapKey: "sequence-number";
834
- readonly lockTokenMapKey: "lock-token";
835
- readonly sessionIdMapKey: "session-id";
836
- readonly sequenceNumbers: "sequence-numbers";
837
- readonly deadLetterReason: "deadletter-reason";
838
- readonly deadLetterDescription: "deadletter-description";
839
- readonly propertiesToModify: "properties-to-modify";
840
- readonly deadLetterName: "com.microsoft:dead-letter";
841
- readonly trackingId: "com.microsoft:tracking-id";
842
- readonly serverTimeout: "com.microsoft:server-timeout";
843
- readonly operations: {
844
- readonly putToken: "put-token";
845
- readonly read: "READ";
846
- readonly cancelScheduledMessage: "com.microsoft:cancel-scheduled-message";
847
- readonly scheduleMessage: "com.microsoft:schedule-message";
848
- readonly renewLock: "com.microsoft:renew-lock";
849
- readonly peekMessage: "com.microsoft:peek-message";
850
- readonly receiveBySequenceNumber: "com.microsoft:receive-by-sequence-number";
851
- readonly deleteMessages: "com.microsoft:batch-delete-messages";
852
- readonly updateDisposition: "com.microsoft:update-disposition";
853
- readonly renewSessionLock: "com.microsoft:renew-session-lock";
854
- readonly setSessionState: "com.microsoft:set-session-state";
855
- readonly getSessionState: "com.microsoft:get-session-state";
856
- readonly enumerateSessions: "com.microsoft:get-message-sessions";
857
- readonly addRule: "com.microsoft:add-rule";
858
- readonly removeRule: "com.microsoft:remove-rule";
859
- readonly enumerateRules: "com.microsoft:enumerate-rules";
860
- };
861
- readonly descriptorCodes: {
862
- readonly ruleDescriptionList: 1335734829060;
863
- readonly sqlFilterList: 83483426822;
864
- readonly correlationFilterList: 83483426825;
865
- readonly sqlRuleActionList: 1335734829062;
866
- readonly trueFilterList: 83483426823;
867
- readonly falseFilterList: 83483426824;
868
- };
869
- };
870
-
871
- /**
872
- * Describes the parameters that can be provided to create the base connection context.
873
- */
874
- export declare interface CreateConnectionContextBaseParameters {
875
- /**
876
- * The connection config that is created by parsing the
877
- * connection string.
878
- */
879
- config: ConnectionConfig;
880
- /**
881
- * Properties to be provided while creating
882
- * the AMQP connection.
883
- */
884
- connectionProperties: ConnectionProperties;
885
- /**
886
- * Determines whether entity path should be a part of
887
- * the connection config. If `true` it must be present, `false` otherwise. Default value false.
888
- */
889
- isEntityPathRequired?: boolean;
890
- /**
891
- * The duration in which the promise should
892
- * complete (resolve/reject). If it is not completed, then the Promise will be rejected after
893
- * timeout occurs. Default: `60000 milliseconds`.
894
- */
895
- operationTimeoutInMs?: number;
896
- }
897
-
898
- /**
899
- * Creates a token provider from the provided shared access data.
900
- * @param data - The sharedAccessKeyName/sharedAccessKey pair or the sharedAccessSignature.
901
- * @hidden
902
- */
903
- export declare function createSasTokenProvider(data: {
904
- sharedAccessKeyName: string;
905
- sharedAccessKey: string;
906
- } | {
907
- sharedAccessSignature: string;
908
- } | NamedKeyCredential | SASCredential): SasTokenProvider;
909
-
910
- /**
911
- * The cancellable async lock instance.
912
- */
913
- export declare const defaultCancellableLock: CancellableAsyncLock;
914
-
915
- /**
916
- * A wrapper for setTimeout that resolves a promise after t milliseconds.
917
- * @param delayInMs - The number of milliseconds to be delayed.
918
- * @param abortSignal - The abortSignal associated with containing operation.
919
- * @param abortErrorMsg - The abort error message associated with containing operation.
920
- * @param value - The value to be resolved with after a timeout of t milliseconds.
921
- * @returns - Resolved promise
922
- */
923
- export declare function delay<T>(delayInMs: number, abortSignal?: AbortSignalLike, abortErrorMsg?: string, value?: T): Promise<T | void>;
924
-
925
- /**
926
- * Maps the Error names to the amqp error conditions.
927
- */
928
- export declare enum ErrorNameConditionMapper {
929
- /**
930
- * Error is thrown when the address is already in use.
931
- */
932
- AddressAlreadyInUseError = "com.microsoft:address-already-in-use",
933
- /**
934
- * Error is thrown when the store lock is lost.
935
- */
936
- StoreLockLostError = "com.microsoft:store-lock-lost",
937
- /**
938
- * Error is thrown when a matching subscription is not found.
939
- */
940
- NoMatchingSubscriptionError = "com.microsoft:no-matching-subscription",
941
- /**
942
- * Error is thrown when an attempt is made to access a partition that is not owned by the
943
- * requesting entity.
944
- */
945
- PartitionNotOwnedError = "com.microsoft:partition-not-owned",
946
- /**
947
- * Error is thrown when access to publisher has been revoked.
948
- */
949
- PublisherRevokedError = "com.microsoft:publisher-revoked",
950
- /**
951
- * Error is thrown when an attempt is made to create an entity that already exists.
952
- */
953
- MessagingEntityAlreadyExistsError = "com.microsoft:entity-already-exists",
954
- /**
955
- * Error is thrown when trying to access/connect to a disabled messaging entity.
956
- */
957
- MessagingEntityDisabledError = "com.microsoft:entity-disabled",
958
- /**
959
- * Error is thrown when the lock on the message is lost.
960
- */
961
- MessageLockLostError = "com.microsoft:message-lock-lost",
962
- /**
963
- * Error is thrown when the lock on the Azure ServiceBus session is lost.
964
- */
965
- SessionLockLostError = "com.microsoft:session-lock-lost",
966
- /**
967
- * Error is thrown when the Azure ServiceBus session cannot be locked.
968
- */
969
- SessionCannotBeLockedError = "com.microsoft:session-cannot-be-locked",
970
- /**
971
- * Error is thrown when an internal server error occurred. You may have found a bug?
972
- */
973
- InternalServerError = "amqp:internal-error",// Retryable
974
- /**
975
- * Error for signaling general communication errors related to messaging operations.
976
- */
977
- ServiceCommunicationError = "amqp:not-found",
978
- /**
979
- * Error is thrown when message is not found.
980
- */
981
- MessageNotFoundError = "com.microsoft:message-not-found",
982
- /**
983
- * Error is thrown when relay is not found.
984
- */
985
- RelayNotFoundError = "com.microsoft:relay-not-found",
986
- /**
987
- * Error is thrown when a feature is not implemented yet but the placeholder is present.
988
- */
989
- NotImplementedError = "amqp:not-implemented",
990
- /**
991
- * Error is thrown when an operation is attempted but is not allowed.
992
- */
993
- InvalidOperationError = "amqp:not-allowed",
994
- /**
995
- * Error is thrown the the Azure EventHub/ServiceBus quota has been exceeded.
996
- * Quotas are reset periodically, this operation will have to wait until then.
997
- * The messaging entity has reached its maximum allowable size.
998
- * This can happen if the maximum number of receivers (which is 5) has already
999
- * been opened on a per-consumer group level.
1000
- */
1001
- QuotaExceededError = "amqp:resource-limit-exceeded",
1002
- /**
1003
- * Error is thrown when the connection parameters are wrong and the server refused the connection.
1004
- */
1005
- UnauthorizedError = "amqp:unauthorized-access",
1006
- /**
1007
- * Error is thrown when the service is unavailable. The operation should be retried.
1008
- */
1009
- ServiceUnavailableError = "com.microsoft:timeout",// Retryable
1010
- /**
1011
- * Error is thrown when no new messages are received for the specified time.
1012
- */
1013
- MessageWaitTimeout = "com.microsoft:message-wait-timeout",
1014
- /**
1015
- * Error is thrown when an argument has a value that is out of the admissible range.
1016
- */
1017
- ArgumentOutOfRangeError = "com.microsoft:argument-out-of-range",
1018
- /**
1019
- * Error is thrown when a condition that should have been met in order to execute an operation was not.
1020
- */
1021
- PreconditionFailedError = "amqp:precondition-failed",
1022
- /**
1023
- * Error is thrown when data could not be decoded.
1024
- */
1025
- DecodeError = "amqp:decode-error",
1026
- /**
1027
- * Error is thrown when an invalid field was passed in a frame body, and the operation could not proceed.
1028
- */
1029
- InvalidFieldError = "amqp:invalid-field",
1030
- /**
1031
- * Error is thrown when the client attempted to work with a server entity to which it
1032
- * has no access because another client is working with it.
1033
- */
1034
- ResourceLockedError = "amqp:resource-locked",
1035
- /**
1036
- * Error is thrown when a server entity the client is working with has been deleted.
1037
- */
1038
- ResourceDeletedError = "amqp:resource-deleted",
1039
- /**
1040
- * Error is thrown when the peer sent a frame that is not permitted in the current state.
1041
- */
1042
- IllegalStateError = "amqp:illegal-state",
1043
- /**
1044
- * Error is thrown when the peer cannot send a frame because the smallest encoding of
1045
- * the performative with the currently valid values would be too large to fit within
1046
- * a frame of the agreed maximum frame size.
1047
- */
1048
- FrameSizeTooSmallError = "amqp:frame-size-too-small",
1049
- /**
1050
- * Error is thrown when an operator intervened to detach for some reason.
1051
- */
1052
- DetachForcedError = "amqp:link:detach-forced",// Retryable
1053
- /**
1054
- * Error is thrown when the peer sent more message transfers than currently allowed on the link.
1055
- */
1056
- TransferLimitExceededError = "amqp:link:transfer-limit-exceeded",// Retryable
1057
- /**
1058
- * Error is thrown when the message sent is too large: the maximum size is 256Kb.
1059
- */
1060
- MessageTooLargeError = "amqp:link:message-size-exceeded",
1061
- /**
1062
- * Error is thrown when the address provided cannot be resolved to a terminus at the current container.
1063
- */
1064
- LinkRedirectError = "amqp:link:redirect",
1065
- /**
1066
- * Error is thrown when two or more instances connect to the same partition
1067
- * with different epoch values.
1068
- */
1069
- ReceiverDisconnectedError = "amqp:link:stolen",
1070
- /**
1071
- * Error is thrown when the peer violated incoming window for the session.
1072
- */
1073
- SessionWindowViolationError = "amqp:session:window-violation",
1074
- /**
1075
- * Error is thrown when input was received for a link that was detached with an error.
1076
- */
1077
- ErrantLinkError = "amqp:session:errant-link",
1078
- /**
1079
- * Error is thrown when an attach was received using a handle that is already in use for an attached link.
1080
- */
1081
- HandleInUseError = "amqp:session:handle-in-use",
1082
- /**
1083
- * Error is thrown when a frame (other than attach) was received referencing a handle which is not
1084
- * currently in use of an attached link.
1085
- */
1086
- UnattachedHandleError = "amqp:session:unattached-handle",
1087
- /**
1088
- * Error is thrown when an operator intervened to close the connection for some reason.
1089
- */
1090
- ConnectionForcedError = "amqp:connection:forced",// Retryable
1091
- /**
1092
- * Error is thrown when a valid frame header cannot be formed from the incoming byte stream.
1093
- */
1094
- FramingError = "amqp:connection:framing-error",
1095
- /**
1096
- * Error is thrown when the container is no longer available on the current connection.
1097
- */
1098
- ConnectionRedirectError = "amqp:connection:redirect",
1099
- /**
1100
- * Error is thrown when the server is busy. Callers should wait a while and retry the operation.
1101
- */
1102
- ServerBusyError = "com.microsoft:server-busy",// Retryable
1103
- /**
1104
- * Error is thrown when an incorrect argument was received.
1105
- */
1106
- ArgumentError = "com.microsoft:argument-error",
1107
- /**
1108
- * Error is thrown when server cancels the operation due to an internal issue.
1109
- */
1110
- OperationCancelledError = "com.microsoft:operation-cancelled",// Retryable
1111
- /**
1112
- * Error is thrown when the client sender does not have enough link credits to send the message.
1113
- */
1114
- SenderBusyError = "client.sender:not-enough-link-credit",// Retryable
1115
- /**
1116
- * Error is thrown when the client sender's link isn't ready
1117
- */
1118
- SenderNotReadyError = "client.sender:link-not-ready",// Retryable
1119
- /**
1120
- * Error is thrown when a low level system error is thrown by node.js.
1121
- * {@link https://nodejs.org/api/errors.html#errors_class_systemerror}
1122
- */
1123
- SystemError = "system:error"
1124
- }
1125
-
1126
- /**
1127
- * Determines if an error is a MessagingError.
1128
- *
1129
- * @param error - An error that can either be an Error or a MessagingError.
1130
- */
1131
- export declare function isMessagingError(error: Error | MessagingError): error is MessagingError;
1132
-
1133
- /**
1134
- * Typeguard that checks if the input is a SasTokenProvider.
1135
- * @param thing - Any object.
1136
- * @hidden
1137
- */
1138
- export declare function isSasTokenProvider(thing: unknown): thing is SasTokenProvider;
1139
-
1140
- /**
1141
- * Checks whether the provided error is a node.js SystemError.
1142
- * @param err - An object that may contain error information.
1143
- */
1144
- export declare function isSystemError(err: unknown): err is NetworkSystemError;
1145
-
1146
- /**
1147
- * The \@azure/logger configuration for this package.
1148
- * This will output logs using the `azure:event-hubs` namespace prefix.
1149
- */
1150
- export declare const logger: AzureLogger;
1151
-
1152
- /**
1153
- * Describes the base class for Messaging Error.
1154
- */
1155
- export declare class MessagingError extends Error {
1156
- /**
1157
- * Address to which the network connection failed.
1158
- * Only present if the `MessagingError` was instantiated with a Node.js `SystemError`.
1159
- */
1160
- address?: string;
1161
- /**
1162
- * A string label that identifies the error.
1163
- */
1164
- code?: string;
1165
- /**
1166
- * System-provided error number.
1167
- * Only present if the `MessagingError` was instantiated with a Node.js `SystemError`.
1168
- */
1169
- errno?: number | string;
1170
- /**
1171
- * The error name. Default value: "MessagingError".
1172
- */
1173
- name: string;
1174
- /**
1175
- * The unavailable network connection port.
1176
- * Only present if the `MessagingError` was instantiated with a Node.js `SystemError`.
1177
- */
1178
- port?: number;
1179
- /**
1180
- * Name of the system call that triggered the error.
1181
- * Only present if the `MessagingError` was instantiated with a Node.js `SystemError`.
1182
- */
1183
- syscall?: string;
1184
- /**
1185
- *
1186
- * Describes whether the error is retryable. Default: true.
1187
- */
1188
- retryable: boolean;
1189
- /**
1190
- * Extra details about the error.
1191
- */
1192
- info?: any;
1193
- /**
1194
- * @param message - The error message that provides more information about the error.
1195
- * @param originalError - An error whose properties will be copied to the MessagingError if the
1196
- * property matches one found on the Node.js `SystemError`.
1197
- */
1198
- constructor(message: string, originalError?: Error);
1199
- }
1200
-
1201
- /**
1202
- * Describes the fields on a Node.js SystemError.
1203
- * Omits fields that are not related to network calls (e.g. file system calls).
1204
- * See https://nodejs.org/dist/latest-v12.x/docs/api/errors.html#errors_class_systemerror
1205
- */
1206
- export declare interface NetworkSystemError {
1207
- address?: string;
1208
- code: string;
1209
- errno: string | number;
1210
- info?: any;
1211
- message: string;
1212
- name: string;
1213
- port?: number;
1214
- stack: string;
1215
- syscall: string;
1216
- }
1217
-
1218
- /**
1219
- * Parses the connection string and returns an object of type T.
1220
- *
1221
- * Connection strings have the following syntax:
1222
- *
1223
- * ConnectionString ::= `Part { ";" Part } [ ";" ] [ WhiteSpace ]`
1224
- * Part ::= [ PartLiteral [ "=" PartLiteral ] ]
1225
- * PartLiteral ::= [ WhiteSpace ] Literal [ WhiteSpace ]
1226
- * Literal ::= ? any sequence of characters except ; or = or WhiteSpace ?
1227
- * WhiteSpace ::= ? all whitespace characters including `\r` and `\n` ?
1228
- *
1229
- * @param connectionString - The connection string to be parsed.
1230
- * @returns ParsedOutput<T>.
1231
- */
1232
- export declare function parseConnectionString<T>(connectionString: string): ParsedOutput<T>;
1233
-
1234
- /**
1235
- * Defines an object with possible properties defined in T.
1236
- */
1237
- export declare type ParsedOutput<T> = {
1238
- [P in keyof T]: T[P];
1239
- };
1240
-
1241
- /**
1242
- * Describes an amqp request(sender)-response(receiver) link that is created over an amqp session.
1243
- */
1244
- export declare class RequestResponseLink implements ReqResLink {
1245
- session: Session;
1246
- sender: Sender;
1247
- receiver: Receiver;
1248
- /**
1249
- * @param session - The amqp session.
1250
- * @param sender - The amqp sender link.
1251
- * @param receiver - The amqp receiver link.
1252
- */
1253
- constructor(session: Session, sender: Sender, receiver: Receiver);
1254
- /**
1255
- * Maintains a map of responses that
1256
- * are being actively returned. It acts as a store for correlating the responses received for
1257
- * the send requests.
1258
- */
1259
- private _responsesMap;
1260
- /**
1261
- * Provides the underlying amqp connection object.
1262
- * @returns Connection.
1263
- */
1264
- get connection(): Connection;
1265
- /**
1266
- * Indicates whether the session and the sender and receiver links are all open or closed.
1267
- * @returns boolean - `true` - `open`, `false` - `closed`.
1268
- */
1269
- isOpen(): boolean;
1270
- /**
1271
- * Sends the given request message and returns the received response. If the operation is not
1272
- * completed in the provided timeout in milliseconds `default: 60000`, then `OperationTimeoutError` is thrown.
1273
- *
1274
- * @param request - The AMQP (request) message.
1275
- * @param options - Options that can be provided while sending a request.
1276
- * @returns Promise<Message> The AMQP (response) message.
1277
- */
1278
- sendRequest(request: Message, options?: SendRequestOptions): Promise<Message>;
1279
- /**
1280
- * Closes the sender, receiver link and the underlying session.
1281
- * @returns Promise<void>
1282
- */
1283
- close(): Promise<void>;
1284
- /**
1285
- * Removes the sender, receiver link and it's underlying session.
1286
- * @returns void
1287
- */
1288
- remove(): void;
1289
- /**
1290
- * Creates an amqp request/response link.
1291
- *
1292
- * @param connection - The amqp connection.
1293
- * @param senderOptions - Options that must be provided to create the sender link.
1294
- * @param receiverOptions - Options that must be provided to create the receiver link.
1295
- * @param createOptions - Optional parameters that can be used to affect this method's behavior.
1296
- * For example, `abortSignal` can be passed to allow cancelling an in-progress `create` invocation.
1297
- * @returns Promise<RequestResponseLink>
1298
- */
1299
- static create(connection: Connection, senderOptions: SenderOptions, receiverOptions: ReceiverOptions, createOptions?: {
1300
- abortSignal?: AbortSignalLike;
1301
- }): Promise<RequestResponseLink>;
1302
- }
1303
-
1304
- /**
1305
- * Every operation is attempted at least once. Additional attempts are made if the previous attempt failed
1306
- * with a retryable error. The number of additional attempts is governed by the `maxRetries` property provided
1307
- * on the `RetryConfig` argument.
1308
- *
1309
- * If `mode` option is set to `Fixed`, then the retries are made on the
1310
- * given operation for a specified number of times, with a fixed delay in between each retry each time.
1311
- *
1312
- * If `mode` option is set to `Exponential`, then the delay between retries is adjusted to increase
1313
- * exponentially with each attempt using back-off factor of power 2.
1314
- *
1315
- * @param config - Parameters to configure retry operation
1316
- *
1317
- * @returns Promise<T>.
1318
- */
1319
- export declare function retry<T>(config: RetryConfig<T>): Promise<T>;
1320
-
1321
- /**
1322
- * Provides a list of retryable AMQP errors.
1323
- * "InternalServerError", "ServerBusyError", "ServiceUnavailableError", "OperationCancelledError",
1324
- * "SenderBusyError", "SenderNotReadyError", "MessagingError", "DetachForcedError", "ConnectionForcedError",
1325
- * "TransferLimitExceededError"
1326
- */
1327
- export declare const retryableErrors: string[];
1328
-
1329
- /**
1330
- * Describes the parameters that need to be configured for the retry operation.
1331
- */
1332
- export declare interface RetryConfig<T> {
1333
- /**
1334
- * The operation that needs to be retried.
1335
- */
1336
- operation: () => Promise<T>;
1337
- /**
1338
- * The connection identifier. Used in logging information.
1339
- * Extremely useful when multiple connections are logged in the same file.
1340
- */
1341
- connectionId: string;
1342
- /**
1343
- * The name/type of operation to be performed.
1344
- * Extremely useful in providing better debug logs.
1345
- */
1346
- operationType: RetryOperationType;
1347
- /**
1348
- * The host "<yournamespace>.servicebus.windows.net".
1349
- * Used to check network connectivity.
1350
- */
1351
- connectionHost?: string;
1352
- /**
1353
- * The retry related options associated with given operation execution.
1354
- */
1355
- retryOptions?: RetryOptions;
1356
- /**
1357
- * The `AbortSignal` associated with the operation being retried on.
1358
- * If this signal is fired during the wait time between retries, then the `retry()` method will ensure that the wait is abandoned and the retry process gets cancelled. If this signal is fired when the operation is in progress, then the operation is expected to react to it.
1359
- */
1360
- abortSignal?: AbortSignalLike;
1361
- }
1362
-
1363
- /**
1364
- * Describes the Retry Mode type
1365
- */
1366
- export declare enum RetryMode {
1367
- Exponential = 0,
1368
- Fixed = 1
1369
- }
1370
-
1371
- /**
1372
- * Describes the retry operation type.
1373
- */
1374
- export declare enum RetryOperationType {
1375
- cbsAuth = "cbsAuth",
1376
- connection = "connection",
1377
- management = "management",
1378
- receiverLink = "receiverLink",
1379
- senderLink = "senderLink",
1380
- sendMessage = "sendMessage",
1381
- receiveMessage = "receiveMessage",
1382
- session = "session",
1383
- messageSettlement = "settlement"
1384
- }
1385
-
1386
- /**
1387
- * Retry policy options that determine the mode, number of retries, retry interval etc.
1388
- */
1389
- export declare interface RetryOptions {
1390
- /**
1391
- * Number of times the operation needs to be retried in case
1392
- * of retryable error. Default: 3.
1393
- */
1394
- maxRetries?: number;
1395
- /**
1396
- * Amount of time to wait in milliseconds before making the
1397
- * next attempt. Default: `30000 milliseconds`.
1398
- * When `mode` option is set to `Exponential`,
1399
- * this is used to compute the exponentially increasing delays between retries.
1400
- */
1401
- retryDelayInMs?: number;
1402
- /**
1403
- * Number of milliseconds to wait before declaring that current attempt has timed out which will trigger a retry
1404
- * A minimum value of `60000` milliseconds will be used if a value not greater than this is provided.
1405
- */
1406
- timeoutInMs?: number;
1407
- /**
1408
- * Denotes which retry mode to apply. If undefined, defaults to `Fixed`
1409
- */
1410
- mode?: RetryMode;
1411
- /**
1412
- * Denotes the maximum delay between retries
1413
- * that the retry attempts will be capped at. Applicable only when performing exponential retry.
1414
- */
1415
- maxRetryDelayInMs?: number;
1416
- }
1417
-
1418
- /**
1419
- * A SasTokenProvider provides an alternative to TokenCredential for providing an `AccessToken`.
1420
- * @hidden
1421
- */
1422
- export declare interface SasTokenProvider {
1423
- /**
1424
- * Property used to distinguish SasTokenProvider from TokenCredential.
1425
- */
1426
- isSasTokenProvider: true;
1427
- /**
1428
- * Gets the token provided by this provider.
1429
- *
1430
- * This method is called automatically by Azure SDK client libraries.
1431
- *
1432
- * @param audience - The audience for which the token is desired.
1433
- */
1434
- getToken(audience: string): Promise<AccessToken>;
1435
- }
1436
-
1437
- /**
1438
- * Describes the options that can be specified while sending a request.
1439
- */
1440
- export declare interface SendRequestOptions {
1441
- /**
1442
- * Cancels the operation.
1443
- */
1444
- abortSignal?: AbortSignalLike;
1445
- /**
1446
- * Max time to wait for the operation to complete.
1447
- * Default: `60000 milliseconds`.
1448
- */
1449
- timeoutInMs?: number;
1450
- /**
1451
- * Name of the request being performed.
1452
- */
1453
- requestName?: string;
1454
- }
1455
-
1456
- /**
1457
- * The standard error message accompanying an AbortError.
1458
- * @hidden
1459
- */
1460
- export declare const StandardAbortMessage = "The operation was aborted.";
1461
-
1462
- /**
1463
- * Maps some SystemErrors to amqp error conditions
1464
- */
1465
- export declare enum SystemErrorConditionMapper {
1466
- ENOTFOUND = "amqp:not-found",
1467
- EBUSY = "com.microsoft:server-busy",
1468
- ECONNREFUSED = "amqp:connection:forced",
1469
- ETIMEDOUT = "com.microsoft:timeout",
1470
- ECONNRESET = "com.microsoft:timeout",
1471
- ENETDOWN = "com.microsoft:timeout",
1472
- EHOSTDOWN = "com.microsoft:timeout",
1473
- ENETRESET = "com.microsoft:timeout",
1474
- ENETUNREACH = "com.microsoft:timeout",
1475
- ENONET = "com.microsoft:timeout"
1476
- }
1477
-
1478
- /**
1479
- * Describes the type of supported tokens.
1480
- */
1481
- export declare enum TokenType {
1482
- /**
1483
- * The "jwt" token type. Used with AADTokenCredential.
1484
- */
1485
- CbsTokenTypeJwt = "jwt",
1486
- /**
1487
- * The sas token type. Used with SharedKeyCredential.
1488
- */
1489
- CbsTokenTypeSas = "servicebus.windows.net:sastoken"
1490
- }
1491
-
1492
- /**
1493
- * Translates the AMQP error received at the protocol layer or a SystemError into a MessagingError.
1494
- * All other errors are returned unaltered.
1495
- *
1496
- * @param err - The amqp error that was received.
1497
- * @returns MessagingError object.
1498
- */
1499
- export declare function translate(err: unknown): MessagingError | Error;
1500
-
1501
- /**
1502
- * Options to configure the channelling of the AMQP connection over Web Sockets.
1503
- */
1504
- export declare interface WebSocketOptions {
1505
- /**
1506
- * The WebSocket constructor used to create an AMQP connection over a WebSocket.
1507
- * This option should be provided in the below scenarios:
1508
- * - The TCP port 5671 which is that is used by the AMQP connection to Event Hubs is blocked in your environment.
1509
- * - Your application needs to be run behind a proxy server.
1510
- * - Your application needs to run in the browser and you want to provide your own choice of Websocket implementation
1511
- * instead of the built-in WebSocket in the browser.
1512
- */
1513
- webSocket?: WebSocketImpl;
1514
- /**
1515
- * Options to be passed to the WebSocket constructor when the underlying `rhea` library instantiates
1516
- * the WebSocket.
1517
- */
1518
- webSocketConstructorOptions?: any;
1519
- }
1520
-
1521
- export { }