@azure/event-hubs 5.13.0-beta.1 → 6.0.0-alpha.20250128.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (615) hide show
  1. package/README.md +32 -31
  2. package/dist/browser/batchingPartitionChannel.d.ts +94 -0
  3. package/dist/browser/batchingPartitionChannel.d.ts.map +1 -0
  4. package/{dist-esm/src → dist/browser}/batchingPartitionChannel.js +4 -4
  5. package/dist/browser/batchingPartitionChannel.js.map +1 -0
  6. package/dist/browser/connectionContext.d.ts +108 -0
  7. package/dist/browser/connectionContext.d.ts.map +1 -0
  8. package/{dist-esm/src → dist/browser}/connectionContext.js +9 -11
  9. package/dist/browser/connectionContext.js.map +1 -0
  10. package/dist/browser/dataTransformer.d.ts +53 -0
  11. package/dist/browser/dataTransformer.d.ts.map +1 -0
  12. package/{dist-esm/src → dist/browser}/dataTransformer.js +2 -2
  13. package/dist/browser/dataTransformer.js.map +1 -0
  14. package/dist/browser/diagnostics/instrumentEventData.d.ts +28 -0
  15. package/dist/browser/diagnostics/instrumentEventData.d.ts.map +1 -0
  16. package/{dist-esm/src → dist/browser}/diagnostics/instrumentEventData.js +3 -3
  17. package/dist/browser/diagnostics/instrumentEventData.js.map +1 -0
  18. package/dist/browser/diagnostics/tracing.d.ts +19 -0
  19. package/dist/browser/diagnostics/tracing.d.ts.map +1 -0
  20. package/{dist-esm/src → dist/browser}/diagnostics/tracing.js +2 -2
  21. package/dist/browser/diagnostics/tracing.js.map +1 -0
  22. package/dist/browser/eventData.d.ts +295 -0
  23. package/dist/browser/eventData.d.ts.map +1 -0
  24. package/{dist-esm/src → dist/browser}/eventData.js +39 -5
  25. package/dist/browser/eventData.js.map +1 -0
  26. package/dist/browser/eventDataAdapter.d.ts +69 -0
  27. package/dist/browser/eventDataAdapter.d.ts.map +1 -0
  28. package/{dist-esm/src → dist/browser}/eventDataAdapter.js +1 -1
  29. package/dist/browser/eventDataAdapter.js.map +1 -0
  30. package/dist/browser/eventDataBatch.d.ts +225 -0
  31. package/dist/browser/eventDataBatch.d.ts.map +1 -0
  32. package/{dist-esm/src → dist/browser}/eventDataBatch.js +7 -4
  33. package/dist/browser/eventDataBatch.js.map +1 -0
  34. package/dist/browser/eventHubBufferedProducerClient.d.ts +323 -0
  35. package/dist/browser/eventHubBufferedProducerClient.d.ts.map +1 -0
  36. package/{dist-esm/src → dist/browser}/eventHubBufferedProducerClient.js +10 -9
  37. package/dist/browser/eventHubBufferedProducerClient.js.map +1 -0
  38. package/dist/browser/eventHubConsumerClient.d.ts +277 -0
  39. package/dist/browser/eventHubConsumerClient.d.ts.map +1 -0
  40. package/{dist-esm/src → dist/browser}/eventHubConsumerClient.js +12 -12
  41. package/dist/browser/eventHubConsumerClient.js.map +1 -0
  42. package/dist/browser/eventHubConsumerClientModels.d.ts +218 -0
  43. package/dist/browser/eventHubConsumerClientModels.d.ts.map +1 -0
  44. package/dist/browser/eventHubConsumerClientModels.js +4 -0
  45. package/dist/browser/eventHubConsumerClientModels.js.map +1 -0
  46. package/dist/browser/eventHubProducerClient.d.ts +266 -0
  47. package/dist/browser/eventHubProducerClient.d.ts.map +1 -0
  48. package/{dist-esm/src → dist/browser}/eventHubProducerClient.js +12 -10
  49. package/dist/browser/eventHubProducerClient.js.map +1 -0
  50. package/dist/browser/eventHubSender.d.ts +227 -0
  51. package/dist/browser/eventHubSender.d.ts.map +1 -0
  52. package/{dist-esm/src → dist/browser}/eventHubSender.js +12 -12
  53. package/dist/browser/eventHubSender.js.map +1 -0
  54. package/dist/browser/eventPosition.d.ts +73 -0
  55. package/dist/browser/eventPosition.d.ts.map +1 -0
  56. package/{dist-esm/src → dist/browser}/eventPosition.js +1 -1
  57. package/{dist-esm/src → dist/browser}/eventPosition.js.map +1 -1
  58. package/dist/browser/eventProcessor.d.ts +232 -0
  59. package/dist/browser/eventProcessor.d.ts.map +1 -0
  60. package/{dist-esm/src → dist/browser}/eventProcessor.js +18 -18
  61. package/dist/browser/eventProcessor.js.map +1 -0
  62. package/dist/browser/eventhubConnectionConfig.d.ts +96 -0
  63. package/dist/browser/eventhubConnectionConfig.d.ts.map +1 -0
  64. package/{dist-esm/src → dist/browser}/eventhubConnectionConfig.js +2 -2
  65. package/dist/browser/eventhubConnectionConfig.js.map +1 -0
  66. package/dist/browser/impl/awaitableQueue.d.ts +25 -0
  67. package/dist/browser/impl/awaitableQueue.d.ts.map +1 -0
  68. package/{dist-esm/src → dist/browser}/impl/awaitableQueue.js +1 -1
  69. package/dist/browser/impl/awaitableQueue.js.map +1 -0
  70. package/dist/browser/impl/partitionAssigner.d.ts +29 -0
  71. package/dist/browser/impl/partitionAssigner.d.ts.map +1 -0
  72. package/{dist-esm/src → dist/browser}/impl/partitionAssigner.js +2 -2
  73. package/dist/browser/impl/partitionAssigner.js.map +1 -0
  74. package/dist/browser/impl/partitionGate.d.ts +27 -0
  75. package/dist/browser/impl/partitionGate.d.ts.map +1 -0
  76. package/{dist-esm/src → dist/browser}/impl/partitionGate.js +1 -1
  77. package/{dist-esm/src → dist/browser}/impl/partitionGate.js.map +1 -1
  78. package/dist/browser/impl/partitionKeyToIdMapper.d.ts +6 -0
  79. package/dist/browser/impl/partitionKeyToIdMapper.d.ts.map +1 -0
  80. package/{dist-esm/src → dist/browser}/impl/partitionKeyToIdMapper.js +1 -1
  81. package/{dist-esm/src → dist/browser}/impl/partitionKeyToIdMapper.js.map +1 -1
  82. package/dist/browser/inMemoryCheckpointStore.d.ts +44 -0
  83. package/dist/browser/inMemoryCheckpointStore.d.ts.map +1 -0
  84. package/{dist-esm/src → dist/browser}/inMemoryCheckpointStore.js +3 -3
  85. package/dist/browser/inMemoryCheckpointStore.js.map +1 -0
  86. package/dist/browser/index.d.ts +21 -0
  87. package/dist/browser/index.d.ts.map +1 -0
  88. package/{dist-esm/src → dist/browser}/index.js +9 -9
  89. package/dist/browser/index.js.map +1 -0
  90. package/dist/browser/loadBalancerStrategies/balancedStrategy.d.ts +30 -0
  91. package/dist/browser/loadBalancerStrategies/balancedStrategy.d.ts.map +1 -0
  92. package/{dist-esm/src → dist/browser}/loadBalancerStrategies/balancedStrategy.js +2 -2
  93. package/dist/browser/loadBalancerStrategies/balancedStrategy.js.map +1 -0
  94. package/dist/browser/loadBalancerStrategies/greedyStrategy.d.ts +24 -0
  95. package/dist/browser/loadBalancerStrategies/greedyStrategy.d.ts.map +1 -0
  96. package/{dist-esm/src → dist/browser}/loadBalancerStrategies/greedyStrategy.js +2 -2
  97. package/dist/browser/loadBalancerStrategies/greedyStrategy.js.map +1 -0
  98. package/dist/browser/loadBalancerStrategies/loadBalancingStrategy.d.ts +28 -0
  99. package/dist/browser/loadBalancerStrategies/loadBalancingStrategy.d.ts.map +1 -0
  100. package/{dist-esm/src → dist/browser}/loadBalancerStrategies/loadBalancingStrategy.js +2 -2
  101. package/dist/browser/loadBalancerStrategies/loadBalancingStrategy.js.map +1 -0
  102. package/dist/browser/loadBalancerStrategies/unbalancedStrategy.d.ts +20 -0
  103. package/dist/browser/loadBalancerStrategies/unbalancedStrategy.d.ts.map +1 -0
  104. package/{dist-esm/src → dist/browser}/loadBalancerStrategies/unbalancedStrategy.js +1 -1
  105. package/dist/browser/loadBalancerStrategies/unbalancedStrategy.js.map +1 -0
  106. package/dist/browser/logger.d.ts +37 -0
  107. package/dist/browser/logger.d.ts.map +1 -0
  108. package/{dist-esm/src → dist/browser}/logger.js +1 -1
  109. package/dist/browser/logger.js.map +1 -0
  110. package/dist/browser/managementClient.d.ts +145 -0
  111. package/dist/browser/managementClient.d.ts.map +1 -0
  112. package/{dist-esm/src → dist/browser}/managementClient.js +8 -8
  113. package/dist/browser/managementClient.js.map +1 -0
  114. package/dist/browser/models/private.d.ts +185 -0
  115. package/dist/browser/models/private.d.ts.map +1 -0
  116. package/dist/browser/models/private.js +4 -0
  117. package/dist/browser/models/private.js.map +1 -0
  118. package/dist/browser/models/public.d.ts +240 -0
  119. package/dist/browser/models/public.d.ts.map +1 -0
  120. package/{dist-esm/src → dist/browser}/models/public.js +1 -1
  121. package/dist/browser/models/public.js.map +1 -0
  122. package/dist/browser/package.json +3 -0
  123. package/dist/browser/partitionProcessor.d.ts +134 -0
  124. package/dist/browser/partitionProcessor.d.ts.map +1 -0
  125. package/{dist-esm/src → dist/browser}/partitionProcessor.js +2 -2
  126. package/dist/browser/partitionProcessor.js.map +1 -0
  127. package/dist/browser/partitionPump.d.ts +38 -0
  128. package/dist/browser/partitionPump.d.ts.map +1 -0
  129. package/{dist-esm/src → dist/browser}/partitionPump.js +6 -7
  130. package/dist/browser/partitionPump.js.map +1 -0
  131. package/dist/browser/partitionReceiver.d.ts +82 -0
  132. package/dist/browser/partitionReceiver.d.ts.map +1 -0
  133. package/{dist-esm/src → dist/browser}/partitionReceiver.js +14 -12
  134. package/dist/browser/partitionReceiver.js.map +1 -0
  135. package/dist/browser/pumpManager.d.ts +72 -0
  136. package/dist/browser/pumpManager.d.ts.map +1 -0
  137. package/{dist-esm/src → dist/browser}/pumpManager.js +4 -4
  138. package/dist/browser/pumpManager.js.map +1 -0
  139. package/dist/browser/util/connectionStringUtils.d.ts +52 -0
  140. package/dist/browser/util/connectionStringUtils.d.ts.map +1 -0
  141. package/{dist-esm/src → dist/browser}/util/connectionStringUtils.js +1 -1
  142. package/{dist-esm/src → dist/browser}/util/connectionStringUtils.js.map +1 -1
  143. package/dist/browser/util/constants.d.ts +25 -0
  144. package/dist/browser/util/constants.d.ts.map +1 -0
  145. package/{dist-esm/src → dist/browser}/util/constants.js +4 -2
  146. package/dist/browser/util/constants.js.map +1 -0
  147. package/dist/browser/util/delayWithoutThrow.d.ts +8 -0
  148. package/dist/browser/util/delayWithoutThrow.d.ts.map +1 -0
  149. package/{dist-esm/src → dist/browser}/util/delayWithoutThrow.js +1 -1
  150. package/dist/browser/util/delayWithoutThrow.js.map +1 -0
  151. package/dist/browser/util/error.d.ts +39 -0
  152. package/dist/browser/util/error.d.ts.map +1 -0
  153. package/{dist-esm/src → dist/browser}/util/error.js +2 -2
  154. package/dist/browser/util/error.js.map +1 -0
  155. package/dist/browser/util/getPromiseParts.d.ts +10 -0
  156. package/dist/browser/util/getPromiseParts.d.ts.map +1 -0
  157. package/{dist-esm/src → dist/browser}/util/getPromiseParts.js +1 -1
  158. package/{dist-esm/src → dist/browser}/util/getPromiseParts.js.map +1 -1
  159. package/dist/browser/util/operationOptions.d.ts +16 -0
  160. package/dist/browser/util/operationOptions.d.ts.map +1 -0
  161. package/dist/browser/util/operationOptions.js +4 -0
  162. package/dist/browser/util/operationOptions.js.map +1 -0
  163. package/dist/browser/util/parseEndpoint.d.ts +11 -0
  164. package/dist/browser/util/parseEndpoint.d.ts.map +1 -0
  165. package/{dist-esm/src → dist/browser}/util/parseEndpoint.js +1 -1
  166. package/{dist-esm/src → dist/browser}/util/parseEndpoint.js.map +1 -1
  167. package/dist/browser/util/retries.d.ts +6 -0
  168. package/dist/browser/util/retries.d.ts.map +1 -0
  169. package/{dist-esm/src → dist/browser}/util/retries.js +1 -1
  170. package/dist/browser/util/retries.js.map +1 -0
  171. package/dist/browser/util/runtimeInfo-browser.d.mts.map +1 -0
  172. package/dist/browser/util/runtimeInfo-browser.mjs.map +1 -0
  173. package/dist/browser/util/runtimeInfo.d.ts +6 -0
  174. package/{dist-esm/src/util/runtimeInfo.browser.js → dist/browser/util/runtimeInfo.js} +2 -2
  175. package/dist/browser/util/timerLoop.d.ts +26 -0
  176. package/dist/browser/util/timerLoop.d.ts.map +1 -0
  177. package/{dist-esm/src → dist/browser}/util/timerLoop.js +1 -1
  178. package/{dist-esm/src → dist/browser}/util/timerLoop.js.map +1 -1
  179. package/dist/browser/util/typeGuards.d.ts +8 -0
  180. package/dist/browser/util/typeGuards.d.ts.map +1 -0
  181. package/{dist-esm/src → dist/browser}/util/typeGuards.js +2 -2
  182. package/dist/browser/util/typeGuards.js.map +1 -0
  183. package/dist/browser/util/utils.d.ts +7 -0
  184. package/dist/browser/util/utils.d.ts.map +1 -0
  185. package/{dist-esm/src → dist/browser}/util/utils.js +1 -1
  186. package/{dist-esm/src → dist/browser}/util/utils.js.map +1 -1
  187. package/dist/browser/withAuth.d.ts +25 -0
  188. package/dist/browser/withAuth.d.ts.map +1 -0
  189. package/{dist-esm/src → dist/browser}/withAuth.js +4 -4
  190. package/dist/browser/withAuth.js.map +1 -0
  191. package/dist/commonjs/batchingPartitionChannel.d.ts +94 -0
  192. package/dist/commonjs/batchingPartitionChannel.d.ts.map +1 -0
  193. package/dist/commonjs/batchingPartitionChannel.js +252 -0
  194. package/dist/commonjs/batchingPartitionChannel.js.map +1 -0
  195. package/dist/commonjs/connectionContext.d.ts +108 -0
  196. package/dist/commonjs/connectionContext.d.ts.map +1 -0
  197. package/dist/commonjs/connectionContext.js +322 -0
  198. package/dist/commonjs/connectionContext.js.map +1 -0
  199. package/dist/commonjs/dataTransformer.d.ts +53 -0
  200. package/dist/commonjs/dataTransformer.d.ts.map +1 -0
  201. package/dist/commonjs/dataTransformer.js +138 -0
  202. package/dist/commonjs/dataTransformer.js.map +1 -0
  203. package/dist/commonjs/diagnostics/instrumentEventData.d.ts +28 -0
  204. package/dist/commonjs/diagnostics/instrumentEventData.d.ts.map +1 -0
  205. package/dist/commonjs/diagnostics/instrumentEventData.js +73 -0
  206. package/dist/commonjs/diagnostics/instrumentEventData.js.map +1 -0
  207. package/dist/commonjs/diagnostics/tracing.d.ts +19 -0
  208. package/dist/commonjs/diagnostics/tracing.d.ts.map +1 -0
  209. package/dist/commonjs/diagnostics/tracing.js +44 -0
  210. package/dist/commonjs/diagnostics/tracing.js.map +1 -0
  211. package/dist/commonjs/eventData.d.ts +295 -0
  212. package/dist/commonjs/eventData.d.ts.map +1 -0
  213. package/dist/commonjs/eventData.js +253 -0
  214. package/dist/commonjs/eventData.js.map +1 -0
  215. package/dist/commonjs/eventDataAdapter.d.ts +69 -0
  216. package/dist/commonjs/eventDataAdapter.d.ts.map +1 -0
  217. package/dist/commonjs/eventDataAdapter.js +38 -0
  218. package/dist/commonjs/eventDataAdapter.js.map +1 -0
  219. package/dist/commonjs/eventDataBatch.d.ts +225 -0
  220. package/dist/commonjs/eventDataBatch.d.ts.map +1 -0
  221. package/dist/commonjs/eventDataBatch.js +254 -0
  222. package/dist/commonjs/eventDataBatch.js.map +1 -0
  223. package/dist/commonjs/eventHubBufferedProducerClient.d.ts +323 -0
  224. package/dist/commonjs/eventHubBufferedProducerClient.d.ts.map +1 -0
  225. package/dist/commonjs/eventHubBufferedProducerClient.js +289 -0
  226. package/dist/commonjs/eventHubBufferedProducerClient.js.map +1 -0
  227. package/dist/commonjs/eventHubConsumerClient.d.ts +277 -0
  228. package/dist/commonjs/eventHubConsumerClient.d.ts.map +1 -0
  229. package/dist/commonjs/eventHubConsumerClient.js +298 -0
  230. package/dist/commonjs/eventHubConsumerClient.js.map +1 -0
  231. package/dist/commonjs/eventHubConsumerClientModels.d.ts +218 -0
  232. package/dist/commonjs/eventHubConsumerClientModels.d.ts.map +1 -0
  233. package/dist/commonjs/eventHubConsumerClientModels.js +5 -0
  234. package/dist/commonjs/eventHubConsumerClientModels.js.map +1 -0
  235. package/dist/commonjs/eventHubProducerClient.d.ts +266 -0
  236. package/dist/commonjs/eventHubProducerClient.d.ts.map +1 -0
  237. package/dist/commonjs/eventHubProducerClient.js +319 -0
  238. package/dist/commonjs/eventHubProducerClient.js.map +1 -0
  239. package/dist/commonjs/eventHubSender.d.ts +227 -0
  240. package/dist/commonjs/eventHubSender.d.ts.map +1 -0
  241. package/dist/commonjs/eventHubSender.js +547 -0
  242. package/dist/commonjs/eventHubSender.js.map +1 -0
  243. package/dist/commonjs/eventPosition.d.ts +73 -0
  244. package/dist/commonjs/eventPosition.d.ts.map +1 -0
  245. package/dist/commonjs/eventPosition.js +128 -0
  246. package/dist/commonjs/eventPosition.js.map +1 -0
  247. package/dist/commonjs/eventProcessor.d.ts +232 -0
  248. package/dist/commonjs/eventProcessor.d.ts.map +1 -0
  249. package/dist/commonjs/eventProcessor.js +371 -0
  250. package/dist/commonjs/eventProcessor.js.map +1 -0
  251. package/dist/commonjs/eventhubConnectionConfig.d.ts +96 -0
  252. package/dist/commonjs/eventhubConnectionConfig.d.ts.map +1 -0
  253. package/dist/commonjs/eventhubConnectionConfig.js +101 -0
  254. package/dist/commonjs/eventhubConnectionConfig.js.map +1 -0
  255. package/dist/commonjs/impl/awaitableQueue.d.ts +25 -0
  256. package/dist/commonjs/impl/awaitableQueue.d.ts.map +1 -0
  257. package/dist/commonjs/impl/awaitableQueue.js +51 -0
  258. package/dist/commonjs/impl/awaitableQueue.js.map +1 -0
  259. package/dist/commonjs/impl/partitionAssigner.d.ts +29 -0
  260. package/dist/commonjs/impl/partitionAssigner.d.ts.map +1 -0
  261. package/dist/commonjs/impl/partitionAssigner.js +58 -0
  262. package/dist/commonjs/impl/partitionAssigner.js.map +1 -0
  263. package/dist/commonjs/impl/partitionGate.d.ts +27 -0
  264. package/dist/commonjs/impl/partitionGate.d.ts.map +1 -0
  265. package/dist/commonjs/impl/partitionGate.js +44 -0
  266. package/dist/commonjs/impl/partitionGate.js.map +1 -0
  267. package/dist/commonjs/impl/partitionKeyToIdMapper.d.ts +6 -0
  268. package/dist/commonjs/impl/partitionKeyToIdMapper.d.ts.map +1 -0
  269. package/dist/commonjs/impl/partitionKeyToIdMapper.js +115 -0
  270. package/dist/commonjs/impl/partitionKeyToIdMapper.js.map +1 -0
  271. package/dist/commonjs/inMemoryCheckpointStore.d.ts +44 -0
  272. package/dist/commonjs/inMemoryCheckpointStore.d.ts.map +1 -0
  273. package/dist/commonjs/inMemoryCheckpointStore.js +96 -0
  274. package/dist/commonjs/inMemoryCheckpointStore.js.map +1 -0
  275. package/dist/commonjs/index.d.ts +21 -0
  276. package/dist/commonjs/index.d.ts.map +1 -0
  277. package/dist/commonjs/index.js +26 -0
  278. package/dist/commonjs/index.js.map +1 -0
  279. package/dist/commonjs/loadBalancerStrategies/balancedStrategy.d.ts +30 -0
  280. package/dist/commonjs/loadBalancerStrategies/balancedStrategy.d.ts.map +1 -0
  281. package/dist/commonjs/loadBalancerStrategies/balancedStrategy.js +43 -0
  282. package/dist/commonjs/loadBalancerStrategies/balancedStrategy.js.map +1 -0
  283. package/dist/commonjs/loadBalancerStrategies/greedyStrategy.d.ts +24 -0
  284. package/dist/commonjs/loadBalancerStrategies/greedyStrategy.d.ts.map +1 -0
  285. package/dist/commonjs/loadBalancerStrategies/greedyStrategy.js +32 -0
  286. package/dist/commonjs/loadBalancerStrategies/greedyStrategy.js.map +1 -0
  287. package/dist/commonjs/loadBalancerStrategies/loadBalancingStrategy.d.ts +28 -0
  288. package/dist/commonjs/loadBalancerStrategies/loadBalancingStrategy.d.ts.map +1 -0
  289. package/dist/commonjs/loadBalancerStrategies/loadBalancingStrategy.js +248 -0
  290. package/dist/commonjs/loadBalancerStrategies/loadBalancingStrategy.js.map +1 -0
  291. package/dist/commonjs/loadBalancerStrategies/unbalancedStrategy.d.ts +20 -0
  292. package/dist/commonjs/loadBalancerStrategies/unbalancedStrategy.d.ts.map +1 -0
  293. package/dist/commonjs/loadBalancerStrategies/unbalancedStrategy.js +26 -0
  294. package/dist/commonjs/loadBalancerStrategies/unbalancedStrategy.js.map +1 -0
  295. package/dist/commonjs/logger.d.ts +37 -0
  296. package/dist/commonjs/logger.d.ts.map +1 -0
  297. package/dist/commonjs/logger.js +65 -0
  298. package/dist/commonjs/logger.js.map +1 -0
  299. package/dist/commonjs/managementClient.d.ts +145 -0
  300. package/dist/commonjs/managementClient.d.ts.map +1 -0
  301. package/dist/commonjs/managementClient.js +275 -0
  302. package/dist/commonjs/managementClient.js.map +1 -0
  303. package/dist/commonjs/models/private.d.ts +185 -0
  304. package/dist/commonjs/models/private.d.ts.map +1 -0
  305. package/dist/commonjs/models/private.js +5 -0
  306. package/dist/commonjs/models/private.js.map +1 -0
  307. package/dist/commonjs/models/public.d.ts +240 -0
  308. package/dist/commonjs/models/public.d.ts.map +1 -0
  309. package/dist/commonjs/models/public.js +21 -0
  310. package/dist/commonjs/models/public.js.map +1 -0
  311. package/dist/commonjs/package.json +3 -0
  312. package/dist/commonjs/partitionProcessor.d.ts +134 -0
  313. package/dist/commonjs/partitionProcessor.d.ts.map +1 -0
  314. package/dist/commonjs/partitionProcessor.js +138 -0
  315. package/dist/commonjs/partitionProcessor.js.map +1 -0
  316. package/dist/commonjs/partitionPump.d.ts +38 -0
  317. package/dist/commonjs/partitionPump.d.ts.map +1 -0
  318. package/dist/commonjs/partitionPump.js +171 -0
  319. package/dist/commonjs/partitionPump.js.map +1 -0
  320. package/dist/commonjs/partitionReceiver.d.ts +82 -0
  321. package/dist/commonjs/partitionReceiver.d.ts.map +1 -0
  322. package/dist/commonjs/partitionReceiver.js +335 -0
  323. package/dist/commonjs/partitionReceiver.js.map +1 -0
  324. package/dist/commonjs/pumpManager.d.ts +72 -0
  325. package/dist/commonjs/pumpManager.d.ts.map +1 -0
  326. package/dist/commonjs/pumpManager.js +122 -0
  327. package/dist/commonjs/pumpManager.js.map +1 -0
  328. package/{types/latest → dist/commonjs}/tsdoc-metadata.json +1 -1
  329. package/dist/commonjs/util/connectionStringUtils.d.ts +52 -0
  330. package/dist/commonjs/util/connectionStringUtils.d.ts.map +1 -0
  331. package/dist/commonjs/util/connectionStringUtils.js +51 -0
  332. package/dist/commonjs/util/connectionStringUtils.js.map +1 -0
  333. package/dist/commonjs/util/constants.d.ts +25 -0
  334. package/dist/commonjs/util/constants.d.ts.map +1 -0
  335. package/dist/commonjs/util/constants.js +30 -0
  336. package/dist/commonjs/util/constants.js.map +1 -0
  337. package/dist/commonjs/util/delayWithoutThrow.d.ts +8 -0
  338. package/dist/commonjs/util/delayWithoutThrow.d.ts.map +1 -0
  339. package/dist/commonjs/util/delayWithoutThrow.js +20 -0
  340. package/dist/commonjs/util/delayWithoutThrow.js.map +1 -0
  341. package/dist/commonjs/util/error.d.ts +39 -0
  342. package/dist/commonjs/util/error.d.ts.map +1 -0
  343. package/dist/commonjs/util/error.js +110 -0
  344. package/dist/commonjs/util/error.js.map +1 -0
  345. package/dist/commonjs/util/getPromiseParts.d.ts +10 -0
  346. package/dist/commonjs/util/getPromiseParts.d.ts.map +1 -0
  347. package/dist/commonjs/util/getPromiseParts.js +23 -0
  348. package/dist/commonjs/util/getPromiseParts.js.map +1 -0
  349. package/dist/commonjs/util/operationOptions.d.ts +16 -0
  350. package/dist/commonjs/util/operationOptions.d.ts.map +1 -0
  351. package/dist/commonjs/util/operationOptions.js +5 -0
  352. package/dist/commonjs/util/operationOptions.js.map +1 -0
  353. package/dist/commonjs/util/parseEndpoint.d.ts +11 -0
  354. package/dist/commonjs/util/parseEndpoint.d.ts.map +1 -0
  355. package/dist/commonjs/util/parseEndpoint.js +20 -0
  356. package/dist/commonjs/util/parseEndpoint.js.map +1 -0
  357. package/dist/commonjs/util/retries.d.ts +6 -0
  358. package/dist/commonjs/util/retries.d.ts.map +1 -0
  359. package/dist/commonjs/util/retries.js +16 -0
  360. package/dist/commonjs/util/retries.js.map +1 -0
  361. package/dist/commonjs/util/runtimeInfo.d.ts +6 -0
  362. package/dist/commonjs/util/runtimeInfo.d.ts.map +1 -0
  363. package/dist/commonjs/util/runtimeInfo.js +15 -0
  364. package/dist/commonjs/util/runtimeInfo.js.map +1 -0
  365. package/dist/commonjs/util/timerLoop.d.ts +26 -0
  366. package/dist/commonjs/util/timerLoop.d.ts.map +1 -0
  367. package/dist/commonjs/util/timerLoop.js +30 -0
  368. package/dist/commonjs/util/timerLoop.js.map +1 -0
  369. package/dist/commonjs/util/typeGuards.d.ts +8 -0
  370. package/dist/commonjs/util/typeGuards.d.ts.map +1 -0
  371. package/dist/commonjs/util/typeGuards.js +15 -0
  372. package/dist/commonjs/util/typeGuards.js.map +1 -0
  373. package/dist/commonjs/util/utils.d.ts +7 -0
  374. package/dist/commonjs/util/utils.d.ts.map +1 -0
  375. package/dist/commonjs/util/utils.js +16 -0
  376. package/dist/commonjs/util/utils.js.map +1 -0
  377. package/dist/commonjs/withAuth.d.ts +25 -0
  378. package/dist/commonjs/withAuth.d.ts.map +1 -0
  379. package/dist/commonjs/withAuth.js +88 -0
  380. package/dist/commonjs/withAuth.js.map +1 -0
  381. package/dist/esm/batchingPartitionChannel.d.ts +94 -0
  382. package/dist/esm/batchingPartitionChannel.d.ts.map +1 -0
  383. package/dist/esm/batchingPartitionChannel.js +248 -0
  384. package/dist/esm/batchingPartitionChannel.js.map +1 -0
  385. package/dist/esm/connectionContext.d.ts +108 -0
  386. package/dist/esm/connectionContext.d.ts.map +1 -0
  387. package/dist/esm/connectionContext.js +318 -0
  388. package/dist/esm/connectionContext.js.map +1 -0
  389. package/dist/esm/dataTransformer.d.ts +53 -0
  390. package/dist/esm/dataTransformer.d.ts.map +1 -0
  391. package/dist/esm/dataTransformer.js +133 -0
  392. package/dist/esm/dataTransformer.js.map +1 -0
  393. package/dist/esm/diagnostics/instrumentEventData.d.ts +28 -0
  394. package/dist/esm/diagnostics/instrumentEventData.d.ts.map +1 -0
  395. package/dist/esm/diagnostics/instrumentEventData.js +68 -0
  396. package/dist/esm/diagnostics/instrumentEventData.js.map +1 -0
  397. package/dist/esm/diagnostics/tracing.d.ts +19 -0
  398. package/dist/esm/diagnostics/tracing.d.ts.map +1 -0
  399. package/dist/esm/diagnostics/tracing.js +40 -0
  400. package/dist/esm/diagnostics/tracing.js.map +1 -0
  401. package/dist/esm/eventData.d.ts +295 -0
  402. package/dist/esm/eventData.d.ts.map +1 -0
  403. package/dist/esm/eventData.js +245 -0
  404. package/dist/esm/eventData.js.map +1 -0
  405. package/dist/esm/eventDataAdapter.d.ts +69 -0
  406. package/dist/esm/eventDataAdapter.d.ts.map +1 -0
  407. package/dist/esm/eventDataAdapter.js +35 -0
  408. package/dist/esm/eventDataAdapter.js.map +1 -0
  409. package/dist/esm/eventDataBatch.d.ts +225 -0
  410. package/dist/esm/eventDataBatch.d.ts.map +1 -0
  411. package/dist/esm/eventDataBatch.js +249 -0
  412. package/dist/esm/eventDataBatch.js.map +1 -0
  413. package/dist/esm/eventHubBufferedProducerClient.d.ts +323 -0
  414. package/dist/esm/eventHubBufferedProducerClient.d.ts.map +1 -0
  415. package/dist/esm/eventHubBufferedProducerClient.js +285 -0
  416. package/dist/esm/eventHubBufferedProducerClient.js.map +1 -0
  417. package/dist/esm/eventHubConsumerClient.d.ts +277 -0
  418. package/dist/esm/eventHubConsumerClient.d.ts.map +1 -0
  419. package/dist/esm/eventHubConsumerClient.js +293 -0
  420. package/dist/esm/eventHubConsumerClient.js.map +1 -0
  421. package/dist/esm/eventHubConsumerClientModels.d.ts +218 -0
  422. package/dist/esm/eventHubConsumerClientModels.d.ts.map +1 -0
  423. package/dist/esm/eventHubConsumerClientModels.js +4 -0
  424. package/dist/esm/eventHubConsumerClientModels.js.map +1 -0
  425. package/dist/esm/eventHubProducerClient.d.ts +266 -0
  426. package/dist/esm/eventHubProducerClient.d.ts.map +1 -0
  427. package/dist/esm/eventHubProducerClient.js +315 -0
  428. package/dist/esm/eventHubProducerClient.js.map +1 -0
  429. package/dist/esm/eventHubSender.d.ts +227 -0
  430. package/dist/esm/eventHubSender.d.ts.map +1 -0
  431. package/dist/esm/eventHubSender.js +541 -0
  432. package/dist/esm/eventHubSender.js.map +1 -0
  433. package/dist/esm/eventPosition.d.ts +73 -0
  434. package/dist/esm/eventPosition.d.ts.map +1 -0
  435. package/dist/esm/eventPosition.js +121 -0
  436. package/dist/esm/eventPosition.js.map +1 -0
  437. package/dist/esm/eventProcessor.d.ts +232 -0
  438. package/dist/esm/eventProcessor.d.ts.map +1 -0
  439. package/dist/esm/eventProcessor.js +367 -0
  440. package/dist/esm/eventProcessor.js.map +1 -0
  441. package/dist/esm/eventhubConnectionConfig.d.ts +96 -0
  442. package/dist/esm/eventhubConnectionConfig.d.ts.map +1 -0
  443. package/dist/esm/eventhubConnectionConfig.js +98 -0
  444. package/dist/esm/eventhubConnectionConfig.js.map +1 -0
  445. package/dist/esm/impl/awaitableQueue.d.ts +25 -0
  446. package/dist/esm/impl/awaitableQueue.d.ts.map +1 -0
  447. package/dist/esm/impl/awaitableQueue.js +47 -0
  448. package/dist/esm/impl/awaitableQueue.js.map +1 -0
  449. package/dist/esm/impl/partitionAssigner.d.ts +29 -0
  450. package/dist/esm/impl/partitionAssigner.d.ts.map +1 -0
  451. package/dist/esm/impl/partitionAssigner.js +54 -0
  452. package/dist/esm/impl/partitionAssigner.js.map +1 -0
  453. package/dist/esm/impl/partitionGate.d.ts +27 -0
  454. package/dist/esm/impl/partitionGate.d.ts.map +1 -0
  455. package/dist/esm/impl/partitionGate.js +40 -0
  456. package/dist/esm/impl/partitionGate.js.map +1 -0
  457. package/dist/esm/impl/partitionKeyToIdMapper.d.ts +6 -0
  458. package/dist/esm/impl/partitionKeyToIdMapper.d.ts.map +1 -0
  459. package/dist/esm/impl/partitionKeyToIdMapper.js +111 -0
  460. package/dist/esm/impl/partitionKeyToIdMapper.js.map +1 -0
  461. package/dist/esm/inMemoryCheckpointStore.d.ts +44 -0
  462. package/dist/esm/inMemoryCheckpointStore.d.ts.map +1 -0
  463. package/dist/esm/inMemoryCheckpointStore.js +92 -0
  464. package/dist/esm/inMemoryCheckpointStore.js.map +1 -0
  465. package/dist/esm/index.d.ts +21 -0
  466. package/dist/esm/index.d.ts.map +1 -0
  467. package/dist/esm/index.js +12 -0
  468. package/dist/esm/index.js.map +1 -0
  469. package/dist/esm/loadBalancerStrategies/balancedStrategy.d.ts +30 -0
  470. package/dist/esm/loadBalancerStrategies/balancedStrategy.d.ts.map +1 -0
  471. package/dist/esm/loadBalancerStrategies/balancedStrategy.js +39 -0
  472. package/dist/esm/loadBalancerStrategies/balancedStrategy.js.map +1 -0
  473. package/dist/esm/loadBalancerStrategies/greedyStrategy.d.ts +24 -0
  474. package/dist/esm/loadBalancerStrategies/greedyStrategy.d.ts.map +1 -0
  475. package/dist/esm/loadBalancerStrategies/greedyStrategy.js +28 -0
  476. package/dist/esm/loadBalancerStrategies/greedyStrategy.js.map +1 -0
  477. package/dist/esm/loadBalancerStrategies/loadBalancingStrategy.d.ts +28 -0
  478. package/dist/esm/loadBalancerStrategies/loadBalancingStrategy.d.ts.map +1 -0
  479. package/dist/esm/loadBalancerStrategies/loadBalancingStrategy.js +245 -0
  480. package/dist/esm/loadBalancerStrategies/loadBalancingStrategy.js.map +1 -0
  481. package/dist/esm/loadBalancerStrategies/unbalancedStrategy.d.ts +20 -0
  482. package/dist/esm/loadBalancerStrategies/unbalancedStrategy.d.ts.map +1 -0
  483. package/dist/esm/loadBalancerStrategies/unbalancedStrategy.js +22 -0
  484. package/dist/esm/loadBalancerStrategies/unbalancedStrategy.js.map +1 -0
  485. package/dist/esm/logger.d.ts +37 -0
  486. package/dist/esm/logger.d.ts.map +1 -0
  487. package/dist/esm/logger.js +56 -0
  488. package/dist/esm/logger.js.map +1 -0
  489. package/dist/esm/managementClient.d.ts +145 -0
  490. package/dist/esm/managementClient.d.ts.map +1 -0
  491. package/dist/esm/managementClient.js +271 -0
  492. package/dist/esm/managementClient.js.map +1 -0
  493. package/dist/esm/models/private.d.ts +185 -0
  494. package/dist/esm/models/private.d.ts.map +1 -0
  495. package/dist/esm/models/private.js +4 -0
  496. package/dist/esm/models/private.js.map +1 -0
  497. package/dist/esm/models/public.d.ts +240 -0
  498. package/dist/esm/models/public.d.ts.map +1 -0
  499. package/dist/esm/models/public.js +18 -0
  500. package/dist/esm/models/public.js.map +1 -0
  501. package/dist/esm/package.json +3 -0
  502. package/dist/esm/partitionProcessor.d.ts +134 -0
  503. package/dist/esm/partitionProcessor.d.ts.map +1 -0
  504. package/dist/esm/partitionProcessor.js +134 -0
  505. package/dist/esm/partitionProcessor.js.map +1 -0
  506. package/dist/esm/partitionPump.d.ts +38 -0
  507. package/dist/esm/partitionPump.d.ts.map +1 -0
  508. package/dist/esm/partitionPump.js +166 -0
  509. package/dist/esm/partitionPump.js.map +1 -0
  510. package/dist/esm/partitionReceiver.d.ts +82 -0
  511. package/dist/esm/partitionReceiver.d.ts.map +1 -0
  512. package/dist/esm/partitionReceiver.js +330 -0
  513. package/dist/esm/partitionReceiver.js.map +1 -0
  514. package/dist/esm/pumpManager.d.ts +72 -0
  515. package/dist/esm/pumpManager.d.ts.map +1 -0
  516. package/dist/esm/pumpManager.js +118 -0
  517. package/dist/esm/pumpManager.js.map +1 -0
  518. package/dist/esm/util/connectionStringUtils.d.ts +52 -0
  519. package/dist/esm/util/connectionStringUtils.d.ts.map +1 -0
  520. package/dist/esm/util/connectionStringUtils.js +48 -0
  521. package/dist/esm/util/connectionStringUtils.js.map +1 -0
  522. package/dist/esm/util/constants.d.ts +25 -0
  523. package/dist/esm/util/constants.d.ts.map +1 -0
  524. package/dist/esm/util/constants.js +27 -0
  525. package/dist/esm/util/constants.js.map +1 -0
  526. package/dist/esm/util/delayWithoutThrow.d.ts +8 -0
  527. package/dist/esm/util/delayWithoutThrow.d.ts.map +1 -0
  528. package/dist/esm/util/delayWithoutThrow.js +17 -0
  529. package/dist/esm/util/delayWithoutThrow.js.map +1 -0
  530. package/dist/esm/util/error.d.ts +39 -0
  531. package/dist/esm/util/error.d.ts.map +1 -0
  532. package/dist/esm/util/error.js +103 -0
  533. package/dist/esm/util/error.js.map +1 -0
  534. package/dist/esm/util/getPromiseParts.d.ts +10 -0
  535. package/dist/esm/util/getPromiseParts.d.ts.map +1 -0
  536. package/dist/esm/util/getPromiseParts.js +20 -0
  537. package/dist/esm/util/getPromiseParts.js.map +1 -0
  538. package/dist/esm/util/operationOptions.d.ts +16 -0
  539. package/dist/esm/util/operationOptions.d.ts.map +1 -0
  540. package/dist/esm/util/operationOptions.js +4 -0
  541. package/dist/esm/util/operationOptions.js.map +1 -0
  542. package/dist/esm/util/parseEndpoint.d.ts +11 -0
  543. package/dist/esm/util/parseEndpoint.d.ts.map +1 -0
  544. package/dist/esm/util/parseEndpoint.js +17 -0
  545. package/dist/esm/util/parseEndpoint.js.map +1 -0
  546. package/dist/esm/util/retries.d.ts +6 -0
  547. package/dist/esm/util/retries.d.ts.map +1 -0
  548. package/dist/esm/util/retries.js +13 -0
  549. package/dist/esm/util/retries.js.map +1 -0
  550. package/dist/esm/util/runtimeInfo.d.ts +6 -0
  551. package/dist/esm/util/runtimeInfo.d.ts.map +1 -0
  552. package/{dist-esm/src → dist/esm}/util/runtimeInfo.js +1 -1
  553. package/{dist-esm/src → dist/esm}/util/runtimeInfo.js.map +1 -1
  554. package/dist/esm/util/timerLoop.d.ts +26 -0
  555. package/dist/esm/util/timerLoop.d.ts.map +1 -0
  556. package/dist/esm/util/timerLoop.js +27 -0
  557. package/dist/esm/util/timerLoop.js.map +1 -0
  558. package/dist/esm/util/typeGuards.d.ts +8 -0
  559. package/dist/esm/util/typeGuards.d.ts.map +1 -0
  560. package/dist/esm/util/typeGuards.js +12 -0
  561. package/dist/esm/util/typeGuards.js.map +1 -0
  562. package/dist/esm/util/utils.d.ts +7 -0
  563. package/dist/esm/util/utils.d.ts.map +1 -0
  564. package/dist/esm/util/utils.js +13 -0
  565. package/dist/esm/util/utils.js.map +1 -0
  566. package/dist/esm/withAuth.d.ts +25 -0
  567. package/dist/esm/withAuth.d.ts.map +1 -0
  568. package/dist/esm/withAuth.js +84 -0
  569. package/dist/esm/withAuth.js.map +1 -0
  570. package/package.json +85 -80
  571. package/dist/index.js +0 -5372
  572. package/dist/index.js.map +0 -1
  573. package/dist-esm/src/batchingPartitionChannel.js.map +0 -1
  574. package/dist-esm/src/connectionContext.js.map +0 -1
  575. package/dist-esm/src/dataTransformer.js.map +0 -1
  576. package/dist-esm/src/diagnostics/instrumentEventData.js.map +0 -1
  577. package/dist-esm/src/diagnostics/tracing.js.map +0 -1
  578. package/dist-esm/src/eventData.js.map +0 -1
  579. package/dist-esm/src/eventDataAdapter.js.map +0 -1
  580. package/dist-esm/src/eventDataBatch.js.map +0 -1
  581. package/dist-esm/src/eventHubBufferedProducerClient.js.map +0 -1
  582. package/dist-esm/src/eventHubConsumerClient.js.map +0 -1
  583. package/dist-esm/src/eventHubConsumerClientModels.js +0 -4
  584. package/dist-esm/src/eventHubConsumerClientModels.js.map +0 -1
  585. package/dist-esm/src/eventHubProducerClient.js.map +0 -1
  586. package/dist-esm/src/eventHubSender.js.map +0 -1
  587. package/dist-esm/src/eventProcessor.js.map +0 -1
  588. package/dist-esm/src/eventhubConnectionConfig.js.map +0 -1
  589. package/dist-esm/src/impl/awaitableQueue.js.map +0 -1
  590. package/dist-esm/src/impl/partitionAssigner.js.map +0 -1
  591. package/dist-esm/src/inMemoryCheckpointStore.js.map +0 -1
  592. package/dist-esm/src/index.js.map +0 -1
  593. package/dist-esm/src/loadBalancerStrategies/balancedStrategy.js.map +0 -1
  594. package/dist-esm/src/loadBalancerStrategies/greedyStrategy.js.map +0 -1
  595. package/dist-esm/src/loadBalancerStrategies/loadBalancingStrategy.js.map +0 -1
  596. package/dist-esm/src/loadBalancerStrategies/unbalancedStrategy.js.map +0 -1
  597. package/dist-esm/src/logger.js.map +0 -1
  598. package/dist-esm/src/managementClient.js.map +0 -1
  599. package/dist-esm/src/models/private.js +0 -4
  600. package/dist-esm/src/models/private.js.map +0 -1
  601. package/dist-esm/src/models/public.js.map +0 -1
  602. package/dist-esm/src/partitionProcessor.js.map +0 -1
  603. package/dist-esm/src/partitionPump.js.map +0 -1
  604. package/dist-esm/src/partitionReceiver.js.map +0 -1
  605. package/dist-esm/src/pumpManager.js.map +0 -1
  606. package/dist-esm/src/util/constants.js.map +0 -1
  607. package/dist-esm/src/util/delayWithoutThrow.js.map +0 -1
  608. package/dist-esm/src/util/error.js.map +0 -1
  609. package/dist-esm/src/util/operationOptions.js +0 -4
  610. package/dist-esm/src/util/operationOptions.js.map +0 -1
  611. package/dist-esm/src/util/retries.js.map +0 -1
  612. package/dist-esm/src/util/runtimeInfo.browser.js.map +0 -1
  613. package/dist-esm/src/util/typeGuards.js.map +0 -1
  614. package/dist-esm/src/withAuth.js.map +0 -1
  615. package/types/latest/event-hubs.d.ts +0 -1877
