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

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