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

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