@azure/event-hubs 5.12.1-alpha.20240604.1 → 5.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (607) hide show
  1. package/README.md +1 -1
  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 +107 -0
  7. package/dist/browser/connectionContext.d.ts.map +1 -0
  8. package/{dist-esm/src → dist/browser}/connectionContext.js +8 -8
  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 +38 -4
  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 +11 -10
  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-esm/src → dist/browser}/impl/awaitableQueue.js.map +1 -1
  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-esm/src → dist/browser}/logger.js.map +1 -1
  110. package/dist/browser/managementClient.d.ts +141 -0
  111. package/dist/browser/managementClient.d.ts.map +1 -0
  112. package/{dist-esm/src → dist/browser}/managementClient.js +7 -7
  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-esm/src → dist/browser}/models/private.js +2 -2
  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 +15 -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 +23 -0
  144. package/dist/browser/util/constants.d.ts.map +1 -0
  145. package/{dist-esm/src → dist/browser}/util/constants.js +1 -1
  146. package/{dist-esm/src → dist/browser}/util/constants.js.map +1 -1
  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-esm/src → dist/browser}/util/delayWithoutThrow.js.map +1 -1
  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-esm/src → dist/browser}/util/operationOptions.js.map +1 -1
  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-esm/src → dist/browser}/util/retries.js.map +1 -1
  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 +1 -1
  182. package/{dist-esm/src → dist/browser}/util/typeGuards.js.map +1 -1
  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 +3 -3
  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 +107 -0
  196. package/dist/commonjs/connectionContext.d.ts.map +1 -0
  197. package/dist/commonjs/connectionContext.js +324 -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 +141 -0
  300. package/dist/commonjs/managementClient.d.ts.map +1 -0
  301. package/dist/commonjs/managementClient.js +274 -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 +6 -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 +23 -0
  334. package/dist/commonjs/util/constants.d.ts.map +1 -0
  335. package/dist/commonjs/util/constants.js +28 -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 +107 -0
  386. package/dist/esm/connectionContext.d.ts.map +1 -0
  387. package/dist/esm/connectionContext.js +320 -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 +141 -0
  490. package/dist/esm/managementClient.d.ts.map +1 -0
  491. package/dist/esm/managementClient.js +270 -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 +23 -0
  523. package/dist/esm/util/constants.d.ts.map +1 -0
  524. package/dist/esm/util/constants.js +25 -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/{types/latest → dist}/event-hubs.d.ts +1 -3
  571. package/package.json +84 -76
  572. package/dist/index.js +0 -5369
  573. package/dist/index.js.map +0 -1
  574. package/dist-esm/src/batchingPartitionChannel.js.map +0 -1
  575. package/dist-esm/src/connectionContext.js.map +0 -1
  576. package/dist-esm/src/dataTransformer.js.map +0 -1
  577. package/dist-esm/src/diagnostics/instrumentEventData.js.map +0 -1
  578. package/dist-esm/src/diagnostics/tracing.js.map +0 -1
  579. package/dist-esm/src/eventData.js.map +0 -1
  580. package/dist-esm/src/eventDataAdapter.js.map +0 -1
  581. package/dist-esm/src/eventDataBatch.js.map +0 -1
  582. package/dist-esm/src/eventHubBufferedProducerClient.js.map +0 -1
  583. package/dist-esm/src/eventHubConsumerClient.js.map +0 -1
  584. package/dist-esm/src/eventHubConsumerClientModels.js +0 -4
  585. package/dist-esm/src/eventHubConsumerClientModels.js.map +0 -1
  586. package/dist-esm/src/eventHubProducerClient.js.map +0 -1
  587. package/dist-esm/src/eventHubSender.js.map +0 -1
  588. package/dist-esm/src/eventProcessor.js.map +0 -1
  589. package/dist-esm/src/eventhubConnectionConfig.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/managementClient.js.map +0 -1
  598. package/dist-esm/src/models/private.js.map +0 -1
  599. package/dist-esm/src/models/public.js.map +0 -1
  600. package/dist-esm/src/partitionProcessor.js.map +0 -1
  601. package/dist-esm/src/partitionPump.js.map +0 -1
  602. package/dist-esm/src/partitionReceiver.js.map +0 -1
  603. package/dist-esm/src/pumpManager.js.map +0 -1
  604. package/dist-esm/src/util/error.js.map +0 -1
  605. package/dist-esm/src/util/operationOptions.js +0 -4
  606. package/dist-esm/src/util/runtimeInfo.browser.js.map +0 -1
  607. package/dist-esm/src/withAuth.js.map +0 -1
