@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
@@ -1 +0,0 @@
1
- {"version":3,"file":"serviceBusMessage.js","sourceRoot":"","sources":["../../src/serviceBusMessage.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,oBAAoB,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AC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AmqpAnnotatedMessage, Constants } from \"@azure/core-amqp\";\nimport { Buffer } from \"buffer\";\nimport Long from \"long\";\nimport {\n Delivery,\n DeliveryAnnotations,\n MessageAnnotations,\n uuid_to_string,\n Message as RheaMessage,\n} from \"rhea-promise\";\nimport { defaultDataTransformer } from \"./dataTransformer\";\nimport { messageLogger as logger } from \"./log\";\nimport { ReceiveMode } from \"./models\";\nimport { isDefined, isObjectWithProperties } from \"@azure/core-util\";\nimport { reorderLockToken } from \"./util/utils\";\n\n/**\n * @internal\n */\nexport enum DispositionType {\n complete = \"complete\",\n deadletter = \"deadletter\",\n abandon = \"abandon\",\n defer = \"defer\",\n}\n\n/**\n * @internal\n * Describes the delivery annotations for Service Bus.\n */\nexport interface ServiceBusDeliveryAnnotations extends DeliveryAnnotations {\n /**\n * The offset of the last event.\n */\n last_enqueued_offset?: string;\n /**\n * The sequence number of the last event.\n */\n last_enqueued_sequence_number?: number;\n /**\n * The enqueued time of the last event.\n */\n last_enqueued_time_utc?: number;\n /**\n * The retrieval time of the last event.\n */\n runtime_info_retrieval_time_utc?: number;\n /**\n * Any unknown delivery annotations.\n */\n [x: string]: any;\n}\n\n/**\n * @internal\n * Describes the message annotations for Service Bus.\n */\nexport interface ServiceBusMessageAnnotations extends MessageAnnotations {\n /**\n * Annotation for the partition key set for the event.\n */\n \"x-opt-partition-key\"?: string | null;\n /**\n * Annontation for the sequence number of the event.\n */\n \"x-opt-sequence-number\"?: number;\n /**\n * Annotation for the enqueued time of the event.\n */\n \"x-opt-enqueued-time\"?: number;\n /**\n * Annotation for the offset of the event.\n */\n \"x-opt-offset\"?: string;\n /**\n * Annotation for the message being locked until.\n */\n \"x-opt-locked-until\"?: Date | number;\n /**\n * Annotation for the message state.\n */\n \"x-opt-message-state\"?: number;\n}\n\n/**\n * Describes the reason and error description for dead lettering a message using the `deadLetter()`\n * method on the message received from Service Bus.\n */\nexport interface DeadLetterOptions {\n /**\n * The reason for deadlettering the message.\n */\n deadLetterReason: string;\n /**\n * The error description for deadlettering the message.\n */\n deadLetterErrorDescription: string;\n}\n\n/**\n * Describes the message to be sent to Service Bus.\n */\nexport interface ServiceBusMessage {\n /**\n * The message body that needs to be sent or is received.\n * If the application receiving the message is not using this SDK,\n * convert your body payload to a byte array or Buffer for better\n * cross-language compatibility.\n */\n body: any;\n /**\n * The message identifier is an\n * application-defined value that uniquely identifies the message and its payload.\n *\n * Note: Numbers that are not whole integers are not allowed.\n */\n messageId?: string | number | Buffer;\n /**\n * The content type of the message. Optionally describes\n * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for\n * example \"application/json\".\n */\n contentType?: string;\n /**\n * The correlation identifier that allows an\n * application to specify a context for the message for the purposes of correlation, for example\n * reflecting the MessageId of a message that is being replied to.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n correlationId?: string | number | Buffer;\n /**\n * The partition key for sending a message to a partitioned entity.\n * Maximum length is 128 characters. For {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},\n * setting this value enables assigning related messages to the same internal partition,\n * so that submission sequence order is correctly recorded. The partition is chosen by a hash\n * function over this value and cannot be chosen directly.\n * - For session-aware entities, the `sessionId` property overrides this value.\n * - For non partitioned entities, partition key will be ignored\n *\n */\n partitionKey?: string;\n /**\n * The partition key for sending a message into an entity\n * via a partitioned transfer queue. Maximum length is 128 characters. If a message is sent via a\n * transfer queue in the scope of a transaction, this value selects the transfer queue partition:\n * This is functionally equivalent to `partitionKey` property and ensures that messages are kept\n * together and in order as they are transferred.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.\n */\n\n // Will be required later for implementing Transactions\n // viaPartitionKey?: string;\n\n /**\n * The session identifier for a session-aware entity. Maximum\n * length is 128 characters. For session-aware entities, this application-defined value specifies\n * the session affiliation of the message. Messages with the same session identifier are subject\n * to summary locking and enable exact in-order processing and demultiplexing. For\n * session-unaware entities, this value is ignored.\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.\n */\n sessionId?: string;\n /**\n * The session identifier augmenting the `replyTo` address.\n * Maximum length is 128 characters. This value augments the ReplyTo information and specifies\n * which SessionId should be set for the reply when sent to the reply entity.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyToSessionId?: string;\n /**\n * The message’s time to live value. This value is the relative\n * duration after which the message expires, starting from the instant the message has been\n * accepted and stored by the broker, as captured in `enqueuedTimeUtc`. When not set explicitly,\n * the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level\n * `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is\n * silently adjusted if it does. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.\n */\n timeToLive?: number;\n /**\n * The application specific label. This property enables the\n * application to indicate the purpose of the message to the receiver in a standardized. fashion,\n * similar to an email subject line. The mapped AMQP property is \"subject\".\n */\n subject?: string;\n /**\n * The \"to\" address. This property is reserved for future use in routing\n * scenarios and presently ignored by the broker itself. Applications can use this value in\n * rule-driven {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}\n * scenarios to indicate the intended logical destination of the message.\n */\n to?: string;\n /**\n * The address of an entity to send replies to. This optional and\n * application-defined value is a standard way to express a reply path to the receiver of the\n * message. When a sender expects a reply, it sets the value to the absolute or relative path of\n * the queue or topic it expects the reply to be sent to. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyTo?: string;\n /**\n * The date and time in UTC at which the message will\n * be enqueued. This property returns the time in UTC; when setting the property, the\n * supplied DateTime value must also be in UTC. This value is for delayed message sending.\n * It is utilized to delay messages sending to a specific time in the future. Message enqueuing\n * time does not mean that the message will be sent at the same time. It will get enqueued,\n * but the actual sending time depends on the queue's workload and its state.\n */\n scheduledEnqueueTimeUtc?: Date;\n /**\n * The application specific properties which can be\n * used for custom message metadata.\n */\n applicationProperties?: { [key: string]: number | boolean | string | Date | null };\n}\n\n/**\n * @internal\n * Gets the error message for when a property on given message is not of expected type\n */\nexport function getMessagePropertyTypeMismatchError(msg: ServiceBusMessage): Error | undefined {\n if (msg.contentType != null && typeof msg.contentType !== \"string\") {\n return new TypeError(\"The property 'contentType' on the message must be of type 'string'\");\n }\n\n if (msg.subject != null && typeof msg.subject !== \"string\") {\n return new TypeError(\"The property 'label' on the message must be of type 'string'\");\n }\n\n if (msg.to != null && typeof msg.to !== \"string\") {\n return new TypeError(\"The property 'to' on the message must be of type 'string'\");\n }\n\n if (msg.replyTo != null && typeof msg.replyTo !== \"string\") {\n return new TypeError(\"The property 'replyTo' on the message must be of type 'string'\");\n }\n\n if (msg.replyToSessionId != null && typeof msg.replyToSessionId !== \"string\") {\n return new TypeError(\"The property 'replyToSessionId' on the message must be of type 'string'\");\n }\n\n if (msg.timeToLive != null && typeof msg.timeToLive !== \"number\") {\n return new TypeError(\"The property 'timeToLive' on the message must be of type 'number'\");\n }\n\n if (msg.sessionId != null && typeof msg.sessionId !== \"string\") {\n return new TypeError(\"The property 'sessionId' on the message must be of type 'string'\");\n }\n\n if (\n msg.messageId != null &&\n typeof msg.messageId !== \"string\" &&\n typeof msg.messageId !== \"number\" &&\n !Buffer.isBuffer(msg.messageId)\n ) {\n return new TypeError(\n \"The property 'messageId' on the message must be of type string, number or Buffer\",\n );\n }\n\n if (\n msg.correlationId != null &&\n typeof msg.correlationId !== \"string\" &&\n typeof msg.correlationId !== \"number\" &&\n !Buffer.isBuffer(msg.correlationId)\n ) {\n return new TypeError(\n \"The property 'correlationId' on the message must be of type string, number or Buffer\",\n );\n }\n return;\n}\n\n/**\n * @internal\n * Converts given ServiceBusMessage to RheaMessage\n */\nexport function toRheaMessage(\n msg: ServiceBusMessage | ServiceBusReceivedMessage | AmqpAnnotatedMessage,\n encoder: Pick<typeof defaultDataTransformer, \"encode\">,\n): RheaMessage {\n let amqpMsg: RheaMessage;\n if (isAmqpAnnotatedMessage(msg)) {\n amqpMsg = {\n ...AmqpAnnotatedMessage.toRheaMessage(msg),\n body: encoder.encode(msg.body, msg.bodyType ?? \"data\"),\n };\n } else {\n let bodyType: \"data\" | \"sequence\" | \"value\" = \"data\";\n\n if (isServiceBusReceivedMessage(msg)) {\n /*\n * TODO: this is a bit complicated.\n *\n * It seems reasonable to expect to be able to round-trip a message (ie,\n * receive a message, and then send it again, possibly to another queue / topic).\n * If the user does that we need to make sure to respect their original AMQP\n * type so when the message is re - encoded we don't put 'body' into the wrong spot.\n *\n * The complication is that we need to decide if we're okay with respecting a field\n * from the rawAmqpMessage, which up until now we've treated as just vestigial\n * information on send. My hope is that the use case of \"alter the sb message in some\n * incompatible way with the underying _rawAmqpMessage.bodyType\" is not common\n * enough for us to try to do anything more than what I'm doing here.\n */\n bodyType = msg._rawAmqpMessage.bodyType ?? \"data\";\n }\n\n // TODO: it seems sensible that we'd also do this for AMQPAnnotated message.\n const validationError = getMessagePropertyTypeMismatchError(msg);\n\n if (validationError) {\n throw validationError;\n }\n\n amqpMsg = {\n body: encoder.encode(msg.body, bodyType),\n message_annotations: {},\n };\n\n if (msg.timeToLive) {\n amqpMsg.ttl = Math.min(msg.timeToLive, Constants.maxUint32Value);\n amqpMsg.creation_time = new Date();\n amqpMsg.absolute_expiry_time = new Date(\n Math.min(amqpMsg.creation_time.getTime() + amqpMsg.ttl, Constants.maxAbsoluteExpiryTime),\n );\n }\n }\n\n if (isAmqpAnnotatedMessage(msg)) {\n return amqpMsg;\n }\n\n if (msg.applicationProperties != null) {\n amqpMsg.application_properties = msg.applicationProperties;\n }\n if (msg.contentType != null) {\n amqpMsg.content_type = msg.contentType;\n }\n if (msg.sessionId != null) {\n if (msg.sessionId.length > Constants.maxSessionIdLength) {\n throw new Error(\n \"Length of 'sessionId' property on the message cannot be greater than 128 characters.\",\n );\n }\n\n amqpMsg.group_id = msg.sessionId;\n }\n if (msg.replyTo != null) {\n amqpMsg.reply_to = msg.replyTo;\n }\n if (msg.to != null) {\n amqpMsg.to = msg.to;\n }\n if (msg.subject != null) {\n amqpMsg.subject = msg.subject;\n }\n\n updateMessageId(amqpMsg, msg.messageId);\n\n if (msg.correlationId != null) {\n amqpMsg.correlation_id = msg.correlationId;\n }\n if (msg.replyToSessionId != null) {\n amqpMsg.reply_to_group_id = msg.replyToSessionId;\n }\n if (msg.partitionKey != null) {\n if (msg.partitionKey.length > Constants.maxPartitionKeyLength) {\n throw new Error(\n \"Length of 'partitionKey' property on the message cannot be greater than 128 characters.\",\n );\n }\n amqpMsg.message_annotations![Constants.partitionKey] = msg.partitionKey;\n }\n\n // Will be required later for implementing Transactions\n // if (msg.viaPartitionKey != null) {\n // if (msg.viaPartitionKey.length > Constants.maxPartitionKeyLength) {\n // throw new Error(\n // \"Length of 'viaPartitionKey' property on the message cannot be greater than 128 characters.\"\n // );\n // }\n // amqpMsg.message_annotations![Constants.viaPartitionKey] = msg.viaPartitionKey;\n // }\n\n updateScheduledTime(amqpMsg, msg.scheduledEnqueueTimeUtc);\n\n logger.verbose(\"SBMessage to RheaMessage: %O\", amqpMsg);\n return amqpMsg;\n}\n\n/** @internal */\nexport function updateMessageId(\n rheaMessage: RheaMessage,\n messageId: RheaMessage[\"message_id\"],\n): void {\n if (messageId != null) {\n if (typeof messageId === \"string\" && messageId.length > Constants.maxMessageIdLength) {\n throw new Error(\n `Length of 'messageId' property on the message cannot be greater than ${Constants.maxMessageIdLength} characters.`,\n );\n }\n\n rheaMessage.message_id = messageId;\n }\n}\n\n/** @internal */\nexport function updateScheduledTime(\n rheaMessage: RheaMessage,\n scheduledEnqueuedTimeUtc: Date | undefined,\n): void {\n if (scheduledEnqueuedTimeUtc != null) {\n rheaMessage.message_annotations = rheaMessage.message_annotations ?? {};\n rheaMessage.message_annotations[Constants.scheduledEnqueueTime] = scheduledEnqueuedTimeUtc;\n }\n}\n\n/**\n * Describes the message received from Service Bus during peek operations and so cannot be settled.\n */\nexport interface ServiceBusReceivedMessage extends ServiceBusMessage {\n /**\n * The reason for deadlettering the message.\n * @readonly\n */\n readonly deadLetterReason?: string;\n /**\n * The error description for deadlettering the message.\n * @readonly\n */\n readonly deadLetterErrorDescription?: string;\n /**\n * The lock token is a reference to the lock that is being held by the broker in\n * `peekLock` receive mode. Locks are used internally settle messages as explained in the\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n * @readonly\n */\n readonly lockToken?: string;\n /**\n * Number of deliveries that have been attempted for this message. The count is\n * incremented when a message lock expires, or the message is explicitly abandoned using the\n * `abandon()` method on the message.\n * @readonly\n */\n readonly deliveryCount?: number;\n /**\n * The UTC instant at which the message has been accepted and stored in Service Bus.\n * @readonly\n */\n readonly enqueuedTimeUtc?: Date;\n /**\n * The UTC instant at which the message is marked for removal and no longer available for\n * retrieval from the entity due to expiration. This property is computed from 2 other properties\n * on the message: `enqueuedTimeUtc` + `timeToLive`.\n */\n readonly expiresAtUtc?: Date;\n /**\n * The UTC instant until which the message is held locked in the queue/subscription.\n * When the lock expires, the `deliveryCount` is incremented and the message is again available\n * for retrieval.\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n */\n lockedUntilUtc?: Date;\n /**\n * The original sequence number of the message. For\n * messages that have been auto-forwarded, this property reflects the sequence number that had\n * first been assigned to the message at its original point of submission.\n * @readonly\n */\n readonly enqueuedSequenceNumber?: number;\n /**\n * The unique number assigned to a message by Service Bus.\n * The sequence number is a unique 64-bit integer assigned to a message as it is accepted\n * and stored by the broker and functions as its true identifier. For partitioned entities,\n * the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase.\n * They roll over to 0 when the 48-64 bit range is exhausted.\n *\n * **Max safe integer** that Javascript currently supports is `2^53 - 1`. The sequence number\n * is an AMQP `Long` type which can be upto 64 bits long. To represent that we are using a\n * library named {@link https://github.com/dcodeIO/long.js | long.js}. We expect customers\n * to use the **`Long`** type exported by this library.\n * @readonly\n */\n readonly sequenceNumber?: Long;\n /**\n * The name of the queue or subscription that this message\n * was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered\n * and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the\n * entity in which the message was dead-lettered.\n * @readonly\n */\n readonly deadLetterSource?: string;\n /**\n * State of the message can be active, deferred or scheduled. Deferred messages have deferred state,\n * scheduled messages have scheduled state, all other messages have active state.\n */\n readonly state: \"active\" | \"deferred\" | \"scheduled\";\n /**\n * The underlying raw amqp message.\n * @readonly\n */\n readonly _rawAmqpMessage: AmqpAnnotatedMessage;\n}\n\n/**\n * @internal\n * Converts given RheaMessage to ServiceBusReceivedMessage\n */\nexport function fromRheaMessage(\n rheaMessage: RheaMessage,\n options: {\n skipParsingBodyAsJson: boolean;\n skipConvertingDate?: boolean;\n delivery?: Delivery;\n shouldReorderLockToken?: boolean;\n },\n): ServiceBusReceivedMessage {\n if (!rheaMessage) {\n rheaMessage = {\n body: undefined,\n };\n }\n const {\n skipParsingBodyAsJson,\n delivery,\n shouldReorderLockToken,\n skipConvertingDate = false,\n } = options;\n const { body, bodyType } = defaultDataTransformer.decodeWithType(\n rheaMessage.body,\n skipParsingBodyAsJson,\n );\n\n const sbmsg: ServiceBusMessage = {\n body: body,\n };\n\n if (rheaMessage.application_properties != null) {\n sbmsg.applicationProperties = skipConvertingDate\n ? rheaMessage.application_properties\n : convertDatesToNumbers(rheaMessage.application_properties);\n }\n if (rheaMessage.content_type != null) {\n sbmsg.contentType = rheaMessage.content_type;\n }\n if (rheaMessage.group_id != null) {\n sbmsg.sessionId = rheaMessage.group_id;\n }\n if (rheaMessage.reply_to != null) {\n sbmsg.replyTo = rheaMessage.reply_to;\n }\n if (rheaMessage.to != null) {\n sbmsg.to = rheaMessage.to;\n }\n if (rheaMessage.subject != null) {\n sbmsg.subject = rheaMessage.subject;\n }\n if (rheaMessage.message_id != null) {\n sbmsg.messageId = rheaMessage.message_id;\n }\n if (rheaMessage.correlation_id != null) {\n sbmsg.correlationId = rheaMessage.correlation_id;\n }\n if (rheaMessage.reply_to_group_id != null) {\n sbmsg.replyToSessionId = rheaMessage.reply_to_group_id;\n }\n\n if (rheaMessage.message_annotations != null) {\n if (rheaMessage.message_annotations[Constants.partitionKey] != null) {\n sbmsg.partitionKey = rheaMessage.message_annotations[Constants.partitionKey];\n }\n\n // Will be required later for implementing Transactions\n // if (msg.message_annotations[Constants.viaPartitionKey] != null) {\n // sbmsg.viaPartitionKey = msg.message_annotations[Constants.viaPartitionKey];\n // }\n\n if (rheaMessage.message_annotations[Constants.scheduledEnqueueTime] != null) {\n sbmsg.scheduledEnqueueTimeUtc =\n rheaMessage.message_annotations[Constants.scheduledEnqueueTime];\n }\n }\n\n type PartialWritable<T> = Partial<{\n -readonly [P in keyof T]: T[P];\n }>;\n const props: PartialWritable<ServiceBusReceivedMessage> & {\n state: \"active\" | \"deferred\" | \"scheduled\";\n } = { state: \"active\" };\n if (rheaMessage.message_annotations != null) {\n if (rheaMessage.message_annotations[Constants.deadLetterSource] != null) {\n props.deadLetterSource = rheaMessage.message_annotations[Constants.deadLetterSource];\n }\n const messageState = rheaMessage.message_annotations[Constants.messageState];\n if (messageState === 1) {\n props.state = \"deferred\";\n } else if (messageState === 2) {\n props.state = \"scheduled\";\n }\n if (rheaMessage.message_annotations[Constants.enqueueSequenceNumber] != null) {\n props.enqueuedSequenceNumber =\n rheaMessage.message_annotations[Constants.enqueueSequenceNumber];\n }\n if (rheaMessage.message_annotations[Constants.sequenceNumber] != null) {\n if (Buffer.isBuffer(rheaMessage.message_annotations[Constants.sequenceNumber])) {\n props.sequenceNumber = Long.fromBytesBE(\n rheaMessage.message_annotations[Constants.sequenceNumber],\n );\n } else {\n props.sequenceNumber = Long.fromNumber(\n rheaMessage.message_annotations[Constants.sequenceNumber],\n );\n }\n }\n if (rheaMessage.message_annotations[Constants.enqueuedTime] != null) {\n props.enqueuedTimeUtc = new Date(\n rheaMessage.message_annotations[Constants.enqueuedTime] as number,\n );\n }\n if (rheaMessage.message_annotations[Constants.lockedUntil] != null) {\n props.lockedUntilUtc = new Date(\n rheaMessage.message_annotations[Constants.lockedUntil] as number,\n );\n }\n }\n\n const rawMessage = AmqpAnnotatedMessage.fromRheaMessage(rheaMessage);\n rawMessage.bodyType = bodyType;\n if (rheaMessage.ttl == null) {\n rheaMessage.ttl = rawMessage.header?.timeToLive ?? Constants.maxDurationValue;\n }\n if (props.enqueuedTimeUtc) {\n props.expiresAtUtc = new Date(\n Math.min(props.enqueuedTimeUtc.getTime() + rheaMessage.ttl, Constants.maxDurationValue),\n );\n }\n\n if (rawMessage.applicationProperties) {\n rawMessage.applicationProperties = skipConvertingDate\n ? rawMessage.applicationProperties\n : convertDatesToNumbers(rawMessage.applicationProperties);\n }\n if (rawMessage.deliveryAnnotations) {\n rawMessage.deliveryAnnotations = skipConvertingDate\n ? rawMessage.deliveryAnnotations\n : convertDatesToNumbers(rawMessage.deliveryAnnotations);\n }\n if (rawMessage.messageAnnotations) {\n rawMessage.messageAnnotations = skipConvertingDate\n ? rawMessage.messageAnnotations\n : convertDatesToNumbers(rawMessage.messageAnnotations);\n }\n\n if (rawMessage.header?.timeToLive) {\n sbmsg.timeToLive = rawMessage.header.timeToLive;\n }\n\n const rcvdsbmsg: ServiceBusReceivedMessage = {\n _rawAmqpMessage: rawMessage,\n deliveryCount: rheaMessage.delivery_count,\n lockToken:\n delivery && delivery.tag && delivery.tag.length !== 0\n ? uuid_to_string(\n shouldReorderLockToken === true\n ? reorderLockToken(\n typeof delivery.tag === \"string\" ? Buffer.from(delivery.tag) : delivery.tag,\n )\n : typeof delivery.tag === \"string\"\n ? Buffer.from(delivery.tag)\n : delivery.tag,\n )\n : undefined,\n ...sbmsg,\n ...props,\n deadLetterReason: sbmsg.applicationProperties?.DeadLetterReason as string | undefined,\n deadLetterErrorDescription: sbmsg.applicationProperties?.DeadLetterErrorDescription as\n | string\n | undefined,\n };\n\n logger.verbose(\"AmqpMessage to ServiceBusReceivedMessage: %O\", rcvdsbmsg);\n return rcvdsbmsg;\n}\n\n/**\n * @internal\n */\nexport function isServiceBusMessage(possible: unknown): possible is ServiceBusMessage {\n return isObjectWithProperties(possible, [\"body\"]);\n}\n\n/**\n * @internal\n */\nexport function isAmqpAnnotatedMessage(possible: unknown): possible is AmqpAnnotatedMessage {\n return (\n isObjectWithProperties(possible, [\"body\", \"bodyType\"]) &&\n possible.constructor.name !== ServiceBusMessageImpl.name\n );\n}\n\n/**\n * @internal\n */\nexport function isServiceBusReceivedMessage(\n possible: unknown,\n): possible is ServiceBusReceivedMessage {\n return isServiceBusMessage(possible) && \"_rawAmqpMessage\" in possible;\n}\n\n/**\n * Describes the message received from Service Bus.\n *\n * @internal\n */\nexport class ServiceBusMessageImpl implements ServiceBusReceivedMessage {\n /**\n * The message body that needs to be sent or is received.\n */\n body: any;\n /**\n * The application specific properties.\n */\n applicationProperties?: { [key: string]: any };\n /**\n * The message identifier is an\n * application-defined value that uniquely identifies the message and its payload. The identifier\n * is a free-form string and can reflect a GUID or an identifier derived from the application\n * context. If enabled, the\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/duplicate-detection | duplicate detection}\n * identifies and removes second and further submissions of messages with the same MessageId.\n */\n messageId?: string | number | Buffer;\n /**\n * The content type of the message. Optionally describes\n * the payload of the message, with a descriptor following the format of RFC2045, Section 5, for\n * example \"application/json\".\n */\n contentType?: string;\n /**\n * The correlation identifier that allows an\n * application to specify a context for the message for the purposes of correlation, for example\n * reflecting the MessageId of a message that is being replied to.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n correlationId?: string | number | Buffer;\n /**\n * The partition key for sending a message to a\n * partitioned entity. Maximum length is 128 characters. For {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-partitioning | partitioned entities},\n * setting this value enables assigning related messages to the same internal partition,\n * so that submission sequence order is correctly recorded. The partition is chosen by a hash\n * function over this value and cannot be chosen directly. For session-aware entities,\n * the `sessionId` property overrides this value.\n */\n partitionKey?: string;\n /**\n * The partition key for sending a message into an entity\n * via a partitioned transfer queue. Maximum length is 128 characters. If a message is sent via a\n * transfer queue in the scope of a transaction, this value selects the transfer queue partition:\n * This is functionally equivalent to `partitionKey` property and ensures that messages are kept\n * together and in order as they are transferred.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-transactions#transfers-and-send-via | Transfers and Send Via}.\n */\n // Will be required later for implementing Transactions\n // viaPartitionKey?: string;\n /**\n * The session identifier for a session-aware entity. Maximum\n * length is 128 characters. For session-aware entities, this application-defined value specifies\n * the session affiliation of the message. Messages with the same session identifier are subject\n * to summary locking and enable exact in-order processing and demultiplexing. For\n * session-unaware entities, this value is ignored.\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-sessions | Message Sessions}.\n */\n sessionId?: string;\n /**\n * The session identifier augmenting the `replyTo` address.\n * Maximum length is 128 characters. This value augments the ReplyTo information and specifies\n * which SessionId should be set for the reply when sent to the reply entity.\n * See {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyToSessionId?: string;\n /**\n * The message’s time to live value. This value is the relative\n * duration after which the message expires, starting from the instant the message has been\n * accepted and stored by the broker, as captured in `enqueuedTimeUtc`. When not set explicitly,\n * the assumed value is the DefaultTimeToLive for the respective queue or topic. A message-level\n * `timeToLive` value cannot be longer than the entity's DefaultTimeToLive setting and it is\n * silently adjusted if it does. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-expiration | Expiration}.\n */\n timeToLive?: number;\n /**\n * The application specific label. This property enables the\n * application to indicate the purpose of the message to the receiver in a standardized. fashion,\n * similar to an email subject line. The mapped AMQP property is \"subject\".\n */\n subject?: string;\n /**\n * The \"to\" address. This property is reserved for future use in routing\n * scenarios and presently ignored by the broker itself. Applications can use this value in\n * rule-driven {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-auto-forwarding | auto-forward chaining}\n * scenarios to indicate the intended logical destination of the message.\n */\n to?: string;\n /**\n * The address of an entity to send replies to. This optional and\n * application-defined value is a standard way to express a reply path to the receiver of the\n * message. When a sender expects a reply, it sets the value to the absolute or relative path of\n * the queue or topic it expects the reply to be sent to. See\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/service-bus-messages-payloads?#message-routing-and-correlation | Message Routing and Correlation}.\n */\n replyTo?: string;\n /**\n * The date and time in UTC at which the message will\n * be enqueued. This property returns the time in UTC; when setting the property, the\n * supplied DateTime value must also be in UTC. This value is for delayed message sending.\n * It is utilized to delay messages sending to a specific time in the future. Message enqueuing\n * time does not mean that the message will be sent at the same time. It will get enqueued,\n * but the actual sending time depends on the queue's workload and its state.\n */\n scheduledEnqueueTimeUtc?: Date;\n /**\n * The lock token is a reference to the lock that is being held by the broker in\n * `peekLock` receive mode. Locks are used internally settle messages as explained in the\n * {@link https://docs.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement | product documentation in more detail}\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n * @readonly\n */\n readonly lockToken?: string;\n /**\n * Number of deliveries that have been attempted for this message. The count is\n * incremented when a message lock expires, or the message is explicitly abandoned using the\n * `abandon()` method on the message.\n * @readonly\n */\n readonly deliveryCount?: number;\n /**\n * The UTC instant at which the message has been accepted and stored in Service Bus.\n * @readonly\n */\n readonly enqueuedTimeUtc?: Date;\n /**\n * The UTC instant at which the message is marked for removal and no longer available for\n * retrieval from the entity due to expiration. This property is computed from 2 other properties\n * on the message: `enqueuedTimeUtc` + `timeToLive`.\n */\n readonly expiresAtUtc?: Date;\n /**\n * The UTC instant until which the message is held locked in the queue/subscription.\n * When the lock expires, the `deliveryCount` is incremented and the message is again available\n * for retrieval.\n * - Not applicable when the message is received in `receiveAndDelete` receive mode.\n * mode.\n */\n lockedUntilUtc?: Date;\n /**\n * The original sequence number of the message. For\n * messages that have been auto-forwarded, this property reflects the sequence number that had\n * first been assigned to the message at its original point of submission.\n * @readonly\n */\n readonly enqueuedSequenceNumber?: number;\n /**\n * The unique number assigned to a message by Service Bus.\n * The sequence number is a unique 64-bit integer assigned to a message as it is accepted\n * and stored by the broker and functions as its true identifier. For partitioned entities,\n * the topmost 16 bits reflect the partition identifier. Sequence numbers monotonically increase.\n * They roll over to 0 when the 48-64 bit range is exhausted.\n * @readonly\n */\n readonly sequenceNumber?: Long;\n /**\n * The name of the queue or subscription that this message\n * was enqueued on, before it was deadlettered. Only set in messages that have been dead-lettered\n * and subsequently auto-forwarded from the dead-letter sub-queue to another entity. Indicates the\n * entity in which the message was dead-lettered.\n * @readonly\n */\n readonly deadLetterSource?: string;\n /**\n * State of the message can be active, deferred or scheduled. Deferred messages have deferred state,\n * scheduled messages have scheduled state, all other messages have active state.\n */\n readonly state: \"active\" | \"deferred\" | \"scheduled\";\n /**\n * The associated delivery of the received message.\n */\n readonly delivery: Delivery;\n /**\n * The underlying raw amqp annotated message.\n * @readonly\n */\n readonly _rawAmqpMessage: AmqpAnnotatedMessage;\n /**\n * The reason for deadlettering the message.\n * @readonly\n */\n readonly deadLetterReason?: string;\n /**\n * The error description for deadlettering the message.\n * @readonly\n */\n readonly deadLetterErrorDescription?: string;\n /**\n * @internal\n */\n constructor(\n msg: RheaMessage,\n delivery: Delivery,\n shouldReorderLockToken: boolean,\n receiveMode: ReceiveMode,\n skipParsingBodyAsJson: boolean,\n skipConvertingDate: boolean,\n ) {\n const { _rawAmqpMessage, ...restOfMessageProps } = fromRheaMessage(\n msg,\n\n { skipParsingBodyAsJson, delivery, shouldReorderLockToken, skipConvertingDate },\n );\n this._rawAmqpMessage = _rawAmqpMessage; // need to initialize _rawAmqpMessage property to make compiler happy\n Object.assign(this, restOfMessageProps);\n this.state = restOfMessageProps.state; // to suppress error TS2564: Property 'state' has no initializer and is not definitely assigned in the constructor.\n\n // Lock on a message is applicable only in peekLock mode, but the service sets\n // the lock token even in receiveAndDelete mode if the entity in question is partitioned.\n if (receiveMode === \"receiveAndDelete\") {\n this.lockToken = undefined;\n }\n this.delivery = delivery;\n }\n\n /**\n * Creates a clone of the current message to allow it to be re-sent to the queue\n * @returns ServiceBusMessage\n */\n clone(): ServiceBusMessage {\n // We are returning a ServiceBusMessage object because that object can then be sent to Service Bus\n const clone: ServiceBusMessage = {\n body: this.body,\n contentType: this.contentType,\n correlationId: this.correlationId,\n subject: this.subject,\n messageId: this.messageId,\n partitionKey: this.partitionKey,\n replyTo: this.replyTo,\n replyToSessionId: this.replyToSessionId,\n scheduledEnqueueTimeUtc: this.scheduledEnqueueTimeUtc,\n sessionId: this.sessionId,\n timeToLive: this.timeToLive,\n to: this.to,\n applicationProperties: this.applicationProperties,\n // Will be required later for implementing Transactions\n // viaPartitionKey: this.viaPartitionKey\n };\n\n return clone;\n }\n}\n\n/**\n * Converts any Date objects into a number representing date.getTime().\n * Recursively checks for any Date objects in arrays and objects.\n * @internal\n */\nfunction convertDatesToNumbers<T = unknown>(thing: T): T {\n // fast exit\n if (!isDefined(thing)) return thing;\n\n // When 'thing' is a Date, return the number representation\n if (\n typeof thing === \"object\" &&\n isObjectWithProperties(thing, [\"getTime\"]) &&\n typeof thing.getTime === \"function\"\n ) {\n return thing.getTime();\n }\n\n /*\n Examples:\n [0, 'foo', new Date(), { nested: new Date()}]\n */\n if (Array.isArray(thing)) {\n const result = [];\n for (const element of thing) {\n result.push(convertDatesToNumbers(element));\n }\n return result as unknown as T;\n }\n\n /*\n Examples:\n { foo: new Date(), children: { nested: new Date() }}\n */\n if (typeof thing === \"object\" && isDefined<object>(thing)) {\n const thingShallowCopy = { ...thing };\n for (const key of Object.keys(thingShallowCopy)) {\n (thingShallowCopy as any)[key] = convertDatesToNumbers((thingShallowCopy as any)[key]);\n }\n return thingShallowCopy;\n }\n\n return thing;\n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K,CAAC;QACf,CAAC;QAED,oEAAoE;QACpE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3C,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ServiceBusMessage, toRheaMessage } from \"./serviceBusMessage\";\nimport {\n errorInvalidMessageTypeSingle,\n throwIfNotValidServiceBusMessage,\n throwTypeErrorIfParameterMissing,\n} from \"./util/errors\";\nimport { ConnectionContext } from \"./connectionContext\";\nimport {\n MessageAnnotations,\n messageProperties as RheaMessagePropertiesList,\n message as RheaMessageUtil,\n Message as RheaMessage,\n} from \"rhea-promise\";\nimport { TracingContext } from \"@azure/core-tracing\";\nimport { TryAddOptions } from \"./modelsToBeSharedWithEventHubs\";\nimport { AmqpAnnotatedMessage } from \"@azure/core-amqp\";\nimport { defaultDataTransformer } from \"./dataTransformer\";\nimport { instrumentMessage } from \"./diagnostics/instrumentServiceBusMessage\";\n\n/**\n * @internal\n * The amount of bytes to reserve as overhead for a small message.\n */\nconst smallMessageOverhead = 5;\n/**\n * @internal\n * The amount of bytes to reserve as overhead for a large message.\n */\nconst largeMessageOverhead = 8;\n/**\n * @internal\n * The maximum number of bytes that a message may be to be considered small.\n */\nconst smallMessageMaxBytes = 255;\n\n/**\n * A batch of messages that you can create using the {@link createBatch} method.\n *\n */\nexport interface ServiceBusMessageBatch {\n /**\n * Size of the batch in bytes after the events added to it have been encoded into a single AMQP\n * message.\n * @readonly\n */\n readonly sizeInBytes: number;\n\n /**\n * Number of messages added to the batch.\n * @readonly\n */\n readonly count: number;\n\n /**\n * The maximum size of the batch, in bytes. The `tryAddMessage` function on the batch will return `false`\n * if the message being added causes the size of the batch to exceed this limit. Use the `createMessageBatch()` method on\n * the `Sender` to set the maxSizeInBytes.\n * @readonly\n */\n readonly maxSizeInBytes: number;\n\n /**\n * Adds a message to the batch if permitted by the batch's size limit.\n * **NOTE**: Always remember to check the return value of this method, before calling it again\n * for the next event.\n *\n * @param message - The message to add to the batch.\n * @returns A boolean value indicating if the message has been added to the batch or not.\n */\n tryAddMessage(\n message: ServiceBusMessage | AmqpAnnotatedMessage,\n options?: TryAddOptions,\n ): boolean;\n\n /**\n * The AMQP message containing encoded events that were added to the batch.\n * Used internally by the `sendBatch()` method on the `Sender`.\n * This is not meant for the user to use directly.\n *\n * @readonly\n * @internal\n * @hidden\n */\n _generateMessage(): Buffer;\n\n /**\n * Gets the \"message\" span contexts that were created when adding events to the batch.\n * Used internally by the `sendBatch()` method to set up the right spans in traces if tracing is enabled.\n * @internal\n * @hidden\n */\n readonly _messageSpanContexts: TracingContext[];\n}\n\n/**\n * An internal class representing a batch of messages which can be used to send messages to Service Bus.\n *\n * @internal\n */\nexport class ServiceBusMessageBatchImpl implements ServiceBusMessageBatch {\n /**\n * Current size of the batch in bytes.\n */\n private _sizeInBytes: number;\n /**\n * Encoded amqp messages.\n */\n private _encodedMessages: Buffer[] = [];\n /**\n * List of 'message' span contexts.\n */\n private _spanContexts: TracingContext[] = [];\n /**\n * ServiceBusMessageBatch should not be constructed using `new ServiceBusMessageBatch()`\n * Use the `createBatch()` method on your `Sender` instead.\n * @internal\n * @hidden\n */\n constructor(\n private _context: ConnectionContext,\n private _maxSizeInBytes: number,\n ) {\n this._sizeInBytes = 0;\n this._batchMessageProperties = {};\n }\n\n /**\n * The maximum size of the batch, in bytes.\n * @readonly\n */\n get maxSizeInBytes(): number {\n return this._maxSizeInBytes;\n }\n\n /**\n * Size of the `ServiceBusMessageBatch` instance after the messages added to it have been\n * encoded into a single AMQP message.\n * @readonly\n */\n get sizeInBytes(): number {\n return this._sizeInBytes;\n }\n\n /**\n * Number of messages in the `ServiceBusMessageBatch` instance.\n * @readonly\n */\n get count(): number {\n return this._encodedMessages.length;\n }\n\n /**\n * Gets the \"message\" span contexts that were created when adding messages to the batch.\n * @internal\n * @hidden\n */\n get _messageSpanContexts(): TracingContext[] {\n return this._spanContexts;\n }\n\n /**\n * Generates an AMQP message that contains the provided encoded messages and annotations.\n *\n * @param encodedMessages - The already encoded messages to include in the AMQP batch.\n * @param annotations - The message annotations to set on the batch.\n * @param applicationProperties - The application properties to set on the batch.\n * @param messageProperties - The message properties to set on the batch.\n */\n private _generateBatch(\n encodedMessages: Buffer[],\n annotations?: MessageAnnotations,\n applicationProperties?: { [key: string]: any },\n messageProperties?: { [key: string]: string },\n ): Buffer {\n const batchEnvelope: RheaMessage = {\n body: RheaMessageUtil.data_sections(encodedMessages),\n message_annotations: annotations,\n application_properties: applicationProperties,\n };\n if (messageProperties) {\n for (const prop of RheaMessagePropertiesList) {\n if ((messageProperties as any)[prop]) {\n (batchEnvelope as any)[prop] = (messageProperties as any)[prop];\n }\n }\n }\n return RheaMessageUtil.encode(batchEnvelope);\n }\n\n /**\n * Represents the single AMQP message which is the result of encoding all the events\n * added into the `ServiceBusMessageBatch` instance.\n *\n * This is not meant for the user to use directly.\n *\n * When the `ServiceBusMessageBatch` instance is passed to the `sendBatch()` method on the `Sender`,\n * this single batched AMQP message is what gets sent over the wire to the service.\n * @readonly\n */\n _generateMessage(): Buffer {\n return this._generateBatch(\n this._encodedMessages,\n this._batchAnnotations,\n this._batchApplicationProperties,\n this._batchMessageProperties,\n );\n }\n\n /**\n * The message annotations to apply on the batch envelope.\n * This will reflect the message annotations on the first message\n * that was added to the batch.\n */\n private _batchAnnotations?: MessageAnnotations;\n /**\n * The message properties to apply on the batch envelope.\n * This will reflect the message properties on the first message\n * that was added to the batch.\n */\n private _batchMessageProperties?: { [key: string]: string };\n /**\n * The application properties to apply on the batch envelope.\n * This will reflect the application properties on the first message\n * that was added to the batch.\n */\n private _batchApplicationProperties?: { [key: string]: any };\n\n /**\n * Tries to add a message to the batch if permitted by the batch's size limit.\n * **NOTE**: Always remember to check the return value of this method, before calling it again\n * for the next message.\n *\n * @param originalMessage - An individual service bus message.\n * @returns A boolean value indicating if the message has been added to the batch or not.\n */\n public tryAddMessage(\n originalMessage: ServiceBusMessage | AmqpAnnotatedMessage,\n options: TryAddOptions = {},\n ): boolean {\n throwTypeErrorIfParameterMissing(this._context.connectionId, \"message\", originalMessage);\n throwIfNotValidServiceBusMessage(originalMessage, errorInvalidMessageTypeSingle);\n\n const { message, spanContext } = instrumentMessage(\n originalMessage,\n options,\n this._context.config.entityPath!,\n this._context.config.host,\n \"publish\",\n );\n\n // Convert ServiceBusMessage to AmqpMessage.\n const amqpMessage = toRheaMessage(message, defaultDataTransformer);\n\n const encodedMessage = RheaMessageUtil.encode(amqpMessage);\n let currentSize = this._sizeInBytes;\n\n // The first time an event is added, we need to calculate\n // the overhead of creating an AMQP batch, including the\n // message_annotations, application_properties and message_properties\n // that are taken from the 1st message.\n if (this.count === 0) {\n if (amqpMessage.message_annotations) {\n this._batchAnnotations = amqpMessage.message_annotations;\n }\n if (amqpMessage.application_properties) {\n this._batchApplicationProperties = amqpMessage.application_properties;\n }\n for (const prop of RheaMessagePropertiesList) {\n if ((amqpMessage as any)[prop]) {\n (this._batchMessageProperties as any)[prop] = (amqpMessage as any)[prop];\n }\n }\n // Figure out the overhead of creating a batch by generating an empty batch\n // with the expected batch annotations.\n currentSize += this._generateBatch(\n [],\n this._batchAnnotations,\n this._batchApplicationProperties,\n this._batchMessageProperties,\n ).length;\n }\n\n const messageSize = encodedMessage.length;\n const messageOverhead =\n messageSize <= smallMessageMaxBytes ? smallMessageOverhead : largeMessageOverhead;\n currentSize += messageSize + messageOverhead;\n // Check if the size of the batch exceeds the maximum allowed size\n // once we add the new event to it.\n if (currentSize > this._maxSizeInBytes) {\n return false;\n }\n\n // The message will fit in the batch, so it is now safe to store it.\n this._encodedMessages.push(encodedMessage);\n if (spanContext) {\n this._spanContexts.push(spanContext);\n }\n\n this._sizeInBytes = currentSize;\n return true;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"serviceBusRuleManager.js","sourceRoot":"","sources":["../../src/serviceBusRuleManager.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAe,kBAAkB,EAAgB,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAE,iBAAiB,IAAI,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EACL,eAAe,GAGhB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAA2C,MAAM,oBAAoB,CAAC;AAuDpG;;GAEG;AACH,MAAM,OAAO,yBAAyB;IAQpC;;;OAGG;IACH,YACU,QAA2B,EAC3B,WAAmB,EACnB,gBAA8B,EAAE;QAFhC,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,gBAAW,GAAX,WAAW,CAAQ;QACnB,kBAAa,GAAb,aAAa,CAAmB;QAd1C;;WAEG;QACK,cAAS,GAAY,KAAK,CAAC;QAajC,4BAA4B,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;IAC3C,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAClE,CAAC;IA4BD,KAAK,CAAC,UAAU,CACd,QAAgB,EAChB,MAA6C,EAC7C,4BAAmE,EACnE,UAA4B,EAAE;QAE9B,IAAI,aAAa,GAA8B,SAAS,CAAC;QACzD,IAAI,WAAyC,CAAC;QAC9C,IAAI,4BAA4B,E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H,CAAC,CAAC,SAAS,CAAC;YAChB,CAAC;SACF,CAAC;QAEF,OAAO,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,UAA4B,EAAE;QAC/D,OAAO,aAAa,CAAC,QAAQ,CAC3B,kCAAkC,EAClC,OAAO,EACP,KAAK,EAAE,cAAc,EAAE,EAAE;YACvB,MAAM,0BAA0B,GAAG,KAAK,IAAmB,EAAE;gBAC3D,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE;oBAC9E,GAAG,cAAc;oBACjB,kBAAkB,EAAE,IAAI,CAAC,IAAI;oBAC7B,WAAW,EAAE,YAAY;oBACzB,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;iBAC5C,CAAC,CAAC;YACL,CAAC,CAAC;YACF,MAAM,MAAM,GAAsB;gBAChC,SAAS,EAAE,0BAA0B;gBACrC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,YAAY;gBACxC,aAAa,EAAE,kBAAkB,CAAC,UAAU;gBAC5C,YAAY,EAAE,IAAI,CAAC,aAAa;gBAChC,WAAW,EAAE,cAAc,EAAE,WAAW;aACzC,CAAC;YACF,OAAO,KAAK,CAAO,MAAM,CAAC,CAAC;QAC7B,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { OperationOptionsBase } from \"./modelsToBeSharedWithEventHubs\";\nimport { ConnectionContext } from \"./connectionContext\";\nimport { RetryConfig, RetryOperationType, RetryOptions, retry } from \"@azure/core-amqp\";\nimport { CorrelationRuleFilter } from \"./core/managementClient\";\nimport { ruleManagerLogger as logger } from \"./log\";\nimport {\n isSqlRuleAction,\n RuleProperties,\n SqlRuleAction,\n} from \"./serializers/ruleResourceSerializer\";\nimport { getUniqueName } from \"./util/utils\";\nimport { throwErrorIfConnectionClosed } from \"./util/errors\";\nimport { SqlRuleFilter } from \"./serializers/ruleResourceSerializer\";\nimport { tracingClient } from \"./diagnostics/tracing\";\nimport { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from \"@azure/core-paging\";\nimport { OperationOptions } from \"@azure/core-client\";\nimport { ListRequestOptions } from \"./serviceBusAtomManagementClient\";\n\n/**\n * Allows rules for a subscription to be managed. This rule manager requires only Listen claims, whereas the\n * {@link ServiceBusAdministrationClient} requires Manage claims.\n */\nexport interface ServiceBusRuleManager {\n /**\n * Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.\n *\n * @param ruleName - the name of the rule\n * @param filter - the filter expression that the rule evaluates.\n * @param options - The options that can be used to abort, trace and control other configurations on the request.\n */\n createRule(\n ruleName: string,\n filter: SqlRuleFilter | CorrelationRuleFilter,\n options?: OperationOptionsBase,\n ): Promise<void>;\n /**\n * Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.\n *\n * @param ruleName - the name of the rule\n * @param filter - the filter expression that the rule evaluates.\n * @param ruleAction - The SQL like expression that can be executed on the message should the associated filter apply.\n * @param options - The options that can be used to abort, trace and control other configurations on the request.\n */\n createRule(\n ruleName: string,\n filter: SqlRuleFilter | CorrelationRuleFilter,\n ruleAction?: SqlRuleAction,\n options?: OperationOptionsBase,\n ): Promise<void>;\n /**\n * Deletes a rule.\n *\n * @param ruleName - the name of the rule\n */\n deleteRule(ruleName: string, options?: OperationOptionsBase): Promise<void>;\n /**\n * Returns an async iterable iterator to list all the rules\n * under the specified subscription.\n *\n * .byPage() returns an async iterable iterator to list the rules in pages.\n *\n * @returns An asyncIterableIterator that supports paging.\n */\n listRules(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: OperationOptions,\n ): PagedAsyncIterableIterator<RuleProperties>;\n}\n\n/**\n * @internal\n */\nexport class ServiceBusRuleManagerImpl implements ServiceBusRuleManager {\n /**\n * Denotes if close() was called on this sender\n */\n private _isClosed: boolean = false;\n private name: string;\n public entityPath: string;\n\n /**\n * @internal\n * @throws Error if the underlying connection is closed.\n */\n constructor(\n private _context: ConnectionContext,\n private _entityPath: string,\n private _retryOptions: RetryOptions = {},\n ) {\n throwErrorIfConnectionClosed(_context);\n this.entityPath = _entityPath;\n this.name = getUniqueName(\"ruleManager\");\n }\n\n public get isClosed(): boolean {\n return this._isClosed || this._context.wasConnectionCloseCalled;\n }\n\n /**\n * Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.\n *\n * @param ruleName - the name of the rule\n * @param filter - the filter expression that the rule evaluates.\n * @param options - The options that can be used to abort, trace and control other configurations on the request.\n */\n createRule(\n ruleName: string,\n filter: SqlRuleFilter | CorrelationRuleFilter,\n options?: OperationOptions,\n ): Promise<void>;\n /**\n * Adds a rule to the current subscription to filter the messages reaching from topic to the subscription.\n *\n * @param ruleName - the name of the rule\n * @param filter - the filter expression that the rule evaluates.\n * @param ruleAction - The SQL like expression that can be executed on the message should the associated filter apply.\n * @param options - The options that can be used to abort, trace and control other configurations on the request.\n */\n createRule(\n ruleName: string,\n filter: SqlRuleFilter | CorrelationRuleFilter,\n ruleAction?: SqlRuleAction,\n options?: OperationOptions,\n ): Promise<void>;\n async createRule(\n ruleName: string,\n filter: SqlRuleFilter | CorrelationRuleFilter,\n ruleActionOrOperationOptions?: SqlRuleAction | OperationOptionsBase,\n options: OperationOptions = {},\n ): Promise<void> {\n let sqlRuleAction: SqlRuleAction | undefined = undefined;\n let operOptions: OperationOptions | undefined;\n if (ruleActionOrOperationOptions) {\n if (isSqlRuleAction(ruleActionOrOperationOptions)) {\n // Overload#2 - where the sqlExpression in the ruleAction is defined\n sqlRuleAction = ruleActionOrOperationOptions;\n operOptions = options;\n } else {\n // Overload#1 - where the sqlExpression in the ruleAction is undefined\n operOptions = { ...ruleActionOrOperationOptions, ...options };\n }\n }\n\n return tracingClient.withSpan(\n \"ServiceBusRuleManager.createRule\",\n operOptions ?? {},\n async (updatedOptions) => {\n const addRuleOperationPromise = async (): Promise<void> => {\n return this._context\n .getManagementClient(this._entityPath)\n .addRule(ruleName, filter, sqlRuleAction?.sqlExpression, {\n ...updatedOptions,\n associatedLinkName: this.name,\n requestName: \"addRule\",\n timeoutInMs: this._retryOptions.timeoutInMs,\n });\n };\n const config: RetryConfig<void> = {\n operation: addRuleOperationPromise,\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.management,\n retryOptions: this._retryOptions,\n abortSignal: updatedOptions?.abortSignal,\n };\n return retry<void>(config);\n },\n );\n }\n\n /**\n * Get all rules associated with the subscription.\n */\n private async getRules(\n options?: ListRequestOptions & OperationOptions,\n ): Promise<RuleProperties[]> {\n return tracingClient.withSpan(\n \"ServiceBusRuleManager.getRules\",\n options ?? {},\n async (updatedOptions) => {\n const getRulesOperationPromise = async (): Promise<RuleProperties[]> => {\n return this._context.getManagementClient(this._entityPath).getRules({\n ...updatedOptions,\n associatedLinkName: this.name,\n requestName: \"getRules\",\n timeoutInMs: this._retryOptions.timeoutInMs,\n });\n };\n const config: RetryConfig<RuleProperties[]> = {\n operation: getRulesOperationPromise,\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.management,\n retryOptions: this._retryOptions,\n abortSignal: updatedOptions?.abortSignal,\n };\n return retry<RuleProperties[]>(config);\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list all the rules\n * under the specified subscription.\n *\n * .byPage() returns an async iterable iterator to list the rules in pages.\n *\n * @returns An asyncIterableIterator that supports paging.\n */\n public listRules(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: OperationOptions,\n ): PagedAsyncIterableIterator<RuleProperties, RuleProperties[], { maxPageSize?: number }> {\n logger.verbose(`Performing operation - listRules() with options: %j`, options);\n const pagedResult: PagedResult<RuleProperties[], { maxPageSize?: number }, number> = {\n firstPageLink: 0,\n getPage: async (pageLink, maxPageSize) => {\n const top = maxPageSize ?? 100;\n const rules = await this.getRules({\n skip: pageLink,\n maxCount: top,\n ...options,\n });\n return rules.length\n ? {\n page: rules,\n nextPageLink: rules.length > 0 ? pageLink + rules.length : undefined,\n }\n : undefined;\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n }\n\n /**\n * Deletes a rule.\n */\n async deleteRule(ruleName: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"ServiceBusRuleManager.deleteRule\",\n options,\n async (updatedOptions) => {\n const removeRuleOperationPromise = async (): Promise<void> => {\n return this._context.getManagementClient(this._entityPath).removeRule(ruleName, {\n ...updatedOptions,\n associatedLinkName: this.name,\n requestName: \"removeRule\",\n timeoutInMs: this._retryOptions.timeoutInMs,\n });\n };\n const config: RetryConfig<void> = {\n operation: removeRuleOperationPromise,\n connectionId: this._context.connectionId,\n operationType: RetryOperationType.management,\n retryOptions: this._retryOptions,\n abortSignal: updatedOptions?.abortSignal,\n };\n return retry<void>(config);\n },\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"messageSession.js","sourceRoot":"","sources":["../../../src/session/messageSession.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,SAAS,EACT,wBAAwB,EAGxB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAKL,cAAc,GAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAmB,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAA2B,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AA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uF;YACvF,MAAM,kCAAkC,GAAG,IAAI,CAAC;YAChD,qIAAqI;YACrI,0HAA0H;YAC1H,4IAA4I;YAC5I,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,EAAE,6BAA6B,CAAC,CAAC;YACnF,4HAA4H;YAC5H,yIAAyI;YACzI,qDAAqD;YACrD,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;YACvE,0IAA0I;YAC1I,kEAAkE;YAClE,IAAI,WAAW,IAAI,kCAAkC,EAAE,CAAC;gBACtD,WAAW,IAAI,yBAAyB,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,MAAM,cAAc,CAAC,KAAK,CAAC;YACzB,WAAW,EAAE,OAAO,EAAE,WAAW;YACjC,WAAW;SACZ,CAAC,CAAC;QACH,OAAO,cAAc,CAAC;IACxB,CAAC;IAES,qBAAqB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n Constants,\n ErrorNameConditionMapper,\n MessagingError,\n RetryOptions,\n StandardAbortMessage,\n} from \"@azure/core-amqp\";\nimport {\n AmqpError,\n EventContext,\n OnAmqpEvent,\n Receiver,\n ReceiverEvents,\n ReceiverOptions,\n} from \"rhea-promise\";\nimport { ConnectionContext } from \"../connectionContext\";\nimport { LinkEntity } from \"../core/linkEntity\";\nimport { DispositionStatusOptions } from \"../core/managementClient\";\nimport { OnAmqpEventAsPromise, OnError, OnMessage } from \"../core/messageReceiver\";\nimport { receiverLogger as logger } from \"../log\";\nimport { DispositionType, ServiceBusMessageImpl } from \"../serviceBusMessage\";\nimport { throwErrorIfConnectionClosed } from \"../util/errors\";\nimport { calculateRenewAfterDuration, convertTicksToDate } from \"../util/utils\";\nimport { BatchingReceiverLite, MinimalReceiver } from \"../core/batchingReceiver\";\nimport { onMessageSettled, DeferredPromiseAndTimer, createReceiverOptions } from \"../core/shared\";\nimport { AbortError, AbortSignalLike } from \"@azure/abort-controller\";\nimport { ReceiverHelper } from \"../core/receiverHelper\";\nimport {\n ServiceBusSessionReceiverOptions,\n ProcessErrorArgs,\n ReceiveMode,\n SubscribeOptions,\n} from \"../models\";\nimport { OperationOptionsBase } from \"../modelsToBeSharedWithEventHubs\";\nimport { ServiceBusError, translateServiceBusError } from \"../serviceBusError\";\nimport { abandonMessage, completeMessage } from \"../receivers/receiverCommon\";\nimport { delay, isDefined } from \"@azure/core-util\";\n\n/**\n * Describes the options that need to be provided while creating a message session receiver link.\n * @internal\n */\nexport interface CreateMessageSessionReceiverLinkOptions {\n onClose: OnAmqpEventAsPromise;\n onSessionClose: OnAmqpEventAsPromise;\n onError: OnAmqpEvent;\n onSessionError: OnAmqpEvent;\n onSettled: OnAmqpEvent;\n sessionId?: string;\n}\n\n/**\n * @internal\n * Describes all the options that can be set while instantiating a MessageSession object.\n */\nexport type MessageSessionOptions = Pick<\n ServiceBusSessionReceiverOptions,\n \"maxAutoLockRenewalDurationInMs\" | \"abortSignal\"\n> & {\n receiveMode?: ReceiveMode;\n retryOptions: RetryOptions | undefined;\n skipParsingBodyAsJson: boolean;\n skipConvertingDate: boolean;\n};\n\n/**\n * @internal\n * Describes the receiver for a Message Session.\n */\nexport class MessageSession extends LinkEntity<Receiver> {\n /**\n * Provides the duration until which the session is locked.\n */\n sessionLockedUntilUtc!: Date;\n /**\n * The sessionId for the message session. Empty string is valid sessionId.\n */\n sessionId!: string;\n /**\n * The maximum number of concurrent sessions that the\n * client should initiate.\n * - **Default**: `1`.\n */\n maxConcurrentSessions?: number;\n /**\n * The maximum number of messages that should be\n * processed concurrently in a session while in streaming mode. Once this limit has been reached,\n * more messages will not be received until the user's message handler has completed processing current message.\n * - **Default**: `1` (message in a session at a time).\n */\n maxConcurrentCalls: number = 1;\n /**\n * The mode in which messages should be received.\n * Default: ReceiveMode.peekLock\n */\n receiveMode: ReceiveMode;\n /**\n * Indicates whether `Message.complete()` should be called\n * automatically after the message processing is complete while receiving messages with handlers.\n * Default: false.\n */\n autoComplete: boolean;\n /**\n * The maximum duration within which the\n * lock will be renewed automatically. This value should be greater than the longest message\n * lock duration; for example, the `lockDuration` property on the received message.\n *\n * Default: `300 * 1000` (5 minutes);\n */\n maxAutoRenewDurationInMs: number;\n /**\n * Should lock renewal happen automatically.\n */\n autoRenewLock: boolean;\n /**\n * Denotes if we are currently receiving messages\n */\n get isReceivingMessages(): boolean {\n return this._batchingReceiverLite.isReceivingMessages || this._isReceivingMessagesForSubscriber;\n }\n\n private _batchingReceiverLite: BatchingReceiverLite;\n private _isReceivingMessagesForSubscriber: boolean;\n\n /**\n * Maintains a map of deliveries that\n * are being actively disposed. It acts as a store for correlating the responses received for\n * active dispositions.\n */\n private _deliveryDispositionMap: Map<number, DeferredPromiseAndTimer> = new Map<\n number,\n DeferredPromiseAndTimer\n >();\n /**\n * The message handler provided by the user that will\n * be wrapped inside _onAmqpMessage.\n */\n private _onMessage!: OnMessage;\n /**\n * The error handler provided by the user that will be wrapped\n * inside _onAmqpError.\n */\n private _onError?: OnError;\n /**\n * If the user provided error handler is present then it will\n * notify the user's error handler about the error.\n */\n private _notifyError: OnError;\n /**\n * The message handler that will be set as the handler on the\n * underlying rhea receiver for the \"receiver_close\" event.\n */\n private _onAmqpClose: OnAmqpEventAsPromise;\n /**\n * The message handler that will be set as the handler on\n * the underlying rhea receiver's session for the \"session_error\" event.\n */\n private _onSessionError: OnAmqpEvent;\n /**\n * The message handler that will be set as the handler on\n * the underlying rhea receiver's session for the \"session_close\" event.\n */\n private _onSessionClose: OnAmqpEventAsPromise;\n /**\n * The message handler that will be set as the handler on the\n * underlying rhea receiver for the \"receiver_error\" event.\n */\n private _onAmqpError: OnAmqpEvent;\n /**\n * The message handler that will be set as the handler on the\n * underlying rhea receiver for the \"settled\" event.\n */\n private _onSettled: OnAmqpEvent;\n /**\n * The session lock renewal timer that keeps\n * track of when the MessageSession is due for session lock renewal.\n */\n private _sessionLockRenewalTimer?: NodeJS.Timeout;\n\n private _totalAutoLockRenewDuration: number;\n\n /**\n * Whether to prevent the client from running JSON.parse() on the message body when receiving the message.\n */\n private skipParsingBodyAsJson: boolean;\n\n /**\n * Whether to skip converting Date type on properties of message annotations\n * or application properties into numbers when receiving the message. By\n * default, properties of Date type is converted into UNIX epoch number for\n * compatibility.\n */\n private skipConvertingDate: boolean;\n\n public get receiverHelper(): ReceiverHelper {\n return this._receiverHelper;\n }\n private _receiverHelper: ReceiverHelper;\n\n /**\n * Ensures that the session lock is renewed before it expires. The lock will not be renewed for\n * more than the configured totalAutoLockRenewDuration.\n */\n private _ensureSessionLockRenewal(): void {\n if (\n this.autoRenewLock &&\n new Date(this._totalAutoLockRenewDuration) > this.sessionLockedUntilUtc! &&\n Date.now() < this._totalAutoLockRenewDuration &&\n this.isOpen()\n ) {\n const nextRenewalTimeout = calculateRenewAfterDuration(this.sessionLockedUntilUtc!);\n this._sessionLockRenewalTimer = setTimeout(async () => {\n try {\n logger.verbose(\n \"%s Attempting to renew the session lock for MessageSession '%s' \" + \"with name '%s'.\",\n this.logPrefix,\n this.sessionId,\n this.name,\n );\n this.sessionLockedUntilUtc = await this._context\n .getManagementClient(this.entityPath)\n .renewSessionLock(this.sessionId, {\n associatedLinkName: this.name,\n timeoutInMs: 10000,\n });\n logger.verbose(\n \"%s Successfully renewed the session lock for MessageSession '%s' \" + \"with name '%s'.\",\n this.logPrefix,\n this.sessionId,\n this.name,\n );\n logger.verbose(\n \"%s Calling _ensureSessionLockRenewal() again for MessageSession '%s'.\",\n this.logPrefix,\n this.sessionId,\n );\n this._ensureSessionLockRenewal();\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while renewing the session lock for MessageSession '%s'\",\n this.logPrefix,\n this.sessionId,\n );\n }\n }, nextRenewalTimeout);\n logger.verbose(\n \"%s MessageSession '%s' has next session lock renewal in %d milliseconds @(%s).\",\n this.logPrefix,\n this.sessionId,\n nextRenewalTimeout,\n new Date(Date.now() + nextRenewalTimeout).toString(),\n );\n }\n }\n\n protected async createRheaLink(\n options: ReceiverOptions,\n _abortSignal?: AbortSignalLike,\n ): Promise<Receiver> {\n this._lastSBError = undefined;\n let errorMessage: string = \"\";\n\n const link = await this._context.connection.createReceiver(options);\n\n const receivedSessionId = link.source?.filter?.[Constants.sessionFilterName];\n if (!this._providedSessionId && !receivedSessionId) {\n // When we ask for any sessions (passing option of session-filter: undefined),\n // but don't receive one back, check whether service has sent any error.\n if (\n options.source &&\n typeof options.source !== \"string\" &&\n options.source.filter &&\n Constants.sessionFilterName in options.source.filter &&\n options.source.filter![Constants.sessionFilterName] === undefined\n ) {\n await delay(1); // yield to eventloop\n if (this._lastSBError) {\n throw this._lastSBError;\n }\n }\n // Ideally this code path should never be reached as `MessageSession.createReceiver()` should fail instead\n // TODO: https://github.com/Azure/azure-sdk-for-js/issues/9775 to figure out why this code path indeed gets hit.\n errorMessage = `Failed to create a receiver. No unlocked sessions available.`;\n } else if (this._providedSessionId && receivedSessionId !== this._providedSessionId) {\n // This code path is reached if the session is already locked by another receiver.\n // TODO: Check why the service would not throw an error or just timeout instead of giving a misleading successful receiver\n errorMessage = `Failed to create a receiver for the requested session '${this._providedSessionId}'. It may be locked by another receiver.`;\n }\n\n if (errorMessage) {\n const error = translateServiceBusError({\n description: errorMessage,\n condition: ErrorNameConditionMapper.SessionCannotBeLockedError,\n });\n logger.logError(error, this.logPrefix);\n throw error;\n }\n\n return link;\n }\n\n /**\n * Creates a new AMQP receiver under a new AMQP session.\n */\n private async _init(\n opts: { abortSignal?: AbortSignalLike; timeoutInMs?: number } = {},\n ): Promise<void> {\n try {\n const sessionOptions = this._createMessageSessionOptions(this.identifier, opts.timeoutInMs);\n await this.initLink(sessionOptions, opts.abortSignal);\n\n if (!this.link) {\n throw new Error(\"INTERNAL ERROR: failed to create receiver but without an error.\");\n }\n\n const receivedSessionId = this.link.source?.filter?.[Constants.sessionFilterName];\n\n if (!this._providedSessionId) this.sessionId = receivedSessionId;\n this.sessionLockedUntilUtc = convertTicksToDate(\n this.link.properties[\"com.microsoft:locked-until-utc\"],\n );\n logger.verbose(\n \"%s Session with id '%s' is locked until: '%s'.\",\n this.logPrefix,\n this.sessionId,\n this.sessionLockedUntilUtc.toISOString(),\n );\n logger.verbose(\n \"%s Receiver created with receiver options: %O\",\n this.logPrefix,\n sessionOptions,\n );\n if (!this._context.messageSessions[this.name]) {\n this._context.messageSessions[this.name] = this;\n }\n this._totalAutoLockRenewDuration = Date.now() + this.maxAutoRenewDurationInMs;\n this._ensureSessionLockRenewal();\n } catch (err: any) {\n const errObj = translateServiceBusError(err);\n logger.logError(errObj, \"%s An error occured while creating the receiver\", this.logPrefix);\n\n // Fix the unhelpful error messages for the OperationTimeoutError that comes from `rhea-promise`.\n if ((errObj as MessagingError).code === \"OperationTimeoutError\") {\n if (this._providedSessionId) {\n errObj.message = `Failed to create a receiver for the requested session '${this._providedSessionId}' within allocated time and retry attempts.`;\n } else {\n errObj.message = \"Failed to create a receiver within allocated time and retry attempts.\";\n }\n }\n throw errObj;\n }\n }\n\n /**\n * Creates the options that need to be specified while creating an AMQP receiver link.\n */\n private _createMessageSessionOptions(clientId: string, timeoutInMs?: number): ReceiverOptions {\n const rcvrOptions: ReceiverOptions = createReceiverOptions(\n this.name,\n this.receiveMode,\n {\n address: this.address,\n filter: { [Constants.sessionFilterName]: this.sessionId },\n },\n clientId,\n {\n onClose: (context) =>\n this._onAmqpClose(context).catch(() => {\n /* */\n }),\n onSessionClose: (context) =>\n this._onSessionClose(context).catch(() => {\n /* */\n }),\n onError: this._onAmqpError,\n onSessionError: this._onSessionError,\n onSettled: this._onSettled,\n },\n timeoutInMs,\n );\n\n return rcvrOptions;\n }\n\n private _retryOptions: RetryOptions | undefined;\n private _lastSBError: Error | ServiceBusError | undefined;\n\n /**\n * Constructs a MessageSession instance which lets you receive messages as batches\n * or via callbacks using subscribe.\n *\n * @param _providedSessionId - The sessionId provided by the user. This can be the\n * name of a session ID to open (empty string is also valid) or it can be undefined,\n * to indicate we want the next unlocked non-empty session.\n */\n constructor(\n public identifier: string,\n connectionContext: ConnectionContext,\n entityPath: string,\n private _providedSessionId: string | undefined,\n options: MessageSessionOptions,\n ) {\n super(entityPath, entityPath, connectionContext, \"session\", logger, {\n address: entityPath,\n audience: `${connectionContext.config.endpoint}${entityPath}`,\n });\n this._receiverHelper = new ReceiverHelper(() => ({\n receiver: this.link,\n logPrefix: this.logPrefix,\n }));\n this._retryOptions = options.retryOptions;\n this.autoComplete = false;\n if (isDefined(this._providedSessionId)) this.sessionId = this._providedSessionId;\n this.receiveMode = options.receiveMode || \"peekLock\";\n this.skipParsingBodyAsJson = options.skipParsingBodyAsJson;\n this.skipConvertingDate = options.skipConvertingDate;\n this.maxAutoRenewDurationInMs =\n options.maxAutoLockRenewalDurationInMs != null\n ? options.maxAutoLockRenewalDurationInMs\n : 300 * 1000;\n this._totalAutoLockRenewDuration = Date.now() + this.maxAutoRenewDurationInMs;\n this.autoRenewLock = this.maxAutoRenewDurationInMs > 0 && this.receiveMode === \"peekLock\";\n\n this._isReceivingMessagesForSubscriber = false;\n this._batchingReceiverLite = new BatchingReceiverLite(\n connectionContext,\n entityPath,\n async (_abortSignal?: AbortSignalLike): Promise<MinimalReceiver> => {\n return this.link!;\n },\n this.receiveMode,\n this.skipParsingBodyAsJson,\n this.skipConvertingDate,\n );\n\n // setting all the handlers\n this._onSettled = (context: EventContext) => {\n const delivery = context.delivery;\n\n onMessageSettled(this.logPrefix, delivery, this._deliveryDispositionMap);\n };\n\n this._notifyError = async (args: ProcessErrorArgs) => {\n if (this._onError) {\n this._onError(args);\n logger.verbose(\n \"%s Notified the user's error handler about the error received by the Receiver\",\n this.logPrefix,\n );\n }\n };\n\n this._onAmqpError = (context: EventContext) => {\n const receiverError = context.receiver && context.receiver.error;\n if (receiverError) {\n const sbError = translateServiceBusError(receiverError) as MessagingError;\n if (sbError.code === \"SessionLockLostError\") {\n sbError.message = `The session lock has expired on the session with id ${this.sessionId}.`;\n }\n this._lastSBError = sbError;\n logger.logError(sbError, \"%s An error occurred for Receiver\", this.logPrefix);\n this._notifyError({\n error: sbError,\n errorSource: \"receive\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n }\n };\n\n this._onSessionError = (context: EventContext) => {\n const connectionId = this._context.connectionId;\n const sessionError = context.session && context.session.error;\n if (sessionError) {\n const sbError = translateServiceBusError(sessionError);\n logger.logError(\n sbError,\n \"[%s] An error occurred on the session for Receiver '%s': %O.\",\n connectionId,\n this.name,\n sbError,\n );\n this._notifyError({\n error: sbError,\n errorSource: \"receive\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n }\n };\n\n this._onAmqpClose = async (context: EventContext) => {\n const connectionId = this._context.connectionId;\n const receiverError = context.receiver && context.receiver.error;\n const receiver = this.link || context.receiver!;\n if (receiverError) {\n const sbError = translateServiceBusError(receiverError) as MessagingError;\n logger.logError(\n sbError,\n \"[%s] 'receiver_close' event occurred for receiver '%s' for sessionId '%s'. \" +\n \"The associated error is: %O\",\n connectionId,\n this.name,\n this.sessionId,\n sbError,\n );\n // no need to notify the user's error handler since rhea guarantees that receiver_error\n // will always be emitted before receiver_close.\n }\n if (receiver && !receiver.isItselfClosed()) {\n logger.verbose(\n \"%s 'receiver_close' event occurred on the receiver for sessionId '%s' \" +\n \"and the sdk did not initiate this. Hence, let's gracefully close the receiver.\",\n this.logPrefix,\n this.sessionId,\n );\n try {\n await this.close();\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while closing the receiver for sessionId '%s'.\",\n this.logPrefix,\n this.sessionId,\n );\n }\n } else {\n logger.verbose(\n \"%s 'receiver_close' event occurred on the receiver for sessionId '%s' \" +\n \"because the sdk initiated it. Hence no need to gracefully close the receiver\",\n this.logPrefix,\n this.sessionId,\n );\n }\n };\n\n this._onSessionClose = async (context: EventContext) => {\n const receiver = this.link || context.receiver!;\n const sessionError = context.session && context.session.error;\n if (sessionError) {\n const sbError = translateServiceBusError(sessionError);\n logger.logError(\n sbError,\n \"%s 'session_close' event occurred for receiver for sessionId '%s'. \" +\n \"The associated error is\",\n this.logPrefix,\n this.sessionId,\n );\n // no need to notify the user's error handler since rhea guarantees that session_error\n // will always be emitted before session_close.\n }\n\n if (receiver && !receiver.isSessionItselfClosed()) {\n logger.verbose(\n \"%s 'session_close' event occurred on the receiver for sessionId '%s' \" +\n \"and the sdk did not initiate this. Hence, let's gracefully close the receiver.\",\n this.logPrefix,\n this.sessionId,\n );\n try {\n await this.close();\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while closing the receiver for sessionId '%s'\",\n this.logPrefix,\n this.sessionId,\n );\n }\n } else {\n logger.verbose(\n \"%s 'session_close' event occurred on the receiver for sessionId'%s' \" +\n \"because the sdk initiated it. Hence no need to gracefully close the receiver\",\n this.logPrefix,\n this.sessionId,\n );\n }\n };\n }\n\n /**\n * Closes the underlying AMQP receiver link.\n */\n async close(error?: Error | AmqpError): Promise<void> {\n try {\n this._isReceivingMessagesForSubscriber = false;\n if (this._sessionLockRenewalTimer) clearTimeout(this._sessionLockRenewalTimer);\n logger.verbose(\n \"%s Cleared the timers for 'no new message received' task and \" +\n \"'session lock renewal' task.\",\n this.logPrefix,\n );\n\n await super.close();\n\n this._batchingReceiverLite.terminate(error);\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while closing the message session with id '%s'\",\n this.logPrefix,\n this.sessionId,\n );\n }\n }\n\n /**\n * Determines whether the AMQP receiver link is open. If open then returns true else returns false.\n */\n isOpen(): boolean {\n const result: boolean = this.link! && this.link!.isOpen();\n logger.verbose(\n \"%s Receiver for sessionId '%s' is open? -> %s\",\n this.logPrefix,\n this.sessionId,\n result,\n );\n return result;\n }\n\n /**\n * Registers handlers to deal with the incoming stream of messages over an AMQP receiver link\n * from a Queue/Subscription.\n * To stop receiving messages, call `close()` on the SessionReceiver or set the property\n * `newMessageWaitTimeoutInMs` in the options to provide a timeout.\n *\n * @param onMessage - Handler for processing each incoming message.\n * @param onError - Handler for any error that occurs while receiving or processing messages.\n * @param options - Options to control whether messages should be automatically completed. You can\n * also provide a timeout in milliseconds to denote the amount of time to wait for a new message\n * before closing the receiver.\n */\n public subscribe(onMessage: OnMessage, onError: OnError, options: SubscribeOptions): void {\n this.receiverHelper.resume();\n this._subscribeImpl(onMessage, onError, options);\n }\n\n private _subscribeImpl(onMessage: OnMessage, onError: OnError, options: SubscribeOptions): void {\n if (!options) options = {};\n\n if (options.abortSignal?.aborted) {\n throw new AbortError(StandardAbortMessage);\n }\n\n this._isReceivingMessagesForSubscriber = true;\n if (typeof options.maxConcurrentCalls === \"number\" && options.maxConcurrentCalls > 0) {\n this.maxConcurrentCalls = options.maxConcurrentCalls;\n }\n\n // If explicitly set to false then autoComplete is false else true (default).\n this.autoComplete =\n options.autoCompleteMessages === false ? options.autoCompleteMessages : true;\n this._onMessage = onMessage;\n this._onError = onError;\n\n if (this.link && this.link.isOpen()) {\n const onSessionMessage = async (context: EventContext): Promise<void> => {\n // If the receiver got closed in PeekLock mode, avoid processing the message as we\n // cannot settle the message.\n if (this.receiveMode === \"peekLock\" && (!this.link || !this.link.isOpen())) {\n logger.verbose(\n \"%s Not calling the user's message handler for the current message \" +\n \"as the receiver is closed\",\n this.logPrefix,\n );\n return;\n }\n\n const bMessage = new ServiceBusMessageImpl(\n context.message!,\n context.delivery!,\n true,\n this.receiveMode,\n this.skipParsingBodyAsJson,\n this.skipConvertingDate,\n );\n\n try {\n await this._onMessage(bMessage);\n\n if (\n this.autoComplete &&\n this.receiveMode === \"peekLock\" &&\n !bMessage.delivery.remote_settled\n ) {\n try {\n logger.verbose(\n \"%s Auto completing the message with id '%s' on the receiver.\",\n this.logPrefix,\n bMessage.messageId,\n );\n await completeMessage(bMessage, this._context, this.entityPath, this._retryOptions);\n } catch (completeError: any) {\n const translatedError = translateServiceBusError(completeError);\n logger.logError(\n translatedError,\n \"%s An error occurred while completing the message with id '%s' on the \" +\n \"receiver\",\n this.logPrefix,\n bMessage.messageId,\n );\n await this._notifyError({\n error: translatedError,\n errorSource: \"complete\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n }\n }\n } catch (err: any) {\n logger.logError(\n err,\n \"%s An error occurred while running user's message handler for the message \" +\n \"with id '%s' on the receiver\",\n this.logPrefix,\n bMessage.messageId,\n );\n await this._onError!({\n error: err,\n errorSource: \"processMessageCallback\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n\n const error = translateServiceBusError(err);\n // Nothing much to do if user's message handler throws. Let us try abandoning the message.\n if (\n !bMessage.delivery.remote_settled &&\n this.receiveMode === \"peekLock\" &&\n this.isOpen() // only try to abandon the messages if the connection is still open\n ) {\n try {\n logger.logError(\n error,\n \"%s Abandoning the message with id '%s' on the receiver since an error occured\",\n this.logPrefix,\n bMessage.messageId,\n );\n await abandonMessage(\n bMessage,\n this._context,\n this.entityPath,\n undefined,\n this._retryOptions,\n );\n } catch (abandonError: any) {\n const translatedError = translateServiceBusError(abandonError);\n logger.logError(\n translatedError,\n \"%s An error occurred while abandoning the message with id '%s' on the \" +\n \"receiver\",\n this.logPrefix,\n bMessage.messageId,\n translatedError,\n );\n await this._notifyError({\n error: translatedError,\n errorSource: \"abandon\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n }\n }\n return;\n } finally {\n try {\n this.receiverHelper.addCredit(1);\n } catch (err: any) {\n // this isn't something we expect in normal operation - we'd only get here\n // because of a bug in our code.\n this.processCreditError(err);\n }\n }\n };\n // setting the \"message\" event listener.\n this.link.on(ReceiverEvents.message, onSessionMessage);\n\n try {\n this.receiverHelper.addCredit(this.maxConcurrentCalls);\n } catch (err: any) {\n // this isn't something we expect in normal operation - we'd only get here\n // because of a bug in our code.\n this.processCreditError(err);\n }\n } else {\n this._isReceivingMessagesForSubscriber = false;\n const msg =\n `MessageSession with sessionId '${this.sessionId}' and name '${this.name}' ` +\n `has either not been created or is not open.`;\n logger.verbose(\"[%s] %s\", this._context.connectionId, msg);\n this._notifyError({\n error: new Error(msg),\n // This is _probably_ the right error code since we require that\n // the message session is created before we even give back the receiver. So it not\n // being open at this point is either:\n //\n // 1. we didn't acquire the lock\n // 2. the connection was broken (we don't reconnect)\n //\n // If any of these becomes untrue you'll probably want to re-evaluate this classification.\n errorSource: \"receive\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n }\n }\n\n private async processCreditError(err: any): Promise<void> {\n if (err.name === \"AbortError\") {\n // if we fail to add credits because the user has asked us to stop\n // then this isn't an error - it's normal.\n return;\n }\n\n logger.logError(err, \"Cannot request messages on the receiver\");\n\n const error = new ServiceBusError(\"Cannot request messages on the receiver\", \"SessionLockLost\");\n error.retryable = false;\n\n // from the user's perspective this is a fatal link error and they should retry\n // opening the link.\n await this._onError!({\n error,\n errorSource: \"processMessageCallback\",\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n identifier: this.identifier,\n });\n }\n\n /**\n * Returns a batch of messages based on given count and timeout over an AMQP receiver link\n * from a Queue/Subscription.\n *\n * @param maxMessageCount - The maximum number of messages to receive from Queue/Subscription.\n * @param maxWaitTimeInMs - The total wait time in milliseconds until which the receiver will attempt to receive specified number of messages.\n * If this time elapses before the `maxMessageCount` is reached, then messages collected till then will be returned to the user.\n * @returns A promise that resolves with an array of Message objects.\n */\n async receiveMessages(\n maxMessageCount: number,\n maxWaitTimeInMs: number,\n maxTimeAfterFirstMessageInMs: number,\n options: OperationOptionsBase,\n ): Promise<ServiceBusMessageImpl[]> {\n try {\n return await this._batchingReceiverLite.receiveMessages({\n maxMessageCount,\n maxWaitTimeInMs,\n maxTimeAfterFirstMessageInMs,\n ...options,\n });\n } catch (error: any) {\n logger.logError(error, `${this.logPrefix} Rejecting receiveMessages() with error`);\n throw error;\n }\n }\n\n /**\n * To be called when connection is disconnected to gracefully close ongoing receive request.\n * @param connectionError - The connection error if any.\n */\n async onDetached(connectionError: AmqpError | Error): Promise<void> {\n logger.error(\n translateServiceBusError(connectionError),\n `${this.logPrefix} onDetached: closing link (session receiver will not reconnect)`,\n );\n try {\n // Notifying so that the streaming receiver knows about the error\n await this._notifyError({\n entityPath: this.entityPath,\n fullyQualifiedNamespace: this._context.config.host,\n error: translateServiceBusError(connectionError),\n errorSource: \"receive\",\n identifier: this.identifier,\n });\n } catch (error: any) {\n logger.error(\n translateServiceBusError(error),\n `${\n this.logPrefix\n } onDetached: unexpected error seen when tried calling \"_notifyError\" with ${translateServiceBusError(\n connectionError,\n )}`,\n );\n }\n await this.close(connectionError);\n }\n\n /**\n * Settles the message with the specified disposition.\n * @param message - The ServiceBus Message that needs to be settled.\n * @param operation - The disposition type.\n * @param options - Optional parameters that can be provided while disposing the message.\n */\n async settleMessage(\n message: ServiceBusMessageImpl,\n operation: DispositionType,\n options: DispositionStatusOptions,\n ): Promise<any> {\n return new Promise((resolve, reject) => {\n if (operation.match(/^(complete|abandon|defer|deadletter)$/) == null) {\n return reject(new Error(`operation: '${operation}' is not a valid operation.`));\n }\n const delivery = message.delivery;\n const timer = setTimeout(() => {\n this._deliveryDispositionMap.delete(delivery.id);\n logger.verbose(\n \"[%s] Disposition for delivery id: %d, did not complete in %d milliseconds. \" +\n \"Hence rejecting the promise with timeout error\",\n this._context.connectionId,\n delivery.id,\n Constants.defaultOperationTimeoutInMs,\n );\n\n const e: AmqpError = {\n condition: ErrorNameConditionMapper.ServiceUnavailableError,\n description:\n \"Operation to settle the message has timed out. The disposition of the \" +\n \"message may or may not be successful\",\n };\n return reject(translateServiceBusError(e));\n }, Constants.defaultOperationTimeoutInMs);\n this._deliveryDispositionMap.set(delivery.id, {\n resolve: resolve,\n reject: reject,\n timer: timer,\n });\n if (operation === DispositionType.complete) {\n delivery.accept();\n } else if (operation === DispositionType.abandon) {\n const params: any = {\n undeliverable_here: false,\n };\n if (options.propertiesToModify) params.message_annotations = options.propertiesToModify;\n delivery.modified(params);\n } else if (operation === DispositionType.defer) {\n const params: any = {\n undeliverable_here: true,\n };\n if (options.propertiesToModify) params.message_annotations = options.propertiesToModify;\n delivery.modified(params);\n } else if (operation === DispositionType.deadletter) {\n const error: AmqpError = {\n condition: Constants.deadLetterName,\n info: {\n ...options.propertiesToModify,\n DeadLetterReason: options.deadLetterReason,\n DeadLetterErrorDescription: options.deadLetterDescription,\n },\n };\n delivery.reject(error);\n }\n });\n }\n\n /**\n * Creates a new instance of the MessageSession based on the provided parameters.\n * @param identifier - name to identify the message session\n * @param context - The client entity context\n * @param options - Options that can be provided while creating the MessageSession.\n */\n static async create(\n identifier: string,\n context: ConnectionContext,\n entityPath: string,\n sessionId: string | undefined,\n options: MessageSessionOptions,\n ): Promise<MessageSession> {\n throwErrorIfConnectionClosed(context);\n const messageSession = new MessageSession(identifier, context, entityPath, sessionId, options);\n let timeoutInMs: number | undefined;\n // Only passing client timeout in link properties for accepting next available\n // session as this is the only long-polling scenario.\n if (sessionId === undefined) {\n timeoutInMs = options.retryOptions?.timeoutInMs ?? Constants.defaultOperationTimeoutInMs;\n // The number of milliseconds to use as the basis for calculating a random jitter amount\n // opening receiver links. This is intended to ensure that multiple\n // session operations don't timeout at the same exact moment.\n const openReceiveLinkBaseJitterInMs = 100;\n // The amount of time to subtract from the client timeout when setting the server timeout when attempting to\n // accept the next available session. This will decrease the likelihood that the client times out before receiving a\n // response from the server.\n const openReceiveLinkBufferInMs = 20;\n // The amount minimum threshold for the server timeout for which we will subtract the \"openReceiveLinkBufferInMs\".\n // If the server timeout is less than this, we will not subtract the additional buffer.\n const openReceiveLinkBufferThresholdInMs = 1000;\n // Subtract a random amount up to 100ms from the operation timeout as the jitter when attempting to open next available session link.\n // This prevents excessive resource usage when using high amounts of concurrency and accepting the next available session.\n // Take the min of 1% of the total timeout and the base jitter amount so that we don't end up subtracting more than 1% of the total timeout.\n const jitterBaseInMs = Math.min(timeoutInMs * 0.01, openReceiveLinkBaseJitterInMs);\n // We set the operation timeout on the properties not only to include the jitter, but also because the server will otherwise\n // restrict the maximum timeout to 1 minute and 5 seconds, regardless of the client timeout. We only do this for accepting next available\n // session as this is the only long-polling scenario.\n timeoutInMs = Math.floor(timeoutInMs - jitterBaseInMs * Math.random());\n // Subtract an additional constant buffer to reduce the likelihood that the client times out before the service which leads to unnecessary\n // network traffic. If the timeout is too short, we won't do this.\n if (timeoutInMs >= openReceiveLinkBufferThresholdInMs) {\n timeoutInMs -= openReceiveLinkBufferInMs;\n }\n }\n\n await messageSession._init({\n abortSignal: options?.abortSignal,\n timeoutInMs,\n });\n return messageSession;\n }\n\n protected removeLinkFromContext(): void {\n delete this._context.messageSessions[this.name];\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"atomXmlHelper.js","sourceRoot":"","sources":["../../../src/util/atomXmlHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,SAAS,GAGV,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAmB7C;;IAEI;AACJ,SAAS,mBAAmB,CAC1B,OAAwB,EACxB,OAOC;IAED,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC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CAAC,MAAM,KAAK,KAAK,IAAI,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC;YAC1F,OAAO,cAAc,CAAC;QACxB,CAAC;QAED,IAAI,YAAY,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACzE,OAAO,cAAc,CAAC;QACxB,CAAC;QAED,OAAO,iCAAiC,CAAC;IAC3C,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,IAAI,YAAY,IAAI,YAAY,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YACzE,OAAO,uBAAuB,CAAC;QACjC,CAAC;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5B,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,OAAQ,SAAS,CAAC,iBAAsD,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5F,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelineResponse,\n RestError,\n PipelineRequest,\n TransferProgressEvent,\n} from \"@azure/core-rest-pipeline\";\nimport { ServiceClient, OperationOptions, FullOperationResponse } from \"@azure/core-client\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\n\nimport * as Constants from \"./constants\";\nimport { administrationLogger as logger } from \"../log\";\nimport { Buffer } from \"buffer\";\n\nimport { parseURL } from \"./parseUrl\";\nimport { isJSONLikeObject } from \"./utils\";\nimport { isDefined } from \"@azure/core-util\";\nimport { OperationTracingOptions } from \"@azure/core-tracing\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport { InternalQueueOptions } from \"../serializers/queueResourceSerializer\";\nimport { InternalTopicOptions } from \"../serializers/topicResourceSerializer\";\nimport { InternalSubscriptionOptions } from \"../serializers/subscriptionResourceSerializer\";\nimport { CreateRuleOptions } from \"../serializers/ruleResourceSerializer\";\n\n/**\n * @internal\n * Represents the internal ATOM XML serializer interface\n */\nexport interface AtomXmlSerializer {\n // eslint-disable-next-line @typescript-eslint/ban-types\n serialize(requestBodyInJson: object): Record<string, unknown>;\n\n deserialize(response: FullOperationResponse): Promise<FullOperationResponse>;\n}\n\n/**\n applies options to the pipeline request.\n */\nfunction applyRequestOptions(\n request: PipelineRequest,\n options: {\n headers?: Record<string, string>;\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n abortSignal?: AbortSignalLike;\n tracingOptions?: OperationTracingOptions;\n timeout: number;\n },\n): void {\n if (options.headers) {\n const headers = options.headers;\n for (const headerName of Object.keys(headers)) {\n request.headers.set(headerName, headers[headerName]);\n }\n }\n request.onDownloadProgress = options.onDownloadProgress;\n request.onUploadProgress = options.onUploadProgress;\n request.abortSignal = options.abortSignal;\n request.timeout = options.timeout;\n if (options.tracingOptions) {\n request.tracingOptions = options.tracingOptions;\n }\n}\n\n/**\n * @internal\n * Utility to execute Atom XML operations as HTTP requests\n */\nexport async function executeAtomXmlOperation(\n serviceBusAtomManagementClient: ServiceClient,\n request: PipelineRequest,\n serializer: AtomXmlSerializer,\n operationOptions: OperationOptions,\n requestObject?:\n | InternalQueueOptions\n | InternalTopicOptions\n | InternalSubscriptionOptions\n | CreateRuleOptions,\n): Promise<FullOperationResponse> {\n if (requestObject) {\n request.body = stringifyXML(serializer.serialize(requestObject), { rootName: \"entry\" });\n if (request.method === \"PUT\") {\n request.headers.set(\"content-length\", Buffer.byteLength(request.body));\n }\n }\n\n logger.verbose(`Executing ATOM based HTTP request: ${request.body}`);\n\n const reqPrepareOptions = {\n headers: operationOptions.requestOptions?.customHeaders,\n onUploadProgress: operationOptions.requestOptions?.onUploadProgress,\n onDownloadProgress: operationOptions.requestOptions?.onDownloadProgress,\n abortSignal: operationOptions.abortSignal,\n tracingOptions: operationOptions.tracingOptions,\n disableJsonStringifyOnBody: true,\n timeout: operationOptions.requestOptions?.timeout || 0,\n };\n applyRequestOptions(request, reqPrepareOptions);\n const response: PipelineResponse = await serviceBusAtomManagementClient.sendRequest(request);\n\n logger.verbose(`Received ATOM based HTTP response: ${response.bodyAsText}`);\n\n try {\n if (response.bodyAsText) {\n (response as FullOperationResponse).parsedBody = await parseXML(response.bodyAsText, {\n includeRoot: true,\n });\n }\n } catch (err: any) {\n const error = new RestError(\n `Error occurred while parsing the response body - expected the service to return valid xml content.`,\n {\n code: RestError.PARSE_ERROR,\n statusCode: response.status,\n request: response.request,\n response,\n },\n );\n logger.logError(err, \"Error parsing response body from Service\");\n throw error;\n }\n\n return serializer.deserialize(response);\n}\n\n/**\n * @internal\n * The key-value pairs having undefined/null as the values would lead to the empty tags in the serialized XML request.\n * Empty tags in the request body is problematic because of the following reasons.\n * - ATOM based management operations throw a \"Bad Request\" error if empty tags are included in the XML request body at top level.\n * - At the inner levels, Service assigns the empty strings as values to the empty tags instead of throwing an error.\n *\n * This method recursively removes the key-value pairs with undefined/null as the values from the request object that is to be serialized.\n *\n */\nexport function sanitizeSerializableObject(resource: { [key: string]: any }): void {\n Object.keys(resource).forEach(function (property) {\n if (!isDefined(resource[property])) {\n delete resource[property];\n } else if (isJSONLikeObject(resource[property])) {\n sanitizeSerializableObject(resource[property]);\n }\n });\n}\n\n/**\n * @internal\n * Serializes input information to construct the Atom XML request\n * @param resourceName - Name of the resource to be serialized like `QueueDescription`\n * @param resource - The entity details\n * @param allowedProperties - The set of properties that are allowed by the service for the\n * associated operation(s);\n */\nexport function serializeToAtomXmlRequest(\n resourceName: string,\n resource: unknown,\n): Record<string, unknown> {\n const content: any = {};\n\n content[resourceName] = Object.assign({}, resource);\n sanitizeSerializableObject(content[resourceName]);\n\n content[resourceName][Constants.XML_METADATA_MARKER] = {\n xmlns: \"http://schemas.microsoft.com/netservices/2010/10/servicebus/connect\",\n \"xmlns:i\": \"http://www.w3.org/2001/XMLSchema-instance\",\n };\n\n content[Constants.XML_METADATA_MARKER] = { type: \"application/xml\" };\n const requestDetails: Record<string, unknown> = {\n updated: new Date().toISOString(),\n content: content,\n };\n requestDetails[Constants.XML_METADATA_MARKER] = {\n xmlns: \"http://www.w3.org/2005/Atom\",\n };\n return requestDetails;\n}\n\n/**\n * @internal\n * Transforms response to contain the parsed data.\n * @param nameProperties - The set of 'name' properties to be constructed on the\n * resultant object e.g., QueueName, TopicName, etc.\n */\nexport async function deserializeAtomXmlResponse(\n nameProperties: string[],\n response: FullOperationResponse,\n): Promise<FullOperationResponse> {\n // If received data is a non-valid HTTP response, the body is expected to contain error information\n if (response.status < 200 || response.status >= 300) {\n throw buildError(response);\n }\n\n parseAtomResult(response, nameProperties);\n\n return response;\n}\n\n/**\n * @internal\n * Utility to deserialize the given JSON content in response body based on\n * if it's a single `entry` or `feed` and updates the `response.parsedBody` to hold the evaluated output.\n * @param response - Response containing the JSON value in `response.parsedBody`\n * @param nameProperties - The set of 'name' properties to be constructed on the\n * resultant object e.g., QueueName, TopicName, etc.\n * */\nfunction parseAtomResult(response: FullOperationResponse, nameProperties: string[]): void {\n const atomResponseInJson = response.parsedBody;\n\n let result: any;\n if (!atomResponseInJson) {\n response.parsedBody = undefined;\n return;\n }\n\n if (atomResponseInJson.feed) {\n result = parseFeedResult(atomResponseInJson.feed);\n } else if (atomResponseInJson.entry) {\n result = parseEntryResult(atomResponseInJson.entry);\n }\n\n if (result) {\n if (Array.isArray(result)) {\n result.forEach((entry) => {\n setName(entry, nameProperties);\n });\n } else {\n setName(result, nameProperties);\n }\n response.parsedBody = result;\n return;\n }\n\n logger.warning(\n \"Failure in parsing response body from service. Expected response to be in Atom XML format and have either feed or entry components, but received - %0\",\n atomResponseInJson,\n );\n throw new RestError(\n \"Error occurred while parsing the response body - expected the service to return atom xml content with either feed or entry elements.\",\n {\n code: RestError.PARSE_ERROR,\n statusCode: response.status,\n request: response.request,\n response,\n },\n );\n}\n\n/**\n * @internal\n * Utility to help parse given `entry` result\n */\nfunction parseEntryResult(entry: any): Record<string, unknown> | undefined {\n let result: any;\n\n if (\n typeof entry !== \"object\" ||\n entry == null ||\n typeof entry.content !== \"object\" ||\n entry.content == null\n ) {\n return undefined;\n }\n\n const contentElementNames = Object.keys(entry.content).filter(function (key) {\n return key !== Constants.XML_METADATA_MARKER;\n });\n\n if (contentElementNames && contentElementNames[0]) {\n const contentRootElementName = contentElementNames[0];\n delete entry.content[contentRootElementName][Constants.XML_METADATA_MARKER];\n result = entry.content[contentRootElementName];\n\n if (result) {\n if (entry[Constants.XML_METADATA_MARKER]) {\n result[Constants.ATOM_METADATA_MARKER] = entry[Constants.XML_METADATA_MARKER];\n } else {\n result[Constants.ATOM_METADATA_MARKER] = {};\n }\n\n result[Constants.ATOM_METADATA_MARKER][\"ContentRootElement\"] = contentRootElementName;\n\n Object.keys(entry).forEach((property: string) => {\n if (property !== \"content\" && property !== Constants.XML_METADATA_MARKER) {\n result[Constants.ATOM_METADATA_MARKER][property] = entry[property];\n }\n });\n\n return result;\n }\n }\n\n return undefined;\n}\n\n/**\n * @internal\n * Utility to help parse link info from the given `feed` result\n */\nfunction parseLinkInfo(\n feedLink: { [Constants.XML_METADATA_MARKER]: { rel: string; href: string } }[],\n relationship: \"self\" | \"next\",\n): string | undefined {\n if (!feedLink || !Array.isArray(feedLink)) {\n return undefined;\n }\n for (const linkInfo of feedLink) {\n if (linkInfo[Constants.XML_METADATA_MARKER].rel === relationship) {\n return linkInfo[Constants.XML_METADATA_MARKER].href;\n }\n }\n return undefined;\n}\n\n/**\n * @internal\n * Utility to help parse given `feed` result\n */\nfunction parseFeedResult(feed: any): Record<string, unknown>[] & { nextLink?: string } {\n const result: Record<string, unknown>[] & { nextLink?: string } = [];\n if (typeof feed === \"object\" && feed != null && feed.entry) {\n if (Array.isArray(feed.entry)) {\n feed.entry.forEach((entry: any) => {\n const parsedEntryResult = parseEntryResult(entry);\n if (parsedEntryResult) {\n result.push(parsedEntryResult);\n }\n });\n } else {\n const parsedEntryResult = parseEntryResult(feed.entry);\n if (parsedEntryResult) {\n result.push(parsedEntryResult);\n }\n }\n result.nextLink = parseLinkInfo(feed.link, \"next\");\n }\n return result;\n}\n\n/**\n * @internal\n */\nfunction isKnownResponseCode(\n statusCode: number,\n): statusCode is keyof typeof Constants.HttpResponseCodes {\n return !!(Constants.HttpResponseCodes as { [statusCode: number]: string })[statusCode];\n}\n\n/**\n * @internal\n * Extracts the applicable entity name(s) from the URL based on the known structure\n * and instantiates the corresponding name properties to the deserialized response\n *\n * The pattern matching checks to extract entity names are based on following\n * constraints dictated by the service\n * - '/' is allowed in Queue and Topic names\n * - '/' is not allowed in Namespace, Subscription and Rule names\n * - Valid pathname URL structures used in the ATOM based management API are\n * - `<namespace-component>/<topic-name>/Subscriptions/<subscription-name>/Rules/<rule-name>`\n * - `<namespace-component>/<topic-name>/Subscriptions/<subscription-name>`\n * - `<namespace-component>/<any-entity-name>`\n *\n */\nfunction setName(entry: any, nameProperties: any): any {\n if (entry[Constants.ATOM_METADATA_MARKER]) {\n let rawUrl = entry[Constants.ATOM_METADATA_MARKER].id;\n\n // The parsedUrl gets constructed differently for browser vs Node.\n // It is specifically behaves different for some of the Atom based management API where\n // the received URL in \"id\" element is of type \"sb:// ... \" and not a standard HTTP one\n // Hence, normalizing the URL for parsing to work as expected in browser\n if (rawUrl.startsWith(\"sb://\")) {\n rawUrl = \"https://\" + rawUrl.substring(5);\n }\n\n const parsedUrl = parseURL(rawUrl);\n const pathname: string = parsedUrl.pathname;\n\n const firstIndexOfDelimiter = pathname.indexOf(\"/\");\n\n if (pathname.match(\"(.*)/(.*)/Subscriptions/(.*)/Rules/(.*)\")) {\n const lastIndexOfSubscriptionsDelimiter = pathname.lastIndexOf(\"/Subscriptions/\");\n const firstIndexOfRulesDelimiter = pathname.indexOf(\"/Rules/\");\n entry[nameProperties[0]] = pathname.substring(\n firstIndexOfDelimiter + 1,\n lastIndexOfSubscriptionsDelimiter,\n );\n entry[nameProperties[1]] = pathname.substring(\n lastIndexOfSubscriptionsDelimiter + 15,\n firstIndexOfRulesDelimiter,\n );\n entry[nameProperties[2]] = pathname.substring(firstIndexOfRulesDelimiter + 7);\n } else if (pathname.match(\"(.*)/(.*)/Subscriptions/(.*)\")) {\n const lastIndexOfSubscriptionsDelimiter = pathname.lastIndexOf(\"/Subscriptions/\");\n entry[nameProperties[0]] = pathname.substring(\n firstIndexOfDelimiter + 1,\n lastIndexOfSubscriptionsDelimiter,\n );\n entry[nameProperties[1]] = pathname.substring(lastIndexOfSubscriptionsDelimiter + 15);\n } else if (pathname.match(\"(.*)/(.*)\")) {\n entry[nameProperties[0]] = pathname.substring(firstIndexOfDelimiter + 1);\n }\n }\n}\n\n/**\n * @internal\n * Utility to help construct the normalized `RestError` object based on given error\n * information and other data present in the received `response` object.\n */\nexport function buildError(response: FullOperationResponse): RestError {\n if (!isKnownResponseCode(response.status)) {\n throw new RestError(\n `Service returned an error response with an unrecognized HTTP status code - ${response.status}`,\n {\n code: \"ServiceError\",\n statusCode: response.status,\n request: response.request,\n response,\n },\n );\n }\n\n const errorBody = response.parsedBody;\n let errorMessage;\n if (typeof errorBody === \"string\") {\n errorMessage = errorBody;\n } else {\n if (\n !isDefined(errorBody) ||\n !isDefined(errorBody.Error) ||\n !isDefined(errorBody.Error.Detail)\n ) {\n errorMessage =\n \"Detailed error message information not available. Look at the 'code' property on error for more information.\";\n } else {\n errorMessage = errorBody.Error.Detail;\n }\n }\n\n const errorCode = getErrorCode(response, errorMessage);\n\n const error: RestError = new RestError(errorMessage, {\n code: errorCode,\n statusCode: response.status,\n request: response.request,\n response,\n });\n return error;\n}\n\n/**\n * @internal\n * Helper utility to construct user friendly error codes based on based on given error\n * information and other data present in the received `response` object.\n */\nfunction getErrorCode(response: PipelineResponse, errorMessage: string): string {\n if (response.status === 401) {\n return \"UnauthorizedRequestError\";\n }\n if (response.status === 404) {\n return \"MessageEntityNotFoundError\";\n }\n if (response.status === 409) {\n if (response.request.method === \"DELETE\") {\n return \"ServiceError\";\n }\n\n if (response.request.method === \"PUT\" && response.request.headers.get(\"If-Match\") === \"*\") {\n return \"ServiceError\";\n }\n\n if (errorMessage && errorMessage.toLowerCase().includes(\"subcode=40901\")) {\n return \"ServiceError\";\n }\n\n return \"MessageEntityAlreadyExistsError\";\n }\n\n if (response.status === 403) {\n if (errorMessage && errorMessage.toLowerCase().includes(\"subcode=40301\")) {\n return \"InvalidOperationError\";\n }\n return \"QuotaExceededError\";\n }\n\n if (response.status === 400) {\n return \"ServiceError\";\n }\n\n if (response.status === 503) {\n return \"ServerBusyError\";\n }\n\n return (Constants.HttpResponseCodes as { [statusCode: number]: string })[response.status];\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../../../src/util/compat/compatibility.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,OAAO,EAAmB,WAAW,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AA6G9E,SAAS,gBAAgB,CAAC,OAAoB;IAC5C,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAwB;IACjD,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC;QAC1C,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,IAAI,EAAE;KAC/D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAA0B;IACvD,OAAO;QACL,OAAO,EAAE,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC5C,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;KAC5C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AbortSignalLike } from \"@azure/abort-controller\";\nimport {\n HttpHeaders,\n HttpMethods,\n PipelineRequest,\n PipelineResponse,\n ProxySettings,\n} from \"@azure/core-rest-pipeline\";\nimport { HttpHeadersLike, HttpHeaders as HttpHeadersV1 } from \"./httpHeaders\";\n\n/**\n * Fired in response to upload or download progress.\n */\nexport type TransferProgressEvent = {\n /**\n * The number of bytes loaded so far.\n */\n loadedBytes: number;\n};\n\n/**\n * A description of a HTTP request to be made to a remote server.\n */\nexport interface WebResourceLike {\n /**\n * The URL being accessed by the request.\n */\n url: string;\n /**\n * The HTTP method to use when making the request.\n */\n method: HttpMethods;\n /**\n * The HTTP body contents of the request.\n */\n body?: any;\n /**\n * The HTTP headers to use when making the request.\n */\n headers: HttpHeadersLike;\n /**\n * Whether or not the body of the HttpOperationResponse should be treated as a stream.\n * @deprecated Use streamResponseStatusCodes property instead.\n */\n streamResponseBody?: boolean;\n /**\n * A list of response status codes whose corresponding HttpOperationResponse body should be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n /**\n * Form data, used to build the request body.\n */\n formData?: any;\n /**\n * A query string represented as an object.\n */\n query?: { [key: string]: any };\n /**\n * If credentials (cookies) should be sent along during an XHR.\n */\n withCredentials: boolean;\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n * If the request is terminated, an `AbortError` is thrown.\n */\n timeout: number;\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n /**\n * If the connection should be reused.\n */\n keepAlive?: boolean;\n /**\n * Whether or not to decompress response according to Accept-Encoding header (node-fetch only)\n */\n decompressResponse?: boolean;\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId: string;\n\n /**\n * Signal of an abort controller. Can be used to abort both sending a network request and waiting for a response.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /** Callback which fires upon download progress. */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n}\n\n/**\n * The properties on an HTTP response which will always be present.\n */\nexport interface HttpResponse {\n /**\n * The raw request\n */\n request: WebResourceLike;\n\n /**\n * The HTTP response status (e.g. 200)\n */\n status: number;\n\n /**\n * The HTTP response headers.\n */\n headers: HttpHeadersLike;\n}\n\nfunction toHttpHeaderLike(headers: HttpHeaders): HttpHeadersLike {\n return new HttpHeadersV1(headers.toJSON({ preserveCase: true }));\n}\n\nfunction toWebResourceLike(request: PipelineRequest): WebResourceLike {\n return {\n url: request.url,\n method: request.method,\n headers: toHttpHeaderLike(request.headers),\n withCredentials: request.withCredentials,\n timeout: request.timeout,\n requestId: request.headers.get(\"x-ms-client-request-id\") || \"\",\n };\n}\n\n/**\n * Helper to transform PipelineResponse to slimmed-down HttpResponse used in Service Bus.\n */\nexport function toHttpResponse(response: PipelineResponse): HttpResponse {\n return {\n request: toWebResourceLike(response.request),\n status: response.status,\n headers: toHttpHeaderLike(response.headers),\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpHeaders.js","sourceRoot":"","sources":["../../../../src/util/compat/httpHeaders.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AA4ED,MAAM,UAAU,iBAAiB,CAAC,MAAgB;IAChD,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACzC,MAAM,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AAK,CAAC;QACrD,CAAC;QACD,OAAO,IAAI,WAAW,CAAC,sBAAsB,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * A collection of HttpHeaders that can be sent with a HTTP request.\n */\nfunction getHeaderKey(headerName: string): string {\n return headerName.toLowerCase();\n}\n\n/**\n * An individual header within a HttpHeaders collection.\n */\nexport interface HttpHeader {\n /**\n * The name of the header.\n */\n name: string;\n\n /**\n * The value of the header.\n */\n value: string;\n}\n\n/**\n * A HttpHeaders collection represented as a simple JSON object.\n */\nexport type RawHttpHeaders = { [headerName: string]: string };\n\n/**\n * A collection of HTTP header key/value pairs.\n */\nexport interface HttpHeadersLike {\n /**\n * Set a header in this collection with the provided name and value. The name is\n * case-insensitive.\n * @param headerName - The name of the header to set. This value is case-insensitive.\n * @param headerValue - The value of the header to set.\n */\n set(headerName: string, headerValue: string | number): void;\n /**\n * Get the header value for the provided header name, or undefined if no header exists in this\n * collection with the provided name.\n * @param headerName - The name of the header.\n */\n get(headerName: string): string | undefined;\n /**\n * Get whether or not this header collection contains a header entry for the provided header name.\n */\n contains(headerName: string): boolean;\n /**\n * Remove the header with the provided headerName. Return whether or not the header existed and\n * was removed.\n * @param headerName - The name of the header to remove.\n */\n remove(headerName: string): boolean;\n /**\n * Get the headers that are contained this collection as an object.\n */\n rawHeaders(): RawHttpHeaders;\n /**\n * Get the headers that are contained in this collection as an array.\n */\n headersArray(): HttpHeader[];\n /**\n * Get the header names that are contained in this collection.\n */\n headerNames(): string[];\n /**\n * Get the header values that are contained in this collection.\n */\n headerValues(): string[];\n /**\n * Create a deep clone/copy of this HttpHeaders collection.\n */\n clone(): HttpHeadersLike;\n /**\n * Get the JSON object representation of this HTTP header collection.\n * The result is the same as `rawHeaders()`.\n */\n toJson(options?: { preserveCase?: boolean }): RawHttpHeaders;\n}\n\nexport function isHttpHeadersLike(object?: unknown): object is HttpHeadersLike {\n if (object && typeof object === \"object\") {\n const castObject = object as {\n rawHeaders: unknown;\n clone: unknown;\n get: unknown;\n set: unknown;\n contains: unknown;\n remove: unknown;\n headersArray: unknown;\n headerValues: unknown;\n headerNames: unknown;\n toJson: unknown;\n };\n if (\n typeof castObject.rawHeaders === \"function\" &&\n typeof castObject.clone === \"function\" &&\n typeof castObject.get === \"function\" &&\n typeof castObject.set === \"function\" &&\n typeof castObject.contains === \"function\" &&\n typeof castObject.remove === \"function\" &&\n typeof castObject.headersArray === \"function\" &&\n typeof castObject.headerValues === \"function\" &&\n typeof castObject.headerNames === \"function\" &&\n typeof castObject.toJson === \"function\"\n ) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * A collection of HTTP header key/value pairs.\n */\nexport class HttpHeaders implements HttpHeadersLike {\n private readonly _headersMap: { [headerKey: string]: HttpHeader };\n\n constructor(rawHeaders?: RawHttpHeaders) {\n this._headersMap = {};\n if (rawHeaders) {\n for (const headerName in rawHeaders) {\n this.set(headerName, rawHeaders[headerName]);\n }\n }\n }\n\n /**\n * Set a header in this collection with the provided name and value. The name is\n * case-insensitive.\n * @param headerName - The name of the header to set. This value is case-insensitive.\n * @param headerValue - The value of the header to set.\n */\n public set(headerName: string, headerValue: string | number): void {\n this._headersMap[getHeaderKey(headerName)] = {\n name: headerName,\n value: headerValue.toString(),\n };\n }\n\n /**\n * Get the header value for the provided header name, or undefined if no header exists in this\n * collection with the provided name.\n * @param headerName - The name of the header.\n */\n public get(headerName: string): string | undefined {\n const header: HttpHeader = this._headersMap[getHeaderKey(headerName)];\n return !header ? undefined : header.value;\n }\n\n /**\n * Get whether or not this header collection contains a header entry for the provided header name.\n */\n public contains(headerName: string): boolean {\n return !!this._headersMap[getHeaderKey(headerName)];\n }\n\n /**\n * Remove the header with the provided headerName. Return whether or not the header existed and\n * was removed.\n * @param headerName - The name of the header to remove.\n */\n public remove(headerName: string): boolean {\n const result: boolean = this.contains(headerName);\n delete this._headersMap[getHeaderKey(headerName)];\n return result;\n }\n\n /**\n * Get the headers that are contained this collection as an object.\n */\n public rawHeaders(): RawHttpHeaders {\n return this.toJson({ preserveCase: true });\n }\n\n /**\n * Get the headers that are contained in this collection as an array.\n */\n public headersArray(): HttpHeader[] {\n const headers: HttpHeader[] = [];\n for (const headerKey in this._headersMap) {\n headers.push(this._headersMap[headerKey]);\n }\n return headers;\n }\n\n /**\n * Get the header names that are contained in this collection.\n */\n public headerNames(): string[] {\n const headerNames: string[] = [];\n const headers: HttpHeader[] = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerNames.push(headers[i].name);\n }\n return headerNames;\n }\n\n /**\n * Get the header values that are contained in this collection.\n */\n public headerValues(): string[] {\n const headerValues: string[] = [];\n const headers: HttpHeader[] = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerValues.push(headers[i].value);\n }\n return headerValues;\n }\n\n /**\n * Get the JSON object representation of this HTTP header collection.\n */\n public toJson(options: { preserveCase?: boolean } = {}): RawHttpHeaders {\n const result: RawHttpHeaders = {};\n if (options.preserveCase) {\n for (const headerKey in this._headersMap) {\n const header: HttpHeader = this._headersMap[headerKey];\n result[header.name] = header.value;\n }\n } else {\n for (const headerKey in this._headersMap) {\n const header: HttpHeader = this._headersMap[headerKey];\n result[getHeaderKey(header.name)] = header.value;\n }\n }\n return result;\n }\n\n /**\n * Get the string representation of this HTTP header collection.\n */\n public toString(): string {\n return JSON.stringify(this.toJson({ preserveCase: true }));\n }\n\n /**\n * Create a deep clone/copy of this HttpHeaders collection.\n */\n public clone(): HttpHeaders {\n const resultPreservingCasing: RawHttpHeaders = {};\n for (const headerKey in this._headersMap) {\n const header: HttpHeader = this._headersMap[headerKey];\n resultPreservingCasing[header.name] = header.value;\n }\n return new HttpHeaders(resultPreservingCasing);\n }\n}\n"]}
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export * from "./compatibility";
4
- export * from "./httpHeaders";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/util/compat/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./compatibility\";\nexport * from \"./httpHeaders\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"connectionStringUtils.js","sourceRoot":"","sources":["../../../src/util/connectionStringUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AA2CzD;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAC7C,gBAAwB;IAExB,MAAM,YAAY,GAAG,qBAAqB,CAMvC,gBAAgB,CAAC,CAAC;IACrB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,YAAY,CAAC,qBAAqB,EAAE,CAAC;QACvC,IAAI,YAAY,CAAC,eAAe,IAAI,YAAY,CAAC,mBAAmB,EAAE,CAAC;YACrE,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;QACJ,CAAC;IACH,CAAC;SAAM,IAAI,YAAY,CAAC,eAAe,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;IAC7F,CAAC;SAAM,IAAI,CAAC,YAAY,CAAC,eAAe,IAAI,YAAY,CAAC,mBAAmB,EAAE,CAAC;QAC7E,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAyC;QACnD,uBAAuB,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/E,QAAQ,EAAE,YAAY,CAAC,QAAQ;KAChC,CAAC;IACF,IAAI,YAAY,CAAC,UAAU,EAAE,CAAC;QAC5B,MAAM,CAAC,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;IAC9C,CAAC;IACD,IAAI,YAAY,CAAC,qBAAqB,EAAE,CAAC;QACvC,MAAM,CAAC,qBAAqB,GAAG,YAAY,CAAC,qBAAqB,CAAC;IACpE,CAAC;IACD,IAAI,YAAY,CAAC,eAAe,IAAI,YAAY,CAAC,mBAAmB,EAAE,CAAC;QACrE,MAAM,CAAC,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC;QACtD,MAAM,CAAC,mBAAmB,GAAG,YAAY,CAAC,mBAAmB,CAAC;IAChE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { parseConnectionString } from \"@azure/core-amqp\";\n\n/**\n * The set of properties that comprise a Service Bus connection string.\n */\nexport interface ServiceBusConnectionStringProperties {\n /**\n * The fully qualified Service Bus namespace extracted from the \"Endpoint\" in the\n * connection string. This is likely to be similar to `{yournamespace}.servicebus.windows.net`.\n * This is typically used to construct the ServiceBusClient.\n */\n fullyQualifiedNamespace: string;\n /**\n * The value for \"Endpoint\" in the connection string.\n */\n endpoint: string;\n /**\n * The value for \"EntityPath\" in the connection string which would be the name of the queue or\n * topic associated with the connection string.\n * Connection string from a Shared Access Policy created at the namespace level\n * will not have the EntityPath in it.\n */\n entityPath?: string;\n /**\n * The value for \"SharedAccessKey\" in the connection string. This along with the \"SharedAccessKeyName\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKey?: string;\n /**\n * The value for \"SharedAccessKeyName\" in the connection string. This along with the \"SharedAccessKey\"\n * in the connection string is used to generate a SharedAccessSignature which can be used authorize\n * the connection to the service.\n */\n sharedAccessKeyName?: string;\n /**\n * The value for \"SharedAccessSignature\" in the connection string. This is typically not present in the\n * connection string generated for a Shared Access Policy. It is instead generated by the\n * user and appended to the connection string for ease of use.\n */\n sharedAccessSignature?: string;\n}\n\n/**\n * Parses given connection string into the different properties applicable to Azure Service Bus.\n * The properties are useful to then construct a ServiceBusClient.\n * @param connectionString - The connection string associated with the Shared Access Policy created\n * for the Service Bus namespace, queue or topic.\n */\nexport function parseServiceBusConnectionString(\n connectionString: string,\n): ServiceBusConnectionStringProperties {\n const parsedResult = parseConnectionString<{\n Endpoint: string;\n EntityPath?: string;\n SharedAccessSignature?: string;\n SharedAccessKey?: string;\n SharedAccessKeyName?: string;\n }>(connectionString);\n if (!parsedResult.Endpoint) {\n throw new Error(\"Connection string should have an Endpoint key.\");\n }\n\n if (parsedResult.SharedAccessSignature) {\n if (parsedResult.SharedAccessKey || parsedResult.SharedAccessKeyName) {\n throw new Error(\n \"Connection string cannot have both SharedAccessSignature and SharedAccessKey keys.\",\n );\n }\n } else if (parsedResult.SharedAccessKey && !parsedResult.SharedAccessKeyName) {\n throw new Error(\"Connection string with SharedAccessKey should have SharedAccessKeyName.\");\n } else if (!parsedResult.SharedAccessKey && parsedResult.SharedAccessKeyName) {\n throw new Error(\n \"Connection string with SharedAccessKeyName should have SharedAccessKey as well.\",\n );\n }\n\n const output: ServiceBusConnectionStringProperties = {\n fullyQualifiedNamespace: (parsedResult.Endpoint.match(\".*://([^/]*)\") || [])[1],\n endpoint: parsedResult.Endpoint,\n };\n if (parsedResult.EntityPath) {\n output.entityPath = parsedResult.EntityPath;\n }\n if (parsedResult.SharedAccessSignature) {\n output.sharedAccessSignature = parsedResult.SharedAccessSignature;\n }\n if (parsedResult.SharedAccessKey && parsedResult.SharedAccessKeyName) {\n output.sharedAccessKey = parsedResult.SharedAccessKey;\n output.sharedAccessKeyName = parsedResult.SharedAccessKeyName;\n }\n return output;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.browser.js","sourceRoot":"","sources":["../../../src/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AAE,EAAE,CAAC;QACtC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n */\nexport async function generateKey(secret: string, stringToSign: string): Promise<string> {\n const key = await self.crypto.subtle.importKey(\n \"raw\",\n convertToUint8Array(secret),\n {\n name: \"HMAC\",\n hash: { name: \"SHA-256\" },\n },\n false,\n [\"sign\"],\n );\n\n const signature = await self.crypto.subtle.sign(\"HMAC\", key, convertToUint8Array(stringToSign));\n const base64encodedString = encodeByteArray(new Uint8Array(signature));\n const result = encodeURIComponent(base64encodedString);\n return result;\n}\n\n/**\n * @internal\n */\nfunction convertToUint8Array(value: string): Uint8Array {\n const arr = new Uint8Array(value.length);\n for (let i = 0; i < value.length; i++) {\n arr[i] = value.charCodeAt(i);\n }\n return arr;\n}\n\n/**\n * Encodes a byte array in base64 format.\n * @param value - the Uint8Aray to encode\n * @internal\n *\n */\nfunction encodeByteArray(value: Uint8Array): string {\n let str = \"\";\n for (let i = 0; i < value.length; i++) {\n str += String.fromCharCode(value[i]);\n }\n return btoa(str);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/util/crypto.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,YAAoB;IACpE,MAAM,MAAM,GAAG,kBAAkB,CAC/B,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAC1E,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport crypto from \"crypto\";\n\n/**\n * @internal\n */\nexport async function generateKey(secret: string, stringToSign: string): Promise<string> {\n const result = encodeURIComponent(\n crypto.createHmac(\"sha256\", secret).update(stringToSign).digest(\"base64\"),\n );\n return result;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/util/errors.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,qIAAqI,CAAC;AAExI;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,oDAAoD,CAAC;AAEhG;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,OAA0B;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;QAChD,MAAM,YAAY,GAAG,2CAA2C,CAAC;QACjE,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,YAAY,MAAM,EAAE,KAAK,CAAC,CAAC;QACtD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,UAAkB;IACxD,OAAO,CACL,mBAAmB,UAAU,+CAA+C;QA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AAM,UAAU,gCAAgC,CAC9C,GAAY,EACZ,wBAAgC;IAEhC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,IAAI,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,SAAS,EAAE,CAAC;YAC5E,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;AACH,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAC/C,+KAA+K,CAAC;AAElL,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GACxC,0FAA0F,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport Long from \"long\";\nimport { ConnectionContext } from \"../connectionContext\";\nimport { logger, receiverLogger } from \"../log\";\nimport { ReceiveMode } from \"../models\";\nimport {\n isAmqpAnnotatedMessage,\n isServiceBusMessage,\n ServiceBusReceivedMessage,\n} from \"../serviceBusMessage\";\nimport { isDefined } from \"@azure/core-util\";\n\n/**\n * Error message to use when EntityPath in connection string does not match the\n * queue or topic name passed to the methods in the ServiceBusClient that create\n * senders and receivers.\n *\n * @internal\n */\nexport const entityPathMisMatchError =\n \"The queue or topic name provided does not match the EntityPath in the connection string passed to the ServiceBusClient constructor.\";\n\n/**\n * Error message for when maxMessageCount provided is invalid.\n *\n * @internal\n */\nexport const InvalidMaxMessageCountError = \"'maxMessageCount' must be a number greater than 0.\";\n\n/**\n * @internal\n * Logs and throws Error if the current AMQP connection is closed.\n * @param context - The ConnectionContext associated with the current AMQP connection.\n */\nexport function throwErrorIfConnectionClosed(context: ConnectionContext): void {\n if (context && context.wasConnectionCloseCalled) {\n const errorMessage = \"The underlying AMQP connection is closed.\";\n const error = new Error(errorMessage);\n logger.warning(`[${context.connectionId}] %O`, error);\n throw error;\n }\n}\n\n/**\n * @internal\n * Gets the error message when a sender is used when its already closed\n * @param entityPath - Value of the `entityPath` property on the client which denotes its name\n */\nexport function getSenderClosedErrorMsg(entityPath: string): string {\n return (\n `The sender for \"${entityPath}\" has been closed and can no longer be used. ` +\n `Please create a new sender using the \"createSender\" method on the ServiceBusClient.`\n );\n}\n\n/**\n * @internal\n * Gets the error message when a receiver is used when its already closed\n * @param entityPath - Value of the `entityPath` property on the client which denotes its name\n * @param sessionId - If using session receiver, then the id of the session\n */\nexport function getReceiverClosedErrorMsg(entityPath: string, sessionId?: string): string {\n if (!isDefined(sessionId)) {\n return (\n `The receiver for \"${entityPath}\" has been closed and can no longer be used. ` +\n `Please create a new receiver using the \"createReceiver\" method on the ServiceBusClient.`\n );\n }\n return (\n `The receiver for session \"${sessionId}\" in \"${entityPath}\" has been closed and can no ` +\n `longer be used. Please create a new receiver using the \"acceptSession\" or \"acceptNextSession\" method on the ServiceBusClient.`\n );\n}\n\n/**\n * @internal\n * @param entityPath - Value of the `entityPath` property on the client which denotes its name\n * @param sessionId - If using session receiver, then the id of the session\n */\nexport function getAlreadyReceivingErrorMsg(entityPath: string, sessionId?: string): string {\n if (!isDefined(sessionId)) {\n return `The receiver for \"${entityPath}\" is already receiving messages.`;\n }\n return `The receiver for session \"${sessionId}\" for \"${entityPath}\" is already receiving messages.`;\n}\n\n/**\n * @internal\n * Logs and Throws TypeError if given parameter is undefined or null\n * @param connectionId - Id of the underlying AMQP connection used for logging\n * @param parameterName - Name of the parameter to check\n * @param parameterValue - Value of the parameter to check\n */\nexport function throwTypeErrorIfParameterMissing(\n connectionId: string,\n parameterName: string,\n parameterValue: unknown,\n): void {\n if (parameterValue === undefined || parameterValue === null) {\n const error = new TypeError(`Missing parameter \"${parameterName}\"`);\n logger.warning(`[${connectionId}] %O`, error);\n throw error;\n }\n}\n\n/**\n * @internal\n * Logs and Throws TypeError if given parameter is not an instance of expected type\n * @param connectionId - Id of the underlying AMQP connection used for logging\n * @param parameterName - Name of the parameter to type check\n * @param parameterValue - Value of the parameter to type check\n * @param constructor - Constructor function of the expected parameter type\n */\nexport function throwTypeErrorIfNotInstanceOfParameterType(\n connectionId: string,\n parameterName: string,\n parameterValue: unknown,\n // eslint-disable-next-line @typescript-eslint/ban-types\n constructor: Function,\n): void {\n if (!(parameterValue instanceof constructor)) {\n const error = new TypeError(\n `The parameter \"${parameterName}\" should be an instance of \"${constructor.name}\"`,\n );\n logger.warning(`[${connectionId}] %O`, error);\n throw error;\n }\n}\n\n/**\n * @internal\n * Logs and Throws TypeError if given parameter is not of expected type\n * @param connectionId - Id of the underlying AMQP connection used for logging\n * @param parameterName - Name of the parameter to type check\n * @param parameterValue - Value of the parameter to type check\n * @param expectedType - Expected type of the parameter\n */\nexport function throwTypeErrorIfParameterTypeMismatch(\n connectionId: string,\n parameterName: string,\n parameterValue: unknown,\n expectedType: string,\n): void {\n if (typeof parameterValue !== expectedType) {\n const error = new TypeError(\n `The parameter \"${parameterName}\" should be of type \"${expectedType}\"`,\n );\n logger.warning(`[${connectionId}] %O`, error);\n throw error;\n }\n}\n\n/**\n * @internal\n * Logs and Throws TypeError if given parameter is not of type `Long` or an array of type `Long`\n * @param connectionId - Id of the underlying AMQP connection used for logging\n * @param parameterName - Name of the parameter to type check\n * @param parameterValue - Value of the parameter to type check\n */\nexport function throwTypeErrorIfParameterNotLong(\n connectionId: string,\n parameterName: string,\n parameterValue: unknown,\n): TypeError | undefined {\n if (Array.isArray(parameterValue)) {\n return throwTypeErrorIfParameterNotLongArray(connectionId, parameterName, parameterValue);\n }\n if (Long.isLong(parameterValue)) {\n return;\n }\n const error = new TypeError(`The parameter \"${parameterName}\" should be of type \"Long\"`);\n logger.warning(`[${connectionId}] %O`, error);\n throw error;\n}\n\n/**\n * @internal\n * Logs and Throws TypeError if given parameter is not an array of type `Long`\n * @param connectionId - Id of the underlying AMQP connection used for logging\n * @param parameterName - Name of the parameter to type check\n * @param parameterValue - Value of the parameter to type check\n */\nexport function throwTypeErrorIfParameterNotLongArray(\n connectionId: string,\n parameterName: string,\n parameterValue: any[],\n): TypeError | undefined {\n if (parameterValue.every((item) => Long.isLong(item))) {\n return;\n }\n const error = new TypeError(`The parameter \"${parameterName}\" should be an array of type \"Long\"`);\n logger.warning(`[${connectionId}] %O`, error);\n throw error;\n}\n\n/**\n * @internal\n * Logs and Throws TypeError if given parameter is an empty string\n * @param connectionId - Id of the underlying AMQP connection used for logging\n * @param parameterName - Name of the parameter to type check\n * @param parameterValue - Value of the parameter to type check\n */\nexport function throwTypeErrorIfParameterIsEmptyString(\n connectionId: string,\n parameterName: string,\n parameterValue: string,\n): TypeError | undefined {\n if (parameterValue !== \"\") {\n return;\n }\n const error = new TypeError(`Empty string not allowed in parameter \"${parameterName}\"`);\n logger.warning(`[${connectionId}] %O`, error);\n throw error;\n}\n\n/**\n * @internal\n * The error message for operations on the receiver that are invalid for a message received in receiveAndDelete mode.\n */\nexport const InvalidOperationInReceiveAndDeleteMode =\n \"The operation is not supported in 'receiveAndDelete' receive mode.\";\n\n/**\n * @internal\n * The error message for operations on the receiver that are invalid for a peeked message.\n */\nexport const InvalidOperationForPeekedMessage =\n \"This operation is not supported for peeked messages. Only messages received using 'receiveMessages()', 'subscribe()' and 'getMessageIterator()' methods on the receiver in 'peekLock' receive mode can be settled.\";\n\n/**\n * @internal\n * The error message for when one attempts to settle an already settled message.\n */\nexport const MessageAlreadySettled = \"The message has either been deleted or already settled\";\n\n/**\n * Throws error if the ServiceBusReceivedMessage cannot be settled.\n * @internal\n */\nexport function throwErrorIfInvalidOperationOnMessage(\n message: ServiceBusReceivedMessage,\n receiveMode: ReceiveMode,\n connectionId: string,\n): void {\n let error: Error | undefined;\n\n if (receiveMode === \"receiveAndDelete\") {\n error = new Error(InvalidOperationInReceiveAndDeleteMode);\n } else if (!message.lockToken) {\n error = new Error(InvalidOperationForPeekedMessage);\n }\n\n if (error) {\n receiverLogger.logError(\n error,\n \"[%s] An error occurred for message with id '%s'\",\n connectionId,\n message.messageId,\n );\n throw error;\n }\n}\n\n/**\n * Error message for when the ServiceBusMessage provided by the user has different values\n * for partitionKey and sessionId.\n * @internal\n */\nexport const PartitionKeySessionIdMismatchError =\n \"The fields 'partitionKey' and 'sessionId' cannot have different values.\";\n/**\n * Throws error if the given object is not a valid ServiceBusMessage\n * @internal\n * @param msg - The object that needs to be validated as a ServiceBusMessage\n * @param errorMessageForWrongType - The error message to use when given object is not a ServiceBusMessage\n */\nexport function throwIfNotValidServiceBusMessage(\n msg: unknown,\n errorMessageForWrongType: string,\n): void {\n if (!isServiceBusMessage(msg) && !isAmqpAnnotatedMessage(msg)) {\n throw new TypeError(errorMessageForWrongType);\n }\n\n if (isServiceBusMessage(msg)) {\n if (msg.partitionKey && msg.sessionId && msg.partitionKey !== msg.sessionId) {\n throw new TypeError(PartitionKeySessionIdMismatchError);\n }\n }\n}\n\n/** @internal */\nexport const errorInvalidMessageTypeSingleOrArray =\n \"Provided value for 'messages' must be of type: ServiceBusMessage, AmqpAnnotatedMessage, ServiceBusMessageBatch or an array of type ServiceBusMessage or AmqpAnnotatedMessage.\";\n\n/** @internal */\nexport const errorInvalidMessageTypeSingle =\n \"Provided value for 'message' must be of type: ServiceBusMessage or AmqpAnnotatedMessage.\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseUrl.browser.js","sourceRoot":"","sources":["../../../src/util/parseUrl.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAO,EAAE;IAC9C,6DAA6D;IAC7D,gDAAgD;IAChD,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n */\nexport const parseURL = (rawUrl: string): any => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: \"self\" will exist in the browser.\n return new self.URL(rawUrl);\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseUrl.js","sourceRoot":"","sources":["../../../src/util/parseUrl.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAO,EAAE;IAC9C,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n */\nimport { URL } from \"url\";\n\n/**\n * @internal\n */\nexport const parseURL = (rawUrl: string): URL => {\n return new URL(rawUrl);\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimeInfo.browser.js","sourceRoot":"","sources":["../../../src/util/runtimeInfo.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,SAAwB,CAAC;IAChD,MAAM,MAAM,GAAG;QACb,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,CAAC,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;KAChE,CAAC;IAEF,OAAO,GAAG,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AACzC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * @internal\n */\ninterface NavigatorEx extends Navigator {\n // oscpu is not yet standards-compliant, but can not be undefined in TypeScript 3.6.2\n readonly oscpu: string;\n}\n\n/**\n * Returns information about the platform this function is being run on.\n * @hidden\n * @internal\n */\nexport function getRuntimeInfo(): string {\n const navigator = self.navigator as NavigatorEx;\n const osInfo = {\n key: \"OS\",\n value: (navigator.oscpu || navigator.platform).replace(\" \", \"\"),\n };\n\n return `${osInfo.key}/${osInfo.value}`;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimeInfo.js","sourceRoot":"","sources":["../../../src/util/runtimeInfo.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,WAAW,GAAG;QAClB,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,OAAO,CAAC,OAAO;KACvB,CAAC;IAEF,MAAM,MAAM,GAAG;QACb,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG;KACrD,CAAC;IAEF,OAAO,GAAG,WAAW,CAAC,GAAG,IAAI,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AACjF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport * as os from \"os\";\n\n/**\n * Returns information about the platform this function is being run on.\n * @hidden\n * @internal\n */\nexport function getRuntimeInfo(): string {\n const runtimeInfo = {\n key: \"Node\",\n value: process.version,\n };\n\n const osInfo = {\n key: \"OS\",\n value: `(${os.arch()}-${os.type()}-${os.release()})`,\n };\n\n return `${runtimeInfo.key}/${runtimeInfo.value} ${osInfo.key}/${osInfo.value}`;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimeInfo.native.js","sourceRoot":"","sources":["../../../src/util/runtimeInfo.native.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,+FAA+F;AAE7I;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC;IACtE,MAAM,WAAW,GAAG;QAClB,GAAG,EAAE,cAAc;QACnB,KAAK,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE;KACpC,CAAC;IAEF,MAAM,MAAM,GAAG;QACb,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,GAAG,QAAQ,CAAC,EAAE,IAAI,QAAQ,CAAC,OAAO,EAAE;KAC5C,CAAC;IAEF,OAAO,GAAG,WAAW,CAAC,GAAG,IAAI,WAAW,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AACjF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/*\n * NOTE: When moving this file, please update \"react-native\" section in package.json.\n */\nconst { Platform } = require(\"react-native\"); // eslint-disable-line import/no-extraneous-dependencies, @typescript-eslint/no-require-imports\n\n/**\n * Returns information about the platform this function is being run on.\n * @hidden\n * @internal\n */\nexport function getRuntimeInfo(): string {\n const { major, minor, patch } = Platform.constants.reactNativeVersion;\n const runtimeInfo = {\n key: \"react-native\",\n value: `${major}.${minor}.${patch}`,\n };\n\n const osInfo = {\n key: \"OS\",\n value: `${Platform.OS}-${Platform.Version}`,\n };\n\n return `${runtimeInfo.key}/${runtimeInfo.value} ${osInfo.key}/${osInfo.value}`;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"sasServiceClientCredentials.js","sourceRoot":"","sources":["../../../src/util/sasServiceClientCredentials.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC,OAAO,EAAE,iBAAiB,EAAmB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,kBAAkB,CAAC;AAE5E;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAUtC;;;;OAIG;IACH,YAAY,UAA8B;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,SAAiB,EAAE,cAAsB;QACxE,MAAM,YAAY,GAAG,GAAG,SAAS,KAAK,cAAc,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CAAC,OAAwB;QACxC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,OAAO,CAAC,OAAO,GAAG,iBAAiB,EAAE,CAAC;QAE5D,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAE9E,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;QACvC,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAC3E,OAAO,CAAC,OAAO,CAAC,GAAG,CACjB,eAAe,EACf,6BAA6B,SAAS,OAAO,cAAc,QAAQ,IAAI,CAAC,WAAW,CAAC,IAAI,OAAO,SAAS,EAAE,CAC3G,CAAC;QACF,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;QAC/B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,QAAQ,CAAC,QAAgB;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccessToken, NamedKeyCredential } from \"@azure/core-auth\";\nimport { createHttpHeaders, PipelineRequest } from \"@azure/core-rest-pipeline\";\nimport { generateKey } from \"./crypto\";\nimport { createSasTokenProvider, SasTokenProvider } from \"@azure/core-amqp\";\n\n/**\n * @internal\n */\nexport class SasServiceClientCredentials {\n /**\n * The NamedKeyCredential containing the key name and secret key value.\n */\n private _credential: NamedKeyCredential;\n\n /**\n * A SasTokenProvider provides a method to retrieve an `AccessToken`.\n */\n private _tokenProvider: SasTokenProvider;\n /**\n * Creates a new sasServiceClientCredentials object.\n *\n * @param credential - The NamedKeyCredential containing the key name and secret key value.\n */\n constructor(credential: NamedKeyCredential) {\n this._credential = credential;\n this._tokenProvider = createSasTokenProvider(credential);\n }\n\n private async _generateSignature(targetUri: string, expirationDate: number): Promise<string> {\n const stringToSign = `${targetUri}\\n${expirationDate}`;\n const result = await generateKey(this._credential.key, stringToSign);\n return result;\n }\n\n /**\n * Signs a request with the Authentication header.\n *\n * @param request - The {@link PipelineRequest} to be signed.\n * @returns The signed request object.\n */\n async signRequest(request: PipelineRequest): Promise<PipelineRequest> {\n if (!request.headers) request.headers = createHttpHeaders();\n\n const targetUri = encodeURIComponent(request.url.toLowerCase()).toLowerCase();\n\n const date = new Date();\n date.setMinutes(date.getMinutes() + 5);\n const expirationDate = Math.round(date.getTime() / 1000);\n const signature = await this._generateSignature(targetUri, expirationDate);\n request.headers.set(\n \"authorization\",\n `SharedAccessSignature sig=${signature}&se=${expirationDate}&skn=${this._credential.name}&sr=${targetUri}`,\n );\n request.withCredentials = true;\n return request;\n }\n\n getToken(audience: string): Promise<AccessToken> {\n return this._tokenProvider.getToken(audience);\n }\n}\n"]}