@azure/service-bus 7.10.0-beta.1 → 7.10.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (848) hide show
  1. package/README.md +114 -57
  2. package/dist/browser/connectionContext.d.ts +109 -0
  3. package/dist/browser/connectionContext.d.ts.map +1 -0
  4. package/{dist-esm/src → dist/browser}/connectionContext.js +9 -9
  5. package/dist/browser/connectionContext.js.map +1 -0
  6. package/dist/browser/constructorHelpers.d.ts +79 -0
  7. package/dist/browser/constructorHelpers.d.ts.map +1 -0
  8. package/{dist-esm/src → dist/browser}/constructorHelpers.js +5 -5
  9. package/dist/browser/constructorHelpers.js.map +1 -0
  10. package/dist/browser/core/autoLockRenewer.d.ts +58 -0
  11. package/dist/browser/core/autoLockRenewer.d.ts.map +1 -0
  12. package/{dist-esm/src → dist/browser}/core/autoLockRenewer.js +12 -8
  13. package/dist/browser/core/autoLockRenewer.js.map +1 -0
  14. package/dist/browser/core/batchingReceiver.d.ts +120 -0
  15. package/dist/browser/core/batchingReceiver.d.ts.map +1 -0
  16. package/{dist-esm/src → dist/browser}/core/batchingReceiver.js +23 -13
  17. package/dist/browser/core/batchingReceiver.js.map +1 -0
  18. package/dist/browser/core/linkEntity.d.ts +192 -0
  19. package/dist/browser/core/linkEntity.d.ts.map +1 -0
  20. package/{dist-esm/src → dist/browser}/core/linkEntity.js +77 -14
  21. package/dist/browser/core/linkEntity.js.map +1 -0
  22. package/dist/browser/core/managementClient.d.ts +312 -0
  23. package/dist/browser/core/managementClient.d.ts.map +1 -0
  24. package/{dist-esm/src → dist/browser}/core/managementClient.js +37 -33
  25. package/dist/browser/core/managementClient.js.map +1 -0
  26. package/dist/browser/core/messageReceiver.d.ts +147 -0
  27. package/dist/browser/core/messageReceiver.d.ts.map +1 -0
  28. package/{dist-esm/src → dist/browser}/core/messageReceiver.js +36 -14
  29. package/dist/browser/core/messageReceiver.js.map +1 -0
  30. package/dist/browser/core/messageSender.d.ts +93 -0
  31. package/dist/browser/core/messageSender.d.ts.map +1 -0
  32. package/{dist-esm/src → dist/browser}/core/messageSender.js +36 -12
  33. package/dist/browser/core/messageSender.js.map +1 -0
  34. package/dist/browser/core/receiverHelper.d.ts +45 -0
  35. package/dist/browser/core/receiverHelper.d.ts.map +1 -0
  36. package/{dist-esm/src → dist/browser}/core/receiverHelper.js +6 -5
  37. package/dist/browser/core/receiverHelper.js.map +1 -0
  38. package/dist/browser/core/shared.d.ts +34 -0
  39. package/dist/browser/core/shared.d.ts.map +1 -0
  40. package/{dist-esm/src → dist/browser}/core/shared.js +3 -3
  41. package/dist/browser/core/shared.js.map +1 -0
  42. package/dist/browser/core/streamingReceiver.d.ts +142 -0
  43. package/dist/browser/core/streamingReceiver.d.ts.map +1 -0
  44. package/{dist-esm/src → dist/browser}/core/streamingReceiver.js +73 -36
  45. package/dist/browser/core/streamingReceiver.js.map +1 -0
  46. package/dist/browser/dataTransformer.d.ts +77 -0
  47. package/dist/browser/dataTransformer.d.ts.map +1 -0
  48. package/{dist-esm/src → dist/browser}/dataTransformer.js +2 -2
  49. package/dist/browser/dataTransformer.js.map +1 -0
  50. package/dist/browser/diagnostics/instrumentServiceBusMessage.d.ts +50 -0
  51. package/dist/browser/diagnostics/instrumentServiceBusMessage.d.ts.map +1 -0
  52. package/{dist-esm/src → dist/browser}/diagnostics/instrumentServiceBusMessage.js +2 -2
  53. package/dist/browser/diagnostics/instrumentServiceBusMessage.js.map +1 -0
  54. package/dist/browser/diagnostics/tracing.d.ts +21 -0
  55. package/dist/browser/diagnostics/tracing.d.ts.map +1 -0
  56. package/{dist-esm/src → dist/browser}/diagnostics/tracing.js +2 -2
  57. package/dist/browser/diagnostics/tracing.js.map +1 -0
  58. package/dist/browser/experimental/index.d.ts +10 -0
  59. package/dist/browser/experimental/index.d.ts.map +1 -0
  60. package/dist/browser/experimental/index.js +4 -0
  61. package/dist/browser/experimental/index.js.map +1 -0
  62. package/dist/browser/index.d.ts +26 -0
  63. package/dist/browser/index.d.ts.map +1 -0
  64. package/{dist-esm/src → dist/browser}/index.js +5 -5
  65. package/dist/browser/index.js.map +1 -0
  66. package/dist/browser/log.d.ts +70 -0
  67. package/dist/browser/log.d.ts.map +1 -0
  68. package/{dist-esm/src → dist/browser}/log.js +1 -1
  69. package/dist/browser/log.js.map +1 -0
  70. package/dist/browser/models.d.ts +328 -0
  71. package/dist/browser/models.d.ts.map +1 -0
  72. package/dist/browser/models.js +4 -0
  73. package/dist/browser/models.js.map +1 -0
  74. package/dist/browser/modelsToBeSharedWithEventHubs.d.ts +18 -0
  75. package/dist/browser/modelsToBeSharedWithEventHubs.d.ts.map +1 -0
  76. package/dist/browser/modelsToBeSharedWithEventHubs.js +4 -0
  77. package/dist/browser/modelsToBeSharedWithEventHubs.js.map +1 -0
  78. package/dist/browser/package.json +3 -0
  79. package/dist/browser/receivers/receiver.d.ts +299 -0
  80. package/dist/browser/receivers/receiver.d.ts.map +1 -0
  81. package/{dist-esm/src → dist/browser}/receivers/receiver.js +40 -22
  82. package/dist/browser/receivers/receiver.js.map +1 -0
  83. package/dist/browser/receivers/receiverCommon.d.ts +81 -0
  84. package/dist/browser/receivers/receiverCommon.d.ts.map +1 -0
  85. package/{dist-esm/src → dist/browser}/receivers/receiverCommon.js +7 -8
  86. package/dist/browser/receivers/receiverCommon.js.map +1 -0
  87. package/dist/browser/receivers/sessionReceiver.d.ts +189 -0
  88. package/dist/browser/receivers/sessionReceiver.d.ts.map +1 -0
  89. package/{dist-esm/src → dist/browser}/receivers/sessionReceiver.js +32 -24
  90. package/dist/browser/receivers/sessionReceiver.js.map +1 -0
  91. package/dist/browser/sender.d.ts +125 -0
  92. package/dist/browser/sender.d.ts.map +1 -0
  93. package/{dist-esm/src → dist/browser}/sender.js +19 -13
  94. package/dist/browser/sender.js.map +1 -0
  95. package/dist/browser/serializers/namespaceResourceSerializer.d.ts +46 -0
  96. package/dist/browser/serializers/namespaceResourceSerializer.d.ts.map +1 -0
  97. package/{dist-esm/src → dist/browser}/serializers/namespaceResourceSerializer.js +3 -3
  98. package/dist/browser/serializers/namespaceResourceSerializer.js.map +1 -0
  99. package/dist/browser/serializers/queueResourceSerializer.d.ts +461 -0
  100. package/dist/browser/serializers/queueResourceSerializer.d.ts.map +1 -0
  101. package/{dist-esm/src → dist/browser}/serializers/queueResourceSerializer.js +4 -4
  102. package/dist/browser/serializers/queueResourceSerializer.js.map +1 -0
  103. package/dist/browser/serializers/ruleResourceSerializer.d.ts +135 -0
  104. package/dist/browser/serializers/ruleResourceSerializer.d.ts.map +1 -0
  105. package/{dist-esm/src → dist/browser}/serializers/ruleResourceSerializer.js +4 -4
  106. package/dist/browser/serializers/ruleResourceSerializer.js.map +1 -0
  107. package/dist/browser/serializers/subscriptionResourceSerializer.d.ts +396 -0
  108. package/dist/browser/serializers/subscriptionResourceSerializer.d.ts.map +1 -0
  109. package/{dist-esm/src → dist/browser}/serializers/subscriptionResourceSerializer.js +5 -5
  110. package/dist/browser/serializers/subscriptionResourceSerializer.js.map +1 -0
  111. package/dist/browser/serializers/topicResourceSerializer.d.ts +335 -0
  112. package/dist/browser/serializers/topicResourceSerializer.d.ts.map +1 -0
  113. package/{dist-esm/src → dist/browser}/serializers/topicResourceSerializer.js +4 -4
  114. package/dist/browser/serializers/topicResourceSerializer.js.map +1 -0
  115. package/dist/browser/serviceBusAtomManagementClient.d.ts +652 -0
  116. package/dist/browser/serviceBusAtomManagementClient.d.ts.map +1 -0
  117. package/{dist-esm/src → dist/browser}/serviceBusAtomManagementClient.js +78 -109
  118. package/dist/browser/serviceBusAtomManagementClient.js.map +1 -0
  119. package/dist/browser/serviceBusClient.d.ts +231 -0
  120. package/dist/browser/serviceBusClient.d.ts.map +1 -0
  121. package/{dist-esm/src → dist/browser}/serviceBusClient.js +24 -11
  122. package/dist/browser/serviceBusClient.js.map +1 -0
  123. package/dist/browser/serviceBusError.d.ts +119 -0
  124. package/dist/browser/serviceBusError.d.ts.map +1 -0
  125. package/{dist-esm/src → dist/browser}/serviceBusError.js +21 -1
  126. package/dist/browser/serviceBusError.js.map +1 -0
  127. package/dist/browser/serviceBusMessage.d.ts +529 -0
  128. package/dist/browser/serviceBusMessage.d.ts.map +1 -0
  129. package/{dist-esm/src → dist/browser}/serviceBusMessage.js +193 -5
  130. package/dist/browser/serviceBusMessage.js.map +1 -0
  131. package/dist/browser/serviceBusMessageBatch.d.ts +153 -0
  132. package/dist/browser/serviceBusMessageBatch.d.ts.map +1 -0
  133. package/{dist-esm/src → dist/browser}/serviceBusMessageBatch.js +37 -13
  134. package/dist/browser/serviceBusMessageBatch.js.map +1 -0
  135. package/dist/browser/serviceBusRuleManager.d.ts +103 -0
  136. package/dist/browser/serviceBusRuleManager.d.ts.map +1 -0
  137. package/{dist-esm/src → dist/browser}/serviceBusRuleManager.js +16 -13
  138. package/dist/browser/serviceBusRuleManager.js.map +1 -0
  139. package/dist/browser/session/messageSession.d.ts +236 -0
  140. package/dist/browser/session/messageSession.d.ts.map +1 -0
  141. package/{dist-esm/src → dist/browser}/session/messageSession.js +145 -30
  142. package/dist/browser/session/messageSession.js.map +1 -0
  143. package/dist/browser/util/atomXmlHelper.d.ts +56 -0
  144. package/dist/browser/util/atomXmlHelper.d.ts.map +1 -0
  145. package/{dist-esm/src → dist/browser}/util/atomXmlHelper.js +7 -7
  146. package/dist/browser/util/atomXmlHelper.js.map +1 -0
  147. package/dist/browser/util/compat/compatibility.d.ts +109 -0
  148. package/dist/browser/util/compat/compatibility.d.ts.map +1 -0
  149. package/{dist-esm/src → dist/browser}/util/compat/compatibility.js +2 -2
  150. package/dist/browser/util/compat/compatibility.js.map +1 -0
  151. package/dist/browser/util/compat/httpHeaders.d.ts +136 -0
  152. package/dist/browser/util/compat/httpHeaders.d.ts.map +1 -0
  153. package/{dist-esm/src → dist/browser}/util/compat/httpHeaders.js +2 -1
  154. package/dist/browser/util/compat/httpHeaders.js.map +1 -0
  155. package/dist/browser/util/compat/index.d.ts +3 -0
  156. package/dist/browser/util/compat/index.d.ts.map +1 -0
  157. package/dist/browser/util/compat/index.js +5 -0
  158. package/dist/browser/util/compat/index.js.map +1 -0
  159. package/dist/browser/util/connectionStringUtils.d.ts +53 -0
  160. package/dist/browser/util/connectionStringUtils.d.ts.map +1 -0
  161. package/{dist-esm/src → dist/browser}/util/connectionStringUtils.js +8 -2
  162. package/dist/browser/util/connectionStringUtils.js.map +1 -0
  163. package/dist/browser/util/constants.d.ts +322 -0
  164. package/dist/browser/util/constants.d.ts.map +1 -0
  165. package/{dist-esm/src → dist/browser}/util/constants.js +3 -3
  166. package/{dist-esm/src → dist/browser}/util/constants.js.map +1 -1
  167. package/dist/browser/util/crypto-browser.d.mts.map +1 -0
  168. package/dist/browser/util/crypto-browser.mjs.map +1 -0
  169. package/dist/browser/util/crypto.d.ts +5 -0
  170. package/{dist-esm/src/util/crypto.browser.js → dist/browser/util/crypto.js} +2 -4
  171. package/dist/browser/util/errors.d.ts +130 -0
  172. package/dist/browser/util/errors.d.ts.map +1 -0
  173. package/{dist-esm/src → dist/browser}/util/errors.js +4 -4
  174. package/dist/browser/util/errors.js.map +1 -0
  175. package/dist/browser/util/parseUrl-browser.d.mts.map +1 -0
  176. package/dist/browser/util/parseUrl-browser.mjs.map +1 -0
  177. package/dist/browser/util/parseUrl.d.ts +5 -0
  178. package/{dist-esm/src/util/parseUrl.browser.js → dist/browser/util/parseUrl.js} +1 -3
  179. package/dist/browser/util/runtimeInfo-browser.d.mts.map +1 -0
  180. package/dist/browser/util/runtimeInfo-browser.mjs.map +1 -0
  181. package/dist/browser/util/runtimeInfo.d.ts +7 -0
  182. package/{dist-esm/src/util/runtimeInfo.browser.js → dist/browser/util/runtimeInfo.js} +2 -2
  183. package/dist/browser/util/sasServiceClientCredentials.d.ts +31 -0
  184. package/dist/browser/util/sasServiceClientCredentials.d.ts.map +1 -0
  185. package/{dist-esm/src → dist/browser}/util/sasServiceClientCredentials.js +9 -3
  186. package/dist/browser/util/sasServiceClientCredentials.js.map +1 -0
  187. package/dist/browser/util/semaphore.d.ts +38 -0
  188. package/dist/browser/util/semaphore.d.ts.map +1 -0
  189. package/{dist-esm/src → dist/browser}/util/semaphore.js +7 -3
  190. package/dist/browser/util/semaphore.js.map +1 -0
  191. package/dist/browser/util/typeGuards.d.ts +8 -0
  192. package/dist/browser/util/typeGuards.d.ts.map +1 -0
  193. package/{dist-esm/src → dist/browser}/util/typeGuards.js +2 -2
  194. package/dist/browser/util/typeGuards.js.map +1 -0
  195. package/dist/browser/util/utils.d.ts +247 -0
  196. package/dist/browser/util/utils.d.ts.map +1 -0
  197. package/{dist-esm/src → dist/browser}/util/utils.js +5 -7
  198. package/dist/browser/util/utils.js.map +1 -0
  199. package/dist/commonjs/connectionContext.d.ts +109 -0
  200. package/dist/commonjs/connectionContext.d.ts.map +1 -0
  201. package/dist/commonjs/connectionContext.js +358 -0
  202. package/dist/commonjs/connectionContext.js.map +1 -0
  203. package/dist/commonjs/constructorHelpers.d.ts +79 -0
  204. package/dist/commonjs/constructorHelpers.d.ts.map +1 -0
  205. package/dist/commonjs/constructorHelpers.js +103 -0
  206. package/dist/commonjs/constructorHelpers.js.map +1 -0
  207. package/dist/commonjs/core/autoLockRenewer.d.ts +58 -0
  208. package/dist/commonjs/core/autoLockRenewer.d.ts.map +1 -0
  209. package/dist/commonjs/core/autoLockRenewer.js +178 -0
  210. package/dist/commonjs/core/autoLockRenewer.js.map +1 -0
  211. package/dist/commonjs/core/batchingReceiver.d.ts +120 -0
  212. package/dist/commonjs/core/batchingReceiver.d.ts.map +1 -0
  213. package/dist/commonjs/core/batchingReceiver.js +405 -0
  214. package/dist/commonjs/core/batchingReceiver.js.map +1 -0
  215. package/dist/commonjs/core/linkEntity.d.ts +192 -0
  216. package/dist/commonjs/core/linkEntity.d.ts.map +1 -0
  217. package/dist/commonjs/core/linkEntity.js +344 -0
  218. package/dist/commonjs/core/linkEntity.js.map +1 -0
  219. package/dist/commonjs/core/managementClient.d.ts +312 -0
  220. package/dist/commonjs/core/managementClient.d.ts.map +1 -0
  221. package/dist/commonjs/core/managementClient.js +1078 -0
  222. package/dist/commonjs/core/managementClient.js.map +1 -0
  223. package/dist/commonjs/core/messageReceiver.d.ts +147 -0
  224. package/dist/commonjs/core/messageReceiver.d.ts.map +1 -0
  225. package/dist/commonjs/core/messageReceiver.js +169 -0
  226. package/dist/commonjs/core/messageReceiver.js.map +1 -0
  227. package/dist/commonjs/core/messageSender.d.ts +93 -0
  228. package/dist/commonjs/core/messageSender.d.ts.map +1 -0
  229. package/dist/commonjs/core/messageSender.js +307 -0
  230. package/dist/commonjs/core/messageSender.js.map +1 -0
  231. package/dist/commonjs/core/receiverHelper.d.ts +45 -0
  232. package/dist/commonjs/core/receiverHelper.d.ts.map +1 -0
  233. package/dist/commonjs/core/receiverHelper.js +123 -0
  234. package/dist/commonjs/core/receiverHelper.js.map +1 -0
  235. package/dist/commonjs/core/shared.d.ts +34 -0
  236. package/dist/commonjs/core/shared.d.ts.map +1 -0
  237. package/dist/commonjs/core/shared.js +70 -0
  238. package/dist/commonjs/core/shared.js.map +1 -0
  239. package/dist/commonjs/core/streamingReceiver.d.ts +142 -0
  240. package/dist/commonjs/core/streamingReceiver.d.ts.map +1 -0
  241. package/dist/commonjs/core/streamingReceiver.js +526 -0
  242. package/dist/commonjs/core/streamingReceiver.js.map +1 -0
  243. package/dist/commonjs/dataTransformer.d.ts +77 -0
  244. package/dist/commonjs/dataTransformer.d.ts.map +1 -0
  245. package/dist/commonjs/dataTransformer.js +169 -0
  246. package/dist/commonjs/dataTransformer.js.map +1 -0
  247. package/dist/commonjs/diagnostics/instrumentServiceBusMessage.d.ts +50 -0
  248. package/dist/commonjs/diagnostics/instrumentServiceBusMessage.d.ts.map +1 -0
  249. package/dist/commonjs/diagnostics/instrumentServiceBusMessage.js +107 -0
  250. package/dist/commonjs/diagnostics/instrumentServiceBusMessage.js.map +1 -0
  251. package/dist/commonjs/diagnostics/tracing.d.ts +21 -0
  252. package/dist/commonjs/diagnostics/tracing.d.ts.map +1 -0
  253. package/dist/commonjs/diagnostics/tracing.js +41 -0
  254. package/dist/commonjs/diagnostics/tracing.js.map +1 -0
  255. package/dist/commonjs/experimental/index.d.ts +10 -0
  256. package/dist/commonjs/experimental/index.d.ts.map +1 -0
  257. package/dist/commonjs/experimental/index.js +5 -0
  258. package/dist/commonjs/experimental/index.js.map +1 -0
  259. package/dist/commonjs/index.d.ts +26 -0
  260. package/dist/commonjs/index.d.ts.map +1 -0
  261. package/dist/commonjs/index.js +22 -0
  262. package/dist/commonjs/index.js.map +1 -0
  263. package/dist/commonjs/log.d.ts +70 -0
  264. package/dist/commonjs/log.d.ts.map +1 -0
  265. package/dist/commonjs/log.js +94 -0
  266. package/dist/commonjs/log.js.map +1 -0
  267. package/dist/commonjs/models.d.ts +328 -0
  268. package/dist/commonjs/models.d.ts.map +1 -0
  269. package/dist/commonjs/models.js +5 -0
  270. package/dist/commonjs/models.js.map +1 -0
  271. package/dist/commonjs/modelsToBeSharedWithEventHubs.d.ts +18 -0
  272. package/dist/commonjs/modelsToBeSharedWithEventHubs.d.ts.map +1 -0
  273. package/dist/commonjs/modelsToBeSharedWithEventHubs.js +5 -0
  274. package/dist/commonjs/modelsToBeSharedWithEventHubs.js.map +1 -0
  275. package/dist/commonjs/package.json +3 -0
  276. package/dist/commonjs/receivers/receiver.d.ts +299 -0
  277. package/dist/commonjs/receivers/receiver.d.ts.map +1 -0
  278. package/dist/commonjs/receivers/receiver.js +383 -0
  279. package/dist/commonjs/receivers/receiver.js.map +1 -0
  280. package/dist/commonjs/receivers/receiverCommon.d.ts +81 -0
  281. package/dist/commonjs/receivers/receiverCommon.d.ts.map +1 -0
  282. package/dist/commonjs/receivers/receiverCommon.js +269 -0
  283. package/dist/commonjs/receivers/receiverCommon.js.map +1 -0
  284. package/dist/commonjs/receivers/sessionReceiver.d.ts +189 -0
  285. package/dist/commonjs/receivers/sessionReceiver.d.ts.map +1 -0
  286. package/dist/commonjs/receivers/sessionReceiver.js +432 -0
  287. package/dist/commonjs/receivers/sessionReceiver.js.map +1 -0
  288. package/dist/commonjs/sender.d.ts +125 -0
  289. package/dist/commonjs/sender.d.ts.map +1 -0
  290. package/dist/commonjs/sender.js +191 -0
  291. package/dist/commonjs/sender.js.map +1 -0
  292. package/dist/commonjs/serializers/namespaceResourceSerializer.d.ts +46 -0
  293. package/dist/commonjs/serializers/namespaceResourceSerializer.d.ts.map +1 -0
  294. package/dist/commonjs/serializers/namespaceResourceSerializer.js +39 -0
  295. package/dist/commonjs/serializers/namespaceResourceSerializer.js.map +1 -0
  296. package/dist/commonjs/serializers/queueResourceSerializer.d.ts +461 -0
  297. package/dist/commonjs/serializers/queueResourceSerializer.d.ts.map +1 -0
  298. package/dist/commonjs/serializers/queueResourceSerializer.js +107 -0
  299. package/dist/commonjs/serializers/queueResourceSerializer.js.map +1 -0
  300. package/dist/commonjs/serializers/ruleResourceSerializer.d.ts +135 -0
  301. package/dist/commonjs/serializers/ruleResourceSerializer.d.ts.map +1 -0
  302. package/dist/commonjs/serializers/ruleResourceSerializer.js +287 -0
  303. package/dist/commonjs/serializers/ruleResourceSerializer.js.map +1 -0
  304. package/dist/commonjs/serializers/subscriptionResourceSerializer.d.ts +396 -0
  305. package/dist/commonjs/serializers/subscriptionResourceSerializer.d.ts.map +1 -0
  306. package/dist/commonjs/serializers/subscriptionResourceSerializer.js +103 -0
  307. package/dist/commonjs/serializers/subscriptionResourceSerializer.js.map +1 -0
  308. package/dist/commonjs/serializers/topicResourceSerializer.d.ts +335 -0
  309. package/dist/commonjs/serializers/topicResourceSerializer.d.ts.map +1 -0
  310. package/dist/commonjs/serializers/topicResourceSerializer.js +97 -0
  311. package/dist/commonjs/serializers/topicResourceSerializer.js.map +1 -0
  312. package/dist/commonjs/serviceBusAtomManagementClient.d.ts +652 -0
  313. package/dist/commonjs/serviceBusAtomManagementClient.d.ts.map +1 -0
  314. package/dist/commonjs/serviceBusAtomManagementClient.js +1648 -0
  315. package/dist/commonjs/serviceBusAtomManagementClient.js.map +1 -0
  316. package/dist/commonjs/serviceBusClient.d.ts +231 -0
  317. package/dist/commonjs/serviceBusClient.d.ts.map +1 -0
  318. package/dist/commonjs/serviceBusClient.js +221 -0
  319. package/dist/commonjs/serviceBusClient.js.map +1 -0
  320. package/dist/commonjs/serviceBusError.d.ts +119 -0
  321. package/dist/commonjs/serviceBusError.d.ts.map +1 -0
  322. package/dist/commonjs/serviceBusError.js +109 -0
  323. package/dist/commonjs/serviceBusError.js.map +1 -0
  324. package/dist/commonjs/serviceBusMessage.d.ts +529 -0
  325. package/dist/commonjs/serviceBusMessage.d.ts.map +1 -0
  326. package/dist/commonjs/serviceBusMessage.js +611 -0
  327. package/dist/commonjs/serviceBusMessage.js.map +1 -0
  328. package/dist/commonjs/serviceBusMessageBatch.d.ts +153 -0
  329. package/dist/commonjs/serviceBusMessageBatch.d.ts.map +1 -0
  330. package/dist/commonjs/serviceBusMessageBatch.js +196 -0
  331. package/dist/commonjs/serviceBusMessageBatch.js.map +1 -0
  332. package/dist/commonjs/serviceBusRuleManager.d.ts +103 -0
  333. package/dist/commonjs/serviceBusRuleManager.d.ts.map +1 -0
  334. package/dist/commonjs/serviceBusRuleManager.js +153 -0
  335. package/dist/commonjs/serviceBusRuleManager.js.map +1 -0
  336. package/dist/commonjs/session/messageSession.d.ts +236 -0
  337. package/dist/commonjs/session/messageSession.d.ts.map +1 -0
  338. package/dist/commonjs/session/messageSession.js +759 -0
  339. package/dist/commonjs/session/messageSession.js.map +1 -0
  340. package/dist/commonjs/tsdoc-metadata.json +11 -0
  341. package/dist/commonjs/util/atomXmlHelper.d.ts +56 -0
  342. package/dist/commonjs/util/atomXmlHelper.d.ts.map +1 -0
  343. package/dist/commonjs/util/atomXmlHelper.js +386 -0
  344. package/dist/commonjs/util/atomXmlHelper.js.map +1 -0
  345. package/dist/commonjs/util/compat/compatibility.d.ts +109 -0
  346. package/dist/commonjs/util/compat/compatibility.d.ts.map +1 -0
  347. package/dist/commonjs/util/compat/compatibility.js +30 -0
  348. package/dist/commonjs/util/compat/compatibility.js.map +1 -0
  349. package/dist/commonjs/util/compat/httpHeaders.d.ts +136 -0
  350. package/dist/commonjs/util/compat/httpHeaders.d.ts.map +1 -0
  351. package/dist/commonjs/util/compat/httpHeaders.js +157 -0
  352. package/dist/commonjs/util/compat/httpHeaders.js.map +1 -0
  353. package/dist/commonjs/util/compat/index.d.ts +3 -0
  354. package/dist/commonjs/util/compat/index.d.ts.map +1 -0
  355. package/dist/commonjs/util/compat/index.js +8 -0
  356. package/dist/commonjs/util/compat/index.js.map +1 -0
  357. package/dist/commonjs/util/connectionStringUtils.d.ts +53 -0
  358. package/dist/commonjs/util/connectionStringUtils.d.ts.map +1 -0
  359. package/dist/commonjs/util/connectionStringUtils.js +51 -0
  360. package/dist/commonjs/util/connectionStringUtils.js.map +1 -0
  361. package/dist/commonjs/util/constants.d.ts +322 -0
  362. package/dist/commonjs/util/constants.d.ts.map +1 -0
  363. package/dist/commonjs/util/constants.js +327 -0
  364. package/dist/commonjs/util/constants.js.map +1 -0
  365. package/dist/commonjs/util/crypto.d.ts +5 -0
  366. package/dist/commonjs/util/crypto.d.ts.map +1 -0
  367. package/dist/commonjs/util/crypto.js +15 -0
  368. package/dist/commonjs/util/crypto.js.map +1 -0
  369. package/dist/commonjs/util/errors.d.ts +130 -0
  370. package/dist/commonjs/util/errors.d.ts.map +1 -0
  371. package/dist/commonjs/util/errors.js +236 -0
  372. package/dist/commonjs/util/errors.js.map +1 -0
  373. package/dist/commonjs/util/parseUrl.d.ts +5 -0
  374. package/dist/commonjs/util/parseUrl.d.ts.map +1 -0
  375. package/dist/commonjs/util/parseUrl.js +13 -0
  376. package/dist/commonjs/util/parseUrl.js.map +1 -0
  377. package/dist/commonjs/util/runtimeInfo.d.ts +7 -0
  378. package/dist/commonjs/util/runtimeInfo.d.ts.map +1 -0
  379. package/dist/commonjs/util/runtimeInfo.js +24 -0
  380. package/dist/commonjs/util/runtimeInfo.js.map +1 -0
  381. package/dist/commonjs/util/sasServiceClientCredentials.d.ts +31 -0
  382. package/dist/commonjs/util/sasServiceClientCredentials.d.ts.map +1 -0
  383. package/dist/commonjs/util/sasServiceClientCredentials.js +56 -0
  384. package/dist/commonjs/util/sasServiceClientCredentials.js.map +1 -0
  385. package/dist/commonjs/util/semaphore.d.ts +38 -0
  386. package/dist/commonjs/util/semaphore.d.ts.map +1 -0
  387. package/dist/commonjs/util/semaphore.js +85 -0
  388. package/dist/commonjs/util/semaphore.js.map +1 -0
  389. package/dist/commonjs/util/typeGuards.d.ts +8 -0
  390. package/dist/commonjs/util/typeGuards.d.ts.map +1 -0
  391. package/dist/commonjs/util/typeGuards.js +15 -0
  392. package/dist/commonjs/util/typeGuards.js.map +1 -0
  393. package/dist/commonjs/util/utils.d.ts +247 -0
  394. package/dist/commonjs/util/utils.d.ts.map +1 -0
  395. package/dist/commonjs/util/utils.js +524 -0
  396. package/dist/commonjs/util/utils.js.map +1 -0
  397. package/dist/esm/connectionContext.d.ts +109 -0
  398. package/dist/esm/connectionContext.d.ts.map +1 -0
  399. package/dist/esm/connectionContext.js +355 -0
  400. package/dist/esm/connectionContext.js.map +1 -0
  401. package/dist/esm/constructorHelpers.d.ts +79 -0
  402. package/dist/esm/constructorHelpers.d.ts.map +1 -0
  403. package/dist/esm/constructorHelpers.js +96 -0
  404. package/dist/esm/constructorHelpers.js.map +1 -0
  405. package/dist/esm/core/autoLockRenewer.d.ts +58 -0
  406. package/dist/esm/core/autoLockRenewer.d.ts.map +1 -0
  407. package/dist/esm/core/autoLockRenewer.js +174 -0
  408. package/dist/esm/core/autoLockRenewer.js.map +1 -0
  409. package/dist/esm/core/batchingReceiver.d.ts +120 -0
  410. package/dist/esm/core/batchingReceiver.d.ts.map +1 -0
  411. package/dist/esm/core/batchingReceiver.js +399 -0
  412. package/dist/esm/core/batchingReceiver.js.map +1 -0
  413. package/dist/esm/core/linkEntity.d.ts +192 -0
  414. package/dist/esm/core/linkEntity.d.ts.map +1 -0
  415. package/dist/esm/core/linkEntity.js +340 -0
  416. package/dist/esm/core/linkEntity.js.map +1 -0
  417. package/dist/esm/core/managementClient.d.ts +312 -0
  418. package/dist/esm/core/managementClient.d.ts.map +1 -0
  419. package/dist/esm/core/managementClient.js +1072 -0
  420. package/dist/esm/core/managementClient.js.map +1 -0
  421. package/dist/esm/core/messageReceiver.d.ts +147 -0
  422. package/dist/esm/core/messageReceiver.d.ts.map +1 -0
  423. package/dist/esm/core/messageReceiver.js +165 -0
  424. package/dist/esm/core/messageReceiver.js.map +1 -0
  425. package/dist/esm/core/messageSender.d.ts +93 -0
  426. package/dist/esm/core/messageSender.d.ts.map +1 -0
  427. package/dist/esm/core/messageSender.js +303 -0
  428. package/dist/esm/core/messageSender.js.map +1 -0
  429. package/dist/esm/core/receiverHelper.d.ts +45 -0
  430. package/dist/esm/core/receiverHelper.d.ts.map +1 -0
  431. package/dist/esm/core/receiverHelper.js +119 -0
  432. package/dist/esm/core/receiverHelper.js.map +1 -0
  433. package/dist/esm/core/shared.d.ts +34 -0
  434. package/dist/esm/core/shared.d.ts.map +1 -0
  435. package/dist/esm/core/shared.js +66 -0
  436. package/dist/esm/core/shared.js.map +1 -0
  437. package/dist/esm/core/streamingReceiver.d.ts +142 -0
  438. package/dist/esm/core/streamingReceiver.d.ts.map +1 -0
  439. package/dist/esm/core/streamingReceiver.js +522 -0
  440. package/dist/esm/core/streamingReceiver.js.map +1 -0
  441. package/dist/esm/dataTransformer.d.ts +77 -0
  442. package/dist/esm/dataTransformer.d.ts.map +1 -0
  443. package/dist/esm/dataTransformer.js +163 -0
  444. package/dist/esm/dataTransformer.js.map +1 -0
  445. package/dist/esm/diagnostics/instrumentServiceBusMessage.d.ts +50 -0
  446. package/dist/esm/diagnostics/instrumentServiceBusMessage.d.ts.map +1 -0
  447. package/dist/esm/diagnostics/instrumentServiceBusMessage.js +101 -0
  448. package/dist/esm/diagnostics/instrumentServiceBusMessage.js.map +1 -0
  449. package/dist/esm/diagnostics/tracing.d.ts +21 -0
  450. package/dist/esm/diagnostics/tracing.d.ts.map +1 -0
  451. package/dist/esm/diagnostics/tracing.js +37 -0
  452. package/dist/esm/diagnostics/tracing.js.map +1 -0
  453. package/dist/esm/experimental/index.d.ts +10 -0
  454. package/dist/esm/experimental/index.d.ts.map +1 -0
  455. package/dist/esm/experimental/index.js +4 -0
  456. package/dist/esm/experimental/index.js.map +1 -0
  457. package/dist/esm/index.d.ts +26 -0
  458. package/dist/esm/index.d.ts.map +1 -0
  459. package/dist/esm/index.js +10 -0
  460. package/dist/esm/index.js.map +1 -0
  461. package/dist/esm/log.d.ts +70 -0
  462. package/dist/esm/log.d.ts.map +1 -0
  463. package/dist/esm/log.js +89 -0
  464. package/dist/esm/log.js.map +1 -0
  465. package/dist/esm/models.d.ts +328 -0
  466. package/dist/esm/models.d.ts.map +1 -0
  467. package/dist/esm/models.js +4 -0
  468. package/dist/esm/models.js.map +1 -0
  469. package/dist/esm/modelsToBeSharedWithEventHubs.d.ts +18 -0
  470. package/dist/esm/modelsToBeSharedWithEventHubs.d.ts.map +1 -0
  471. package/dist/esm/modelsToBeSharedWithEventHubs.js +4 -0
  472. package/dist/esm/modelsToBeSharedWithEventHubs.js.map +1 -0
  473. package/dist/esm/package.json +3 -0
  474. package/dist/esm/receivers/receiver.d.ts +299 -0
  475. package/dist/esm/receivers/receiver.d.ts.map +1 -0
  476. package/dist/esm/receivers/receiver.js +379 -0
  477. package/dist/esm/receivers/receiver.js.map +1 -0
  478. package/dist/esm/receivers/receiverCommon.d.ts +81 -0
  479. package/dist/esm/receivers/receiverCommon.d.ts.map +1 -0
  480. package/dist/esm/receivers/receiverCommon.js +257 -0
  481. package/dist/esm/receivers/receiverCommon.js.map +1 -0
  482. package/dist/esm/receivers/sessionReceiver.d.ts +189 -0
  483. package/dist/esm/receivers/sessionReceiver.d.ts.map +1 -0
  484. package/dist/esm/receivers/sessionReceiver.js +428 -0
  485. package/dist/esm/receivers/sessionReceiver.js.map +1 -0
  486. package/dist/esm/sender.d.ts +125 -0
  487. package/dist/esm/sender.d.ts.map +1 -0
  488. package/dist/esm/sender.js +186 -0
  489. package/dist/esm/sender.js.map +1 -0
  490. package/dist/esm/serializers/namespaceResourceSerializer.d.ts +46 -0
  491. package/dist/esm/serializers/namespaceResourceSerializer.d.ts.map +1 -0
  492. package/dist/esm/serializers/namespaceResourceSerializer.js +34 -0
  493. package/dist/esm/serializers/namespaceResourceSerializer.js.map +1 -0
  494. package/dist/esm/serializers/queueResourceSerializer.d.ts +461 -0
  495. package/dist/esm/serializers/queueResourceSerializer.d.ts.map +1 -0
  496. package/dist/esm/serializers/queueResourceSerializer.js +99 -0
  497. package/dist/esm/serializers/queueResourceSerializer.js.map +1 -0
  498. package/dist/esm/serializers/ruleResourceSerializer.d.ts +135 -0
  499. package/dist/esm/serializers/ruleResourceSerializer.d.ts.map +1 -0
  500. package/dist/esm/serializers/ruleResourceSerializer.js +278 -0
  501. package/dist/esm/serializers/ruleResourceSerializer.js.map +1 -0
  502. package/dist/esm/serializers/subscriptionResourceSerializer.d.ts +396 -0
  503. package/dist/esm/serializers/subscriptionResourceSerializer.d.ts.map +1 -0
  504. package/dist/esm/serializers/subscriptionResourceSerializer.js +95 -0
  505. package/dist/esm/serializers/subscriptionResourceSerializer.js.map +1 -0
  506. package/dist/esm/serializers/topicResourceSerializer.d.ts +335 -0
  507. package/dist/esm/serializers/topicResourceSerializer.d.ts.map +1 -0
  508. package/dist/esm/serializers/topicResourceSerializer.js +89 -0
  509. package/dist/esm/serializers/topicResourceSerializer.js.map +1 -0
  510. package/dist/esm/serviceBusAtomManagementClient.d.ts +652 -0
  511. package/dist/esm/serviceBusAtomManagementClient.d.ts.map +1 -0
  512. package/dist/esm/serviceBusAtomManagementClient.js +1643 -0
  513. package/dist/esm/serviceBusAtomManagementClient.js.map +1 -0
  514. package/dist/esm/serviceBusClient.d.ts +231 -0
  515. package/dist/esm/serviceBusClient.d.ts.map +1 -0
  516. package/dist/esm/serviceBusClient.js +216 -0
  517. package/dist/esm/serviceBusClient.js.map +1 -0
  518. package/dist/esm/serviceBusError.d.ts +119 -0
  519. package/dist/esm/serviceBusError.d.ts.map +1 -0
  520. package/dist/esm/serviceBusError.js +103 -0
  521. package/dist/esm/serviceBusError.js.map +1 -0
  522. package/dist/esm/serviceBusMessage.d.ts +529 -0
  523. package/dist/esm/serviceBusMessage.d.ts.map +1 -0
  524. package/dist/esm/serviceBusMessage.js +598 -0
  525. package/dist/esm/serviceBusMessage.js.map +1 -0
  526. package/dist/esm/serviceBusMessageBatch.d.ts +153 -0
  527. package/dist/esm/serviceBusMessageBatch.d.ts.map +1 -0
  528. package/dist/esm/serviceBusMessageBatch.js +192 -0
  529. package/dist/esm/serviceBusMessageBatch.js.map +1 -0
  530. package/dist/esm/serviceBusRuleManager.d.ts +103 -0
  531. package/dist/esm/serviceBusRuleManager.d.ts.map +1 -0
  532. package/dist/esm/serviceBusRuleManager.js +149 -0
  533. package/dist/esm/serviceBusRuleManager.js.map +1 -0
  534. package/dist/esm/session/messageSession.d.ts +236 -0
  535. package/dist/esm/session/messageSession.d.ts.map +1 -0
  536. package/dist/esm/session/messageSession.js +755 -0
  537. package/dist/esm/session/messageSession.js.map +1 -0
  538. package/dist/esm/util/atomXmlHelper.d.ts +56 -0
  539. package/dist/esm/util/atomXmlHelper.d.ts.map +1 -0
  540. package/dist/esm/util/atomXmlHelper.js +378 -0
  541. package/dist/esm/util/atomXmlHelper.js.map +1 -0
  542. package/dist/esm/util/compat/compatibility.d.ts +109 -0
  543. package/dist/esm/util/compat/compatibility.d.ts.map +1 -0
  544. package/dist/esm/util/compat/compatibility.js +27 -0
  545. package/dist/esm/util/compat/compatibility.js.map +1 -0
  546. package/dist/esm/util/compat/httpHeaders.d.ts +136 -0
  547. package/dist/esm/util/compat/httpHeaders.d.ts.map +1 -0
  548. package/dist/esm/util/compat/httpHeaders.js +152 -0
  549. package/dist/esm/util/compat/httpHeaders.js.map +1 -0
  550. package/dist/esm/util/compat/index.d.ts +3 -0
  551. package/dist/esm/util/compat/index.d.ts.map +1 -0
  552. package/dist/esm/util/compat/index.js +5 -0
  553. package/dist/esm/util/compat/index.js.map +1 -0
  554. package/dist/esm/util/connectionStringUtils.d.ts +53 -0
  555. package/dist/esm/util/connectionStringUtils.d.ts.map +1 -0
  556. package/dist/esm/util/connectionStringUtils.js +48 -0
  557. package/dist/esm/util/connectionStringUtils.js.map +1 -0
  558. package/dist/esm/util/constants.d.ts +322 -0
  559. package/dist/esm/util/constants.d.ts.map +1 -0
  560. package/dist/esm/util/constants.js +324 -0
  561. package/dist/esm/util/constants.js.map +1 -0
  562. package/dist/esm/util/crypto.d.ts +5 -0
  563. package/dist/esm/util/crypto.d.ts.map +1 -0
  564. package/{dist-esm/src → dist/esm}/util/crypto.js +1 -3
  565. package/dist/esm/util/crypto.js.map +1 -0
  566. package/dist/esm/util/errors.d.ts +130 -0
  567. package/dist/esm/util/errors.d.ts.map +1 -0
  568. package/dist/esm/util/errors.js +220 -0
  569. package/dist/esm/util/errors.js.map +1 -0
  570. package/dist/esm/util/parseUrl.d.ts +5 -0
  571. package/dist/esm/util/parseUrl.d.ts.map +1 -0
  572. package/{dist-esm/src → dist/esm}/util/parseUrl.js +0 -6
  573. package/dist/esm/util/parseUrl.js.map +1 -0
  574. package/dist/esm/util/runtimeInfo.d.ts +7 -0
  575. package/dist/esm/util/runtimeInfo.d.ts.map +1 -0
  576. package/{dist-esm/src → dist/esm}/util/runtimeInfo.js +2 -2
  577. package/dist/esm/util/runtimeInfo.js.map +1 -0
  578. package/dist/esm/util/sasServiceClientCredentials.d.ts +31 -0
  579. package/dist/esm/util/sasServiceClientCredentials.d.ts.map +1 -0
  580. package/dist/esm/util/sasServiceClientCredentials.js +52 -0
  581. package/dist/esm/util/sasServiceClientCredentials.js.map +1 -0
  582. package/dist/esm/util/semaphore.d.ts +38 -0
  583. package/dist/esm/util/semaphore.d.ts.map +1 -0
  584. package/dist/esm/util/semaphore.js +81 -0
  585. package/dist/esm/util/semaphore.js.map +1 -0
  586. package/dist/esm/util/typeGuards.d.ts +8 -0
  587. package/dist/esm/util/typeGuards.d.ts.map +1 -0
  588. package/dist/esm/util/typeGuards.js +12 -0
  589. package/dist/esm/util/typeGuards.js.map +1 -0
  590. package/dist/esm/util/utils.d.ts +247 -0
  591. package/dist/esm/util/utils.d.ts.map +1 -0
  592. package/dist/esm/util/utils.js +496 -0
  593. package/dist/esm/util/utils.js.map +1 -0
  594. package/dist/react-native/connectionContext.d.ts +109 -0
  595. package/dist/react-native/connectionContext.d.ts.map +1 -0
  596. package/dist/react-native/connectionContext.js +355 -0
  597. package/dist/react-native/connectionContext.js.map +1 -0
  598. package/dist/react-native/constructorHelpers.d.ts +79 -0
  599. package/dist/react-native/constructorHelpers.d.ts.map +1 -0
  600. package/dist/react-native/constructorHelpers.js +96 -0
  601. package/dist/react-native/constructorHelpers.js.map +1 -0
  602. package/dist/react-native/core/autoLockRenewer.d.ts +58 -0
  603. package/dist/react-native/core/autoLockRenewer.d.ts.map +1 -0
  604. package/dist/react-native/core/autoLockRenewer.js +174 -0
  605. package/dist/react-native/core/autoLockRenewer.js.map +1 -0
  606. package/dist/react-native/core/batchingReceiver.d.ts +120 -0
  607. package/dist/react-native/core/batchingReceiver.d.ts.map +1 -0
  608. package/dist/react-native/core/batchingReceiver.js +399 -0
  609. package/dist/react-native/core/batchingReceiver.js.map +1 -0
  610. package/dist/react-native/core/linkEntity.d.ts +192 -0
  611. package/dist/react-native/core/linkEntity.d.ts.map +1 -0
  612. package/dist/react-native/core/linkEntity.js +340 -0
  613. package/dist/react-native/core/linkEntity.js.map +1 -0
  614. package/dist/react-native/core/managementClient.d.ts +312 -0
  615. package/dist/react-native/core/managementClient.d.ts.map +1 -0
  616. package/dist/react-native/core/managementClient.js +1072 -0
  617. package/dist/react-native/core/managementClient.js.map +1 -0
  618. package/dist/react-native/core/messageReceiver.d.ts +147 -0
  619. package/dist/react-native/core/messageReceiver.d.ts.map +1 -0
  620. package/dist/react-native/core/messageReceiver.js +165 -0
  621. package/dist/react-native/core/messageReceiver.js.map +1 -0
  622. package/dist/react-native/core/messageSender.d.ts +93 -0
  623. package/dist/react-native/core/messageSender.d.ts.map +1 -0
  624. package/dist/react-native/core/messageSender.js +303 -0
  625. package/dist/react-native/core/messageSender.js.map +1 -0
  626. package/dist/react-native/core/receiverHelper.d.ts +45 -0
  627. package/dist/react-native/core/receiverHelper.d.ts.map +1 -0
  628. package/dist/react-native/core/receiverHelper.js +119 -0
  629. package/dist/react-native/core/receiverHelper.js.map +1 -0
  630. package/dist/react-native/core/shared.d.ts +34 -0
  631. package/dist/react-native/core/shared.d.ts.map +1 -0
  632. package/dist/react-native/core/shared.js +66 -0
  633. package/dist/react-native/core/shared.js.map +1 -0
  634. package/dist/react-native/core/streamingReceiver.d.ts +142 -0
  635. package/dist/react-native/core/streamingReceiver.d.ts.map +1 -0
  636. package/dist/react-native/core/streamingReceiver.js +522 -0
  637. package/dist/react-native/core/streamingReceiver.js.map +1 -0
  638. package/dist/react-native/dataTransformer.d.ts +77 -0
  639. package/dist/react-native/dataTransformer.d.ts.map +1 -0
  640. package/dist/react-native/dataTransformer.js +163 -0
  641. package/dist/react-native/dataTransformer.js.map +1 -0
  642. package/dist/react-native/diagnostics/instrumentServiceBusMessage.d.ts +50 -0
  643. package/dist/react-native/diagnostics/instrumentServiceBusMessage.d.ts.map +1 -0
  644. package/dist/react-native/diagnostics/instrumentServiceBusMessage.js +101 -0
  645. package/dist/react-native/diagnostics/instrumentServiceBusMessage.js.map +1 -0
  646. package/dist/react-native/diagnostics/tracing.d.ts +21 -0
  647. package/dist/react-native/diagnostics/tracing.d.ts.map +1 -0
  648. package/dist/react-native/diagnostics/tracing.js +37 -0
  649. package/dist/react-native/diagnostics/tracing.js.map +1 -0
  650. package/dist/react-native/experimental/index.d.ts +10 -0
  651. package/dist/react-native/experimental/index.d.ts.map +1 -0
  652. package/dist/react-native/experimental/index.js +4 -0
  653. package/dist/react-native/experimental/index.js.map +1 -0
  654. package/dist/react-native/index.d.ts +26 -0
  655. package/dist/react-native/index.d.ts.map +1 -0
  656. package/dist/react-native/index.js +10 -0
  657. package/dist/react-native/index.js.map +1 -0
  658. package/dist/react-native/log.d.ts +70 -0
  659. package/dist/react-native/log.d.ts.map +1 -0
  660. package/dist/react-native/log.js +89 -0
  661. package/dist/react-native/log.js.map +1 -0
  662. package/dist/react-native/models.d.ts +328 -0
  663. package/dist/react-native/models.d.ts.map +1 -0
  664. package/dist/react-native/models.js +4 -0
  665. package/dist/react-native/models.js.map +1 -0
  666. package/dist/react-native/modelsToBeSharedWithEventHubs.d.ts +18 -0
  667. package/dist/react-native/modelsToBeSharedWithEventHubs.d.ts.map +1 -0
  668. package/dist/react-native/modelsToBeSharedWithEventHubs.js +4 -0
  669. package/dist/react-native/modelsToBeSharedWithEventHubs.js.map +1 -0
  670. package/dist/react-native/package.json +3 -0
  671. package/dist/react-native/receivers/receiver.d.ts +299 -0
  672. package/dist/react-native/receivers/receiver.d.ts.map +1 -0
  673. package/dist/react-native/receivers/receiver.js +379 -0
  674. package/dist/react-native/receivers/receiver.js.map +1 -0
  675. package/dist/react-native/receivers/receiverCommon.d.ts +81 -0
  676. package/dist/react-native/receivers/receiverCommon.d.ts.map +1 -0
  677. package/dist/react-native/receivers/receiverCommon.js +257 -0
  678. package/dist/react-native/receivers/receiverCommon.js.map +1 -0
  679. package/dist/react-native/receivers/sessionReceiver.d.ts +189 -0
  680. package/dist/react-native/receivers/sessionReceiver.d.ts.map +1 -0
  681. package/dist/react-native/receivers/sessionReceiver.js +428 -0
  682. package/dist/react-native/receivers/sessionReceiver.js.map +1 -0
  683. package/dist/react-native/sender.d.ts +125 -0
  684. package/dist/react-native/sender.d.ts.map +1 -0
  685. package/dist/react-native/sender.js +186 -0
  686. package/dist/react-native/sender.js.map +1 -0
  687. package/dist/react-native/serializers/namespaceResourceSerializer.d.ts +46 -0
  688. package/dist/react-native/serializers/namespaceResourceSerializer.d.ts.map +1 -0
  689. package/dist/react-native/serializers/namespaceResourceSerializer.js +34 -0
  690. package/dist/react-native/serializers/namespaceResourceSerializer.js.map +1 -0
  691. package/dist/react-native/serializers/queueResourceSerializer.d.ts +461 -0
  692. package/dist/react-native/serializers/queueResourceSerializer.d.ts.map +1 -0
  693. package/dist/react-native/serializers/queueResourceSerializer.js +99 -0
  694. package/dist/react-native/serializers/queueResourceSerializer.js.map +1 -0
  695. package/dist/react-native/serializers/ruleResourceSerializer.d.ts +135 -0
  696. package/dist/react-native/serializers/ruleResourceSerializer.d.ts.map +1 -0
  697. package/dist/react-native/serializers/ruleResourceSerializer.js +278 -0
  698. package/dist/react-native/serializers/ruleResourceSerializer.js.map +1 -0
  699. package/dist/react-native/serializers/subscriptionResourceSerializer.d.ts +396 -0
  700. package/dist/react-native/serializers/subscriptionResourceSerializer.d.ts.map +1 -0
  701. package/dist/react-native/serializers/subscriptionResourceSerializer.js +95 -0
  702. package/dist/react-native/serializers/subscriptionResourceSerializer.js.map +1 -0
  703. package/dist/react-native/serializers/topicResourceSerializer.d.ts +335 -0
  704. package/dist/react-native/serializers/topicResourceSerializer.d.ts.map +1 -0
  705. package/dist/react-native/serializers/topicResourceSerializer.js +89 -0
  706. package/dist/react-native/serializers/topicResourceSerializer.js.map +1 -0
  707. package/dist/react-native/serviceBusAtomManagementClient.d.ts +652 -0
  708. package/dist/react-native/serviceBusAtomManagementClient.d.ts.map +1 -0
  709. package/dist/react-native/serviceBusAtomManagementClient.js +1643 -0
  710. package/dist/react-native/serviceBusAtomManagementClient.js.map +1 -0
  711. package/dist/react-native/serviceBusClient.d.ts +231 -0
  712. package/dist/react-native/serviceBusClient.d.ts.map +1 -0
  713. package/dist/react-native/serviceBusClient.js +216 -0
  714. package/dist/react-native/serviceBusClient.js.map +1 -0
  715. package/dist/react-native/serviceBusError.d.ts +119 -0
  716. package/dist/react-native/serviceBusError.d.ts.map +1 -0
  717. package/dist/react-native/serviceBusError.js +103 -0
  718. package/dist/react-native/serviceBusError.js.map +1 -0
  719. package/dist/react-native/serviceBusMessage.d.ts +529 -0
  720. package/dist/react-native/serviceBusMessage.d.ts.map +1 -0
  721. package/dist/react-native/serviceBusMessage.js +598 -0
  722. package/dist/react-native/serviceBusMessage.js.map +1 -0
  723. package/dist/react-native/serviceBusMessageBatch.d.ts +153 -0
  724. package/dist/react-native/serviceBusMessageBatch.d.ts.map +1 -0
  725. package/dist/react-native/serviceBusMessageBatch.js +192 -0
  726. package/dist/react-native/serviceBusMessageBatch.js.map +1 -0
  727. package/dist/react-native/serviceBusRuleManager.d.ts +103 -0
  728. package/dist/react-native/serviceBusRuleManager.d.ts.map +1 -0
  729. package/dist/react-native/serviceBusRuleManager.js +149 -0
  730. package/dist/react-native/serviceBusRuleManager.js.map +1 -0
  731. package/dist/react-native/session/messageSession.d.ts +236 -0
  732. package/dist/react-native/session/messageSession.d.ts.map +1 -0
  733. package/dist/react-native/session/messageSession.js +755 -0
  734. package/dist/react-native/session/messageSession.js.map +1 -0
  735. package/dist/react-native/util/atomXmlHelper.d.ts +56 -0
  736. package/dist/react-native/util/atomXmlHelper.d.ts.map +1 -0
  737. package/dist/react-native/util/atomXmlHelper.js +378 -0
  738. package/dist/react-native/util/atomXmlHelper.js.map +1 -0
  739. package/dist/react-native/util/compat/compatibility.d.ts +109 -0
  740. package/dist/react-native/util/compat/compatibility.d.ts.map +1 -0
  741. package/dist/react-native/util/compat/compatibility.js +27 -0
  742. package/dist/react-native/util/compat/compatibility.js.map +1 -0
  743. package/dist/react-native/util/compat/httpHeaders.d.ts +136 -0
  744. package/dist/react-native/util/compat/httpHeaders.d.ts.map +1 -0
  745. package/dist/react-native/util/compat/httpHeaders.js +152 -0
  746. package/dist/react-native/util/compat/httpHeaders.js.map +1 -0
  747. package/dist/react-native/util/compat/index.d.ts +3 -0
  748. package/dist/react-native/util/compat/index.d.ts.map +1 -0
  749. package/dist/react-native/util/compat/index.js +5 -0
  750. package/dist/react-native/util/compat/index.js.map +1 -0
  751. package/dist/react-native/util/connectionStringUtils.d.ts +53 -0
  752. package/dist/react-native/util/connectionStringUtils.d.ts.map +1 -0
  753. package/dist/react-native/util/connectionStringUtils.js +48 -0
  754. package/dist/react-native/util/connectionStringUtils.js.map +1 -0
  755. package/dist/react-native/util/constants.d.ts +322 -0
  756. package/dist/react-native/util/constants.d.ts.map +1 -0
  757. package/dist/react-native/util/constants.js +324 -0
  758. package/dist/react-native/util/constants.js.map +1 -0
  759. package/dist/react-native/util/crypto.d.ts +5 -0
  760. package/dist/react-native/util/crypto.d.ts.map +1 -0
  761. package/dist/react-native/util/crypto.js +11 -0
  762. package/dist/react-native/util/crypto.js.map +1 -0
  763. package/dist/react-native/util/errors.d.ts +130 -0
  764. package/dist/react-native/util/errors.d.ts.map +1 -0
  765. package/dist/react-native/util/errors.js +220 -0
  766. package/dist/react-native/util/errors.js.map +1 -0
  767. package/dist/react-native/util/parseUrl.d.ts +5 -0
  768. package/dist/react-native/util/parseUrl.d.ts.map +1 -0
  769. package/dist/react-native/util/parseUrl.js +9 -0
  770. package/dist/react-native/util/parseUrl.js.map +1 -0
  771. package/dist/react-native/util/runtimeInfo-react-native.d.mts.map +1 -0
  772. package/dist/react-native/util/runtimeInfo-react-native.mjs.map +1 -0
  773. package/dist/react-native/util/runtimeInfo.d.ts +7 -0
  774. package/{dist-esm/src/util/runtimeInfo.native.js → dist/react-native/util/runtimeInfo.js} +3 -3
  775. package/dist/react-native/util/sasServiceClientCredentials.d.ts +31 -0
  776. package/dist/react-native/util/sasServiceClientCredentials.d.ts.map +1 -0
  777. package/dist/react-native/util/sasServiceClientCredentials.js +52 -0
  778. package/dist/react-native/util/sasServiceClientCredentials.js.map +1 -0
  779. package/dist/react-native/util/semaphore.d.ts +38 -0
  780. package/dist/react-native/util/semaphore.d.ts.map +1 -0
  781. package/dist/react-native/util/semaphore.js +81 -0
  782. package/dist/react-native/util/semaphore.js.map +1 -0
  783. package/dist/react-native/util/typeGuards.d.ts +8 -0
  784. package/dist/react-native/util/typeGuards.d.ts.map +1 -0
  785. package/dist/react-native/util/typeGuards.js +12 -0
  786. package/dist/react-native/util/typeGuards.js.map +1 -0
  787. package/dist/react-native/util/utils.d.ts +247 -0
  788. package/dist/react-native/util/utils.d.ts.map +1 -0
  789. package/dist/react-native/util/utils.js +496 -0
  790. package/dist/react-native/util/utils.js.map +1 -0
  791. package/package.json +123 -104
  792. package/dist/index.js +0 -10438
  793. package/dist/index.js.map +0 -1
  794. package/dist-esm/src/connectionContext.js.map +0 -1
  795. package/dist-esm/src/constructorHelpers.js.map +0 -1
  796. package/dist-esm/src/core/autoLockRenewer.js.map +0 -1
  797. package/dist-esm/src/core/batchingReceiver.js.map +0 -1
  798. package/dist-esm/src/core/linkEntity.js.map +0 -1
  799. package/dist-esm/src/core/managementClient.js.map +0 -1
  800. package/dist-esm/src/core/messageReceiver.js.map +0 -1
  801. package/dist-esm/src/core/messageSender.js.map +0 -1
  802. package/dist-esm/src/core/receiverHelper.js.map +0 -1
  803. package/dist-esm/src/core/shared.js.map +0 -1
  804. package/dist-esm/src/core/streamingReceiver.js.map +0 -1
  805. package/dist-esm/src/dataTransformer.js.map +0 -1
  806. package/dist-esm/src/diagnostics/instrumentServiceBusMessage.js.map +0 -1
  807. package/dist-esm/src/diagnostics/tracing.js.map +0 -1
  808. package/dist-esm/src/index.js.map +0 -1
  809. package/dist-esm/src/log.js.map +0 -1
  810. package/dist-esm/src/models.js +0 -4
  811. package/dist-esm/src/models.js.map +0 -1
  812. package/dist-esm/src/modelsToBeSharedWithEventHubs.js +0 -4
  813. package/dist-esm/src/modelsToBeSharedWithEventHubs.js.map +0 -1
  814. package/dist-esm/src/receivers/receiver.js.map +0 -1
  815. package/dist-esm/src/receivers/receiverCommon.js.map +0 -1
  816. package/dist-esm/src/receivers/sessionReceiver.js.map +0 -1
  817. package/dist-esm/src/sender.js.map +0 -1
  818. package/dist-esm/src/serializers/namespaceResourceSerializer.js.map +0 -1
  819. package/dist-esm/src/serializers/queueResourceSerializer.js.map +0 -1
  820. package/dist-esm/src/serializers/ruleResourceSerializer.js.map +0 -1
  821. package/dist-esm/src/serializers/subscriptionResourceSerializer.js.map +0 -1
  822. package/dist-esm/src/serializers/topicResourceSerializer.js.map +0 -1
  823. package/dist-esm/src/serviceBusAtomManagementClient.js.map +0 -1
  824. package/dist-esm/src/serviceBusClient.js.map +0 -1
  825. package/dist-esm/src/serviceBusError.js.map +0 -1
  826. package/dist-esm/src/serviceBusMessage.js.map +0 -1
  827. package/dist-esm/src/serviceBusMessageBatch.js.map +0 -1
  828. package/dist-esm/src/serviceBusRuleManager.js.map +0 -1
  829. package/dist-esm/src/session/messageSession.js.map +0 -1
  830. package/dist-esm/src/util/atomXmlHelper.js.map +0 -1
  831. package/dist-esm/src/util/compat/compatibility.js.map +0 -1
  832. package/dist-esm/src/util/compat/httpHeaders.js.map +0 -1
  833. package/dist-esm/src/util/compat/index.js +0 -5
  834. package/dist-esm/src/util/compat/index.js.map +0 -1
  835. package/dist-esm/src/util/connectionStringUtils.js.map +0 -1
  836. package/dist-esm/src/util/crypto.browser.js.map +0 -1
  837. package/dist-esm/src/util/crypto.js.map +0 -1
  838. package/dist-esm/src/util/errors.js.map +0 -1
  839. package/dist-esm/src/util/parseUrl.browser.js.map +0 -1
  840. package/dist-esm/src/util/parseUrl.js.map +0 -1
  841. package/dist-esm/src/util/runtimeInfo.browser.js.map +0 -1
  842. package/dist-esm/src/util/runtimeInfo.js.map +0 -1
  843. package/dist-esm/src/util/runtimeInfo.native.js.map +0 -1
  844. package/dist-esm/src/util/sasServiceClientCredentials.js.map +0 -1
  845. package/dist-esm/src/util/semaphore.js.map +0 -1
  846. package/dist-esm/src/util/typeGuards.js.map +0 -1
  847. package/dist-esm/src/util/utils.js.map +0 -1
  848. package/types/latest/service-bus-beta.d.ts +0 -3197