@@ -0,0 +1,218 @@
1
+ import { CloseReason } from "./models/public.js";
2
+ import { EventPosition } from "./eventPosition.js";
3
+ import { LastEnqueuedEventProperties } from "./partitionReceiver.js";
4
+ import { MessagingError } from "@azure/core-amqp";
5
+ import { OperationTracingOptions } from "@azure/core-tracing";
6
+ import { ReceivedEventData } from "./eventData.js";
7
+ /**
8
+ * @internal
9
+ */
10
+ export interface BasicPartitionProperties {
11
+ /**
12
+ * The fully qualified Event Hubs namespace. This is likely to be similar to
13
+ * <yournamespace>.servicebus.windows.net
14
+ */
15
+ fullyQualifiedNamespace: string;
16
+ /**
17
+ * The event hub name.
18
+ */
19
+ eventHubName: string;
20
+ /**
21
+ * The consumer group name.
22
+ */
23
+ consumerGroup: string;
24
+ /**
25
+ * The identifier of the Event Hub partition.
26
+ */
27
+ partitionId: string;
28
+ }
29
+ /**
30
+ * Interface that describes the context passed to each of the functions that are a part
31
+ * of the `SubscriptionEventHandlers`. When implementing any of these functions, use
32
+ * the context object to get information about the partition as well as the
33
+ * ability to checkpoint.
34
+ */
35
+ export interface PartitionContext {
36
+ /**
37
+ * The fully qualified Event Hubs namespace. This is likely to be similar to
38
+ * <yournamespace>.servicebus.windows.net
39
+ */
40
+ readonly fullyQualifiedNamespace: string;
41
+ /**
42
+ * The event hub name.
43
+ */
44
+ readonly eventHubName: string;
45
+ /**
46
+ * The consumer group name.
47
+ */
48
+ readonly consumerGroup: string;
49
+ /**
50
+ * The identifier of the Event Hub partition.
51
+ */
52
+ readonly partitionId: string;
53
+ /**
54
+ * Information on the last enqueued event in the partition that is being processed.
55
+ * This property is only updated if the `trackLastEnqueuedEventProperties` option is set to true
56
+ * when creating an instance of EventProcessor.
57
+ * @readonly
58
+ */
59
+ readonly lastEnqueuedEventProperties?: LastEnqueuedEventProperties;
60
+ /**
61
+ * Updates the checkpoint using the event data.
62
+ *
63
+ * A checkpoint is meant to represent the last successfully processed event by the user from a particular
64
+ * partition of a consumer group in an Event Hub instance.
65
+ *
66
+ * @param eventData - The event that you want to update the checkpoint with.
67
+ */
68
+ updateCheckpoint(eventData: ReceivedEventData): Promise<void>;
69
+ }
70
+ /**
71
+ * Signature of the user provided function invoked by `EventHubConsumerClient` when a set of events is received.
72
+ */
73
+ export type ProcessEventsHandler = (events: ReceivedEventData[], context: PartitionContext) => Promise<void>;
74
+ /**
75
+ * Signature of the user provided function invoked by `EventHubConsumerClient` for errors that occur when
76
+ * receiving events or when executing any of the user provided functions passed to the `subscribe()` method.
77
+ */
78
+ export type ProcessErrorHandler = (error: Error | MessagingError, context: PartitionContext) => Promise<void>;
79
+ /**
80
+ * Signature of the user provided function invoked by `EventHubConsumerClient` just before starting to receive
81
+ * events from a partition.
82
+ */
83
+ export type ProcessInitializeHandler = (context: PartitionContext) => Promise<void>;
84
+ /**
85
+ * Signature of the user provided function invoked by `EventHubConsumerClient` just after stopping to receive
86
+ * events from a partition.
87
+ */
88
+ export type ProcessCloseHandler = (reason: CloseReason, context: PartitionContext) => Promise<void>;
89
+ /**
90
+ * Interface that describes the functions to be implemented by the user which are invoked by
91
+ * the `EventHubConsumerClient` when the `subscribe()` method is called to receive events
92
+ * from Event Hub.
93
+ */
94
+ export interface SubscriptionEventHandlers {
95
+ /**
96
+ * The function invoked by `EventHubConsumerClient` when a set of events is received. The
97
+ * `PartitionContext` passed to this function can be used to determine which partition is being read from.
98
+ *
99
+ * The `updateCheckpoint()` method on the context can be used to update checkpoints in the `CheckpointStore`
100
+ * (if one was provided to the client). Use this in frequent intervals to mark events that have been processed
101
+ * so that the client can restart from such checkpoints in the event of a restart or error recovery.
102
+ *
103
+ * Note: It is possible for received events to be an empty array.
104
+ * This can happen if there are no new events to receive
105
+ * in the `maxWaitTimeInSeconds`, which is defaulted to 60 seconds.
106
+ * The `maxWaitTimeInSeconds` can be changed by setting
107
+ * it in the `options` passed to `subscribe()`.
108
+ */
109
+ processEvents: ProcessEventsHandler;
110
+ /**
111
+ * The function invoked by `EventHubConsumerClient` for errors that occur when receiving events
112
+ * or when executing any of the user provided functions passed to the `subscribe()` method.
113
+ *
114
+ * The `PartitionContext` passed to this function will indicate the partition that was being processed
115
+ * when the error was thrown. In cases where an error is thrown outside of processing events from a
116
+ * partition(e.g. failure to perform load balancing), the `partitionId` on the context will be an empty string.
117
+ *
118
+ * After the client completes executing this function, the `partitionClose` function is invoked.
119
+ */
120
+ processError: ProcessErrorHandler;
121
+ /**
122
+ * The function invoked by `EventHubConsumerClient` each time the subscription is about to begin
123
+ * reading from a partition. The `PartitionContext` passed to this function can be used to determine
124
+ * which partition is about to be read from.
125
+ *
126
+ * The client will start receiving events for the partition only after completing the execution of
127
+ * this function (if provided). Therefore, use this function to carry out any setup work including
128
+ * async tasks.
129
+ */
130
+ processInitialize?: ProcessInitializeHandler;
131
+ /**
132
+ * The function invoked by `EventHubConsumerClient` each time the subscription stops reading events from
133
+ * a partition. The information on this partition will be available on the `PartitionContext` passed to the
134
+ * function `processClose`.
135
+ *
136
+ * If the `CloseReason` passed to this function is `OwnershipLost`, then another subscription has taken over
137
+ * reading from the same partition using the same consumer group. This is expected if you have multiple
138
+ * instances of your application running and have passed the `CheckpointStore` to the client to load balance.
139
+ *
140
+ * If the `CloseReason` is `Shutdown`, this indicates that either `subscription.close()` was called, or an
141
+ * error occured. Unless the subscription was explicitly closed via `subscription.close()`, the subscription
142
+ * will attempt to resume reading events from the last checkpoint for the partition.
143
+ */
144
+ processClose?: ProcessCloseHandler;
145
+ }
146
+ /**
147
+ * Options to configure the `subscribe` method on the `EventHubConsumerClient`.
148
+ * For example, `{ maxBatchSize: 20, maxWaitTimeInSeconds: 120, startPosition: { sequenceNumber: 123 } }`
149
+ */
150
+ export interface SubscribeOptions {
151
+ /**
152
+ * The number of events to request per batch
153
+ */
154
+ maxBatchSize?: number;
155
+ /**
156
+ * The maximum amount of time to wait to build up the requested message count before
157
+ * passing the data to user code for processing. If not provided, it defaults to 60 seconds.
158
+ */
159
+ maxWaitTimeInSeconds?: number;
160
+ /**
161
+ * The event position in a partition to start receiving events from if no checkpoint is found.
162
+ * Pass a map of partition id to position if you would like to use different starting
163
+ * position for each partition.
164
+ */
165
+ startPosition?: EventPosition | {
166
+ [partitionId: string]: EventPosition;
167
+ };
168
+ /**
169
+ * Indicates whether or not the consumer should request information on the last enqueued event on its
170
+ * associated partition, and track that information as events are received.
171
+
172
+ * When information about the partition's last enqueued event is being tracked, each event received
173
+ * from the Event Hubs service will carry metadata about the partition that it otherwise would not. This results in a small amount of
174
+ * additional network bandwidth consumption that is generally a favorable trade-off when considered
175
+ * against periodically making requests for partition properties using the Event Hub client.
176
+ */
177
+ trackLastEnqueuedEventProperties?: boolean;
178
+ /**
179
+ * The owner level to use as this subscription subscribes to partitions.
180
+ */
181
+ ownerLevel?: number;
182
+ /**
183
+ * Options for configuring tracing.
184
+ */
185
+ tracingOptions?: OperationTracingOptions;
186
+ /**
187
+ * Option to disable the client from running JSON.parse() on the message body when receiving the message.
188
+ * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you
189
+ * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.
190
+ */
191
+ skipParsingBodyAsJson?: boolean;
192
+ /**
193
+ * The count of events requested eagerly and queued without regard to whether a read was requested.
194
+ */
195
+ prefetchCount?: number;
196
+ }
197
+ /**
198
+ * Interface that describes the object returned by the `subscribe()` method on the `EventHubConsumerClient`.
199
+ */
200
+ export interface Subscription {
201
+ /**
202
+ * Stops the subscription from receiving more messages.
203
+ *
204
+ * If a checkpoint store has been configured this will also mark this subscription's
205
+ * partitions as abandoned, freeing them up to be read by other consumers.
206
+ *
207
+ * @returns Promise<void>
208
+ * @throws Error if the underlying connection encounters an error while closing.
209
+ */
210
+ close(): Promise<void>;
211
+ /**
212
+ * Indicates whether the receiver is running.
213
+ * `true` - is running; `false` otherwise.
214
+ * @readonly
215
+ */
216
+ isRunning: boolean;
217
+ }
218
+ //# sourceMappingURL=eventHubConsumerClientModels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventHubConsumerClientModels.d.ts","sourceRoot":"","sources":["../../src/eventHubConsumerClientModels.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,2BAA2B,CAAC,EAAE,2BAA2B,CAAC;IACnE;;;;;;;OAOG;IACH,gBAAgB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,MAAM,EAAE,iBAAiB,EAAE,EAC3B,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,KAAK,EAAE,KAAK,GAAG,cAAc,EAC7B,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpG;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;;;;;OAaG;IACH,aAAa,EAAE,oBAAoB,CAAC;IACpC;;;;;;;;;OASG;IACH,YAAY,EAAE,mBAAmB,CAAC;IAClC;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IAC7C;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,aAAa,GAAG;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAC;IACzE;;;;;;;;OAQG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=eventHubConsumerClientModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventHubConsumerClientModels.js","sourceRoot":"","sources":["../../src/eventHubConsumerClientModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CloseReason } from \"./models/public.js\";\nimport { EventPosition } from \"./eventPosition.js\";\nimport { LastEnqueuedEventProperties } from \"./partitionReceiver.js\";\nimport { MessagingError } from \"@azure/core-amqp\";\nimport { OperationTracingOptions } from \"@azure/core-tracing\";\nimport { ReceivedEventData } from \"./eventData.js\";\n\n/**\n * @internal\n */\nexport interface BasicPartitionProperties {\n /**\n * The fully qualified Event Hubs namespace. This is likely to be similar to\n * <yournamespace>.servicebus.windows.net\n */\n fullyQualifiedNamespace: string;\n /**\n * The event hub name.\n */\n eventHubName: string;\n /**\n * The consumer group name.\n */\n consumerGroup: string;\n /**\n * The identifier of the Event Hub partition.\n */\n partitionId: string;\n}\n\n/**\n * Interface that describes the context passed to each of the functions that are a part\n * of the `SubscriptionEventHandlers`. When implementing any of these functions, use\n * the context object to get information about the partition as well as the\n * ability to checkpoint.\n */\nexport interface PartitionContext {\n /**\n * The fully qualified Event Hubs namespace. This is likely to be similar to\n * <yournamespace>.servicebus.windows.net\n */\n readonly fullyQualifiedNamespace: string;\n /**\n * The event hub name.\n */\n readonly eventHubName: string;\n /**\n * The consumer group name.\n */\n readonly consumerGroup: string;\n /**\n * The identifier of the Event Hub partition.\n */\n readonly partitionId: string;\n /**\n * Information on the last enqueued event in the partition that is being processed.\n * This property is only updated if the `trackLastEnqueuedEventProperties` option is set to true\n * when creating an instance of EventProcessor.\n * @readonly\n */\n readonly lastEnqueuedEventProperties?: LastEnqueuedEventProperties;\n /**\n * Updates the checkpoint using the event data.\n *\n * A checkpoint is meant to represent the last successfully processed event by the user from a particular\n * partition of a consumer group in an Event Hub instance.\n *\n * @param eventData - The event that you want to update the checkpoint with.\n */\n updateCheckpoint(eventData: ReceivedEventData): Promise<void>;\n}\n\n/**\n * Signature of the user provided function invoked by `EventHubConsumerClient` when a set of events is received.\n */\nexport type ProcessEventsHandler = (\n events: ReceivedEventData[],\n context: PartitionContext,\n) => Promise<void>;\n\n/**\n * Signature of the user provided function invoked by `EventHubConsumerClient` for errors that occur when\n * receiving events or when executing any of the user provided functions passed to the `subscribe()` method.\n */\nexport type ProcessErrorHandler = (\n error: Error | MessagingError,\n context: PartitionContext,\n) => Promise<void>;\n\n/**\n * Signature of the user provided function invoked by `EventHubConsumerClient` just before starting to receive\n * events from a partition.\n */\nexport type ProcessInitializeHandler = (context: PartitionContext) => Promise<void>;\n\n/**\n * Signature of the user provided function invoked by `EventHubConsumerClient` just after stopping to receive\n * events from a partition.\n */\nexport type ProcessCloseHandler = (reason: CloseReason, context: PartitionContext) => Promise<void>;\n\n/**\n * Interface that describes the functions to be implemented by the user which are invoked by\n * the `EventHubConsumerClient` when the `subscribe()` method is called to receive events\n * from Event Hub.\n */\nexport interface SubscriptionEventHandlers {\n /**\n * The function invoked by `EventHubConsumerClient` when a set of events is received. The\n * `PartitionContext` passed to this function can be used to determine which partition is being read from.\n *\n * The `updateCheckpoint()` method on the context can be used to update checkpoints in the `CheckpointStore`\n * (if one was provided to the client). Use this in frequent intervals to mark events that have been processed\n * so that the client can restart from such checkpoints in the event of a restart or error recovery.\n *\n * Note: It is possible for received events to be an empty array.\n * This can happen if there are no new events to receive\n * in the `maxWaitTimeInSeconds`, which is defaulted to 60 seconds.\n * The `maxWaitTimeInSeconds` can be changed by setting\n * it in the `options` passed to `subscribe()`.\n */\n processEvents: ProcessEventsHandler;\n /**\n * The function invoked by `EventHubConsumerClient` for errors that occur when receiving events\n * or when executing any of the user provided functions passed to the `subscribe()` method.\n *\n * The `PartitionContext` passed to this function will indicate the partition that was being processed\n * when the error was thrown. In cases where an error is thrown outside of processing events from a\n * partition(e.g. failure to perform load balancing), the `partitionId` on the context will be an empty string.\n *\n * After the client completes executing this function, the `partitionClose` function is invoked.\n */\n processError: ProcessErrorHandler;\n /**\n * The function invoked by `EventHubConsumerClient` each time the subscription is about to begin\n * reading from a partition. The `PartitionContext` passed to this function can be used to determine\n * which partition is about to be read from.\n *\n * The client will start receiving events for the partition only after completing the execution of\n * this function (if provided). Therefore, use this function to carry out any setup work including\n * async tasks.\n */\n processInitialize?: ProcessInitializeHandler;\n /**\n * The function invoked by `EventHubConsumerClient` each time the subscription stops reading events from\n * a partition. The information on this partition will be available on the `PartitionContext` passed to the\n * function `processClose`.\n *\n * If the `CloseReason` passed to this function is `OwnershipLost`, then another subscription has taken over\n * reading from the same partition using the same consumer group. This is expected if you have multiple\n * instances of your application running and have passed the `CheckpointStore` to the client to load balance.\n *\n * If the `CloseReason` is `Shutdown`, this indicates that either `subscription.close()` was called, or an\n * error occured. Unless the subscription was explicitly closed via `subscription.close()`, the subscription\n * will attempt to resume reading events from the last checkpoint for the partition.\n */\n processClose?: ProcessCloseHandler;\n}\n\n/**\n * Options to configure the `subscribe` method on the `EventHubConsumerClient`.\n * For example, `{ maxBatchSize: 20, maxWaitTimeInSeconds: 120, startPosition: { sequenceNumber: 123 } }`\n */\nexport interface SubscribeOptions {\n /**\n * The number of events to request per batch\n */\n maxBatchSize?: number;\n /**\n * The maximum amount of time to wait to build up the requested message count before\n * passing the data to user code for processing. If not provided, it defaults to 60 seconds.\n */\n maxWaitTimeInSeconds?: number;\n /**\n * The event position in a partition to start receiving events from if no checkpoint is found.\n * Pass a map of partition id to position if you would like to use different starting\n * position for each partition.\n */\n startPosition?: EventPosition | { [partitionId: string]: EventPosition };\n /**\n * Indicates whether or not the consumer should request information on the last enqueued event on its\n * associated partition, and track that information as events are received.\n\n * When information about the partition's last enqueued event is being tracked, each event received\n * from the Event Hubs service will carry metadata about the partition that it otherwise would not. This results in a small amount of\n * additional network bandwidth consumption that is generally a favorable trade-off when considered\n * against periodically making requests for partition properties using the Event Hub client.\n */\n trackLastEnqueuedEventProperties?: boolean;\n /**\n * The owner level to use as this subscription subscribes to partitions.\n */\n ownerLevel?: number;\n /**\n * Options for configuring tracing.\n */\n tracingOptions?: OperationTracingOptions;\n /**\n * Option to disable the client from running JSON.parse() on the message body when receiving the message.\n * Not applicable if the message was sent with AMQP body type value or sequence. Use this option when you\n * prefer to work directly with the bytes present in the message body than have the client attempt to parse it.\n */\n skipParsingBodyAsJson?: boolean;\n /**\n * The count of events requested eagerly and queued without regard to whether a read was requested.\n */\n prefetchCount?: number;\n}\n\n/**\n * Interface that describes the object returned by the `subscribe()` method on the `EventHubConsumerClient`.\n */\nexport interface Subscription {\n /**\n * Stops the subscription from receiving more messages.\n *\n * If a checkpoint store has been configured this will also mark this subscription's\n * partitions as abandoned, freeing them up to be read by other consumers.\n *\n * @returns Promise<void>\n * @throws Error if the underlying connection encounters an error while closing.\n */\n close(): Promise<void>;\n /**\n * Indicates whether the receiver is running.\n * `true` - is running; `false` otherwise.\n * @readonly\n */\n isRunning: boolean;\n}\n"]}
@@ -0,0 +1,266 @@
1
+ import { CreateBatchOptions, EventHubClientOptions, GetEventHubPropertiesOptions, GetPartitionIdsOptions, GetPartitionPropertiesOptions, SendBatchOptions } from "./models/public.js";
2
+ import { EventDataBatch } from "./eventDataBatch.js";
3
+ import { EventHubProperties, PartitionProperties } from "./managementClient.js";
4
+ import { NamedKeyCredential, SASCredential, TokenCredential } from "@azure/core-auth";
5
+ import { AmqpAnnotatedMessage } from "@azure/core-amqp";
6
+ import { EventData } from "./eventData.js";
7
+ import { OperationOptions } from "./util/operationOptions.js";
8
+ /**
9
+ * The `EventHubProducerClient` class is used to send events to an Event Hub.
10
+ *
11
+ * There are multiple ways to create an `EventHubProducerClient`
12
+ * - Use the connection string from the SAS policy created for your Event Hub instance.
13
+ * - Use the connection string from the SAS policy created for your Event Hub namespace,
14
+ * and the name of the Event Hub instance
15
+ * - Use the full namespace like `<yournamespace>.servicebus.windows.net`, and a credentials object.
16
+ *
17
+ * Optionally, you can also pass an options bag to configure the retry policy or proxy settings.
18
+ *
19
+ */
20
+ export declare class EventHubProducerClient {
21
+ /**
22
+ * Describes the amqp connection context for the client.
23
+ */
24
+ private _context;
25
+ /**
26
+ * The options passed by the user when creating the EventHubClient instance.
27
+ */
28
+ private _clientOptions;
29
+ /**
30
+ * Map of partitionId to senders
31
+ */
32
+ private _sendersMap;
33
+ /**
34
+ * Indicates whether or not the EventHubProducerClient should enable idempotent publishing to Event Hub partitions.
35
+ * If enabled, the producer will only be able to publish directly to partitions;
36
+ * it will not be able to publish to the Event Hubs gateway for automatic partition routing
37
+ * nor will it be able to use a partition key.
38
+ * Default: false
39
+ */
40
+ private _enableIdempotentRetries?;
41
+ /**
42
+ * The set of options that can be specified to influence publishing behavior specific to the configured Event Hub partition.
43
+ * These options are not necessary in the majority of scenarios and are intended for use with specialized scenarios,
44
+ * such as when recovering the state used for idempotent publishing.
45
+ */
46
+ private _partitionOptions?;
47
+ /**
48
+ * @readonly
49
+ * The name of the Event Hub instance for which this client is created.
50
+ */
51
+ get eventHubName(): string;
52
+ /**
53
+ * @readonly
54
+ * The fully qualified namespace of the Event Hub instance for which this client is created.
55
+ * This is likely to be similar to <yournamespace>.servicebus.windows.net.
56
+ */
57
+ get fullyQualifiedNamespace(): string;
58
+ /**
59
+ * The name used to identify this EventHubProducerClient.
60
+ * If not specified or empty, a random unique one will be generated.
61
+ */
62
+ readonly identifier: string;
63
+ /**
64
+ * The `EventHubProducerClient` class is used to send events to an Event Hub.
65
+ * Use the `options` parmeter to configure retry policy or proxy settings.
66
+ * @param connectionString - The connection string to use for connecting to the Event Hub instance.
67
+ * It is expected that the shared key properties and the Event Hub path are contained in this connection string.
68
+ * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;EntityPath=my-event-hub-name'.
69
+ * @param options - A set of options to apply when configuring the client.
70
+ * - `retryOptions` : Configures the retry policy for all the operations on the client.
71
+ * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
72
+ * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
73
+ * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
74
+ */
75
+ constructor(connectionString: string, options?: EventHubClientOptions);
76
+ /**
77
+ * The `EventHubProducerClient` class is used to send events to an Event Hub.
78
+ * Use the `options` parmeter to configure retry policy or proxy settings.
79
+ * @param connectionString - The connection string to use for connecting to the Event Hubs namespace.
80
+ * It is expected that the shared key properties are contained in this connection string, but not the Event Hub path,
81
+ * e.g. 'Endpoint=sb://my-servicebus-namespace.servicebus.windows.net/;SharedAccessKeyName=my-SA-name;SharedAccessKey=my-SA-key;'.
82
+ * @param eventHubName - The name of the specific Event Hub to connect the client to.
83
+ * @param options - A set of options to apply when configuring the client.
84
+ * - `retryOptions` : Configures the retry policy for all the operations on the client.
85
+ * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
86
+ * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
87
+ * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
88
+ */
89
+ constructor(connectionString: string, eventHubName: string, options?: EventHubClientOptions);
90
+ /**
91
+ * The `EventHubProducerClient` class is used to send events to an Event Hub.
92
+ * Use the `options` parmeter to configure retry policy or proxy settings.
93
+ * @param fullyQualifiedNamespace - The full namespace which is likely to be similar to
94
+ * <yournamespace>.servicebus.windows.net
95
+ * @param eventHubName - The name of the specific Event Hub to connect the client to.
96
+ * @param credential - An credential object used by the client to get the token to authenticate the connection
97
+ * with the Azure Event Hubs service.
98
+ * See &commat;azure/identity for creating credentials that support AAD auth.
99
+ * Use the `AzureNamedKeyCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessKeyName`
100
+ * and `SharedAccessKey` without using a connection string. These fields map to the `name` and `key` field respectively
101
+ * in `AzureNamedKeyCredential`.
102
+ * Use the `AzureSASCredential` from &commat;azure/core-auth if you want to pass in a `SharedAccessSignature`
103
+ * without using a connection string. This field maps to `signature` in `AzureSASCredential`.
104
+ * @param options - A set of options to apply when configuring the client.
105
+ * - `retryOptions` : Configures the retry policy for all the operations on the client.
106
+ * For example, `{ "maxRetries": 4 }` or `{ "maxRetries": 4, "retryDelayInMs": 30000 }`.
107
+ * - `webSocketOptions`: Configures the channelling of the AMQP connection over Web Sockets.
108
+ * - `userAgent` : A string to append to the built in user agent string that is passed to the service.
109
+ */
110
+ constructor(fullyQualifiedNamespace: string, eventHubName: string, credential: TokenCredential | NamedKeyCredential | SASCredential, options?: EventHubClientOptions);
111
+ /**
112
+ * Creates an instance of `EventDataBatch` to which one can add events until the maximum supported size is reached.
113
+ * The batch can be passed to the {@link sendBatch} method of the `EventHubProducerClient` to be sent to Azure Event Hubs.
114
+ *
115
+ * Events with different values for partitionKey or partitionId will need to be put into different batches.
116
+ * To simplify such batch management across partitions or to have the client automatically batch events
117
+ * and send them in specific intervals, use `EventHubBufferedProducerClient` instead.
118
+ *
119
+ * The below example assumes you have an array of events at hand to be batched safely.
120
+ * If you have events coming in one by one, `EventHubBufferedProducerClient` is recommended instead
121
+ * for effecient management of batches.
122
+ *
123
+ * Example usage:
124
+ * ```ts
125
+ * const client = new EventHubProducerClient(connectionString);
126
+ * let batch = await client.createBatch();
127
+ * for (let i = 0; i < messages.length; i++) {
128
+ * if (!batch.tryAdd(messages[i])) {
129
+ * await client.sendBatch(batch);
130
+ * batch = await client.createBatch();
131
+ * if (!batch.tryAdd(messages[i])) {
132
+ * throw new Error("Message too big to fit")
133
+ * }
134
+ * if (i === messages.length - 1) {
135
+ * await client.sendBatch(batch);
136
+ * }
137
+ * }
138
+ * }
139
+ * ```
140
+ *
141
+ * @param options - Configures the behavior of the batch.
142
+ * - `partitionKey` : A value that is hashed and used by the Azure Event Hubs service to determine the partition to which
143
+ * the events need to be sent.
144
+ * - `partitionId` : Id of the partition to which the batch of events need to be sent.
145
+ * - `maxSizeInBytes`: The upper limit for the size of batch. The `tryAdd` function will return `false` after this limit is reached.
146
+ * - `abortSignal` : A signal the request to cancel the operation.
147
+ * @returns Promise<EventDataBatch>
148
+ * @throws Error if both `partitionId` and `partitionKey` are set in the options.
149
+ * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
150
+ * @throws AbortError if the operation is cancelled via the abortSignal in the options.
151
+ */
152
+ createBatch(options?: CreateBatchOptions): Promise<EventDataBatch>;
153
+ /**
154
+ * Get the information about the state of publishing for a partition as observed by the `EventHubProducerClient`.
155
+ * This data can always be read, but will only be populated with information relevant to the active features
156
+ * for the producer client.
157
+ *
158
+ * @param partitionId - Id of the partition from which to retrieve publishing properties.
159
+ * @param options - The set of options to apply to the operation call.
160
+ * - `abortSignal` : A signal the request to cancel the send operation.
161
+ * @returns Promise<void>
162
+ * @throws AbortError if the operation is cancelled via the abortSignal.
163
+ */
164
+ private getPartitionPublishingProperties;
165
+ /**
166
+ * Sends an array of events as a batch to the associated Event Hub.
167
+ *
168
+ * Azure Event Hubs has a limit on the size of the batch that can be sent which if exceeded
169
+ * will result in an error with code `MessageTooLargeError`.
170
+ * To safely send within batch size limits, use `EventHubProducerClient.createBatch()` or
171
+ * `EventHubBufferedProducerClient` instead.
172
+ *
173
+ * Example usage:
174
+ * ```ts
175
+ * const client = new EventHubProducerClient(connectionString);
176
+ * await client.sendBatch(messages);
177
+ * ```
178
+ *
179
+ * @param batch - An array of {@link EventData} or `AmqpAnnotatedMessage`.
180
+ * @param options - A set of options that can be specified to influence the way in which
181
+ * events are sent to the associated Event Hub.
182
+ * - `abortSignal` : A signal the request to cancel the send operation.
183
+ * - `partitionId` : The partition this batch will be sent to. If set, `partitionKey` can not be set.
184
+ * - `partitionKey` : A value that is hashed to produce a partition assignment. If set, `partitionId` can not be set.
185
+ *
186
+ * @returns Promise<void>
187
+ * @throws MessageTooLargeError if all the events in the input array cannot be fit into a batch.
188
+ * @throws AbortError if the operation is cancelled via the abortSignal.
189
+ * @throws MessagingError if an error is encountered while sending a message.
190
+ * @throws Error if the underlying connection or sender has been closed.
191
+ */
192
+ sendBatch(batch: EventData[] | AmqpAnnotatedMessage[], options?: SendBatchOptions): Promise<void>;
193
+ /**
194
+ * Sends a batch of events created using `EventHubProducerClient.createBatch()` to the associated Event Hub.
195
+ *
196
+ * Events with different values for partitionKey or partitionId will need to be put into different batches.
197
+ * To simplify such batch management across partitions or to have the client automatically batch events
198
+ * and send them in specific intervals, use `EventHubBufferedProducerClient` instead.
199
+ *
200
+ * The below example assumes you have an array of events at hand to be batched safely.
201
+ * If you have events coming in one by one, `EventHubBufferedProducerClient` is recommended instead
202
+ * for effecient management of batches.
203
+ *
204
+ * Example usage:
205
+ * ```ts
206
+ * const client = new EventHubProducerClient(connectionString);
207
+ * let batch = await client.createBatch();
208
+ * for (let i = 0; i < messages.length; i++) {
209
+ * if (!batch.tryAdd(messages[i])) {
210
+ * await client.sendBatch(batch);
211
+ * batch = await client.createBatch();
212
+ * if (!batch.tryAdd(messages[i])) {
213
+ * throw new Error("Message too big to fit")
214
+ * }
215
+ * if (i === messages.length - 1) {
216
+ * await client.sendBatch(batch);
217
+ * }
218
+ * }
219
+ * }
220
+ * ```
221
+ * @param batch - A batch of events that you can create using the {@link createBatch} method.
222
+ * @param options - A set of options that can be specified to influence the way in which
223
+ * events are sent to the associated Event Hub.
224
+ * - `abortSignal` : A signal the request to cancel the send operation.
225
+ *
226
+ * @returns Promise<void>
227
+ * @throws AbortError if the operation is cancelled via the abortSignal.
228
+ * @throws MessagingError if an error is encountered while sending a message.
229
+ * @throws Error if the underlying connection or sender has been closed.
230
+ */
231
+ sendBatch(batch: EventDataBatch, options?: OperationOptions): Promise<void>;
232
+ /**
233
+ * Closes the AMQP connection to the Event Hub instance,
234
+ * returning a promise that will be resolved when disconnection is completed.
235
+ * @returns Promise<void>
236
+ * @throws Error if the underlying connection encounters an error while closing.
237
+ */
238
+ close(): Promise<void>;
239
+ /**
240
+ * Provides the Event Hub runtime information.
241
+ * @param options - The set of options to apply to the operation call.
242
+ * @returns A promise that resolves with information about the Event Hub instance.
243
+ * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
244
+ * @throws AbortError if the operation is cancelled via the abortSignal.
245
+ */
246
+ getEventHubProperties(options?: GetEventHubPropertiesOptions): Promise<EventHubProperties>;
247
+ /**
248
+ * Provides the id for each partition associated with the Event Hub.
249
+ * @param options - The set of options to apply to the operation call.
250
+ * @returns A promise that resolves with an Array of strings representing the id for
251
+ * each partition associated with the Event Hub.
252
+ * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
253
+ * @throws AbortError if the operation is cancelled via the abortSignal.
254
+ */
255
+ getPartitionIds(options?: GetPartitionIdsOptions): Promise<Array<string>>;
256
+ /**
257
+ * Provides information about the state of the specified partition.
258
+ * @param partitionId - The id of the partition for which information is required.
259
+ * @param options - The set of options to apply to the operation call.
260
+ * @returns A promise that resolves with information about the state of the partition .
261
+ * @throws Error if the underlying connection has been closed, create a new EventHubProducerClient.
262
+ * @throws AbortError if the operation is cancelled via the abortSignal.
263
+ */
264
+ getPartitionProperties(partitionId: string, options?: GetPartitionPropertiesOptions): Promise<PartitionProperties>;
265
+ }
266
+ //# sourceMappingURL=eventHubProducerClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventHubProducerClient.d.ts","sourceRoot":"","sources":["../../src/eventHubProducerClient.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,4BAA4B,EAC5B,sBAAsB,EACtB,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAwC,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAWtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAqB,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAK9D;;;;;;;;;;;GAWG;AACH,qBAAa,sBAAsB;IACjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAoB;IAEpC;;OAEG;IACH,OAAO,CAAC,cAAc,CAAwB;IAC9C;;OAEG;IACH,OAAO,CAAC,WAAW,CAA8B;IACjD;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB,CAAC,CAAU;IAC3C;;;;OAIG;IACH,OAAO,CAAC,iBAAiB,CAAC,CAA6C;IACvE;;;OAGG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;;;OAIG;IACH,IAAI,uBAAuB,IAAI,MAAM,CAEpC;IAED;;;OAGG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC;;;;;;;;;;;OAWG;gBACS,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IACrE;;;;;;;;;;;;OAYG;gBACS,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAC3F;;;;;;;;;;;;;;;;;;;OAmBG;gBAED,uBAAuB,EAAE,MAAM,EAC/B,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,eAAe,GAAG,kBAAkB,GAAG,aAAa,EAChE,OAAO,CAAC,EAAE,qBAAqB;IA6BjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACG,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC;IAiD5E;;;;;;;;;;OAUG;YAGW,gCAAgC;IA2B9C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,SAAS,CACb,KAAK,EAAE,SAAS,EAAE,GAAG,oBAAoB,EAAE,EAC3C,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,IAAI,CAAC;IAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACG,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8FjF;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5B;;;;;;OAMG;IACH,qBAAqB,CAAC,OAAO,GAAE,4BAAiC,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAO9F;;;;;;;OAOG;IACH,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAW7E;;;;;;;OAOG;IACH,sBAAsB,CACpB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,mBAAmB,CAAC;CAMhC"}
@@ -1,15 +1,16 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { createConnectionContext } from "./connectionContext";
4
- import { EventDataBatchImpl, isEventDataBatch } from "./eventDataBatch";
2
+ // Licensed under the MIT License.
3
+ import { createConnectionContext } from "./connectionContext.js";
4
+ import { EventDataBatchImpl, isEventDataBatch } from "./eventDataBatch.js";
5
5
  import { isDefined } from "@azure/core-util";