@@ -1,1877 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- import { AbortSignalLike } from '@azure/abort-controller';
4
- import { AmqpAnnotatedMessage } from '@azure/core-amqp';
5
- import { AzureLogger } from '@azure/logger';
6
- import { MessagingError } from '@azure/core-amqp';
7
- import { NamedKeyCredential } from '@azure/core-auth';
8
- import { OperationTracingOptions } from '@azure/core-tracing';
9
- import { RetryMode } from '@azure/core-amqp';
10
- import { RetryOptions } from '@azure/core-amqp';
11
- import { SASCredential } from '@azure/core-auth';
12
- import { TokenCredential } from '@azure/core-auth';
13
- import { WebSocketImpl } from 'rhea-promise';
14
- import { WebSocketOptions } from '@azure/core-amqp';
15
-
16
- /**
17
- * Options to configure the `close` method on the `EventHubBufferedProducerClient`.
18
- */
19
- export declare interface BufferedCloseOptions extends OperationOptions {
20
- /**
21
- * When `true`, all buffered events that are pending should be sent before closing.
22
- * When `false`, abandon all buffered events and close immediately.
23
- * Defaults to `true`.
24
- */
25
- flush?: boolean;
26
- }
27
-
28
- /**
29
- * Options to configure the `flush` method on the `EventHubBufferedProducerClient`.
30
- */
31
- export declare interface BufferedFlushOptions extends OperationOptions {
32
- }
33
-
34
- /**
35
- * A checkpoint is meant to represent the last successfully processed event by the user from a particular
36
- * partition of a consumer group in an Event Hub instance.
37
- *
38
- * When the `updateCheckpoint()` method on the `PartitionProcessor` class is called by the user, a
39
- * `Checkpoint` is created internally. It is then stored in the storage solution implemented by the
40
- * `CheckpointManager` chosen by the user when creating an `EventProcessor`.
41
- *
42
- * Users are never expected to interact with `Checkpoint` directly. This interface exists to support the
43
- * internal workings of `EventProcessor` and `CheckpointManager`.
44
- **/
45
- export declare interface Checkpoint {
46
- /**
47
- * The fully qualified Event Hubs namespace. This is likely to be similar to
48
- * <yournamespace>.servicebus.windows.net
49
- */
50
- fullyQualifiedNamespace: string;
51
- /**
52
- * The event hub name
53
- */
54
- eventHubName: string;
55
- /**
56
- * The consumer group name
57
- */
58
- consumerGroup: string;
59
- /**
60
- * The identifier of the Event Hub partition
61
- */
62
- partitionId: string;
63
- /**
64
- * The sequence number of the event
65
- */
66
- sequenceNumber: number;
67
- /**
68
- * The offset of the event.
69
- */
70
- offset: string;
71
- }
72
-
73
- /**
74
- * A checkpoint store stores and retrieves partition ownership information and checkpoint details
75
- * for each partition in a given consumer group of an event hub instance.
76
- *
77
- * Users are not meant to implement an `CheckpointStore`.
78
- * Users are expected to choose existing implementations of this interface, instantiate it, and pass
79
- * it to the `EventHubConsumerClient` class constructor when instantiating a client.
80
- * Users are not expected to use any of the methods on a checkpoint store, these are used internally by
81
- * the client.
82
- *
83
- * Implementations of `CheckpointStore` can be found on npm by searching for packages with the prefix &commat;azure/eventhub-checkpointstore-.
84
- */
85
- export declare interface CheckpointStore {
86
- /**
87
- * Called to get the list of all existing partition ownership from the underlying data store. Could return empty
88
- * results if there are is no existing ownership information.
89
- *
90
- * @param fullyQualifiedNamespace - The fully qualified Event Hubs namespace. This is likely to be similar to
91
- * <yournamespace>.servicebus.windows.net.
92
- * @param eventHubName - The event hub name.
93
- * @param consumerGroup - The consumer group name.
94
- * @param options - A set of options that can be specified to influence the behavior of this method.
95
- * - `abortSignal`: A signal used to request operation cancellation.
96
- * - `tracingOptions`: Options for configuring tracing.
97
- * @returns A list of partition ownership details of all the partitions that have/had an owner.
98
- */
99
- listOwnership(fullyQualifiedNamespace: string, eventHubName: string, consumerGroup: string, options?: OperationOptions): Promise<PartitionOwnership[]>;
100
- /**
101
- * Called to claim ownership of a list of partitions. This will return the list of partitions that were owned
102
- * successfully.
103
- *
104
- * @param partitionOwnership - The list of partition ownership this instance is claiming to own.
105
- * @param options - A set of options that can be specified to influence the behavior of this method.
106
- * - `abortSignal`: A signal used to request operation cancellation.
107
- * - `tracingOptions`: Options for configuring tracing.
108
- * @returns A list of partitions this instance successfully claimed ownership.
109
- */
110
- claimOwnership(partitionOwnership: PartitionOwnership[], options?: OperationOptions): Promise<PartitionOwnership[]>;
111
- /**
112
- * Updates the checkpoint in the data store for a partition.
113
- *
114
- * @param checkpoint - The checkpoint.
115
- * @param options - A set of options that can be specified to influence the behavior of this method.
116
- * - `abortSignal`: A signal used to request operation cancellation.
117
- * - `tracingOptions`: Options for configuring tracing.
118
- */
119
- updateCheckpoint(checkpoint: Checkpoint, options?: OperationOptions): Promise<void>;
120
- /**
121
- * Lists all the checkpoints in a data store for a given namespace, eventhub and consumer group.
122
- *
123
- * @param fullyQualifiedNamespace - The fully qualified Event Hubs namespace. This is likely to be similar to
124
- * <yournamespace>.servicebus.windows.net.
125
- * @param eventHubName - The event hub name.
126
- * @param consumerGroup - The consumer group name.
127
- * @param options - A set of options that can be specified to influence the behavior of this method.
128
- * - `abortSignal`: A signal used to request operation cancellation.
129
- * - `tracingOptions`: Options for configuring tracing.
130
- * @returns A list of checkpoints for a given namespace, eventhub, and consumer group.
131
- */
132
- listCheckpoints(fullyQualifiedNamespace: string, eventHubName: string, consumerGroup: string, options?: OperationOptions): Promise<Checkpoint[]>;
133
- }
134
-
135
- /**
136
- * An enum representing the different reasons for an `EventHubConsumerClient` to stop processing
137
- * events from a partition in a consumer group of an Event Hub.
138
- */
139
- export declare enum CloseReason {
140
- /**
141
- * Ownership of the partition was lost or transitioned to a new processor instance.
142
- */
143
- OwnershipLost = "OwnershipLost",
144
- /**
145
- * The EventProcessor was shutdown.
146
- */
147
- Shutdown = "Shutdown"
148
- }
149
-
150
- /**
151
- * Options to configure the `createBatch` method on the `EventHubProducerClient`.
152
- * - `partitionKey` : A value that is hashed to produce a partition assignment.
153
- * - `maxSizeInBytes`: The upper limit for the size of batch.
154
- * - `abortSignal` : A signal the request to cancel the send operation.
155
- *
156
- * Example usage:
157
- * ```js
158
- * {
159
- * partitionKey: 'foo',
160
- * maxSizeInBytes: 1024 * 1024 // 1 MB
161
- * }
162
- * ```
163
- */
164
- export declare interface CreateBatchOptions extends OperationOptions {
165
- /**
166
- * A value that is hashed to produce a partition assignment. It guarantees that messages
167
- * with the same partitionKey end up in the same partition.
168
- * If this value is set then partitionId can not be set.
169
- */
170
- partitionKey?: string;
171
- /**
172
- * The partition this batch will be sent to.
173
- * If this value is set then partitionKey can not be set.
174
- */
175
- partitionId?: string;
176
- /**
177
- * The upper limit for the size of batch. The `tryAdd` function will return `false` after this limit is reached.
178
- */
179
- maxSizeInBytes?: number;
180
- }
181
-
182
- /**
183
- * A function that constructs an event data adapter. That adapter can be used
184
- * with `@azure/schema-registry-avro` to encode and decode body in event data.
185
- *
186
- * @param params - parameters to create the event data
187
- * @returns An event data adapter that can produce and consume event data
188
- */
189
- export declare function createEventDataAdapter(params?: EventDataAdapterParameters): MessageAdapter<EventData>;
190
-
191
- /**
192
- * Gets the `EventPosition` corresponding to the location of the the first event present in the partition.
193
- * Pass this position to the `EventHubConsumerClient.subscribe()` method to begin receiving events from the
194
- * first event in the partition which has not expired due to the retention policy.
195
- */
196
- export declare const earliestEventPosition: EventPosition;
197
-
198
- /**
199
- * Options to configure the `enqueueEvents` method on the `EventHubBufferedProducerClient`.
200
- */
201
- export declare interface EnqueueEventOptions extends SendBatchOptions {
202
- }
203
-
204
- /**
205
- * The interface that describes the data to be sent to Event Hub.
206
- * Use this as a reference when creating the object to be sent when using the `EventHubProducerClient`.
207
- * For example, `{ body: "your-data" }` or
208
- * ```
209
- * {
210
- * body: "your-data",
211
- * properties: {
212
- * propertyName: "property value"
213
- * }
214
- * }
215
- * ```
216
- */
217
- export declare interface EventData {
218
- /**
219
- * The message body that needs to be sent.
220
- * If the application reading the events is not using this SDK,
221
- * convert your body payload to a byte array or Buffer for better
222
- * cross-language compatibility.
223
- */
224
- body: any;
225
- /**
226
- * The content type of the message. Optionally describes
227
- * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for
228
- * example "application/json".
229
- */
230
- contentType?: string;
231
- /**
232
- * The correlation identifier that allows an
233
- * application to specify a context for the message for the purposes of correlation, for example
234
- * reflecting the MessageId of a message that is being replied to.
235
- */
236
- correlationId?: string | number | Buffer;
237
- /**
238
- * The message identifier is an
239
- * application-defined value that uniquely identifies the message and its payload.
240
- *
241
- * Note: Numbers that are not whole integers are not allowed.
242
- */
243
- messageId?: string | number | Buffer;
244
- /**
245
- * Set of key value pairs that can be used to set properties specific to user application.
246
- */
247
- properties?: {
248
- [key: string]: any;
249
- };
250
- }
251
-
252
- /**
253
- * Parameters to the `createEventDataAdapter` function that creates an event data adapter.
254
- */
255
- export declare interface EventDataAdapterParameters {
256
- /**
257
- * The correlation identifier that allows an
258
- * application to specify a context for the message for the purposes of correlation, for example
259
- * reflecting the MessageId of a message that is being replied to.
260
- */
261
- correlationId?: string | number | Buffer;
262
- /**
263
- * The message identifier is an
264
- * application-defined value that uniquely identifies the message and its payload.
265
- *
266
- * Note: Numbers that are not whole integers are not allowed.
267
- */
268
- messageId?: string | number | Buffer;
269
- /**
270
- * Set of key value pairs that can be used to set properties specific to user application.
271
- */
272
- properties?: {
273
- [key: string]: any;
274
- };
275
- }
276
-
277
- /**
278
- * An interface representing a batch of events which can be used to send events to Event Hub.
279
- *
280
- * To create the batch, use the `createBatch()` method on the `EventHubProducerClient`.
281
- * To send the batch, use the `sendBatch()` method on the same client.
282
- * To fill the batch, use the `tryAdd()` method on the batch itself.
283
- *
284
- */
285
- export declare interface EventDataBatch {
286
- /* Excluded from this release type: partitionKey */
287
- /* Excluded from this release type: partitionId */
288
- /**
289
- * Size of the batch in bytes after the events added to it have been encoded into a single AMQP
290
- * message.
291
- * @readonly
292
- */
293
- readonly sizeInBytes: number;
294
- /**
295
- * Number of events added to the batch.
296
- * @readonly
297
- */
298
- readonly count: number;
299
- /**
300
- * The maximum size of the batch, in bytes. The `tryAdd` function on the batch will return `false`
301
- * if the event being added causes the size of the batch to exceed this limit. Use the `createBatch()` method on
302
- * the `EventHubProducerClient` to set the maxSizeInBytes.
303
- * @readonly
304
- */
305
- readonly maxSizeInBytes: number;
306
- /**
307
- * Adds an event to the batch if permitted by the batch's size limit.
308
- * **NOTE**: Always remember to check the return value of this method, before calling it again
309
- * for the next event.
310
- *
311
- * @param eventData - An individual event data object or AmqpAnnotatedMessage.
312
- * @returns A boolean value indicating if the event data has been added to the batch or not.
313
- */
314
- tryAdd(eventData: EventData | AmqpAnnotatedMessage, options?: TryAddOptions): boolean;
315
- }
316
-
317
- /**
318
- * The `EventHubBufferedProducerClient`is used to publish events to a specific Event Hub.
319
- *
320
- * The `EventHubBufferedProducerClient` does not publish events immediately.
321
- * Instead, events are buffered so they can be efficiently batched and published
322
- * when the batch is full or the `maxWaitTimeInMs` has elapsed with no new events
323
- * enqueued.
324
- *
325
- * Depending on the options specified when events are enqueued, they may be
326
- * automatically assigned to a partition, grouped according to the specified partition key,
327
- * or assigned a specifically requested partition.
328
- *
329
- * This model is intended to shift the burden of batch management from callers, at the cost of
330
- * non-deterministic timing, for when events will be published. There are additional trade-offs
331
- * to consider, as well:
332
- * - If the application crashes, events in the buffer will not have been published. To prevent
333
- * data loss, callers are encouraged to track publishing progress using the
334
- * `onSendEventsSuccessHandler` and `onSendEventsErrorHandler` handlers.
335
- * - Events specifying a partition key may be assigned a different partition than those using
336
- * the same key with other producers.
337
- * - In the unlikely event that a partition becomes temporarily unavailable, the
338
- * `EventHubBufferedProducerClient` may take longer to recover than other producers.
339
- *
340
- * In scenarios where it is important to have events published immediately with a deterministic
341
- * outcome, ensure that partition keys are assigned to a partition consistent with other
342
- * publishers, or where maximizing availability is a requirement, using the
343
- * `EventHubProducerClient` is recommended.
344
- */
345
- export declare class EventHubBufferedProducerClient {
346
- /**
347
- * Controls the `abortSignal` passed to each `BatchingPartitionChannel`.
348
- * Used to signal when a channel should stop waiting for events.
349
- */
350
- private _abortController;
351
- /**
352
- * Indicates whether the client has been explicitly closed.
353
- */
354
- private _isClosed;
355
- /**
356
- * Handles assigning partitions.
357
- */
358
- private _partitionAssigner;
359
- /**
360
- * The known partitionIds that will be used when assigning events to partitions.
361
- */
362
- private _partitionIds;
363
- /**
364
- * The EventHubProducerClient to use when creating and sending batches to the Event Hub.
365
- */
366
- private _producer;
367
- /**
368
- * Mapping of partitionIds to `BatchingPartitionChannels`.
369
- * Each `BatchingPartitionChannel` handles buffering events and backpressure independently.
370
- */
371
- private _partitionChannels;
372
- /**
373
- * The options passed by the user when creating the EventHubBufferedProducerClient instance.
374
- */
375
- private _clientOptions;
376
- /**
377
- * The interval at which the background management operation should run.
378
- */
379
- private _backgroundManagementInterval;
380
- /**
381
- * Indicates whether the background management loop is running.
382
- */
383
- private _isBackgroundManagementRunning;
384
- /**
385
- * @readonly
386
- * The name of the Event Hub instance for which this client is created.
387
- */
388
- get eventHubName(): string;
389
- /**
390
- * @readonly
391
- * The fully qualified namespace of the Event Hub instance for which this client is created.
392
- * This is likely to be similar to <yournamespace>.servicebus.windows.net.
393
- */
394
- get fullyQualifiedNamespace(): string;
395
- /**
396
- * The name used to identify this EventHubBufferedProducerClient.
397
- * If not specified or empty, a random unique one will be generated.
398
- */
399
- readonly identifier: string;
400
- /**
401
- * The `EventHubBufferedProducerClient` class is used to send events to an Event Hub.
402
- * Use the `options` parmeter to configure retry policy or proxy settings.
403
- * @param connectionString - The connection string to use for connecting to the Event Hub instance.
404
- * It is expected that the shared key properties and the Event Hub path are contained in this connection string.
405
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
406
- * @param options - A set of options to apply when configuring the client.
407
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
408
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
409
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
410
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
411
- */
412
- constructor(connectionString: string, options: EventHubBufferedProducerClientOptions);
413
- /**
414
- * The `EventHubBufferedProducerClient` class is used to send events to an Event Hub.
415
- * Use the `options` parmeter to configure retry policy or proxy settings.
416
- * @param connectionString - The connection string to use for connecting to the Event Hubs namespace.
417
- * It is expected that the shared key properties are contained in this connection string, but not the Event Hub path,
418
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;'.
419
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
420
- * @param options - A set of options to apply when configuring the client.
421
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
422
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
423
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
424
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
425
- */
426
- constructor(connectionString: string, eventHubName: string, options: EventHubBufferedProducerClientOptions);
427
- /**
428
- * The `EventHubBufferedProducerClient` class is used to send events to an Event Hub.
429
- * Use the `options` parmeter to configure retry policy or proxy settings.
430
- * @param fullyQualifiedNamespace - The full namespace which is likely to be similar to
431
- * <yournamespace>.servicebus.windows.net
432
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
433
- * @param credential - An credential object used by the client to get the token to authenticate the connection
434
- * with the Azure Event Hubs service.
435
- * See &commat;azure/identity for creating credentials that support AAD auth.
436
- * Use the `AzureNamedKeyCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessKeyName`
437
- * and `SharedAccessKey` without using a connection string. These fields map to the `name` and `key` field respectively
438
- * in `AzureNamedKeyCredential`.
439
- * Use the `AzureSASCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessSignature`
440
- * without using a connection string. This field maps to `signature` in `AzureSASCredential`.
441
- * @param options - A set of options to apply when configuring the client.
442
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
443
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
444
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
445
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
446
- */
447
- constructor(fullyQualifiedNamespace: string, eventHubName: string, credential: TokenCredential | NamedKeyCredential | SASCredential, options: EventHubBufferedProducerClientOptions);
448
- /**
449
- * Closes the AMQP connection to the Event Hub instance,
450
- * returning a promise that will be resolved when disconnection is completed.
451
- *
452
- * This will wait for enqueued events to be flushed to the service before closing
453
- * the connection.
454
- * To close without flushing, set the `flush` option to `false`.
455
- *
456
- * @param options - The set of options to apply to the operation call.
457
- * @returns Promise<void>
458
- * @throws Error if the underlying connection encounters an error while closing.
459
- */
460
- close(options?: BufferedCloseOptions): Promise<void>;
461
- /**
462
- * Enqueues an event into the buffer to be published to the Event Hub.
463
- * If there is no capacity in the buffer when this method is invoked,
464
- * it will wait for space to become available and ensure that the event
465
- * has been enqueued.
466
- *
467
- * When this call returns, the event has been accepted into the buffer,
468
- * but it may not have been published yet.
469
- * Publishing will take place at a nondeterministic point in the future as the buffer is processed.
470
- *
471
- * @param events - An {@link EventData} or `AmqpAnnotatedMessage`.
472
- * @param options - A set of options that can be specified to influence the way in which
473
- * the event is sent to the associated Event Hub.
474
- * - `abortSignal` : A signal used to cancel the enqueueEvent operation.
475
- * - `partitionId` : The partition this set of events will be sent to. If set, `partitionKey` can not be set.
476
- * - `partitionKey` : A value that is hashed to produce a partition assignment. If set, `partitionId` can not be set.
477
- * @returns The total number of events that are currently buffered and waiting to be published, across all partitions.
478
- */
479
- enqueueEvent(event: EventData | AmqpAnnotatedMessage, options?: EnqueueEventOptions): Promise<number>;
480
- /**
481
- * Enqueues events into the buffer to be published to the Event Hub.
482
- * If there is no capacity in the buffer when this method is invoked,
483
- * it will wait for space to become available and ensure that the events
484
- * have been enqueued.
485
- *
486
- * When this call returns, the events have been accepted into the buffer,
487
- * but it may not have been published yet.
488
- * Publishing will take place at a nondeterministic point in the future as the buffer is processed.
489
- *
490
- * @param events - An array of {@link EventData} or `AmqpAnnotatedMessage`.
491
- * @param options - A set of options that can be specified to influence the way in which
492
- * events are sent to the associated Event Hub.
493
- * - `abortSignal` : A signal used to cancel the enqueueEvents operation.
494
- * - `partitionId` : The partition this set of events will be sent to. If set, `partitionKey` can not be set.
495
- * - `partitionKey` : A value that is hashed to produce a partition assignment. If set, `partitionId` can not be set.
496
- * @returns The total number of events that are currently buffered and waiting to be published, across all partitions.
497
- */
498
- enqueueEvents(events: EventData[] | AmqpAnnotatedMessage[], options?: EnqueueEventOptions): Promise<number>;
499
- /**
500
- * Attempts to publish all events in the buffer immediately.
501
- * This may result in multiple batches being published,
502
- * the outcome of each of which will be individually reported by
503
- * the `onSendEventsSuccessHandler` and `onSendEventsErrorHandler` handlers.
504
- *
505
- * @param options - The set of options to apply to the operation call.
506
- */
507
- flush(options?: BufferedFlushOptions): Promise<void>;
508
- /**
509
- * Provides the Event Hub runtime information.
510
- * @param options - The set of options to apply to the operation call.
511
- * @returns A promise that resolves with information about the Event Hub instance.
512
- * @throws Error if the underlying connection has been closed, create a new EventHubBufferedProducerClient.
513
- * @throws AbortError if the operation is cancelled via the abortSignal.
514
- */
515
- getEventHubProperties(options?: GetEventHubPropertiesOptions): Promise<EventHubProperties>;
516
- /**
517
- * Provides the id for each partition associated with the Event Hub.
518
- * @param options - The set of options to apply to the operation call.
519
- * @returns A promise that resolves with an Array of strings representing the id for
520
- * each partition associated with the Event Hub.
521
- * @throws Error if the underlying connection has been closed, create a new EventHubBufferedProducerClient.
522
- * @throws AbortError if the operation is cancelled via the abortSignal.
523
- */
524
- getPartitionIds(options?: GetPartitionIdsOptions): Promise<Array<string>>;
525
- /**
526
- * Provides information about the state of the specified partition.
527
- * @param partitionId - The id of the partition for which information is required.
528
- * @param options - The set of options to apply to the operation call.
529
- * @returns A promise that resolves with information about the state of the partition .
530
- * @throws Error if the underlying connection has been closed, create a new EventHubBufferedProducerClient.
531
- * @throws AbortError if the operation is cancelled via the abortSignal.
532
- */
533
- getPartitionProperties(partitionId: string, options?: GetPartitionPropertiesOptions): Promise<PartitionProperties>;
534
- /**
535
- * Gets the `BatchingPartitionChannel` associated with the partitionId.
536
- *
537
- * If one does not exist, it is created.
538
- */
539
- private _getPartitionChannel;
540
- /**
541
- * Returns the total number of buffered events across all partitions.
542
- */
543
- private _getTotalBufferedEventsCount;
544
- private _updatePartitionIds;
545
- private _startPartitionIdsUpdateLoop;
546
- }
547
-
548
- /**
549
- * Describes the options that can be provided while creating the `EventHubBufferedProducerClient`.
550
- */
551
- export declare interface EventHubBufferedProducerClientOptions extends EventHubClientOptions {
552
- /**
553
- * The total number of events that can be buffered for publishing at a given time for a given partition.
554
- *
555
- * Default: 1500
556
- */
557
- maxEventBufferLengthPerPartition?: number;
558
- /**
559
- * The amount of time to wait for a new event to be enqueued in the buffer before publishing a partially full batch.
560
- *
561
- * Default: 1 second.
562
- */
563
- maxWaitTimeInMs?: number;
564
- /**
565
- * The handler to call once a batch has successfully published.
566
- */
567
- onSendEventsSuccessHandler?: (ctx: OnSendEventsSuccessContext) => void;
568
- /**
569
- * The handler to call when a batch fails to publish.
570
- */
571
- onSendEventsErrorHandler: (ctx: OnSendEventsErrorContext) => void;
572
- /**
573
- * Indicates whether or not the EventHubProducerClient should enable idempotent publishing to Event Hub partitions.
574
- * If enabled, the producer will only be able to publish directly to partitions;
575
- * it will not be able to publish to the Event Hubs gateway for automatic partition routing
576
- * nor will it be able to use a partition key.
577
- * Default: false
578
- */
579
- enableIdempotentRetries?: boolean;
580
- }
581
-
582
- /**
583
- * Describes the options that can be provided while creating the EventHubClient.
584
- * - `userAgent` : A string to append to the built in user agent string that is passed as a connection property
585
- * to the service.
586
- * - `webSocketOptions` : Options to configure the channelling of the AMQP connection over Web Sockets.
587
- * - `websocket` : The WebSocket constructor used to create an AMQP connection if you choose to make the connection
588
- * over a WebSocket.
589
- * - `webSocketConstructorOptions` : Options to pass to the Websocket constructor when you choose to make the connection
590
- * over a WebSocket.
591
- * - `retryOptions` : The retry options for all the operations on the client/producer/consumer.
592
- * - `maxRetries` : The number of times the operation can be retried in case of a retryable error.
593
- * - `maxRetryDelayInMs`: The maximum delay between retries. Applicable only when performing exponential retries.
594
- * - `mode`: Which retry mode to apply, specified by the `RetryMode` enum. Options are `Exponential` and `Fixed`. Defaults to `Fixed`.
595
- * - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
596
- * this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
597
- * - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
598
- * retry attempts remaining. Default value: 60000 milliseconds.
599
- *
600
- * A simple usage can be `{ "maxRetries": 4 }`.
601
- *
602
- * Example usage:
603
- * ```js
604
- * {
605
- * retryOptions: {
606
- * maxRetries: 4
607
- * }
608
- * }
609
- * ```
610
- */
611
- export declare interface EventHubClientOptions {
612
- /**
613
- * A custom endpoint to use when connecting to the Event Hubs service.
614
- * This can be useful when your network does not allow connecting to the
615
- * standard Azure Event Hubs endpoint address, but does allow connecting
616
- * through an intermediary.
617
- *
618
- * Example: "https://my.custom.endpoint:100/"
619
- */
620
- customEndpointAddress?: string;
621
- /**
622
- * Options to configure the retry policy for all the operations on the client.
623
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
624
- *
625
- */
626
- retryOptions?: RetryOptions;
627
- /**
628
- * Options to configure the channelling of the AMQP connection over Web Sockets.
629
- */
630
- webSocketOptions?: WebSocketOptions;
631
- /**
632
- * Value that is appended to the built in user agent string that is passed to the Event Hubs service.
633
- */
634
- userAgent?: string;
635
- /**
636
- * A unique name used to identify the client. If not provided, a GUID will be used as the identifier
637
- */
638
- identifier?: string;
639
- }
640
-
641
- /**
642
- * The set of properties that comprise an Event Hub connection string.
643
- */
644
- export declare interface EventHubConnectionStringProperties {
645
- /**
646
- * The fully qualified Event Hub namespace extracted from the "Endpoint" in the
647
- * connection string. This is likely to be similar to `{yournamespace}.servicebus.windows.net`.
648
- * This is typically used to construct an EventHubProducerClient or an EventHubConsumerClient.
649
- */
650
- fullyQualifiedNamespace: string;
651
- /**
652
- * The value for "Endpoint" in the connection string.
653
- */
654
- endpoint: string;
655
- /**
656
- * The value for "EntityPath" in the connection string which would be the name of the event hub instance associated with the connection string.
657
- * Connection string from a Shared Access Policy created at the namespace level
658
- * will not have the EntityPath in it.
659
- */
660
- eventHubName?: string;
661
- /**
662
- * The value for "SharedAccessKey" in the connection string. This along with the "SharedAccessKeyName"
663
- * in the connection string is used to generate a SharedAccessSignature which can be used authorize
664
- * the connection to the service.
665
- */
666
- sharedAccessKey?: string;
667
- /**
668
- * The value for "SharedAccessKeyName" in the connection string. This along with the "SharedAccessKey"
669
- * in the connection string is used to generate a SharedAccessSignature which can be used authorize
670
- * the connection to the service.
671
- */
672
- sharedAccessKeyName?: string;
673
- /**
674
- * The value for "SharedAccessSignature" in the connection string. This is typically not present in the
675
- * connection string generated for a Shared Access Policy. It is instead generated by the
676
- * user and appended to the connection string for ease of use.
677
- */
678
- sharedAccessSignature?: string;
679
- /**
680
- * This should be true only if the connection string contains the slug ";UseDevelopmentEmulator=true"
681
- * and the endpoint is a loopback address.
682
- */
683
- useDevelopmentEmulator?: boolean;
684
- }
685
-
686
- /**
687
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
688
- *
689
- * There are multiple ways to create an `EventHubConsumerClient`
690
- * - Use the connection string from the SAS policy created for your Event Hub instance.
691
- * - Use the connection string from the SAS policy created for your Event Hub namespace,
692
- * and the name of the Event Hub instance
693
- * - Use the full namespace like `<yournamespace>.servicebus.windows.net`, and a credentials object.
694
- *
695
- * Optionally, you can also pass:
696
- * - An options bag to configure the retry policy or proxy settings.
697
- * - A checkpoint store that is used by the client to read checkpoints to determine the position from where it should
698
- * resume receiving events when your application gets restarted. The checkpoint store is also used by the client
699
- * to load balance multiple instances of your application.
700
- */
701
- export declare class EventHubConsumerClient {
702
- private _consumerGroup;
703
- /**
704
- * Describes the amqp connection context for the client.
705
- */
706
- private _context;
707
- /**
708
- * The options passed by the user when creating the EventHubClient instance.
709
- */
710
- private _clientOptions;
711
- private _partitionGate;
712
- /**
713
- * The Subscriptions that were spawned by calling `subscribe()`.
714
- * Subscriptions that have been stopped by the user will not
715
- * be present in this set.
716
- */
717
- private _subscriptions;
718
- /**
719
- * The name of the default consumer group in the Event Hubs service.
720
- */
721
- static defaultConsumerGroupName: string;
722
- private _checkpointStore;
723
- private _userChoseCheckpointStore;
724
- /**
725
- * Options for configuring load balancing.
726
- */
727
- private readonly _loadBalancingOptions;
728
- /**
729
- * @readonly
730
- * The name of the Event Hub instance for which this client is created.
731
- */
732
- get eventHubName(): string;
733
- /**
734
- * @readonly
735
- * The fully qualified namespace of the Event Hub instance for which this client is created.
736
- * This is likely to be similar to <yournamespace>.servicebus.windows.net.
737
- */
738
- get fullyQualifiedNamespace(): string;
739
- /**
740
- * The name used to identify this EventHubConsumerClient.
741
- * If not specified or empty, a random unique one will be generated.
742
- */
743
- readonly identifier: string;
744
- /**
745
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
746
- * Use the `options` parmeter to configure retry policy or proxy settings.
747
- * @param consumerGroup - The name of the consumer group from which you want to process events.
748
- * @param connectionString - The connection string to use for connecting to the Event Hub instance.
749
- * It is expected that the shared key properties and the Event Hub path are contained in this connection string.
750
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
751
- * @param options - A set of options to apply when configuring the client.
752
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
753
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
754
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
755
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
756
- */
757
- constructor(consumerGroup: string, connectionString: string, options?: EventHubConsumerClientOptions);
758
- /**
759
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
760
- * Use the `options` parmeter to configure retry policy or proxy settings.
761
- * @param consumerGroup - The name of the consumer group from which you want to process events.
762
- * @param connectionString - The connection string to use for connecting to the Event Hub instance.
763
- * It is expected that the shared key properties and the Event Hub path are contained in this connection string.
764
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
765
- * @param checkpointStore - A checkpoint store that is used by the client to read checkpoints to determine
766
- * the position from where it should resume receiving events when your application gets restarted.
767
- * It is also used by the client to load balance multiple instances of your application.
768
- * @param options - A set of options to apply when configuring the client.
769
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
770
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
771
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
772
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
773
- */
774
- constructor(consumerGroup: string, connectionString: string, checkpointStore: CheckpointStore, options?: EventHubConsumerClientOptions);
775
- /**
776
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
777
- * Use the `options` parmeter to configure retry policy or proxy settings.
778
- * @param consumerGroup - The name of the consumer group from which you want to process events.
779
- * @param connectionString - The connection string to use for connecting to the Event Hubs namespace.
780
- * It is expected that the shared key properties are contained in this connection string, but not the Event Hub path,
781
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;'.
782
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
783
- * @param options - A set of options to apply when configuring the client.
784
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
785
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
786
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
787
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
788
- */
789
- constructor(consumerGroup: string, connectionString: string, eventHubName: string, options?: EventHubConsumerClientOptions);
790
- /**
791
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
792
- * Use the `options` parmeter to configure retry policy or proxy settings.
793
- * @param consumerGroup - The name of the consumer group from which you want to process events.
794
- * @param connectionString - The connection string to use for connecting to the Event Hubs namespace.
795
- * It is expected that the shared key properties are contained in this connection string, but not the Event Hub path,
796
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;'.
797
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
798
- * @param checkpointStore - A checkpoint store that is used by the client to read checkpoints to determine
799
- * the position from where it should resume receiving events when your application gets restarted.
800
- * It is also used by the client to load balance multiple instances of your application.
801
- * @param options - A set of options to apply when configuring the client.
802
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
803
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
804
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
805
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
806
- */
807
- constructor(consumerGroup: string, connectionString: string, eventHubName: string, checkpointStore: CheckpointStore, options?: EventHubConsumerClientOptions);
808
- /**
809
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
810
- * Use the `options` parmeter to configure retry policy or proxy settings.
811
- * @param consumerGroup - The name of the consumer group from which you want to process events.
812
- * @param fullyQualifiedNamespace - The full namespace which is likely to be similar to
813
- * <yournamespace>.servicebus.windows.net
814
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
815
- * @param credential - An credential object used by the client to get the token to authenticate the connection
816
- * with the Azure Event Hubs service.
817
- * See &commat;azure/identity for creating credentials that support AAD auth.
818
- * Use the `AzureNamedKeyCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessKeyName`
819
- * and `SharedAccessKey` without using a connection string. These fields map to the `name` and `key` field respectively
820
- * in `AzureNamedKeyCredential`.
821
- * Use the `AzureSASCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessSignature`
822
- * without using a connection string. This field maps to `signature` in `AzureSASCredential`.
823
- * @param options - A set of options to apply when configuring the client.
824
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
825
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
826
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
827
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
828
- */
829
- constructor(consumerGroup: string, fullyQualifiedNamespace: string, eventHubName: string, credential: TokenCredential | NamedKeyCredential | SASCredential, options?: EventHubConsumerClientOptions);
830
- /**
831
- * The `EventHubConsumerClient` class is used to consume events from an Event Hub.
832
- * Use the `options` parmeter to configure retry policy or proxy settings.
833
- * @param consumerGroup - The name of the consumer group from which you want to process events.
834
- * @param fullyQualifiedNamespace - The full namespace which is likely to be similar to
835
- * <yournamespace>.servicebus.windows.net
836
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
837
- * @param credential - An credential object used by the client to get the token to authenticate the connection
838
- * with the Azure Event Hubs service.
839
- * See &commat;azure/identity for creating credentials that support AAD auth.
840
- * Use the `AzureNamedKeyCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessKeyName`
841
- * and `SharedAccessKey` without using a connection string. These fields map to the `name` and `key` field respectively
842
- * in `AzureNamedKeyCredential`.
843
- * Use the `AzureSASCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessSignature`
844
- * without using a connection string. This field maps to `signature` in `AzureSASCredential`.
845
- * @param checkpointStore - A checkpoint store that is used by the client to read checkpoints to determine
846
- * the position from where it should resume receiving events when your application gets restarted.
847
- * It is also used by the client to load balance multiple instances of your application.
848
- * @param options - A set of options to apply when configuring the client.
849
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
850
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
851
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
852
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
853
- */
854
- constructor(consumerGroup: string, fullyQualifiedNamespace: string, eventHubName: string, credential: TokenCredential | NamedKeyCredential | SASCredential, checkpointStore: CheckpointStore, options?: EventHubConsumerClientOptions);
855
- /**
856
- * Closes the AMQP connection to the Event Hub instance,
857
- * returning a promise that will be resolved when disconnection is completed.
858
- * @returns Promise<void>
859
- * @throws Error if the underlying connection encounters an error while closing.
860
- */
861
- close(): Promise<void>;
862
- /**
863
- * Provides the id for each partition associated with the Event Hub.
864
- * @param options - The set of options to apply to the operation call.
865
- * @returns A promise that resolves with an Array of strings representing the id for
866
- * each partition associated with the Event Hub.
867
- * @throws Error if the underlying connection has been closed, create a new EventHubConsumerClient.
868
- * @throws AbortError if the operation is cancelled via the abortSignal.
869
- */
870
- getPartitionIds(options?: GetPartitionIdsOptions): Promise<Array<string>>;
871
- /**
872
- * Provides information about the state of the specified partition.
873
- * @param partitionId - The id of the partition for which information is required.
874
- * @param options - The set of options to apply to the operation call.
875
- * @returns A promise that resolves with information about the state of the partition .
876
- * @throws Error if the underlying connection has been closed, create a new EventHubConsumerClient.
877
- * @throws AbortError if the operation is cancelled via the abortSignal.
878
- */
879
- getPartitionProperties(partitionId: string, options?: GetPartitionPropertiesOptions): Promise<PartitionProperties>;
880
- /**
881
- * Provides the Event Hub runtime information.
882
- * @param options - The set of options to apply to the operation call.
883
- * @returns A promise that resolves with information about the Event Hub instance.
884
- * @throws Error if the underlying connection has been closed, create a new EventHubConsumerClient.
885
- * @throws AbortError if the operation is cancelled via the abortSignal.
886
- */
887
- getEventHubProperties(options?: GetEventHubPropertiesOptions): Promise<EventHubProperties>;
888
- /**
889
- * Subscribe to events from all partitions.
890
- *
891
- * If checkpoint store is provided to the `EventHubConsumerClient` and there are multiple
892
- * instances of your application, then each instance will subscribe to a subset of the
893
- * partitions such that the load is balanced amongst them.
894
- *
895
- * Call close() on the returned object to stop receiving events.
896
- *
897
- * Example usage:
898
- * ```ts
899
- * const client = new EventHubConsumerClient(consumerGroup, connectionString, eventHubName);
900
- * const subscription = client.subscribe(
901
- * {
902
- * processEvents: (events, context) => { console.log("Received event count: ", events.length) },
903
- * processError: (err, context) => { console.log("Error: ", err) }
904
- * },
905
- * { startPosition: earliestEventPosition }
906
- * );
907
- * ```
908
- *
909
- * @param handlers - Handlers for the lifecycle of the subscription - subscription initialization
910
- * per partition, receiving events, handling errors and the closing
911
- * of a subscription per partition.
912
- * @param options - Configures the way events are received.
913
- * Most common are `maxBatchSize` and `maxWaitTimeInSeconds` that control the flow of
914
- * events to the handler provided to receive events as well as the start position. For example,
915
- * `{ maxBatchSize: 20, maxWaitTimeInSeconds: 120, startPosition: { sequenceNumber: 123 } }`
916
- */
917
- subscribe(handlers: SubscriptionEventHandlers, options?: SubscribeOptions): Subscription;
918
- /**
919
- * Subscribe to events from a single partition.
920
- * Call close() on the returned object to stop receiving events.
921
- *
922
- * Example usage:
923
- * ```ts
924
- * const client = new EventHubConsumerClient(consumerGroup, connectionString, eventHubName);
925
- * const subscription = client.subscribe(
926
- * partitionId,
927
- * {
928
- * processEvents: (events, context) => { console.log("Received event count: ", events.length) },
929
- * processError: (err, context) => { console.log("Error: ", err) }
930
- * },
931
- * { startPosition: earliestEventPosition }
932
- * );
933
- * ```
934
- *
935
- * @param partitionId - The id of the partition to subscribe to.
936
- * @param handlers - Handlers for the lifecycle of the subscription - subscription initialization
937
- * of the partition, receiving events, handling errors and the closing
938
- * of a subscription to the partition.
939
- * @param options - Configures the way events are received.
940
- * Most common are `maxBatchSize` and `maxWaitTimeInSeconds` that control the flow of
941
- * events to the handler provided to receive events as well as the start position. For example,
942
- * `{ maxBatchSize: 20, maxWaitTimeInSeconds: 120, startPosition: { sequenceNumber: 123 } }`
943
- */
944
- subscribe(partitionId: string, handlers: SubscriptionEventHandlers, options?: SubscribeOptions): Subscription;
945
- /**
946
- * Gets the LoadBalancing strategy that should be used based on what the user provided.
947
- */
948
- private _getLoadBalancingStrategy;
949
- private createEventProcessorForAllPartitions;
950
- private createEventProcessorForSinglePartition;
951
- private _createEventProcessor;
952
- }
953
-
954
- /**
955
- * Describes the options that can be provided while creating the EventHubConsumerClient.
956
- * - `loadBalancingOptions`: Options to tune how the EventHubConsumerClient claims partitions.
957
- * - `userAgent` : A string to append to the built in user agent string that is passed as a connection property
958
- * to the service.
959
- * - `webSocketOptions` : Options to configure the channelling of the AMQP connection over Web Sockets.
960
- * - `websocket` : The WebSocket constructor used to create an AMQP connection if you choose to make the connection
961
- * over a WebSocket.
962
- * - `webSocketConstructorOptions` : Options to pass to the Websocket constructor when you choose to make the connection
963
- * over a WebSocket.
964
- * - `retryOptions` : The retry options for all the operations on the client/producer/consumer.
965
- * - `maxRetries` : The number of times the operation can be retried in case of a retryable error.
966
- * - `maxRetryDelayInMs`: The maximum delay between retries. Applicable only when performing exponential retries.
967
- * - `mode`: Which retry mode to apply, specified by the `RetryMode` enum. Options are `Exponential` and `Fixed`. Defaults to `Fixed`.
968
- * - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
969
- * this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
970
- * - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
971
- * retry attempts remaining. Default value: 60000 milliseconds.
972
- *
973
- * A simple usage can be `{ "maxRetries": 4 }`.
974
- *
975
- * Example usage:
976
- * ```js
977
- * {
978
- * retryOptions: {
979
- * maxRetries: 4
980
- * }
981
- * }
982
- * ```
983
- */
984
- export declare interface EventHubConsumerClientOptions extends EventHubClientOptions {
985
- /**
986
- * Options to tune how the EventHubConsumerClient claims partitions.
987
- */
988
- loadBalancingOptions?: LoadBalancingOptions;
989
- }
990
-
991
- /**
992
- * The `EventHubProducerClient` class is used to send events to an Event Hub.
993
- *
994
- * There are multiple ways to create an `EventHubProducerClient`
995
- * - Use the connection string from the SAS policy created for your Event Hub instance.
996
- * - Use the connection string from the SAS policy created for your Event Hub namespace,
997
- * and the name of the Event Hub instance
998
- * - Use the full namespace like `<yournamespace>.servicebus.windows.net`, and a credentials object.
999
- *
1000
- * Optionally, you can also pass an options bag to configure the retry policy or proxy settings.
1001
- *
1002
- */
1003
- export declare class EventHubProducerClient {
1004
- /**
1005
- * Describes the amqp connection context for the client.
1006
- */
1007
- private _context;
1008
- /**
1009
- * The options passed by the user when creating the EventHubClient instance.
1010
- */
1011
- private _clientOptions;
1012
- /**
1013
- * Map of partitionId to senders
1014
- */
1015
- private _sendersMap;
1016
- /**
1017
- * Indicates whether or not the EventHubProducerClient should enable idempotent publishing to Event Hub partitions.
1018
- * If enabled, the producer will only be able to publish directly to partitions;
1019
- * it will not be able to publish to the Event Hubs gateway for automatic partition routing
1020
- * nor will it be able to use a partition key.
1021
- * Default: false
1022
- */
1023
- private _enableIdempotentRetries?;
1024
- /**
1025
- * The set of options that can be specified to influence publishing behavior specific to the configured Event Hub partition.
1026
- * These options are not necessary in the majority of scenarios and are intended for use with specialized scenarios,
1027
- * such as when recovering the state used for idempotent publishing.
1028
- */
1029
- private _partitionOptions?;
1030
- /**
1031
- * @readonly
1032
- * The name of the Event Hub instance for which this client is created.
1033
- */
1034
- get eventHubName(): string;
1035
- /**
1036
- * @readonly
1037
- * The fully qualified namespace of the Event Hub instance for which this client is created.
1038
- * This is likely to be similar to <yournamespace>.servicebus.windows.net.
1039
- */
1040
- get fullyQualifiedNamespace(): string;
1041
- /**
1042
- * The name used to identify this EventHubProducerClient.
1043
- * If not specified or empty, a random unique one will be generated.
1044
- */
1045
- readonly identifier: string;
1046
- /**
1047
- * The `EventHubProducerClient` class is used to send events to an Event Hub.
1048
- * Use the `options` parmeter to configure retry policy or proxy settings.
1049
- * @param connectionString - The connection string to use for connecting to the Event Hub instance.
1050
- * It is expected that the shared key properties and the Event Hub path are contained in this connection string.
1051
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
1052
- * @param options - A set of options to apply when configuring the client.
1053
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
1054
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
1055
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
1056
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
1057
- */
1058
- constructor(connectionString: string, options?: EventHubClientOptions);
1059
- /**
1060
- * The `EventHubProducerClient` class is used to send events to an Event Hub.
1061
- * Use the `options` parmeter to configure retry policy or proxy settings.
1062
- * @param connectionString - The connection string to use for connecting to the Event Hubs namespace.
1063
- * It is expected that the shared key properties are contained in this connection string, but not the Event Hub path,
1064
- * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;'.
1065
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
1066
- * @param options - A set of options to apply when configuring the client.
1067
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
1068
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
1069
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
1070
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
1071
- */
1072
- constructor(connectionString: string, eventHubName: string, options?: EventHubClientOptions);
1073
- /**
1074
- * The `EventHubProducerClient` class is used to send events to an Event Hub.
1075
- * Use the `options` parmeter to configure retry policy or proxy settings.
1076
- * @param fullyQualifiedNamespace - The full namespace which is likely to be similar to
1077
- * <yournamespace>.servicebus.windows.net
1078
- * @param eventHubName - The name of the specific Event Hub to connect the client to.
1079
- * @param credential - An credential object used by the client to get the token to authenticate the connection
1080
- * with the Azure Event Hubs service.
1081
- * See &commat;azure/identity for creating credentials that support AAD auth.
1082
- * Use the `AzureNamedKeyCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessKeyName`
1083
- * and `SharedAccessKey` without using a connection string. These fields map to the `name` and `key` field respectively
1084
- * in `AzureNamedKeyCredential`.
1085
- * Use the `AzureSASCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessSignature`
1086
- * without using a connection string. This field maps to `signature` in `AzureSASCredential`.
1087
- * @param options - A set of options to apply when configuring the client.
1088
- * - `retryOptions` : Configures the retry policy for all the operations on the client.
1089
- * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
1090
- * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
1091
- * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
1092
- */
1093
- constructor(fullyQualifiedNamespace: string, eventHubName: string, credential: TokenCredential | NamedKeyCredential | SASCredential, options?: EventHubClientOptions);
1094
- /**
1095
- * Creates an instance of `EventDataBatch` to which one can add events until the maximum supported size is reached.
1096
- * The batch can be passed to the {@link sendBatch} method of the `EventHubProducerClient` to be sent to Azure Event Hubs.
1097
- *
1098
- * Events with different values for partitionKey or partitionId will need to be put into different batches.
1099
- * To simplify such batch management across partitions or to have the client automatically batch events
1100
- * and send them in specific intervals, use `EventHubBufferedProducerClient` instead.
1101
- *
1102
- * The below example assumes you have an array of events at hand to be batched safely.
1103
- * If you have events coming in one by one, `EventHubBufferedProducerClient` is recommended instead
1104
- * for effecient management of batches.
1105
- *
1106
- * Example usage:
1107
- * ```ts
1108
- * const client = new EventHubProducerClient(connectionString);
1109
- * let batch = await client.createBatch();
1110
- * for (let i = 0; i < messages.length; i++) {
1111
- * if (!batch.tryAdd(messages[i])) {
1112
- * await client.sendBatch(batch);
1113
- * batch = await client.createBatch();
1114
- * if (!batch.tryAdd(messages[i])) {
1115
- * throw new Error("Message too big to fit")
1116
- * }
1117
- * if (i === messages.length - 1) {
1118
- * await client.sendBatch(batch);
1119
- * }
1120
- * }
1121
- * }
1122
- * ```
1123
- *
1124
- * @param options - Configures the behavior of the batch.
1125
- * - `partitionKey` : A value that is hashed and used by the Azure Event Hubs service to determine the partition to which
1126
- * the events need to be sent.
1127
- * - `partitionId` : Id of the partition to which the batch of events need to be sent.
1128
- * - `maxSizeInBytes`: The upper limit for the size of batch. The `tryAdd` function will return `false` after this limit is reached.
1129
- * - `abortSignal` : A signal the request to cancel the operation.
1130
- * @returns Promise<EventDataBatch>
1131
- * @throws Error if both `partitionId` and `partitionKey` are set in the options.
1132
- * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
1133
- * @throws AbortError if the operation is cancelled via the abortSignal in the options.
1134
- */
1135
- createBatch(options?: CreateBatchOptions): Promise<EventDataBatch>;
1136
- /**
1137
- * Get the information about the state of publishing for a partition as observed by the `EventHubProducerClient`.
1138
- * This data can always be read, but will only be populated with information relevant to the active features
1139
- * for the producer client.
1140
- *
1141
- * @param partitionId - Id of the partition from which to retrieve publishing properties.
1142
- * @param options - The set of options to apply to the operation call.
1143
- * - `abortSignal` : A signal the request to cancel the send operation.
1144
- * @returns Promise<void>
1145
- * @throws AbortError if the operation is cancelled via the abortSignal.
1146
- */
1147
- private getPartitionPublishingProperties;
1148
- /**
1149
- * Sends an array of events as a batch to the associated Event Hub.
1150
- *
1151
- * Azure Event Hubs has a limit on the size of the batch that can be sent which if exceeded
1152
- * will result in an error with code `MessageTooLargeError`.
1153
- * To safely send within batch size limits, use `EventHubProducerClient.createBatch()` or
1154
- * `EventHubBufferedProducerClient` instead.
1155
- *
1156
- * Example usage:
1157
- * ```ts
1158
- * const client = new EventHubProducerClient(connectionString);
1159
- * await client.sendBatch(messages);
1160
- * ```
1161
- *
1162
- * @param batch - An array of {@link EventData} or `AmqpAnnotatedMessage`.
1163
- * @param options - A set of options that can be specified to influence the way in which
1164
- * events are sent to the associated Event Hub.
1165
- * - `abortSignal` : A signal the request to cancel the send operation.
1166
- * - `partitionId` : The partition this batch will be sent to. If set, `partitionKey` can not be set.
1167
- * - `partitionKey` : A value that is hashed to produce a partition assignment. If set, `partitionId` can not be set.
1168
- *
1169
- * @returns Promise<void>
1170
- * @throws MessageTooLargeError if all the events in the input array cannot be fit into a batch.
1171
- * @throws AbortError if the operation is cancelled via the abortSignal.
1172
- * @throws MessagingError if an error is encountered while sending a message.
1173
- * @throws Error if the underlying connection or sender has been closed.
1174
- */
1175
- sendBatch(batch: EventData[] | AmqpAnnotatedMessage[], options?: SendBatchOptions): Promise<void>;
1176
- /**
1177
- * Sends a batch of events created using `EventHubProducerClient.createBatch()` to the associated Event Hub.
1178
- *
1179
- * Events with different values for partitionKey or partitionId will need to be put into different batches.
1180
- * To simplify such batch management across partitions or to have the client automatically batch events
1181
- * and send them in specific intervals, use `EventHubBufferedProducerClient` instead.
1182
- *
1183
- * The below example assumes you have an array of events at hand to be batched safely.
1184
- * If you have events coming in one by one, `EventHubBufferedProducerClient` is recommended instead
1185
- * for effecient management of batches.
1186
- *
1187
- * Example usage:
1188
- * ```ts
1189
- * const client = new EventHubProducerClient(connectionString);
1190
- * let batch = await client.createBatch();
1191
- * for (let i = 0; i < messages.length; i++) {
1192
- * if (!batch.tryAdd(messages[i])) {
1193
- * await client.sendBatch(batch);
1194
- * batch = await client.createBatch();
1195
- * if (!batch.tryAdd(messages[i])) {
1196
- * throw new Error("Message too big to fit")
1197
- * }
1198
- * if (i === messages.length - 1) {
1199
- * await client.sendBatch(batch);
1200
- * }
1201
- * }
1202
- * }
1203
- * ```
1204
- * @param batch - A batch of events that you can create using the {@link createBatch} method.
1205
- * @param options - A set of options that can be specified to influence the way in which
1206
- * events are sent to the associated Event Hub.
1207
- * - `abortSignal` : A signal the request to cancel the send operation.
1208
- *
1209
- * @returns Promise<void>
1210
- * @throws AbortError if the operation is cancelled via the abortSignal.
1211
- * @throws MessagingError if an error is encountered while sending a message.
1212
- * @throws Error if the underlying connection or sender has been closed.
1213
- */
1214
- sendBatch(batch: EventDataBatch, options?: OperationOptions): Promise<void>;
1215
- /**
1216
- * Closes the AMQP connection to the Event Hub instance,
1217
- * returning a promise that will be resolved when disconnection is completed.
1218
- * @returns Promise<void>
1219
- * @throws Error if the underlying connection encounters an error while closing.
1220
- */
1221
- close(): Promise<void>;
1222
- /**
1223
- * Provides the Event Hub runtime information.
1224
- * @param options - The set of options to apply to the operation call.
1225
- * @returns A promise that resolves with information about the Event Hub instance.
1226
- * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
1227
- * @throws AbortError if the operation is cancelled via the abortSignal.
1228
- */
1229
- getEventHubProperties(options?: GetEventHubPropertiesOptions): Promise<EventHubProperties>;
1230
- /**
1231
- * Provides the id for each partition associated with the Event Hub.
1232
- * @param options - The set of options to apply to the operation call.
1233
- * @returns A promise that resolves with an Array of strings representing the id for
1234
- * each partition associated with the Event Hub.
1235
- * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
1236
- * @throws AbortError if the operation is cancelled via the abortSignal.
1237
- */
1238
- getPartitionIds(options?: GetPartitionIdsOptions): Promise<Array<string>>;
1239
- /**
1240
- * Provides information about the state of the specified partition.
1241
- * @param partitionId - The id of the partition for which information is required.
1242
- * @param options - The set of options to apply to the operation call.
1243
- * @returns A promise that resolves with information about the state of the partition .
1244
- * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
1245
- * @throws AbortError if the operation is cancelled via the abortSignal.
1246
- */
1247
- getPartitionProperties(partitionId: string, options?: GetPartitionPropertiesOptions): Promise<PartitionProperties>;
1248
- }
1249
-
1250
- /**
1251
- * Describes the runtime information of an Event Hub.
1252
- */
1253
- export declare interface EventHubProperties {
1254
- /**
1255
- * The name of the event hub.
1256
- */
1257
- name: string;
1258
- /**
1259
- * The date and time the hub was created in UTC.
1260
- */
1261
- createdOn: Date;
1262
- /**
1263
- * The slice of string partition identifiers.
1264
- */
1265
- partitionIds: string[];
1266
- /**
1267
- * Whether the hub has geographical disaster recovery enabled.
1268
- */
1269
- isGeoDrEnabled: boolean;
1270
- }
1271
-
1272
- /**
1273
- * Represents the position of an event in an Event Hub partition, typically used when calling the `subscribe()`
1274
- * method on an `EventHubConsumerClient` to specify the position in the partition to begin receiving events from.
1275
- *
1276
- * To get an EventPosition representing the start or end of the stream, use the constants
1277
- * `earliestEventPosition` and `latestEventPosition` respectively.
1278
- *
1279
- */
1280
- export declare interface EventPosition {
1281
- /**
1282
- * The offset of the event identified by this position.
1283
- * Expected to be undefined if the position is just created from a sequence number or an enqueued time.
1284
- *
1285
- * The offset is the relative position for an event in the context of the partition.
1286
- * The offset should not be considered a stable value.
1287
- * The same offset may refer to a different event as events reach the age limit for
1288
- * retention and are no longer visible within the partition.
1289
- */
1290
- offset?: string | "@latest";
1291
- /**
1292
- * Indicates if the specified offset is inclusive of the event which it identifies.
1293
- * This information is only relevent if the event position was identified by an offset or sequence number.
1294
- * Default value: `false`.
1295
- */
1296
- isInclusive?: boolean;
1297
- /**
1298
- * The enqueued time in UTC of the event identified by this position.
1299
- * When provided as a number this value is the number of milliseconds since the Unix Epoch.
1300
- * Expected to be undefined if the position is just created from a sequence number or an offset.
1301
- */
1302
- enqueuedOn?: Date | number;
1303
- /**
1304
- * The sequence number of the event identified by this position.
1305
- * Expected to be undefined if the position is just created from an offset or enqueued time.
1306
- */
1307
- sequenceNumber?: number;
1308
- }
1309
-
1310
- /**
1311
- * The set of options to configure the behavior of `getEventHubProperties`.
1312
- * - `abortSignal` : An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
1313
- * - `parentSpan` : The `Span` or `SpanContext` to use as the `parent` of the span created while calling this operation.
1314
- */
1315
- export declare interface GetEventHubPropertiesOptions extends OperationOptions {
1316
- }
1317
-
1318
- /**
1319
- * The set of options to configure the behavior of `getPartitionIds`.
1320
- * - `abortSignal` : An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
1321
- * - `parentSpan` : The `Span` or `SpanContext` to use as the `parent` of the span created while calling this operation.
1322
- */
1323
- export declare interface GetPartitionIdsOptions extends OperationOptions {
1324
- }
1325
-
1326
- /**
1327
- * The set of options to configure the behavior of `getPartitionProperties`.
1328
- * - `abortSignal` : An implementation of the `AbortSignalLike` interface to signal the request to cancel the operation.
1329
- * - `parentSpan` : The `Span` or `SpanContext` to use as the `parent` of the span created while calling this operation.
1330
- */
1331
- export declare interface GetPartitionPropertiesOptions extends OperationOptions {
1332
- }
1333
-
1334
- /**
1335
- * A set of information about the last enqueued event of a partition, as observed by the consumer as
1336
- * events are received from the Event Hubs service
1337
- */
1338
- export declare interface LastEnqueuedEventProperties {
1339
- /**
1340
- * The sequence number of the event that was last enqueued into the Event Hub partition from which
1341
- * this event was received.
1342
- */
1343
- sequenceNumber?: number;
1344
- /**
1345
- * The date and time, in UTC, that the last event was enqueued into the Event Hub partition from
1346
- * which this event was received.
1347
- */
1348
- enqueuedOn?: Date;
1349
- /**
1350
- * The offset of the event that was last enqueued into the Event Hub partition from which
1351
- * this event was received.
1352
- */
1353
- offset?: string;
1354
- /**
1355
- * The date and time, in UTC, that the last event was retrieved from the Event Hub partition.
1356
- */
1357
- retrievedOn?: Date;
1358
- }
1359
-
1360
- /**
1361
- * Gets the `EventPosition` corresponding to the end of the partition.
1362
- * Pass this position to the `EventHubConsumerClient.subscribe()` method to begin receiving events from the
1363
- * event that is enqueued right after the method call.
1364
- * @returns EventPosition
1365
- */
1366
- export declare const latestEventPosition: EventPosition;
1367
-
1368
- /**
1369
- * An options bag to configure load balancing settings.
1370
- */
1371
- export declare interface LoadBalancingOptions {
1372
- /**
1373
- * Whether to apply a greedy or a more balanced approach when
1374
- * claiming partitions.
1375
- *
1376
- * - balanced: The `EventHubConsumerClient` will take a measured approach to
1377
- * requesting partition ownership when balancing work with other clients,
1378
- * slowly claiming partitions until a stabilized distribution is achieved.
1379
- *
1380
- * - greedy: The `EventHubConsumerClient` will attempt to claim ownership
1381
- * of its fair share of partitions aggressively when balancing work with
1382
- * other clients.
1383
- *
1384
- * This option is ignored when either:
1385
- * - `CheckpointStore` is __not__ provided to the `EventHubConsumerClient`.
1386
- * - `subscribe()` is called for a single partition.
1387
- * Default: balanced
1388
- */
1389
- strategy?: "balanced" | "greedy";
1390
- /**
1391
- * The length of time between attempts to claim partitions.
1392
- * Default: 10000
1393
- */
1394
- updateIntervalInMs?: number;
1395
- /**
1396
- * The length of time a partition claim is valid.
1397
- * Default: 60000
1398
- */
1399
- partitionOwnershipExpirationIntervalInMs?: number;
1400
- }
1401
-
1402
- /**
1403
- * The `@azure/logger` configuration for this package.
1404
- * This will output logs using the `azure:event-hubs` namespace prefix.
1405
- */
1406
- export declare const logger: AzureLogger;
1407
-
1408
- /**
1409
- * A message adapter interface that specifies methods for producing and consuming
1410
- * messages with payloads and content type fields.
1411
- *
1412
- * This interface is hidden because it is already exported by `@azure/schema-registry-avro`
1413
- *
1414
- * @hidden
1415
- */
1416
- export declare interface MessageAdapter<MessageT> {
1417
- /**
1418
- * defines how to create a message from a payload and a content type
1419
- */
1420
- produce: (MessageContent: MessageContent) => MessageT;
1421
- /**
1422
- * defines how to access the payload and the content type of a message
1423
- */
1424
- consume: (message: MessageT) => MessageContent;
1425
- }
1426
-
1427
- /**
1428
- * A message with payload and content type fields
1429
- *
1430
- * This interface is hidden because it is already exported by `@azure/schema-registry-avro`
1431
- *
1432
- * @hidden
1433
- */
1434
- export declare interface MessageContent {
1435
- /**
1436
- * The message's binary data
1437
- */
1438
- data: Uint8Array;
1439
- /**
1440
- * The message's content type
1441
- */
1442
- contentType: string;
1443
- }
1444
-
1445
- export { MessagingError }
1446
-
1447
- /**
1448
- * Contains the events that were not successfully sent to the Event Hub,
1449
- * the partition they were assigned to, and the error that was encountered while sending.
1450
- */
1451
- export declare interface OnSendEventsErrorContext {
1452
- /**
1453
- * The partition each event was assigned.
1454
- */
1455
- partitionId: string;
1456
- /**
1457
- * The array of {@link EventData} and/or `AmqpAnnotatedMessage` that were not successfully sent to the Event Hub.
1458
- */
1459
- events: Array<EventData | AmqpAnnotatedMessage>;
1460
- /**
1461
- * The error that occurred when sending the associated events to the Event Hub.
1462
- */
1463
- error: Error;
1464
- }
1465
-
1466
- /**
1467
- * Contains the events that were successfully sent to the Event Hub,
1468
- * and the partition they were assigned to.
1469
- */
1470
- export declare interface OnSendEventsSuccessContext {
1471
- /**
1472
- * The partition each event was assigned.
1473
- */
1474
- partitionId: string;
1475
- /**
1476
- * The array of {@link EventData} and/or `AmqpAnnotatedMessage` that were successfully sent to the Event Hub.
1477
- */
1478
- events: Array<EventData | AmqpAnnotatedMessage>;
1479
- }
1480
-
1481
- /**
1482
- * Options for configuring tracing and the abortSignal.
1483
- */
1484
- export declare interface OperationOptions {
1485
- /**
1486
- * The signal which can be used to abort requests.
1487
- */
1488
- abortSignal?: AbortSignalLike;
1489
- /**
1490
- * Options for configuring tracing.
1491
- */
1492
- tracingOptions?: OperationTracingOptions;
1493
- }
1494
-
1495
- /**
1496
- * Parses given connection string into the different properties applicable to Azure Event Hubs.
1497
- * The properties are useful to then construct an EventHubProducerClient or an EventHubConsumerClient.
1498
- * @param connectionString - The connection string associated with the Shared Access Policy created
1499
- * for the Event Hubs namespace.
1500
- */
1501
- export declare function parseEventHubConnectionString(connectionString: string): Readonly<EventHubConnectionStringProperties>;
1502
-
1503
- /**
1504
- * Interface that describes the context passed to each of the functions that are a part
1505
- * of the `SubscriptionEventHandlers`. When implementing any of these functions, use
1506
- * the context object to get information about the partition as well as the
1507
- * ability to checkpoint.
1508
- */
1509
- export declare interface PartitionContext {
1510
- /**
1511
- * The fully qualified Event Hubs namespace. This is likely to be similar to
1512
- * <yournamespace>.servicebus.windows.net
1513
- */
1514
- readonly fullyQualifiedNamespace: string;
1515
- /**
1516
- * The event hub name.
1517
- */
1518
- readonly eventHubName: string;
1519
- /**
1520
- * The consumer group name.
1521
- */
1522
- readonly consumerGroup: string;
1523
- /**
1524
- * The identifier of the Event Hub partition.
1525
- */
1526
- readonly partitionId: string;
1527
- /**
1528
- * Information on the last enqueued event in the partition that is being processed.
1529
- * This property is only updated if the `trackLastEnqueuedEventProperties` option is set to true
1530
- * when creating an instance of EventProcessor.
1531
- * @readonly
1532
- */
1533
- readonly lastEnqueuedEventProperties?: LastEnqueuedEventProperties;
1534
- /**
1535
- * Updates the checkpoint using the event data.
1536
- *
1537
- * A checkpoint is meant to represent the last successfully processed event by the user from a particular
1538
- * partition of a consumer group in an Event Hub instance.
1539
- *
1540
- * @param eventData - The event that you want to update the checkpoint with.
1541
- */
1542
- updateCheckpoint(eventData: ReceivedEventData): Promise<void>;
1543
- }
1544
-
1545
- /**
1546
- * An interface representing the details on which instance of a `EventProcessor` owns processing
1547
- * of a given partition from a consumer group of an Event Hub instance.
1548
- *
1549
- * **Note**: This is used internally by the `EventProcessor` and user never has to create it directly.
1550
- */
1551
- export declare interface PartitionOwnership {
1552
- /**
1553
- * The fully qualified Event Hubs namespace. This is likely to be similar to
1554
- * <yournamespace>.servicebus.windows.net
1555
- */
1556
- fullyQualifiedNamespace: string;
1557
- /**
1558
- * The event hub name
1559
- */
1560
- eventHubName: string;
1561
- /**
1562
- * The consumer group name
1563
- */
1564
- consumerGroup: string;
1565
- /**
1566
- * The identifier of the Event Hub partition.
1567
- */
1568
- partitionId: string;
1569
- /**
1570
- * The unique identifier of the event processor.
1571
- */
1572
- ownerId: string;
1573
- /**
1574
- * The last modified time.
1575
- */
1576
- lastModifiedTimeInMs?: number;
1577
- /**
1578
- * The unique identifier for the operation.
1579
- */
1580
- etag?: string;
1581
- }
1582
-
1583
- /**
1584
- * Describes the runtime information of an EventHub Partition.
1585
- */
1586
- export declare interface PartitionProperties {
1587
- /**
1588
- * The name of the Event Hub.
1589
- */
1590
- eventHubName: string;
1591
- /**
1592
- * Identifier of the partition within the Event Hub.
1593
- */
1594
- partitionId: string;
1595
- /**
1596
- * The starting sequence number of the partition's message log.
1597
- */
1598
- beginningSequenceNumber: number;
1599
- /**
1600
- * The last sequence number of the partition's message log.
1601
- */
1602
- lastEnqueuedSequenceNumber: number;
1603
- /**
1604
- * The offset of the last enqueued message in the partition's message log.
1605
- */
1606
- lastEnqueuedOffset: string;
1607
- /**
1608
- * The time of the last enqueued message in the partition's message log in UTC.
1609
- */
1610
- lastEnqueuedOnUtc: Date;
1611
- /**
1612
- * Indicates whether the partition is empty.
1613
- */
1614
- isEmpty: boolean;
1615
- }
1616
-
1617
- /**
1618
- * Signature of the user provided function invoked by `EventHubConsumerClient` just after stopping to receive
1619
- * events from a partition.
1620
- */
1621
- export declare type ProcessCloseHandler = (reason: CloseReason, context: PartitionContext) => Promise<void>;
1622
-
1623
- /**
1624
- * Signature of the user provided function invoked by `EventHubConsumerClient` for errors that occur when
1625
- * receiving events or when executing any of the user provided functions passed to the `subscribe()` method.
1626
- */
1627
- export declare type ProcessErrorHandler = (error: Error | MessagingError, context: PartitionContext) => Promise<void>;
1628
-
1629
- /**
1630
- * Signature of the user provided function invoked by `EventHubConsumerClient` when a set of events is received.
1631
- */
1632
- export declare type ProcessEventsHandler = (events: ReceivedEventData[], context: PartitionContext) => Promise<void>;
1633
-
1634
- /**
1635
- * Signature of the user provided function invoked by `EventHubConsumerClient` just before starting to receive
1636
- * events from a partition.
1637
- */
1638
- export declare type ProcessInitializeHandler = (context: PartitionContext) => Promise<void>;
1639
-
1640
- /**
1641
- * The interface that describes the structure of the event received from Event Hub.
1642
- * Use this as a reference when creating the `processEvents` function to process the events
1643
- * recieved from an Event Hub when using the `EventHubConsumerClient`.
1644
- */
1645
- export declare interface ReceivedEventData {
1646
- /**
1647
- * The message body that needs to be sent or is received.
1648
- */
1649
- body: any;
1650
- /**
1651
- * The application specific properties.
1652
- */
1653
- properties?: {
1654
- [key: string]: any;
1655
- };
1656
- /**
1657
- * The enqueued time of the event.
1658
- */
1659
- enqueuedTimeUtc: Date;
1660
- /**
1661
- * When specified Event Hub will hash this to a partitionId.
1662
- * It guarantees that messages end up in a specific partition on the event hub.
1663
- */
1664
- partitionKey: string | null;
1665
- /**
1666
- * The offset of the event.
1667
- */
1668
- offset: string;
1669
- /**
1670
- * The sequence number of the event.
1671
- */
1672
- sequenceNumber: number;
1673
- /**
1674
- * The properties set by the service.
1675
- */
1676
- systemProperties?: {
1677
- [key: string]: any;
1678
- };
1679
- /**
1680
- * The content type of the message. Optionally describes
1681
- * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for
1682
- * example "application/json".
1683
- */
1684
- contentType?: string;
1685
- /**
1686
- * The correlation identifier that allows an
1687
- * application to specify a context for the message for the purposes of correlation, for example
1688
- * reflecting the MessageId of a message that is being replied to.
1689
- */
1690
- correlationId?: string | number | Buffer;
1691
- /**
1692
- * The message identifier is an
1693
- * application-defined value that uniquely identifies the message and its payload.
1694
- */
1695
- messageId?: string | number | Buffer;
1696
- /**
1697
- * Returns the underlying raw amqp message.
1698
- */
1699
- getRawAmqpMessage(): AmqpAnnotatedMessage;
1700
- }
1701
-
1702
- export { RetryMode }
1703
-
1704
- export { RetryOptions }
1705
-
1706
- /**
1707
- * Options to configure the `sendBatch` method on the `EventHubProducerClient`
1708
- * when sending an array of events.
1709
- * If `partitionId` is set, `partitionKey` must not be set and vice versa.
1710
- *
1711
- * - `partitionId` : The partition this batch will be sent to.
1712
- * - `partitionKey` : A value that is hashed to produce a partition assignment.
1713
- * - `abortSignal` : A signal used to cancel the send operation.
1714
- */
1715
- export declare interface SendBatchOptions extends OperationOptions {
1716
- /**
1717
- * The partition this batch will be sent to.
1718
- * If this value is set then partitionKey can not be set.
1719
- */
1720
- partitionId?: string;
1721
- /**
1722
- * A value that is hashed to produce a partition assignment.
1723
- * It guarantees that messages with the same partitionKey end up in the same partition.
1724
- * Specifying this will throw an error if the producer was created using a `partitionId`.
1725
- */
1726
- partitionKey?: string;
1727
- }
1728
-
1729
- /**
1730
- * Options to configure the `subscribe` method on the `EventHubConsumerClient`.
1731
- * For example, `{ maxBatchSize: 20, maxWaitTimeInSeconds: 120, startPosition: { sequenceNumber: 123 } }`
1732
- */
1733
- export declare interface SubscribeOptions {
1734
- /**
1735
- * The number of events to request per batch
1736
- */
1737
- maxBatchSize?: number;
1738
- /**
1739
- * The maximum amount of time to wait to build up the requested message count before
1740
- * passing the data to user code for processing. If not provided, it defaults to 60 seconds.
1741
- */
1742
- maxWaitTimeInSeconds?: number;
1743
- /**
1744
- * The event position in a partition to start receiving events from if no checkpoint is found.
1745
- * Pass a map of partition id to position if you would like to use different starting
1746
- * position for each partition.
1747
- */
1748
- startPosition?: EventPosition | {
1749
- [partitionId: string]: EventPosition;
1750
- };
1751
- /**
1752
- * Indicates whether or not the consumer should request information on the last enqueued event on its
1753
- * associated partition, and track that information as events are received.
1754
-
1755
- * When information about the partition's last enqueued event is being tracked, each event received
1756
- * from the Event Hubs service will carry metadata about the partition that it otherwise would not. This results in a small amount of
1757
- * additional network bandwidth consumption that is generally a favorable trade-off when considered
1758
- * against periodically making requests for partition properties using the Event Hub client.
1759
- */
1760
- trackLastEnqueuedEventProperties?: boolean;
1761
- /**
1762
- * The owner level to use as this subscription subscribes to partitions.
1763
- */
1764
- ownerLevel?: number;
1765
- /**
1766
- * Options for configuring tracing.
1767
- */
1768
- tracingOptions?: OperationTracingOptions;
1769
- /**
1770
- * Option to disable the client from running JSON.parse() on the message body when receiving the message.
1771
- * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you
1772
- * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.
1773
- */
1774
- skipParsingBodyAsJson?: boolean;
1775
- /**
1776
- * The count of events requested eagerly and queued without regard to whether a read was requested.
1777
- */
1778
- prefetchCount?: number;
1779
- }
1780
-
1781
- /**
1782
- * Interface that describes the object returned by the `subscribe()` method on the `EventHubConsumerClient`.
1783
- */
1784
- export declare interface Subscription {
1785
- /**
1786
- * Stops the subscription from receiving more messages.
1787
- *
1788
- * If a checkpoint store has been configured this will also mark this subscription's
1789
- * partitions as abandoned, freeing them up to be read by other consumers.
1790
- *
1791
- * @returns Promise<void>
1792
- * @throws Error if the underlying connection encounters an error while closing.
1793
- */
1794
- close(): Promise<void>;
1795
- /**
1796
- * Indicates whether the receiver is running.
1797
- * `true` - is running; `false` otherwise.
1798
- * @readonly
1799
- */
1800
- isRunning: boolean;
1801
- }
1802
-
1803
- /**
1804
- * Interface that describes the functions to be implemented by the user which are invoked by
1805
- * the `EventHubConsumerClient` when the `subscribe()` method is called to receive events
1806
- * from Event Hub.
1807
- */
1808
- export declare interface SubscriptionEventHandlers {
1809
- /**
1810
- * The function invoked by `EventHubConsumerClient` when a set of events is received. The
1811
- * `PartitionContext` passed to this function can be used to determine which partition is being read from.
1812
- *
1813
- * The `updateCheckpoint()` method on the context can be used to update checkpoints in the `CheckpointStore`
1814
- * (if one was provided to the client). Use this in frequent intervals to mark events that have been processed
1815
- * so that the client can restart from such checkpoints in the event of a restart or error recovery.
1816
- *
1817
- * Note: It is possible for received events to be an empty array.
1818
- * This can happen if there are no new events to receive
1819
- * in the `maxWaitTimeInSeconds`, which is defaulted to 60 seconds.
1820
- * The `maxWaitTimeInSeconds` can be changed by setting
1821
- * it in the `options` passed to `subscribe()`.
1822
- */
1823
- processEvents: ProcessEventsHandler;
1824
- /**
1825
- * The function invoked by `EventHubConsumerClient` for errors that occur when receiving events
1826
- * or when executing any of the user provided functions passed to the `subscribe()` method.
1827
- *
1828
- * The `PartitionContext` passed to this function will indicate the partition that was being processed
1829
- * when the error was thrown. In cases where an error is thrown outside of processing events from a
1830
- * partition(e.g. failure to perform load balancing), the `partitionId` on the context will be an empty string.
1831
- *
1832
- * After the client completes executing this function, the `partitionClose` function is invoked.
1833
- */
1834
- processError: ProcessErrorHandler;
1835
- /**
1836
- * The function invoked by `EventHubConsumerClient` each time the subscription is about to begin
1837
- * reading from a partition. The `PartitionContext` passed to this function can be used to determine
1838
- * which partition is about to be read from.
1839
- *
1840
- * The client will start receiving events for the partition only after completing the execution of
1841
- * this function (if provided). Therefore, use this function to carry out any setup work including
1842
- * async tasks.
1843
- */
1844
- processInitialize?: ProcessInitializeHandler;
1845
- /**
1846
- * The function invoked by `EventHubConsumerClient` each time the subscription stops reading events from
1847
- * a partition. The information on this partition will be available on the `PartitionContext` passed to the
1848
- * function `processClose`.
1849
- *
1850
- * If the `CloseReason` passed to this function is `OwnershipLost`, then another subscription has taken over
1851
- * reading from the same partition using the same consumer group. This is expected if you have multiple
1852
- * instances of your application running and have passed the `CheckpointStore` to the client to load balance.
1853
- *
1854
- * If the `CloseReason` is `Shutdown`, this indicates that either `subscription.close()` was called, or an
1855
- * error occured. Unless the subscription was explicitly closed via `subscription.close()`, the subscription
1856
- * will attempt to resume reading events from the last checkpoint for the partition.
1857
- */
1858
- processClose?: ProcessCloseHandler;
1859
- }
1860
-
1861
- export { TokenCredential }
1862
-
1863
- /**
1864
- * Options to configure the behavior of the `tryAdd` method on the `EventDataBatch` class.
1865
- */
1866
- export declare interface TryAddOptions {
1867
- /**
1868
- * The options to use when creating Spans for tracing.
1869
- */
1870
- tracingOptions?: OperationTracingOptions;
1871
- }
1872
-
1873
- export { WebSocketImpl }
1874
-
1875
- export { WebSocketOptions }
1876
-
1877
- export { }