@@ -0,0 +1,1643 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { Constants as AMQPConstants, parseConnectionString } from "@azure/core-amqp";
4
+ import { isTokenCredential, isNamedKeyCredential } from "@azure/core-auth";
5
+ import { ServiceClient } from "@azure/core-client";
6
+ import { bearerTokenAuthenticationPolicy, RestError, createPipelineFromOptions, createPipelineRequest, } from "@azure/core-rest-pipeline";
7
+ import { administrationLogger as logger } from "./log.js";
8
+ import { buildNamespace, NamespaceResourceSerializer, } from "./serializers/namespaceResourceSerializer.js";
9
+ import { buildQueue, buildQueueOptions, buildQueueRuntimeProperties, QueueResourceSerializer, } from "./serializers/queueResourceSerializer.js";
10
+ import { buildRule, isSqlRuleAction, RuleResourceSerializer, } from "./serializers/ruleResourceSerializer.js";
11
+ import { buildSubscription, buildSubscriptionOptions, buildSubscriptionRuntimeProperties, SubscriptionResourceSerializer, } from "./serializers/subscriptionResourceSerializer.js";
12
+ import { buildTopic, buildTopicOptions, buildTopicRuntimeProperties, TopicResourceSerializer, } from "./serializers/topicResourceSerializer.js";
13
+ import { executeAtomXmlOperation } from "./util/atomXmlHelper.js";
14
+ import * as Constants from "./util/constants.js";
15
+ import { parseURL } from "./util/parseUrl.js";
16
+ import { SasServiceClientCredentials } from "./util/sasServiceClientCredentials.js";
17
+ import { tracingClient } from "./diagnostics/tracing.js";
18
+ import { isDefined } from "@azure/core-util";
19
+ import { formatUserAgentPrefix, getHttpResponseOnly, isAbsoluteUrl, isJSONLikeObject, } from "./util/utils.js";
20
+ function signingPolicy(credentials) {
21
+ return {
22
+ name: "signingPolicy",
23
+ async sendRequest(request, next) {
24
+ const signed = await credentials.signRequest(request);
25
+ return next(signed);
26
+ },
27
+ };
28
+ }
29
+ /**
30
+ * All operations return promises that resolve to an object that has the relevant output.
31
+ * These objects also have a property called `_response` that you can use if you want to
32
+ * access the direct response from the service.
33
+ */
34
+ export class ServiceBusAdministrationClient extends ServiceClient {
35
+ /**
36
+ * Reference to the endpoint as extracted from input connection string.
37
+ */
38
+ endpoint;
39
+ /**
40
+ * Reference to the endpoint with protocol prefix as extracted from input connection string.
41
+ */
42
+ endpointWithProtocol;
43
+ serviceVersion;
44
+ useTls;
45
+ /**
46
+ * Singleton instances of serializers used across the various operations.
47
+ */
48
+ namespaceResourceSerializer;
49
+ queueResourceSerializer;
50
+ topicResourceSerializer;
51
+ subscriptionResourceSerializer;
52
+ ruleResourceSerializer;
53
+ /**
54
+ * Credentials used to generate tokens as required for the various operations.
55
+ */
56
+ credentials;
57
+ constructor(fullyQualifiedNamespaceOrConnectionString1, credentialOrOptions2, options3) {
58
+ let options;
59
+ let fullyQualifiedNamespace;
60
+ let credentials;
61
+ let authPolicy;
62
+ let useTls = true;
63
+ if (isTokenCredential(credentialOrOptions2)) {
64
+ fullyQualifiedNamespace = fullyQualifiedNamespaceOrConnectionString1;
65
+ options = options3 || {};
66
+ credentials = credentialOrOptions2;
67
+ authPolicy = bearerTokenAuthenticationPolicy({
68
+ credential: credentials,
69
+ scopes: AMQPConstants.aadServiceBusScope,
70
+ });
71
+ }
72
+ else if (isNamedKeyCredential(credentialOrOptions2)) {
73
+ fullyQualifiedNamespace = fullyQualifiedNamespaceOrConnectionString1;
74
+ credentials = new SasServiceClientCredentials(credentialOrOptions2);
75
+ options = options3 || {};
76
+ authPolicy = signingPolicy(credentials);
77
+ }
78
+ else {
79
+ const connectionString = fullyQualifiedNamespaceOrConnectionString1;
80
+ options = credentialOrOptions2 || {};
81
+ const connectionStringObj = parseConnectionString(connectionString);
82
+ if (connectionStringObj.Endpoint === undefined) {
83
+ throw new Error("Missing Endpoint in connection string.");
84
+ }
85
+ try {
86
+ fullyQualifiedNamespace = connectionStringObj.Endpoint.match(".*://([^/]*)")[1];
87
+ }
88
+ catch {
89
+ throw new Error("Endpoint in the connection string is not valid.");
90
+ }
91
+ if (connectionStringObj.UseDevelopmentEmulator) {
92
+ useTls = false;
93
+ }
94
+ credentials = new SasServiceClientCredentials({
95
+ key: connectionStringObj.SharedAccessKey,
96
+ name: connectionStringObj.SharedAccessKeyName,
97
+ });
98
+ authPolicy = signingPolicy(credentials);
99
+ }
100
+ const userAgentPrefix = formatUserAgentPrefix(options.userAgentOptions?.userAgentPrefix);
101
+ const serviceClientOptions = createPipelineFromOptions({
102
+ ...options,
103
+ userAgentOptions: {
104
+ userAgentPrefix,
105
+ },
106
+ });
107
+ serviceClientOptions.addPolicy(authPolicy);
108
+ super({ pipeline: serviceClientOptions });
109
+ this.endpoint = fullyQualifiedNamespace;
110
+ this.endpointWithProtocol = fullyQualifiedNamespace.endsWith("/")
111
+ ? "sb://" + fullyQualifiedNamespace
112
+ : "sb://" + fullyQualifiedNamespace + "/";
113
+ this.serviceVersion = options.serviceVersion ?? Constants.CURRENT_API_VERSION;
114
+ this.useTls = useTls;
115
+ this.credentials = credentials;
116
+ this.namespaceResourceSerializer = new NamespaceResourceSerializer();
117
+ this.queueResourceSerializer = new QueueResourceSerializer();
118
+ this.topicResourceSerializer = new TopicResourceSerializer();
119
+ this.subscriptionResourceSerializer = new SubscriptionResourceSerializer();
120
+ this.ruleResourceSerializer = new RuleResourceSerializer();
121
+ }
122
+ /**
123
+ * Returns an object representing the metadata related to a service bus namespace.
124
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
125
+ *
126
+ */
127
+ async getNamespaceProperties(operationOptions = {}) {
128
+ logger.verbose(`Performing management operation - getNamespaceProperties()`);
129
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getNamespaceProperties", operationOptions, async (updatedOptions) => {
130
+ const response = await this.getResource("$namespaceinfo", this.namespaceResourceSerializer, updatedOptions);
131
+ return this.buildNamespacePropertiesResponse(response);
132
+ });
133
+ }
134
+ /**
135
+ * Creates a queue with given name, configured using the given options
136
+ * @param options - Options to configure the Queue being created(For example, you can configure a queue to support partitions or sessions)
137
+ * and the operation options that can be used to abort, trace and control other configurations on the HTTP request.
138
+ *
139
+ * Following are errors that can be expected from this operation
140
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
141
+ * @throws `RestError` with code `MessageEntityAlreadyExistsError` when requested messaging entity already exists,
142
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
143
+ * @throws `RestError` with code `QuotaExceededError` when requested operation fails due to quote limits exceeding from service side,
144
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
145
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
146
+ * bad requests or requests resulting in conflicting operation on the server,
147
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
148
+ */
149
+ async createQueue(queueName, options = {}) {
150
+ return tracingClient.withSpan("ServiceBusAdministrationClient.createQueue", options, async (updatedOptions) => {
151
+ logger.verbose(`Performing management operation - createQueue() for "${queueName}" with options: %j`, options);
152
+ const response = await this.putResource(queueName, buildQueueOptions(options || {}), this.queueResourceSerializer, false, updatedOptions);
153
+ return this.buildQueueResponse(response);
154
+ });
155
+ }
156
+ /**
157
+ * Returns an object representing the Queue and its properties.
158
+ * If you want to get the Queue runtime info like message count details, use `getQueueRuntimeProperties` API.
159
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
160
+ *
161
+ * Following are errors that can be expected from this operation
162
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
163
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
164
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
165
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
166
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
167
+ * bad requests or requests resulting in conflicting operation on the server,
168
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
169
+ */
170
+ async getQueue(queueName, operationOptions = {}) {
171
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getQueue", operationOptions, async (updatedOptions) => {
172
+ logger.verbose(`Performing management operation - getQueue() for "${queueName}"`);
173
+ const response = await this.getResource(queueName, this.queueResourceSerializer, updatedOptions);
174
+ return this.buildQueueResponse(response);
175
+ });
176
+ }
177
+ /**
178
+ * Returns an object representing the Queue runtime info like message count details.
179
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
180
+ *
181
+ * Following are errors that can be expected from this operation
182
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
183
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
184
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
185
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
186
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
187
+ * bad requests or requests resulting in conflicting operation on the server,
188
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
189
+ */
190
+ async getQueueRuntimeProperties(queueName, operationOptions = {}) {
191
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getQueueRuntimeProperties", operationOptions, async (updatedOptions) => {
192
+ logger.verbose(`Performing management operation - getQueueRuntimeProperties() for "${queueName}"`);
193
+ const response = await this.getResource(queueName, this.queueResourceSerializer, updatedOptions);
194
+ return this.buildQueueRuntimePropertiesResponse(response);
195
+ });
196
+ }
197
+ /**
198
+ * Returns a list of objects, each representing a Queue along with its properties.
199
+ * If you want to get the runtime info of the queues like message count, use `getQueuesRuntimeProperties` API instead.
200
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
201
+ *
202
+ * Following are errors that can be expected from this operation
203
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
204
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
205
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
206
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
207
+ * bad requests or requests resulting in conflicting operation on the server,
208
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
209
+ */
210
+ async getQueues(options = {}) {
211
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getQueues", options, async (updatedOptions) => {
212
+ logger.verbose(`Performing management operation - getQueues() with options: %j`, options);
213
+ const response = await this.listResources("$Resources/Queues", updatedOptions, this.queueResourceSerializer);
214
+ return this.buildListQueuesResponse(response);
215
+ });
216
+ }
217
+ async *listQueuesPage(marker, options = {}) {
218
+ let listResponse;
219
+ do {
220
+ listResponse = await this.getQueues({
221
+ skip: Number(marker),
222
+ maxCount: options.maxPageSize,
223
+ ...options,
224
+ });
225
+ marker = listResponse.continuationToken;
226
+ yield listResponse;
227
+ } while (marker);
228
+ }
229
+ async *listQueuesAll(options = {}) {
230
+ let marker;
231
+ for await (const segment of this.listQueuesPage(marker, options)) {
232
+ yield* segment;
233
+ }
234
+ }
235
+ /**
236
+ * Returns an async iterable iterator to list all the queues.
237
+ *
238
+ * .byPage() returns an async iterable iterator to list the queues in pages.
239
+ *
240
+ * @returns An asyncIterableIterator that supports paging.
241
+ */
242
+ listQueues(options) {
243
+ logger.verbose(`Performing management operation - listQueues() with options: %j`, options);
244
+ const iter = this.listQueuesAll(options);
245
+ return {
246
+ /**
247
+ */
248
+ next() {
249
+ return iter.next();
250
+ },
251
+ /**
252
+ */
253
+ [Symbol.asyncIterator]() {
254
+ return this;
255
+ },
256
+ /**
257
+ */
258
+ byPage: (settings = {}) => {
259
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
260
+ return this.listQueuesPage(settings.continuationToken, {
261
+ maxPageSize: settings.maxPageSize,
262
+ ...options,
263
+ });
264
+ },
265
+ };
266
+ }
267
+ /**
268
+ * Returns a list of objects, each representing a Queue's runtime info like message count details.
269
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
270
+ *
271
+ * Following are errors that can be expected from this operation
272
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
273
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
274
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
275
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
276
+ * bad requests or requests resulting in conflicting operation on the server,
277
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
278
+ */
279
+ async getQueuesRuntimeProperties(options = {}) {
280
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getQueuesRuntimeProperties", options, async (updatedOptions) => {
281
+ logger.verbose(`Performing management operation - getQueuesRuntimeProperties() with options: %j`, options);
282
+ const response = await this.listResources("$Resources/Queues", updatedOptions, this.queueResourceSerializer);
283
+ return this.buildListQueuesRuntimePropertiesResponse(response);
284
+ });
285
+ }
286
+ async *listQueuesRuntimePropertiesPage(marker, options = {}) {
287
+ let listResponse;
288
+ do {
289
+ listResponse = await this.getQueuesRuntimeProperties({
290
+ skip: Number(marker),
291
+ maxCount: options.maxPageSize,
292
+ ...options,
293
+ });
294
+ marker = listResponse.continuationToken;
295
+ yield listResponse;
296
+ } while (marker);
297
+ }
298
+ async *listQueuesRuntimePropertiesAll(options = {}) {
299
+ let marker;
300
+ for await (const segment of this.listQueuesRuntimePropertiesPage(marker, options)) {
301
+ yield* segment;
302
+ }
303
+ }
304
+ /**
305
+ * Returns an async iterable iterator to list runtime info of the queues.
306
+ *
307
+ * .byPage() returns an async iterable iterator to list runtime info of the queues in pages.
308
+ *
309
+ *
310
+ * @returns An asyncIterableIterator that supports paging.
311
+ */
312
+ listQueuesRuntimeProperties(options) {
313
+ logger.verbose(`Performing management operation - listQueuesRuntimeProperties() with options: %j`, options);
314
+ const iter = this.listQueuesRuntimePropertiesAll(options);
315
+ return {
316
+ /**
317
+ */
318
+ next() {
319
+ return iter.next();
320
+ },
321
+ /**
322
+ */
323
+ [Symbol.asyncIterator]() {
324
+ return this;
325
+ },
326
+ /**
327
+ */
328
+ byPage: (settings = {}) => {
329
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
330
+ return this.listQueuesRuntimePropertiesPage(settings.continuationToken, {
331
+ maxPageSize: settings.maxPageSize,
332
+ ...options,
333
+ });
334
+ },
335
+ };
336
+ }
337
+ /**
338
+ * Updates the queue based on the queue properties provided.
339
+ * All queue properties must be set even though only a subset of them are actually updatable.
340
+ * Therefore, the suggested flow is to use the output from `getQueue()`, update the desired properties in it, and then pass the modified object to `updateQueue()`.
341
+ *
342
+ * The properties that cannot be updated are marked as readonly in the `QueueProperties` interface.
343
+ *
344
+ * @param queue - Object representing the properties of the queue and the raw response.
345
+ * `requiresSession`, `requiresDuplicateDetection`, `enablePartitioning`, and `name` can't be updated after creating the queue.
346
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
347
+ *
348
+ * Following are errors that can be expected from this operation
349
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
350
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
351
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
352
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
353
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
354
+ * bad requests or requests resulting in conflicting operation on the server,
355
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
356
+ */
357
+ async updateQueue(queue, operationOptions = {}) {
358
+ return tracingClient.withSpan("ServiceBusAdministrationClient.updateQueue", operationOptions, async (updatedOptions) => {
359
+ logger.verbose(`Performing management operation - updateQueue() for "${queue.name}" with options: %j`, queue);
360
+ if (!isJSONLikeObject(queue) || queue == null) {
361
+ throw new TypeError(`Parameter "queue" must be an object of type "QueueDescription" and cannot be undefined or null.`);
362
+ }
363
+ if (!queue.name) {
364
+ throw new TypeError(`"name" attribute of the parameter "queue" cannot be undefined.`);
365
+ }
366
+ const response = await this.putResource(queue.name, buildQueueOptions(queue), this.queueResourceSerializer, true, updatedOptions);
367
+ return this.buildQueueResponse(response);
368
+ });
369
+ }
370
+ /**
371
+ * Deletes a queue.
372
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
373
+ *
374
+ * Following are errors that can be expected from this operation
375
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
376
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
377
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
378
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
379
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
380
+ * bad requests or requests resulting in conflicting operation on the server,
381
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
382
+ */
383
+ async deleteQueue(queueName, operationOptions = {}) {
384
+ return tracingClient.withSpan("ServiceBusAdministrationClient.deleteQueue", operationOptions, async (updatedOptions) => {
385
+ logger.verbose(`Performing management operation - deleteQueue() for "${queueName}"`);
386
+ const response = await this.deleteResource(queueName, this.queueResourceSerializer, updatedOptions);
387
+ return { _response: getHttpResponseOnly(response) };
388
+ });
389
+ }
390
+ /**
391
+ * Checks whether a given queue exists or not.
392
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
393
+ */
394
+ async queueExists(queueName, operationOptions = {}) {
395
+ logger.verbose(`Performing management operation - queueExists() for "${queueName}"`);
396
+ const { span, updatedOptions } = tracingClient.startSpan("ServiceBusAdministrationClient.queueExists", operationOptions);
397
+ try {
398
+ await this.getQueue(queueName, updatedOptions);
399
+ span.setStatus({ status: "success" });
400
+ return true;
401
+ }
402
+ catch (e) {
403
+ span.setStatus({ status: "error", error: e });
404
+ return false;
405
+ }
406
+ finally {
407
+ span.end();
408
+ }
409
+ }
410
+ /**
411
+ * Creates a topic with given name, configured using the given options
412
+ * @param options - Options to configure the Topic being created(For example, you can configure a topic to support partitions)
413
+ * and the operation options that can be used to abort, trace and control other configurations on the HTTP request.
414
+ *
415
+ * Following are errors that can be expected from this operation
416
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
417
+ * @throws `RestError` with code `MessageEntityAlreadyExistsError` when requested messaging entity already exists,
418
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
419
+ * @throws `RestError` with code `QuotaExceededError` when requested operation fails due to quote limits exceeding from service side,
420
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
421
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
422
+ * bad requests or requests resulting in conflicting operation on the server,
423
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
424
+ */
425
+ async createTopic(topicName, options = {}) {
426
+ return tracingClient.withSpan("ServiceBusAdministrationClient.createTopic", options, async (updatedOptions) => {
427
+ logger.verbose(`Performing management operation - createTopic() for "${topicName}" with options: %j`, options);
428
+ const response = await this.putResource(topicName, buildTopicOptions(options || {}), this.topicResourceSerializer, false, updatedOptions);
429
+ return this.buildTopicResponse(response);
430
+ });
431
+ }
432
+ /**
433
+ * Returns an object representing the Topic and its properties.
434
+ * If you want to get the Topic runtime info like subscription count details, use `getTopicRuntimeProperties` API.
435
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
436
+ *
437
+ * Following are errors that can be expected from this operation
438
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
439
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
440
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
441
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
442
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
443
+ * bad requests or requests resulting in conflicting operation on the server,
444
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
445
+ */
446
+ async getTopic(topicName, operationOptions = {}) {
447
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getTopic", operationOptions, async (updatedOptions) => {
448
+ logger.verbose(`Performing management operation - getTopic() for "${topicName}"`);
449
+ const response = await this.getResource(topicName, this.topicResourceSerializer, updatedOptions);
450
+ return this.buildTopicResponse(response);
451
+ });
452
+ }
453
+ /**
454
+ * Returns an object representing the Topic runtime info like subscription count.
455
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
456
+ *
457
+ * Following are errors that can be expected from this operation
458
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
459
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
460
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
461
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
462
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
463
+ * bad requests or requests resulting in conflicting operation on the server,
464
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
465
+ */
466
+ async getTopicRuntimeProperties(topicName, operationOptions = {}) {
467
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getTopicRuntimeProperties", operationOptions, async (updatedOptions) => {
468
+ logger.verbose(`Performing management operation - getTopicRuntimeProperties() for "${topicName}"`);
469
+ const response = await this.getResource(topicName, this.topicResourceSerializer, updatedOptions);
470
+ return this.buildTopicRuntimePropertiesResponse(response);
471
+ });
472
+ }
473
+ /**
474
+ * Returns a list of objects, each representing a Topic along with its properties.
475
+ * If you want to get the runtime info of the topics like subscription count, use `getTopicsRuntimeProperties` API instead.
476
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
477
+ *
478
+ * Following are errors that can be expected from this operation
479
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
480
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
481
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
482
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
483
+ * bad requests or requests resulting in conflicting operation on the server,
484
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
485
+ */
486
+ async getTopics(options = {}) {
487
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getTopics", options, async (updatedOptions) => {
488
+ logger.verbose(`Performing management operation - getTopics() with options: %j`, options);
489
+ const response = await this.listResources("$Resources/Topics", updatedOptions, this.topicResourceSerializer);
490
+ return this.buildListTopicsResponse(response);
491
+ });
492
+ }
493
+ async *listTopicsPage(marker, options = {}) {
494
+ let listResponse;
495
+ do {
496
+ listResponse = await this.getTopics({
497
+ skip: Number(marker),
498
+ maxCount: options.maxPageSize,
499
+ ...options,
500
+ });
501
+ marker = listResponse.continuationToken;
502
+ yield listResponse;
503
+ } while (marker);
504
+ }
505
+ async *listTopicsAll(options = {}) {
506
+ let marker;
507
+ for await (const segment of this.listTopicsPage(marker, options)) {
508
+ yield* segment;
509
+ }
510
+ }
511
+ /**
512
+ * Returns an async iterable iterator to list all the topics.
513
+ *
514
+ * .byPage() returns an async iterable iterator to list the topics in pages.
515
+ *
516
+ *
517
+ * @returns An asyncIterableIterator that supports paging.
518
+ */
519
+ listTopics(options) {
520
+ logger.verbose(`Performing management operation - listTopics() with options: %j`, options);
521
+ const iter = this.listTopicsAll(options);
522
+ return {
523
+ /**
524
+ */
525
+ next() {
526
+ return iter.next();
527
+ },
528
+ /**
529
+ */
530
+ [Symbol.asyncIterator]() {
531
+ return this;
532
+ },
533
+ /**
534
+ */
535
+ byPage: (settings = {}) => {
536
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
537
+ return this.listTopicsPage(settings.continuationToken, {
538
+ maxPageSize: settings.maxPageSize,
539
+ ...options,
540
+ });
541
+ },
542
+ };
543
+ }
544
+ /**
545
+ * Returns a list of objects, each representing a Topic's runtime info like subscription count.
546
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
547
+ *
548
+ * Following are errors that can be expected from this operation
549
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
550
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
551
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
552
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
553
+ * bad requests or requests resulting in conflicting operation on the server,
554
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
555
+ */
556
+ async getTopicsRuntimeProperties(options = {}) {
557
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getTopicsRuntimeProperties", options, async (updatedOptions) => {
558
+ logger.verbose(`Performing management operation - getTopicsRuntimeProperties() with options: %j`, options);
559
+ const response = await this.listResources("$Resources/Topics", updatedOptions, this.topicResourceSerializer);
560
+ return this.buildListTopicsRuntimePropertiesResponse(response);
561
+ });
562
+ }
563
+ async *listTopicsRuntimePropertiesPage(marker, options = {}) {
564
+ let listResponse;
565
+ do {
566
+ listResponse = await this.getTopicsRuntimeProperties({
567
+ skip: Number(marker),
568
+ maxCount: options.maxPageSize,
569
+ ...options,
570
+ });
571
+ marker = listResponse.continuationToken;
572
+ yield listResponse;
573
+ } while (marker);
574
+ }
575
+ async *listTopicsRuntimePropertiesAll(options = {}) {
576
+ let marker;
577
+ for await (const segment of this.listTopicsRuntimePropertiesPage(marker, options)) {
578
+ yield* segment;
579
+ }
580
+ }
581
+ /**
582
+ * Returns an async iterable iterator to list runtime info of the topics.
583
+ *
584
+ * .byPage() returns an async iterable iterator to list runtime info of the topics in pages.
585
+ *
586
+ *
587
+ * @returns An asyncIterableIterator that supports paging.
588
+ */
589
+ listTopicsRuntimeProperties(options) {
590
+ logger.verbose(`Performing management operation - listTopicsRuntimeProperties() with options: %j`, options);
591
+ const iter = this.listTopicsRuntimePropertiesAll(options);
592
+ return {
593
+ /**
594
+ * The next method, part of the iteration protocol
595
+ */
596
+ next() {
597
+ return iter.next();
598
+ },
599
+ /**
600
+ * The connection to the async iterator, part of the iteration protocol
601
+ */
602
+ [Symbol.asyncIterator]() {
603
+ return this;
604
+ },
605
+ /**
606
+ * Return an AsyncIterableIterator that works a page at a time
607
+ */
608
+ byPage: (settings = {}) => {
609
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
610
+ return this.listTopicsRuntimePropertiesPage(settings.continuationToken, {
611
+ maxPageSize: settings.maxPageSize,
612
+ ...options,
613
+ });
614
+ },
615
+ };
616
+ }
617
+ /**
618
+ * Updates the topic based on the topic properties provided.
619
+ * All topic properties must be set even though only a subset of them are actually updatable.
620
+ * Therefore, the suggested flow is to use the output from `getTopic()`, update the desired properties in it, and then pass the modified object to `updateTopic()`.
621
+ *
622
+ * The properties that cannot be updated are marked as readonly in the `TopicProperties` interface.
623
+ *
624
+ * @param topic - Object representing the properties of the topic and the raw response.
625
+ * `requiresDuplicateDetection`, `enablePartitioning`, and `name` can't be updated after creating the topic.
626
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
627
+ *
628
+ * Following are errors that can be expected from this operation
629
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
630
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
631
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
632
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
633
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
634
+ * bad requests or requests resulting in conflicting operation on the server,
635
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
636
+ */
637
+ async updateTopic(topic, operationOptions = {}) {
638
+ return tracingClient.withSpan("ServiceBusAdministrationClient.updateTopic", operationOptions, async (updatedOptions) => {
639
+ logger.verbose(`Performing management operation - updateTopic() for "${topic.name}" with options: %j`, topic);
640
+ if (!isJSONLikeObject(topic) || topic == null) {
641
+ throw new TypeError(`Parameter "topic" must be an object of type "TopicDescription" and cannot be undefined or null.`);
642
+ }
643
+ if (!topic.name) {
644
+ throw new TypeError(`"name" attribute of the parameter "topic" cannot be undefined.`);
645
+ }
646
+ const response = await this.putResource(topic.name, buildTopicOptions(topic), this.topicResourceSerializer, true, updatedOptions);
647
+ return this.buildTopicResponse(response);
648
+ });
649
+ }
650
+ /**
651
+ * Deletes a topic.
652
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
653
+ *
654
+ * Following are errors that can be expected from this operation
655
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
656
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
657
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
658
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
659
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
660
+ * bad requests or requests resulting in conflicting operation on the server,
661
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
662
+ */
663
+ async deleteTopic(topicName, operationOptions = {}) {
664
+ return tracingClient.withSpan("ServiceBusAdministrationClient.deleteTopic", operationOptions, async (updatedOptions) => {
665
+ logger.verbose(`Performing management operation - deleteTopic() for "${topicName}"`);
666
+ const response = await this.deleteResource(topicName, this.topicResourceSerializer, updatedOptions);
667
+ return { _response: getHttpResponseOnly(response) };
668
+ });
669
+ }
670
+ /**
671
+ * Checks whether a given topic exists or not.
672
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
673
+ */
674
+ async topicExists(topicName, operationOptions) {
675
+ logger.verbose(`Performing management operation - topicExists() for "${topicName}"`);
676
+ const { span, updatedOptions } = tracingClient.startSpan("ServiceBusAdministrationClient.topicExists", operationOptions);
677
+ try {
678
+ span.setStatus({ status: "success" });
679
+ await this.getTopic(topicName, updatedOptions);
680
+ return true;
681
+ }
682
+ catch (e) {
683
+ span.setStatus({ status: "error", error: e });
684
+ return false;
685
+ }
686
+ finally {
687
+ span.end();
688
+ }
689
+ }
690
+ /**
691
+ * Creates a subscription with given name, configured using the given options
692
+ * @param options - Options to configure the Subscription being created(For example, you can configure a Subscription to support partitions or sessions)
693
+ * and the operation options that can be used to abort, trace and control other configurations on the HTTP request.
694
+ *
695
+ * Following are errors that can be expected from this operation
696
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
697
+ * @throws `RestError` with code `MessageEntityAlreadyExistsError` when requested messaging entity already exists,
698
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
699
+ * @throws `RestError` with code `QuotaExceededError` when requested operation fails due to quote limits exceeding from service side,
700
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
701
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
702
+ * bad requests or requests resulting in conflicting operation on the server,
703
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
704
+ */
705
+ async createSubscription(topicName, subscriptionName, options = {}) {
706
+ return tracingClient.withSpan("ServiceBusAdministrationClient.createSubscription", options, async (updatedOptions) => {
707
+ logger.verbose(`Performing management operation - createSubscription() for "${subscriptionName}" with options: %j`, options);
708
+ const fullPath = this.getSubscriptionPath(topicName, subscriptionName);
709
+ const response = await this.putResource(fullPath, buildSubscriptionOptions(options || {}), this.subscriptionResourceSerializer, false, updatedOptions);
710
+ return this.buildSubscriptionResponse(response);
711
+ });
712
+ }
713
+ /**
714
+ * Returns an object representing the Subscription and its properties.
715
+ * If you want to get the Subscription runtime info like message count details, use `getSubscriptionRuntimeProperties` API.
716
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
717
+ *
718
+ * Following are errors that can be expected from this operation
719
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
720
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
721
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
722
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
723
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
724
+ * bad requests or requests resulting in conflicting operation on the server,
725
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
726
+ */
727
+ async getSubscription(topicName, subscriptionName, operationOptions = {}) {
728
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getSubscription", operationOptions, async (updatedOptions) => {
729
+ logger.verbose(`Performing management operation - getSubscription() for "${subscriptionName}"`);
730
+ const fullPath = this.getSubscriptionPath(topicName, subscriptionName);
731
+ const response = await this.getResource(fullPath, this.subscriptionResourceSerializer, updatedOptions);
732
+ return this.buildSubscriptionResponse(response);
733
+ });
734
+ }
735
+ /**
736
+ * Returns an object representing the Subscription runtime info like message count details.
737
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
738
+ *
739
+ * Following are errors that can be expected from this operation
740
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
741
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
742
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
743
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
744
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
745
+ * bad requests or requests resulting in conflicting operation on the server,
746
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
747
+ */
748
+ async getSubscriptionRuntimeProperties(topicName, subscriptionName, operationOptions = {}) {
749
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getSubscriptionRuntimeProperties", operationOptions, async (updatedOptions) => {
750
+ logger.verbose(`Performing management operation - getSubscriptionRuntimeProperties() for "${subscriptionName}"`);
751
+ const fullPath = this.getSubscriptionPath(topicName, subscriptionName);
752
+ const response = await this.getResource(fullPath, this.subscriptionResourceSerializer, updatedOptions);
753
+ return this.buildSubscriptionRuntimePropertiesResponse(response);
754
+ });
755
+ }
756
+ /**
757
+ * Returns a list of objects, each representing a Subscription along with its properties.
758
+ * If you want to get the runtime info of the subscriptions like message count, use `getSubscriptionsRuntimeProperties` API instead.
759
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
760
+ *
761
+ * Following are errors that can be expected from this operation
762
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
763
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
764
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
765
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
766
+ * bad requests or requests resulting in conflicting operation on the server,
767
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
768
+ */
769
+ async getSubscriptions(topicName, options = {}) {
770
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getSubscriptions", options, async (updatedOptions) => {
771
+ logger.verbose(`Performing management operation - getSubscriptions() with options: %j`, options);
772
+ const response = await this.listResources(topicName + "/Subscriptions/", updatedOptions, this.subscriptionResourceSerializer);
773
+ return this.buildListSubscriptionsResponse(response);
774
+ });
775
+ }
776
+ async *listSubscriptionsPage(topicName, marker, options = {}) {
777
+ let listResponse;
778
+ do {
779
+ listResponse = await this.getSubscriptions(topicName, {
780
+ skip: Number(marker),
781
+ maxCount: options.maxPageSize,
782
+ ...options,
783
+ });
784
+ marker = listResponse.continuationToken;
785
+ yield listResponse;
786
+ } while (marker);
787
+ }
788
+ async *listSubscriptionsAll(topicName, options = {}) {
789
+ let marker;
790
+ for await (const segment of this.listSubscriptionsPage(topicName, marker, options)) {
791
+ yield* segment;
792
+ }
793
+ }
794
+ /**
795
+ *
796
+ * Returns an async iterable iterator to list all the subscriptions
797
+ * under the specified topic.
798
+ *
799
+ * .byPage() returns an async iterable iterator to list the subscriptions in pages.
800
+ *
801
+ * @returns An asyncIterableIterator that supports paging.
802
+ */
803
+ listSubscriptions(topicName, options) {
804
+ logger.verbose(`Performing management operation - listSubscriptions() with options: %j`, options);
805
+ const iter = this.listSubscriptionsAll(topicName, options);
806
+ return {
807
+ /**
808
+ */
809
+ next() {
810
+ return iter.next();
811
+ },
812
+ /**
813
+ */
814
+ [Symbol.asyncIterator]() {
815
+ return this;
816
+ },
817
+ /**
818
+ */
819
+ byPage: (settings = {}) => {
820
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
821
+ return this.listSubscriptionsPage(topicName, settings.continuationToken, {
822
+ maxPageSize: settings.maxPageSize,
823
+ ...options,
824
+ });
825
+ },
826
+ };
827
+ }
828
+ /**
829
+ * Returns a list of objects, each representing a Subscription's runtime info like message count details.
830
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
831
+ *
832
+ * Following are errors that can be expected from this operation
833
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
834
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
835
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
836
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
837
+ * bad requests or requests resulting in conflicting operation on the server,
838
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
839
+ */
840
+ async getSubscriptionsRuntimeProperties(topicName, options = {}) {
841
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getSubscriptionsRuntimeProperties", options, async (updatedOptions) => {
842
+ logger.verbose(`Performing management operation - getSubscriptionsRuntimeProperties() with options: %j`, options);
843
+ const response = await this.listResources(topicName + "/Subscriptions/", updatedOptions, this.subscriptionResourceSerializer);
844
+ return this.buildListSubscriptionsRuntimePropertiesResponse(response);
845
+ });
846
+ }
847
+ async *listSubscriptionsRuntimePropertiesPage(topicName, marker, options = {}) {
848
+ let listResponse;
849
+ do {
850
+ listResponse = await this.getSubscriptionsRuntimeProperties(topicName, {
851
+ skip: Number(marker),
852
+ maxCount: options.maxPageSize,
853
+ ...options,
854
+ });
855
+ marker = listResponse.continuationToken;
856
+ yield listResponse;
857
+ } while (marker);
858
+ }
859
+ async *listSubscriptionsRuntimePropertiesAll(topicName, options = {}) {
860
+ let marker;
861
+ for await (const segment of this.listSubscriptionsRuntimePropertiesPage(topicName, marker, options)) {
862
+ yield* segment;
863
+ }
864
+ }
865
+ /**
866
+ * Returns an async iterable iterator to list runtime info of the subscriptions
867
+ * under the specified topic.
868
+ *
869
+ * .byPage() returns an async iterable iterator to list runtime info of subscriptions in pages.
870
+ *
871
+ * @returns An asyncIterableIterator that supports paging.
872
+ */
873
+ listSubscriptionsRuntimeProperties(topicName, options) {
874
+ logger.verbose(`Performing management operation - listSubscriptionsRuntimeProperties() with options: %j`, options);
875
+ const iter = this.listSubscriptionsRuntimePropertiesAll(topicName, options);
876
+ return {
877
+ /**
878
+ */
879
+ next() {
880
+ return iter.next();
881
+ },
882
+ /**
883
+ */
884
+ [Symbol.asyncIterator]() {
885
+ return this;
886
+ },
887
+ /**
888
+ */
889
+ byPage: (settings = {}) => {
890
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
891
+ return this.listSubscriptionsRuntimePropertiesPage(topicName, settings.continuationToken, {
892
+ maxPageSize: settings.maxPageSize,
893
+ ...options,
894
+ });
895
+ },
896
+ };
897
+ }
898
+ /**
899
+ * Updates the subscription based on the subscription properties provided.
900
+ * All subscription properties must be set even though only a subset of them are actually updatable.
901
+ * Therefore, the suggested flow is to use the output from `getSubscription()`, update the desired properties in it, and then pass the modified object to `updateSubscription()`.
902
+ *
903
+ * The properties that cannot be updated are marked as readonly in the `SubscriptionProperties` interface.
904
+ * @param subscription - Object representing the properties of the subscription and the raw response.
905
+ * `subscriptionName`, `topicName`, and `requiresSession` can't be updated after creating the subscription.
906
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
907
+ *
908
+ * Following are errors that can be expected from this operation
909
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
910
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
911
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
912
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
913
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
914
+ * bad requests or requests resulting in conflicting operation on the server,
915
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
916
+ */
917
+ async updateSubscription(subscription, operationOptions = {}) {
918
+ return tracingClient.withSpan("ServiceBusAdministrationClient.updateSubscription", operationOptions, async (updatedOptions) => {
919
+ logger.verbose(`Performing management operation - updateSubscription() for "${subscription.subscriptionName}" with options: %j`, subscription);
920
+ if (!isJSONLikeObject(subscription) || subscription == null) {
921
+ throw new TypeError(`Parameter "subscription" must be an object of type "SubscriptionDescription" and cannot be undefined or null.`);
922
+ }
923
+ if (!subscription.topicName || !subscription.subscriptionName) {
924
+ throw new TypeError(`The attributes "topicName" and "subscriptionName" of the parameter "subscription" cannot be undefined.`);
925
+ }
926
+ const fullPath = this.getSubscriptionPath(subscription.topicName, subscription.subscriptionName);
927
+ const response = await this.putResource(fullPath, buildSubscriptionOptions(subscription), this.subscriptionResourceSerializer, true, updatedOptions);
928
+ return this.buildSubscriptionResponse(response);
929
+ });
930
+ }
931
+ /**
932
+ * Deletes a subscription.
933
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
934
+ *
935
+ * Following are errors that can be expected from this operation
936
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
937
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
938
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
939
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
940
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
941
+ * bad requests or requests resulting in conflicting operation on the server,
942
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
943
+ */
944
+ async deleteSubscription(topicName, subscriptionName, operationOptions = {}) {
945
+ return tracingClient.withSpan("ServiceBusAdministrationClient.deleteSubscription", operationOptions, async (updatedOptions) => {
946
+ logger.verbose(`Performing management operation - deleteSubscription() for "${subscriptionName}"`);
947
+ const fullPath = this.getSubscriptionPath(topicName, subscriptionName);
948
+ const response = await this.deleteResource(fullPath, this.subscriptionResourceSerializer, updatedOptions);
949
+ return { _response: getHttpResponseOnly(response) };
950
+ });
951
+ }
952
+ /**
953
+ * Checks whether a given subscription exists in the topic or not.
954
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
955
+ */
956
+ async subscriptionExists(topicName, subscriptionName, operationOptions = {}) {
957
+ logger.verbose(`Performing management operation - subscriptionExists() for "${topicName}" and "${subscriptionName}"`);
958
+ const { span, updatedOptions } = tracingClient.startSpan("ServiceBusAdministrationClient.subscriptionExists", operationOptions);
959
+ try {
960
+ span.setStatus({ status: "success" });
961
+ await this.getSubscription(topicName, subscriptionName, updatedOptions);
962
+ return true;
963
+ }
964
+ catch (e) {
965
+ span.setStatus({ status: "error", error: e });
966
+ return false;
967
+ }
968
+ finally {
969
+ span.end();
970
+ }
971
+ }
972
+ async createRule(topicName, subscriptionName, ruleName, ruleFilter, ruleActionOrOperationOptions, operationOptions) {
973
+ let ruleAction = undefined;
974
+ let operOptions;
975
+ if (ruleActionOrOperationOptions) {
976
+ if (isSqlRuleAction(ruleActionOrOperationOptions)) {
977
+ // Overload#2 - where the sqlExpression in the ruleAction is defined
978
+ ruleAction = ruleActionOrOperationOptions;
979
+ operOptions = operationOptions;
980
+ }
981
+ else {
982
+ // Overload#1
983
+ // Overload#2 - where the sqlExpression in the ruleAction is undefined
984
+ operOptions = { ...ruleActionOrOperationOptions, ...operationOptions };
985
+ }
986
+ }
987
+ return tracingClient.withSpan("ServiceBusAdministrationClient.createRule", operOptions ?? {}, async (updatedOptions) => {
988
+ logger.verbose(`Performing management operation - createRule() for "${ruleName}" with filter: "%j"`, ruleFilter);
989
+ const fullPath = this.getRulePath(topicName, subscriptionName, ruleName);
990
+ const response = await this.putResource(fullPath, { name: ruleName, filter: ruleFilter, action: ruleAction }, this.ruleResourceSerializer, false, updatedOptions);
991
+ return this.buildRuleResponse(response);
992
+ });
993
+ }
994
+ /**
995
+ * Returns an object representing the Rule with the given name along with all its properties.
996
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
997
+ *
998
+ * Following are errors that can be expected from this operation
999
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
1000
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
1001
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
1002
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
1003
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
1004
+ * bad requests or requests resulting in conflicting operation on the server,
1005
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
1006
+ */
1007
+ async getRule(topicName, subscriptionName, ruleName, operationOptions = {}) {
1008
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getRule", operationOptions, async (updatedOptions) => {
1009
+ logger.verbose(`Performing management operation - getRule() for "${ruleName}"`);
1010
+ const fullPath = this.getRulePath(topicName, subscriptionName, ruleName);
1011
+ const response = await this.getResource(fullPath, this.ruleResourceSerializer, updatedOptions);
1012
+ return this.buildRuleResponse(response);
1013
+ });
1014
+ }
1015
+ /**
1016
+ * Lists existing rules.
1017
+ * @param options - The options include the maxCount and the count of entities to skip, the operation options that can be used to abort, trace and control other configurations on the HTTP request.
1018
+ *
1019
+ * Following are errors that can be expected from this operation
1020
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
1021
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
1022
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
1023
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
1024
+ * bad requests or requests resulting in conflicting operation on the server,
1025
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
1026
+ */
1027
+ async getRules(topicName, subscriptionName, options = {}) {
1028
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getRules", options, async (updatedOptions) => {
1029
+ logger.verbose(`Performing management operation - getRules() with options: %j`, options);
1030
+ const fullPath = this.getSubscriptionPath(topicName, subscriptionName) + "/Rules/";
1031
+ const response = await this.listResources(fullPath, updatedOptions, this.ruleResourceSerializer);
1032
+ return this.buildListRulesResponse(response);
1033
+ });
1034
+ }
1035
+ async *listRulesPage(topicName, subscriptionName, marker, options = {}) {
1036
+ let listResponse;
1037
+ do {
1038
+ listResponse = await this.getRules(topicName, subscriptionName, {
1039
+ skip: Number(marker),
1040
+ maxCount: options.maxPageSize,
1041
+ ...options,
1042
+ });
1043
+ marker = listResponse.continuationToken;
1044
+ yield listResponse;
1045
+ } while (marker);
1046
+ }
1047
+ async *listRulesAll(topicName, subscriptionName, options = {}) {
1048
+ let marker;
1049
+ for await (const segment of this.listRulesPage(topicName, subscriptionName, marker, options)) {
1050
+ yield* segment;
1051
+ }
1052
+ }
1053
+ /**
1054
+ * Returns an async iterable iterator to list all the rules
1055
+ * under the specified subscription.
1056
+ *
1057
+ * .byPage() returns an async iterable iterator to list the rules in pages.
1058
+ *
1059
+ * @returns An asyncIterableIterator that supports paging.
1060
+ */
1061
+ listRules(topicName, subscriptionName, options) {
1062
+ logger.verbose(`Performing management operation - listRules() with options: %j`, options);
1063
+ const iter = this.listRulesAll(topicName, subscriptionName, options);
1064
+ return {
1065
+ /**
1066
+ */
1067
+ next() {
1068
+ return iter.next();
1069
+ },
1070
+ /**
1071
+ */
1072
+ [Symbol.asyncIterator]() {
1073
+ return this;
1074
+ },
1075
+ /**
1076
+ */
1077
+ byPage: (settings = {}) => {
1078
+ this.throwIfInvalidContinuationToken(settings.continuationToken);
1079
+ return this.listRulesPage(topicName, subscriptionName, settings.continuationToken, {
1080
+ maxPageSize: settings.maxPageSize,
1081
+ ...options,
1082
+ });
1083
+ },
1084
+ };
1085
+ }
1086
+ /**
1087
+ * Updates properties on the Rule by the given name based on the given options.
1088
+ * All rule properties must be set even if one of them is being updated.
1089
+ * Therefore, the suggested flow is to use the output from `getRule()`, update the desired properties in it, and then pass the modified object to `updateRule()`.
1090
+ *
1091
+ * @param rule - Options to configure the Rule being updated and the raw response.
1092
+ * For example, you can configure the filter to apply on associated Topic/Subscription.
1093
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
1094
+ *
1095
+ * Following are errors that can be expected from this operation
1096
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
1097
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
1098
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
1099
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
1100
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
1101
+ * bad requests or requests resulting in conflicting operation on the server,
1102
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
1103
+ */
1104
+ async updateRule(topicName, subscriptionName, rule, operationOptions) {
1105
+ return tracingClient.withSpan("ServiceBusAdministrationClient.updateRule", operationOptions ?? {}, async (updatedOptions) => {
1106
+ logger.verbose(`Performing management operation - updateRule() for "${rule.name}" with options: %j`, rule);
1107
+ if (!isJSONLikeObject(rule) || rule === null) {
1108
+ throw new TypeError(`Parameter "rule" must be an object of type "RuleDescription" and cannot be undefined or null.`);
1109
+ }
1110
+ if (!rule.name) {
1111
+ throw new TypeError(`"name" attribute of the parameter "rule" cannot be undefined.`);
1112
+ }
1113
+ const fullPath = this.getRulePath(topicName, subscriptionName, rule.name);
1114
+ const response = await this.putResource(fullPath, rule, this.ruleResourceSerializer, true, updatedOptions);
1115
+ return this.buildRuleResponse(response);
1116
+ });
1117
+ }
1118
+ /**
1119
+ * Deletes a rule.
1120
+ * @param operationOptions - The options that can be used to abort, trace and control other configurations on the HTTP request.
1121
+ *
1122
+ * Following are errors that can be expected from this operation
1123
+ * @throws `RestError` with code `UnauthorizedRequestError` when given request fails due to authorization problems,
1124
+ * @throws `RestError` with code `MessageEntityNotFoundError` when requested messaging entity does not exist,
1125
+ * @throws `RestError` with code `InvalidOperationError` when requested operation is invalid and we encounter a 403 HTTP status code,
1126
+ * @throws `RestError` with code `ServerBusyError` when the request fails due to server being busy,
1127
+ * @throws `RestError` with code `ServiceError` when receiving unrecognized HTTP status or for a scenarios such as
1128
+ * bad requests or requests resulting in conflicting operation on the server,
1129
+ * @throws `RestError` with code and statusCode representing the standard set of REST API errors.
1130
+ */
1131
+ async deleteRule(topicName, subscriptionName, ruleName, operationOptions) {
1132
+ return tracingClient.withSpan("ServiceBusAdministrationClient.deleteRule", operationOptions ?? {}, async (updatedOptions) => {
1133
+ logger.verbose(`Performing management operation - deleteRule() for "${ruleName}"`);
1134
+ const fullPath = this.getRulePath(topicName, subscriptionName, ruleName);
1135
+ const response = await this.deleteResource(fullPath, this.ruleResourceSerializer, updatedOptions);
1136
+ return { _response: getHttpResponseOnly(response) };
1137
+ });
1138
+ }
1139
+ /**
1140
+ * Checks whether a given rule exists or not.
1141
+ *
1142
+ */
1143
+ async ruleExists(topicName, subscriptionName, ruleName, operationOptions = {}) {
1144
+ logger.verbose(`Performing management operation - ruleExists() for "${ruleName}"`);
1145
+ const { span, updatedOptions } = tracingClient.startSpan("ServiceBusAdministrationClient.ruleExists", operationOptions);
1146
+ try {
1147
+ span.setStatus({ status: "success" });
1148
+ await this.getRule(topicName, subscriptionName, ruleName, updatedOptions);
1149
+ return true;
1150
+ }
1151
+ catch (e) {
1152
+ span.setStatus({ status: "error", error: e });
1153
+ return false;
1154
+ }
1155
+ finally {
1156
+ span.end();
1157
+ }
1158
+ }
1159
+ /**
1160
+ * Creates or updates a resource based on `isUpdate` parameter.
1161
+ */
1162
+ async putResource(name, entityFields, serializer, isUpdate = false, operationOptions = {}) {
1163
+ return tracingClient.withSpan("ServiceBusAdministrationClient.putResource", operationOptions, async (updatedOptions) => {
1164
+ const request = createPipelineRequest({
1165
+ url: this.getUrl(name),
1166
+ method: "PUT",
1167
+ allowInsecureConnection: !this.useTls,
1168
+ });
1169
+ if (isUpdate) {
1170
+ request.headers.set("If-Match", "*");
1171
+ }
1172
+ const queueOrSubscriptionFields = entityFields;
1173
+ if (queueOrSubscriptionFields.ForwardTo ||
1174
+ queueOrSubscriptionFields.ForwardDeadLetteredMessagesTo) {
1175
+ const token = this.credentials instanceof SasServiceClientCredentials
1176
+ ? (await this.credentials.getToken(this.endpoint)).token
1177
+ : (await this.credentials.getToken([AMQPConstants.aadServiceBusScope])).token;
1178
+ if (queueOrSubscriptionFields.ForwardTo) {
1179
+ request.headers.set("ServiceBusSupplementaryAuthorization", token);
1180
+ if (!isAbsoluteUrl(queueOrSubscriptionFields.ForwardTo)) {
1181
+ queueOrSubscriptionFields.ForwardTo = this.endpointWithProtocol.concat(queueOrSubscriptionFields.ForwardTo);
1182
+ }
1183
+ }
1184
+ if (queueOrSubscriptionFields.ForwardDeadLetteredMessagesTo) {
1185
+ request.headers.set("ServiceBusDlqSupplementaryAuthorization", token);
1186
+ if (!isAbsoluteUrl(queueOrSubscriptionFields.ForwardDeadLetteredMessagesTo)) {
1187
+ queueOrSubscriptionFields.ForwardDeadLetteredMessagesTo =
1188
+ this.endpointWithProtocol.concat(queueOrSubscriptionFields.ForwardDeadLetteredMessagesTo);
1189
+ }
1190
+ }
1191
+ }
1192
+ request.headers.set("content-type", "application/atom+xml;type=entry;charset=utf-8");
1193
+ return executeAtomXmlOperation(this, request, serializer, updatedOptions, entityFields);
1194
+ });
1195
+ }
1196
+ /**
1197
+ * Gets a resource.
1198
+ */
1199
+ async getResource(name, serializer, operationOptions = {}) {
1200
+ return tracingClient.withSpan("ServiceBusAdministrationClient.getResource", operationOptions, async (updatedOptions) => {
1201
+ const request = createPipelineRequest({
1202
+ url: this.getUrl(name),
1203
+ method: "GET",
1204
+ allowInsecureConnection: !this.useTls,
1205
+ });
1206
+ const response = await executeAtomXmlOperation(this, request, serializer, updatedOptions);
1207
+ if (!isDefined(response.parsedBody) ||
1208
+ (Array.isArray(response.parsedBody) && response.parsedBody.length === 0)) {
1209
+ const err = new RestError(`The messaging entity "${name}" being requested cannot be found.`, {
1210
+ code: "MessageEntityNotFoundError",
1211
+ statusCode: response.status,
1212
+ request,
1213
+ response,
1214
+ });
1215
+ throw err;
1216
+ }
1217
+ return response;
1218
+ });
1219
+ }
1220
+ /**
1221
+ * Lists existing resources
1222
+ */
1223
+ async listResources(name, options = {}, serializer) {
1224
+ return tracingClient.withSpan("ServiceBusAdministrationClient.listResources", options, async (updatedOptions) => {
1225
+ const queryParams = {};
1226
+ if (options) {
1227
+ if (options.skip) {
1228
+ queryParams["$skip"] = options.skip.toString();
1229
+ }
1230
+ if (options.maxCount) {
1231
+ queryParams["$top"] = options.maxCount.toString();
1232
+ }
1233
+ }
1234
+ const request = createPipelineRequest({
1235
+ url: this.getUrl(name, queryParams),
1236
+ method: "GET",
1237
+ allowInsecureConnection: !this.useTls,
1238
+ });
1239
+ return executeAtomXmlOperation(this, request, serializer, updatedOptions);
1240
+ });
1241
+ }
1242
+ /**
1243
+ * Deletes a resource.
1244
+ */
1245
+ async deleteResource(name, serializer, operationOptions = {}) {
1246
+ return tracingClient.withSpan("ServiceBusAdministrationClient.deleteResource", operationOptions, async (updatedOptions) => {
1247
+ const request = createPipelineRequest({
1248
+ url: this.getUrl(name),
1249
+ method: "DELETE",
1250
+ allowInsecureConnection: !this.useTls,
1251
+ });
1252
+ return executeAtomXmlOperation(this, request, serializer, updatedOptions);
1253
+ });
1254
+ }
1255
+ getUrl(path, queryParams) {
1256
+ const baseUri = `${this.useTls ? "https" : "http"}://${this.endpoint}/${path}`;
1257
+ const requestUrl = new URL(baseUri);
1258
+ requestUrl.searchParams.set(Constants.API_VERSION_QUERY_KEY, this.serviceVersion);
1259
+ if (queryParams) {
1260
+ for (const key of Object.keys(queryParams)) {
1261
+ requestUrl.searchParams.set(key, queryParams[key]);
1262
+ }
1263
+ }
1264
+ return requestUrl.toString();
1265
+ }
1266
+ getSubscriptionPath(topicName, subscriptionName) {
1267
+ return topicName + "/Subscriptions/" + subscriptionName;
1268
+ }
1269
+ getRulePath(topicName, subscriptionName, ruleName) {
1270
+ return topicName + "/Subscriptions/" + subscriptionName + "/Rules/" + ruleName;
1271
+ }
1272
+ getMarkerFromNextLinkUrl(url) {
1273
+ if (!url) {
1274
+ return undefined;
1275
+ }
1276
+ try {
1277
+ const value = parseURL(url).searchParams.get(Constants.XML_METADATA_MARKER + "skip");
1278
+ return value !== null ? value : undefined;
1279
+ }
1280
+ catch (error) {
1281
+ throw new Error(`Unable to parse the '${Constants.XML_METADATA_MARKER}skip' from the next-link in the response ` +
1282
+ error);
1283
+ }
1284
+ }
1285
+ buildNamespacePropertiesResponse(response) {
1286
+ try {
1287
+ const namespace = buildNamespace(response.parsedBody);
1288
+ const namespaceResponse = Object.defineProperty(namespace || {}, "_response", { value: getHttpResponseOnly(response) });
1289
+ return namespaceResponse;
1290
+ }
1291
+ catch (err) {
1292
+ logger.logError(err, "Failure parsing response from service");
1293
+ throw new RestError(`Error occurred while parsing the response body - cannot form a namespace object using the response from the service.`, {
1294
+ code: RestError.PARSE_ERROR,
1295
+ statusCode: response.status,
1296
+ request: response.request,
1297
+ response,
1298
+ });
1299
+ }
1300
+ }
1301
+ buildListQueuesResponse(response) {
1302
+ try {
1303
+ const queues = [];
1304
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1305
+ if (!Array.isArray(response.parsedBody)) {
1306
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1307
+ }
1308
+ const rawQueueArray = response.parsedBody;
1309
+ for (let i = 0; i < rawQueueArray.length; i++) {
1310
+ const queue = buildQueue(rawQueueArray[i]);
1311
+ if (queue) {
1312
+ queues.push(queue);
1313
+ }
1314
+ }
1315
+ const listQueuesResponse = Object.defineProperty(queues, "_response", {
1316
+ value: getHttpResponseOnly(response),
1317
+ });
1318
+ listQueuesResponse.continuationToken = nextMarker;
1319
+ return listQueuesResponse;
1320
+ }
1321
+ catch (err) {
1322
+ logger.logError(err, "Failure parsing response from service");
1323
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of queues using the response from the service.`, {
1324
+ code: RestError.PARSE_ERROR,
1325
+ statusCode: response.status,
1326
+ request: response.request,
1327
+ response,
1328
+ });
1329
+ }
1330
+ }
1331
+ buildListQueuesRuntimePropertiesResponse(response) {
1332
+ try {
1333
+ const queues = [];
1334
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1335
+ if (!Array.isArray(response.parsedBody)) {
1336
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1337
+ }
1338
+ const rawQueueArray = response.parsedBody;
1339
+ for (let i = 0; i < rawQueueArray.length; i++) {
1340
+ const queue = buildQueueRuntimeProperties(rawQueueArray[i]);
1341
+ if (queue) {
1342
+ queues.push(queue);
1343
+ }
1344
+ }
1345
+ const listQueuesResponse = Object.defineProperty(queues, "_response", {
1346
+ value: getHttpResponseOnly(response),
1347
+ });
1348
+ listQueuesResponse.continuationToken = nextMarker;
1349
+ return listQueuesResponse;
1350
+ }
1351
+ catch (err) {
1352
+ logger.logError(err, "Failure parsing response from service");
1353
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of queues using the response from the service.`, {
1354
+ code: RestError.PARSE_ERROR,
1355
+ statusCode: response.status,
1356
+ request: response.request,
1357
+ response,
1358
+ });
1359
+ }
1360
+ }
1361
+ buildQueueResponse(response) {
1362
+ try {
1363
+ const queue = buildQueue(response.parsedBody);
1364
+ const queueResponse = Object.defineProperty(queue || {}, "_response", {
1365
+ value: getHttpResponseOnly(response),
1366
+ });
1367
+ return queueResponse;
1368
+ }
1369
+ catch (err) {
1370
+ logger.logError(err, "Failure parsing response from service");
1371
+ throw new RestError(`Error occurred while parsing the response body - cannot form a queue object using the response from the service.`, {
1372
+ code: RestError.PARSE_ERROR,
1373
+ statusCode: response.status,
1374
+ request: response.request,
1375
+ response,
1376
+ });
1377
+ }
1378
+ }
1379
+ buildQueueRuntimePropertiesResponse(response) {
1380
+ try {
1381
+ const queue = buildQueueRuntimeProperties(response.parsedBody);
1382
+ const queueResponse = Object.defineProperty(queue || {}, "_response", {
1383
+ value: getHttpResponseOnly(response),
1384
+ });
1385
+ return queueResponse;
1386
+ }
1387
+ catch (err) {
1388
+ logger.logError(err, "Failure parsing response from service");
1389
+ throw new RestError(`Error occurred while parsing the response body - cannot form a queue object using the response from the service.`, {
1390
+ code: RestError.PARSE_ERROR,
1391
+ statusCode: response.status,
1392
+ request: response.request,
1393
+ response,
1394
+ });
1395
+ }
1396
+ }
1397
+ buildListTopicsResponse(response) {
1398
+ try {
1399
+ const topics = [];
1400
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1401
+ if (!Array.isArray(response.parsedBody)) {
1402
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1403
+ }
1404
+ const rawTopicArray = response.parsedBody;
1405
+ for (let i = 0; i < rawTopicArray.length; i++) {
1406
+ const topic = buildTopic(rawTopicArray[i]);
1407
+ if (topic) {
1408
+ topics.push(topic);
1409
+ }
1410
+ }
1411
+ const listTopicsResponse = Object.defineProperty(topics, "_response", {
1412
+ value: getHttpResponseOnly(response),
1413
+ });
1414
+ listTopicsResponse.continuationToken = nextMarker;
1415
+ return listTopicsResponse;
1416
+ }
1417
+ catch (err) {
1418
+ logger.logError(err, "Failure parsing response from service");
1419
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of topics using the response from the service.`, {
1420
+ code: RestError.PARSE_ERROR,
1421
+ statusCode: response.status,
1422
+ request: response.request,
1423
+ response,
1424
+ });
1425
+ }
1426
+ }
1427
+ buildListTopicsRuntimePropertiesResponse(response) {
1428
+ try {
1429
+ const topics = [];
1430
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1431
+ if (!Array.isArray(response.parsedBody)) {
1432
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1433
+ }
1434
+ const rawTopicArray = response.parsedBody;
1435
+ for (let i = 0; i < rawTopicArray.length; i++) {
1436
+ const topic = buildTopicRuntimeProperties(rawTopicArray[i]);
1437
+ if (topic) {
1438
+ topics.push(topic);
1439
+ }
1440
+ }
1441
+ const listTopicsResponse = Object.defineProperty(topics, "_response", {
1442
+ value: getHttpResponseOnly(response),
1443
+ });
1444
+ listTopicsResponse.continuationToken = nextMarker;
1445
+ return listTopicsResponse;
1446
+ }
1447
+ catch (err) {
1448
+ logger.logError(err, "Failure parsing response from service");
1449
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of topics using the response from the service.`, {
1450
+ code: RestError.PARSE_ERROR,
1451
+ statusCode: response.status,
1452
+ request: response.request,
1453
+ response,
1454
+ });
1455
+ }
1456
+ }
1457
+ buildTopicResponse(response) {
1458
+ try {
1459
+ const topic = buildTopic(response.parsedBody);
1460
+ const topicResponse = Object.defineProperty(topic || {}, "_response", {
1461
+ value: getHttpResponseOnly(response),
1462
+ });
1463
+ return topicResponse;
1464
+ }
1465
+ catch (err) {
1466
+ logger.logError(err, "Failure parsing response from service");
1467
+ throw new RestError(`Error occurred while parsing the response body - cannot form a topic object using the response from the service.`, {
1468
+ code: RestError.PARSE_ERROR,
1469
+ statusCode: response.status,
1470
+ request: response.request,
1471
+ response,
1472
+ });
1473
+ }
1474
+ }
1475
+ buildTopicRuntimePropertiesResponse(response) {
1476
+ try {
1477
+ const topic = buildTopicRuntimeProperties(response.parsedBody);
1478
+ const topicResponse = Object.defineProperty(topic || {}, "_response", {
1479
+ value: getHttpResponseOnly(response),
1480
+ });
1481
+ return topicResponse;
1482
+ }
1483
+ catch (err) {
1484
+ logger.logError(err, "Failure parsing response from service");
1485
+ throw new RestError(`Error occurred while parsing the response body - cannot form a topic object using the response from the service.`, {
1486
+ code: RestError.PARSE_ERROR,
1487
+ statusCode: response.status,
1488
+ request: response.request,
1489
+ response,
1490
+ });
1491
+ }
1492
+ }
1493
+ buildListSubscriptionsResponse(response) {
1494
+ try {
1495
+ const subscriptions = [];
1496
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1497
+ if (!Array.isArray(response.parsedBody)) {
1498
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1499
+ }
1500
+ const rawSubscriptionArray = response.parsedBody;
1501
+ for (let i = 0; i < rawSubscriptionArray.length; i++) {
1502
+ const subscription = buildSubscription(rawSubscriptionArray[i]);
1503
+ if (subscription) {
1504
+ subscriptions.push(subscription);
1505
+ }
1506
+ }
1507
+ const listSubscriptionsResponse = Object.defineProperty(subscriptions, "_response", {
1508
+ value: getHttpResponseOnly(response),
1509
+ });
1510
+ listSubscriptionsResponse.continuationToken = nextMarker;
1511
+ return listSubscriptionsResponse;
1512
+ }
1513
+ catch (err) {
1514
+ logger.logError(err, "Failure parsing response from service");
1515
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of subscriptions using the response from the service.`, {
1516
+ code: RestError.PARSE_ERROR,
1517
+ statusCode: response.status,
1518
+ request: response.request,
1519
+ response,
1520
+ });
1521
+ }
1522
+ }
1523
+ buildListSubscriptionsRuntimePropertiesResponse(response) {
1524
+ try {
1525
+ const subscriptions = [];
1526
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1527
+ if (!Array.isArray(response.parsedBody)) {
1528
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1529
+ }
1530
+ const rawSubscriptionArray = response.parsedBody;
1531
+ for (let i = 0; i < rawSubscriptionArray.length; i++) {
1532
+ const subscription = buildSubscriptionRuntimeProperties(rawSubscriptionArray[i]);
1533
+ if (subscription) {
1534
+ subscriptions.push(subscription);
1535
+ }
1536
+ }
1537
+ const listSubscriptionsResponse = Object.defineProperty(subscriptions, "_response", {
1538
+ value: getHttpResponseOnly(response),
1539
+ });
1540
+ listSubscriptionsResponse.continuationToken = nextMarker;
1541
+ return listSubscriptionsResponse;
1542
+ }
1543
+ catch (err) {
1544
+ logger.logError(err, "Failure parsing response from service");
1545
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of subscriptions using the response from the service.`, {
1546
+ code: RestError.PARSE_ERROR,
1547
+ statusCode: response.status,
1548
+ request: response.request,
1549
+ response,
1550
+ });
1551
+ }
1552
+ }
1553
+ buildSubscriptionResponse(response) {
1554
+ try {
1555
+ const subscription = buildSubscription(response.parsedBody);
1556
+ const subscriptionResponse = Object.defineProperty(subscription || {}, "_response", {
1557
+ value: getHttpResponseOnly(response),
1558
+ });
1559
+ return subscriptionResponse;
1560
+ }
1561
+ catch (err) {
1562
+ logger.logError(err, "Failure parsing response from service");
1563
+ throw new RestError(`Error occurred while parsing the response body - cannot form a subscription object using the response from the service.`, {
1564
+ code: RestError.PARSE_ERROR,
1565
+ statusCode: response.status,
1566
+ request: response.request,
1567
+ response,
1568
+ });
1569
+ }
1570
+ }
1571
+ buildSubscriptionRuntimePropertiesResponse(response) {
1572
+ try {
1573
+ const subscription = buildSubscriptionRuntimeProperties(response.parsedBody);
1574
+ const subscriptionResponse = Object.defineProperty(subscription || {}, "_response", {
1575
+ value: getHttpResponseOnly(response),
1576
+ });
1577
+ return subscriptionResponse;
1578
+ }
1579
+ catch (err) {
1580
+ logger.logError(err, "Failure parsing response from service");
1581
+ throw new RestError(`Error occurred while parsing the response body - cannot form a subscription object using the response from the service.`, {
1582
+ code: RestError.PARSE_ERROR,
1583
+ statusCode: response.status,
1584
+ request: response.request,
1585
+ response,
1586
+ });
1587
+ }
1588
+ }
1589
+ buildListRulesResponse(response) {
1590
+ try {
1591
+ const rules = [];
1592
+ const nextMarker = this.getMarkerFromNextLinkUrl(response.parsedBody.nextLink);
1593
+ if (!Array.isArray(response.parsedBody)) {
1594
+ throw new TypeError(`${response.parsedBody} was expected to be of type Array`);
1595
+ }
1596
+ const rawRuleArray = response.parsedBody;
1597
+ for (let i = 0; i < rawRuleArray.length; i++) {
1598
+ const rule = buildRule(rawRuleArray[i]);
1599
+ if (rule) {
1600
+ rules.push(rule);
1601
+ }
1602
+ }
1603
+ const listRulesResponse = Object.defineProperty(rules, "_response", {
1604
+ value: getHttpResponseOnly(response),
1605
+ });
1606
+ listRulesResponse.continuationToken = nextMarker;
1607
+ return listRulesResponse;
1608
+ }
1609
+ catch (err) {
1610
+ logger.logError(err, "Failure parsing response from service");
1611
+ throw new RestError(`Error occurred while parsing the response body - cannot form a list of rules using the response from the service.`, {
1612
+ code: RestError.PARSE_ERROR,
1613
+ statusCode: response.status,
1614
+ request: response.request,
1615
+ response,
1616
+ });
1617
+ }
1618
+ }
1619
+ buildRuleResponse(response) {
1620
+ try {
1621
+ const rule = buildRule(response.parsedBody);
1622
+ const ruleResponse = Object.defineProperty(rule || {}, "_response", {
1623
+ value: getHttpResponseOnly(response),
1624
+ });
1625
+ return ruleResponse;
1626
+ }
1627
+ catch (err) {
1628
+ logger.logError(err, "Failure parsing response from service");
1629
+ throw new RestError(`Error occurred while parsing the response body - cannot form a rule object using the response from the service.`, {
1630
+ code: RestError.PARSE_ERROR,
1631
+ statusCode: response.status,
1632
+ request: response.request,
1633
+ response,
1634
+ });
1635
+ }
1636
+ }
1637
+ throwIfInvalidContinuationToken(token) {
1638
+ if (!(token === undefined || (typeof token === "string" && Number(token) >= 0))) {
1639
+ throw new Error(`Invalid continuationToken ${token} provided`);
1640
+ }
1641
+ }
1642
+ }
1643
+ //# sourceMappingURL=serviceBusAtomManagementClient.js.map