6
- import { isCredential } from "./util/typeGuards";
7
- import { logErrorStackTrace, logger } from "./logger";
8
- import { idempotentAlreadyPublished, idempotentSomeAlreadyPublished, throwErrorIfConnectionClosed, throwTypeErrorIfParameterMissing, validateProducerPartitionSettings, } from "./util/error";
9
- import { EventHubSender } from "./eventHubSender";
10
- import { toSpanOptions, tracingClient } from "./diagnostics/tracing";
11
- import { instrumentEventData } from "./diagnostics/instrumentEventData";
12
- import { getRandomName } from "./util/utils";
6
+ import { isCredential } from "./util/typeGuards.js";
7
+ import { logErrorStackTrace, logger } from "./logger.js";
8
+ import { idempotentAlreadyPublished, idempotentSomeAlreadyPublished, throwErrorIfConnectionClosed, throwTypeErrorIfParameterMissing, validateProducerPartitionSettings, } from "./util/error.js";
9
+ import { assertIsEventData } from "./eventData.js";
10
+ import { EventHubSender } from "./eventHubSender.js";
11
+ import { toSpanOptions, tracingClient } from "./diagnostics/tracing.js";
12
+ import { instrumentEventData } from "./diagnostics/instrumentEventData.js";
13
+ import { getRandomName } from "./util/utils.js";
13
14
  /**
14
15
  * The `EventHubProducerClient` class is used to send events to an Event Hub.
15
16
  *
@@ -188,6 +189,7 @@ export class EventHubProducerClient {
188
189
  if (!Array.isArray(batch)) {
189
190
  batch = [batch];
190
191
  }
192
+ batch.forEach(assertIsEventData);
191
193
  if (batch.some((event) => isDefined(event._publishedSequenceNumber))) {
192
194
  throw new Error(idempotentSomeAlreadyPublished);
193
195
  }