@typespec/ts-http-runtime 0.1.0 → 0.2.0-alpha.20250326.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 (692) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +9 -10
  3. package/dist/browser/abort-controller/AbortError.d.ts +4 -1
  4. package/dist/browser/abort-controller/AbortError.js +4 -1
  5. package/dist/browser/abort-controller/AbortError.js.map +1 -1
  6. package/dist/browser/auth/credentials.d.ts +77 -0
  7. package/dist/browser/auth/credentials.js +27 -0
  8. package/dist/browser/auth/credentials.js.map +1 -0
  9. package/dist/browser/auth/oauth2Flows.d.ts +57 -0
  10. package/dist/{esm/abort-controller/AbortSignalLike.js → browser/auth/oauth2Flows.js} +1 -1
  11. package/dist/browser/auth/oauth2Flows.js.map +1 -0
  12. package/dist/browser/auth/schemes.d.ts +53 -0
  13. package/dist/{react-native/abort-controller/AbortSignalLike.js → browser/auth/schemes.js} +1 -1
  14. package/dist/browser/auth/schemes.js.map +1 -0
  15. package/dist/browser/client/clientHelpers.d.ts +1 -20
  16. package/dist/browser/client/clientHelpers.js +21 -30
  17. package/dist/browser/client/clientHelpers.js.map +1 -1
  18. package/dist/browser/client/common.d.ts +21 -16
  19. package/dist/browser/client/common.js.map +1 -1
  20. package/dist/browser/client/getClient.d.ts +1 -9
  21. package/dist/browser/client/getClient.js +21 -18
  22. package/dist/browser/client/getClient.js.map +1 -1
  23. package/dist/browser/client/multipart.js +1 -1
  24. package/dist/browser/client/multipart.js.map +1 -1
  25. package/dist/browser/client/restError.js +4 -4
  26. package/dist/browser/client/restError.js.map +1 -1
  27. package/dist/browser/client/sendRequest.js +2 -2
  28. package/dist/browser/client/sendRequest.js.map +1 -1
  29. package/dist/browser/constants.js +1 -1
  30. package/dist/browser/constants.js.map +1 -1
  31. package/dist/browser/createPipelineFromOptions.d.ts +3 -1
  32. package/dist/browser/createPipelineFromOptions.js +4 -0
  33. package/dist/browser/createPipelineFromOptions.js.map +1 -1
  34. package/dist/browser/fetchHttpClient.js +1 -1
  35. package/dist/browser/fetchHttpClient.js.map +1 -1
  36. package/dist/browser/index.d.ts +3 -3
  37. package/dist/browser/index.js +2 -2
  38. package/dist/browser/index.js.map +1 -1
  39. package/dist/browser/interfaces.d.ts +11 -2
  40. package/dist/browser/interfaces.js.map +1 -1
  41. package/dist/browser/nodeHttpClient.js +10 -3
  42. package/dist/browser/nodeHttpClient.js.map +1 -1
  43. package/dist/browser/pipelineRequest.d.ts +1 -2
  44. package/dist/browser/pipelineRequest.js.map +1 -1
  45. package/dist/browser/policies/agentPolicy.d.ts +11 -0
  46. package/dist/browser/policies/agentPolicy.js +22 -0
  47. package/dist/browser/policies/agentPolicy.js.map +1 -0
  48. package/dist/browser/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
  49. package/dist/browser/policies/auth/apiKeyAuthenticationPolicy.js +31 -0
  50. package/dist/browser/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
  51. package/dist/browser/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
  52. package/dist/browser/policies/auth/basicAuthenticationPolicy.js +31 -0
  53. package/dist/browser/policies/auth/basicAuthenticationPolicy.js.map +1 -0
  54. package/dist/browser/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
  55. package/dist/browser/policies/auth/bearerAuthenticationPolicy.js +31 -0
  56. package/dist/browser/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
  57. package/dist/browser/policies/auth/checkInsecureConnection.d.ts +9 -0
  58. package/dist/browser/policies/auth/checkInsecureConnection.js +50 -0
  59. package/dist/browser/policies/auth/checkInsecureConnection.js.map +1 -0
  60. package/dist/browser/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
  61. package/dist/browser/policies/auth/oauth2AuthenticationPolicy.js +31 -0
  62. package/dist/browser/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
  63. package/dist/browser/policies/retryPolicy.js +0 -1
  64. package/dist/browser/policies/retryPolicy.js.map +1 -1
  65. package/dist/browser/policies/throttlingRetryPolicy.d.ts +3 -3
  66. package/dist/browser/policies/throttlingRetryPolicy.js +3 -3
  67. package/dist/browser/policies/throttlingRetryPolicy.js.map +1 -1
  68. package/dist/browser/restError.js +9 -8
  69. package/dist/browser/restError.js.map +1 -1
  70. package/dist/browser/util/aborterUtils.d.ts +3 -4
  71. package/dist/browser/util/aborterUtils.js.map +1 -1
  72. package/dist/browser/util/file.js +3 -0
  73. package/dist/browser/util/file.js.map +1 -1
  74. package/dist/browser/util/helpers.d.ts +1 -2
  75. package/dist/browser/util/helpers.js.map +1 -1
  76. package/dist/browser/util/inspect.common.d.ts +1 -1
  77. package/dist/browser/util/inspect.common.js +1 -1
  78. package/dist/browser/util/inspect.common.js.map +1 -1
  79. package/dist/browser/xhrHttpClient.js +1 -1
  80. package/dist/browser/xhrHttpClient.js.map +1 -1
  81. package/dist/commonjs/abort-controller/AbortError.d.ts +4 -1
  82. package/dist/commonjs/abort-controller/AbortError.js +4 -1
  83. package/dist/commonjs/abort-controller/AbortError.js.map +1 -1
  84. package/dist/commonjs/auth/credentials.d.ts +77 -0
  85. package/dist/commonjs/auth/credentials.js +33 -0
  86. package/dist/commonjs/auth/credentials.js.map +1 -0
  87. package/dist/commonjs/auth/oauth2Flows.d.ts +57 -0
  88. package/dist/commonjs/{abort-controller/AbortSignalLike.js → auth/oauth2Flows.js} +1 -1
  89. package/dist/commonjs/auth/oauth2Flows.js.map +1 -0
  90. package/dist/commonjs/auth/schemes.d.ts +53 -0
  91. package/dist/commonjs/auth/schemes.js +5 -0
  92. package/dist/commonjs/auth/schemes.js.map +1 -0
  93. package/dist/commonjs/client/clientHelpers.d.ts +1 -20
  94. package/dist/commonjs/client/clientHelpers.js +21 -31
  95. package/dist/commonjs/client/clientHelpers.js.map +1 -1
  96. package/dist/commonjs/client/common.d.ts +21 -16
  97. package/dist/commonjs/client/common.js.map +1 -1
  98. package/dist/commonjs/client/getClient.d.ts +1 -9
  99. package/dist/commonjs/client/getClient.js +21 -18
  100. package/dist/commonjs/client/getClient.js.map +1 -1
  101. package/dist/commonjs/client/multipart.js +1 -1
  102. package/dist/commonjs/client/multipart.js.map +1 -1
  103. package/dist/commonjs/client/restError.js +4 -4
  104. package/dist/commonjs/client/restError.js.map +1 -1
  105. package/dist/commonjs/client/sendRequest.js +2 -2
  106. package/dist/commonjs/client/sendRequest.js.map +1 -1
  107. package/dist/commonjs/constants.js +1 -1
  108. package/dist/commonjs/constants.js.map +1 -1
  109. package/dist/commonjs/createPipelineFromOptions.d.ts +3 -1
  110. package/dist/commonjs/createPipelineFromOptions.js +4 -0
  111. package/dist/commonjs/createPipelineFromOptions.js.map +1 -1
  112. package/dist/commonjs/fetchHttpClient.js +1 -1
  113. package/dist/commonjs/fetchHttpClient.js.map +1 -1
  114. package/dist/commonjs/index.d.ts +3 -3
  115. package/dist/commonjs/index.js +4 -5
  116. package/dist/commonjs/index.js.map +1 -1
  117. package/dist/commonjs/interfaces.d.ts +11 -2
  118. package/dist/commonjs/interfaces.js.map +1 -1
  119. package/dist/commonjs/nodeHttpClient.js +10 -3
  120. package/dist/commonjs/nodeHttpClient.js.map +1 -1
  121. package/dist/commonjs/pipelineRequest.d.ts +1 -2
  122. package/dist/commonjs/pipelineRequest.js.map +1 -1
  123. package/dist/commonjs/policies/agentPolicy.d.ts +11 -0
  124. package/dist/commonjs/policies/agentPolicy.js +26 -0
  125. package/dist/commonjs/policies/agentPolicy.js.map +1 -0
  126. package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
  127. package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js +35 -0
  128. package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
  129. package/dist/commonjs/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
  130. package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js +35 -0
  131. package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js.map +1 -0
  132. package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
  133. package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js +35 -0
  134. package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
  135. package/dist/commonjs/policies/auth/checkInsecureConnection.d.ts +9 -0
  136. package/dist/commonjs/policies/auth/checkInsecureConnection.js +53 -0
  137. package/dist/commonjs/policies/auth/checkInsecureConnection.js.map +1 -0
  138. package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
  139. package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js +35 -0
  140. package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
  141. package/dist/commonjs/policies/retryPolicy.js +0 -1
  142. package/dist/commonjs/policies/retryPolicy.js.map +1 -1
  143. package/dist/commonjs/policies/throttlingRetryPolicy.d.ts +3 -3
  144. package/dist/commonjs/policies/throttlingRetryPolicy.js +3 -3
  145. package/dist/commonjs/policies/throttlingRetryPolicy.js.map +1 -1
  146. package/dist/commonjs/restError.js +9 -8
  147. package/dist/commonjs/restError.js.map +1 -1
  148. package/dist/commonjs/tsdoc-metadata.json +1 -1
  149. package/dist/commonjs/util/aborterUtils.d.ts +3 -4
  150. package/dist/commonjs/util/aborterUtils.js.map +1 -1
  151. package/dist/commonjs/util/file.js +3 -0
  152. package/dist/commonjs/util/file.js.map +1 -1
  153. package/dist/commonjs/util/helpers.d.ts +1 -2
  154. package/dist/commonjs/util/helpers.js.map +1 -1
  155. package/dist/commonjs/util/inspect.common.d.ts +1 -1
  156. package/dist/commonjs/util/inspect.common.js +1 -1
  157. package/dist/commonjs/util/inspect.common.js.map +1 -1
  158. package/dist/commonjs/xhrHttpClient.js +1 -1
  159. package/dist/commonjs/xhrHttpClient.js.map +1 -1
  160. package/dist/esm/abort-controller/AbortError.d.ts +4 -1
  161. package/dist/esm/abort-controller/AbortError.js +4 -1
  162. package/dist/esm/abort-controller/AbortError.js.map +1 -1
  163. package/dist/esm/auth/credentials.d.ts +77 -0
  164. package/dist/esm/auth/credentials.js +27 -0
  165. package/dist/esm/auth/credentials.js.map +1 -0
  166. package/dist/esm/auth/oauth2Flows.d.ts +57 -0
  167. package/dist/{browser/abort-controller/AbortSignalLike.js → esm/auth/oauth2Flows.js} +1 -1
  168. package/dist/esm/auth/oauth2Flows.js.map +1 -0
  169. package/dist/esm/auth/schemes.d.ts +53 -0
  170. package/dist/esm/auth/schemes.js +4 -0
  171. package/dist/esm/auth/schemes.js.map +1 -0
  172. package/dist/esm/client/clientHelpers.d.ts +1 -20
  173. package/dist/esm/client/clientHelpers.js +21 -30
  174. package/dist/esm/client/clientHelpers.js.map +1 -1
  175. package/dist/esm/client/common.d.ts +21 -16
  176. package/dist/esm/client/common.js.map +1 -1
  177. package/dist/esm/client/getClient.d.ts +1 -9
  178. package/dist/esm/client/getClient.js +21 -18
  179. package/dist/esm/client/getClient.js.map +1 -1
  180. package/dist/esm/client/multipart.js +1 -1
  181. package/dist/esm/client/multipart.js.map +1 -1
  182. package/dist/esm/client/restError.js +4 -4
  183. package/dist/esm/client/restError.js.map +1 -1
  184. package/dist/esm/client/sendRequest.js +2 -2
  185. package/dist/esm/client/sendRequest.js.map +1 -1
  186. package/dist/esm/constants.js +1 -1
  187. package/dist/esm/constants.js.map +1 -1
  188. package/dist/esm/createPipelineFromOptions.d.ts +3 -1
  189. package/dist/esm/createPipelineFromOptions.js +4 -0
  190. package/dist/esm/createPipelineFromOptions.js.map +1 -1
  191. package/dist/esm/fetchHttpClient.js +1 -1
  192. package/dist/esm/fetchHttpClient.js.map +1 -1
  193. package/dist/esm/index.d.ts +3 -3
  194. package/dist/esm/index.js +2 -2
  195. package/dist/esm/index.js.map +1 -1
  196. package/dist/esm/interfaces.d.ts +11 -2
  197. package/dist/esm/interfaces.js.map +1 -1
  198. package/dist/esm/nodeHttpClient.js +10 -3
  199. package/dist/esm/nodeHttpClient.js.map +1 -1
  200. package/dist/esm/pipelineRequest.d.ts +1 -2
  201. package/dist/esm/pipelineRequest.js.map +1 -1
  202. package/dist/esm/policies/agentPolicy.d.ts +11 -0
  203. package/dist/esm/policies/agentPolicy.js +22 -0
  204. package/dist/esm/policies/agentPolicy.js.map +1 -0
  205. package/dist/esm/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
  206. package/dist/esm/policies/auth/apiKeyAuthenticationPolicy.js +31 -0
  207. package/dist/esm/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
  208. package/dist/esm/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
  209. package/dist/esm/policies/auth/basicAuthenticationPolicy.js +31 -0
  210. package/dist/esm/policies/auth/basicAuthenticationPolicy.js.map +1 -0
  211. package/dist/esm/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
  212. package/dist/esm/policies/auth/bearerAuthenticationPolicy.js +31 -0
  213. package/dist/esm/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
  214. package/dist/esm/policies/auth/checkInsecureConnection.d.ts +9 -0
  215. package/dist/esm/policies/auth/checkInsecureConnection.js +50 -0
  216. package/dist/esm/policies/auth/checkInsecureConnection.js.map +1 -0
  217. package/dist/esm/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
  218. package/dist/esm/policies/auth/oauth2AuthenticationPolicy.js +31 -0
  219. package/dist/esm/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
  220. package/dist/esm/policies/retryPolicy.js +0 -1
  221. package/dist/esm/policies/retryPolicy.js.map +1 -1
  222. package/dist/esm/policies/throttlingRetryPolicy.d.ts +3 -3
  223. package/dist/esm/policies/throttlingRetryPolicy.js +3 -3
  224. package/dist/esm/policies/throttlingRetryPolicy.js.map +1 -1
  225. package/dist/esm/restError.js +9 -8
  226. package/dist/esm/restError.js.map +1 -1
  227. package/dist/esm/util/aborterUtils.d.ts +3 -4
  228. package/dist/esm/util/aborterUtils.js.map +1 -1
  229. package/dist/esm/util/file.js +3 -0
  230. package/dist/esm/util/file.js.map +1 -1
  231. package/dist/esm/util/helpers.d.ts +1 -2
  232. package/dist/esm/util/helpers.js.map +1 -1
  233. package/dist/esm/util/inspect.common.d.ts +1 -1
  234. package/dist/esm/util/inspect.common.js +1 -1
  235. package/dist/esm/util/inspect.common.js.map +1 -1
  236. package/dist/esm/xhrHttpClient.js +1 -1
  237. package/dist/esm/xhrHttpClient.js.map +1 -1
  238. package/dist/react-native/abort-controller/AbortError.d.ts +4 -1
  239. package/dist/react-native/abort-controller/AbortError.js +4 -1
  240. package/dist/react-native/abort-controller/AbortError.js.map +1 -1
  241. package/dist/react-native/auth/credentials.d.ts +77 -0
  242. package/dist/react-native/auth/credentials.js +27 -0
  243. package/dist/react-native/auth/credentials.js.map +1 -0
  244. package/dist/react-native/auth/oauth2Flows.d.ts +57 -0
  245. package/dist/react-native/auth/oauth2Flows.js +4 -0
  246. package/dist/react-native/auth/oauth2Flows.js.map +1 -0
  247. package/dist/react-native/auth/schemes.d.ts +53 -0
  248. package/dist/react-native/auth/schemes.js +4 -0
  249. package/dist/react-native/auth/schemes.js.map +1 -0
  250. package/dist/react-native/client/clientHelpers.d.ts +1 -20
  251. package/dist/react-native/client/clientHelpers.js +21 -30
  252. package/dist/react-native/client/clientHelpers.js.map +1 -1
  253. package/dist/react-native/client/common.d.ts +21 -16
  254. package/dist/react-native/client/common.js.map +1 -1
  255. package/dist/react-native/client/getClient.d.ts +1 -9
  256. package/dist/react-native/client/getClient.js +21 -18
  257. package/dist/react-native/client/getClient.js.map +1 -1
  258. package/dist/react-native/client/multipart.js +1 -1
  259. package/dist/react-native/client/multipart.js.map +1 -1
  260. package/dist/react-native/client/restError.js +4 -4
  261. package/dist/react-native/client/restError.js.map +1 -1
  262. package/dist/react-native/client/sendRequest.js +2 -2
  263. package/dist/react-native/client/sendRequest.js.map +1 -1
  264. package/dist/react-native/constants.js +1 -1
  265. package/dist/react-native/constants.js.map +1 -1
  266. package/dist/react-native/createPipelineFromOptions.d.ts +3 -1
  267. package/dist/react-native/createPipelineFromOptions.js +4 -0
  268. package/dist/react-native/createPipelineFromOptions.js.map +1 -1
  269. package/dist/react-native/fetchHttpClient.js +1 -1
  270. package/dist/react-native/fetchHttpClient.js.map +1 -1
  271. package/dist/react-native/index.d.ts +3 -3
  272. package/dist/react-native/index.js +2 -2
  273. package/dist/react-native/index.js.map +1 -1
  274. package/dist/react-native/interfaces.d.ts +11 -2
  275. package/dist/react-native/interfaces.js.map +1 -1
  276. package/dist/react-native/nodeHttpClient.js +10 -3
  277. package/dist/react-native/nodeHttpClient.js.map +1 -1
  278. package/dist/react-native/pipelineRequest.d.ts +1 -2
  279. package/dist/react-native/pipelineRequest.js.map +1 -1
  280. package/dist/react-native/policies/agentPolicy.d.ts +11 -0
  281. package/dist/react-native/policies/agentPolicy.js +22 -0
  282. package/dist/react-native/policies/agentPolicy.js.map +1 -0
  283. package/dist/react-native/policies/auth/apiKeyAuthenticationPolicy.d.ts +30 -0
  284. package/dist/react-native/policies/auth/apiKeyAuthenticationPolicy.js +31 -0
  285. package/dist/react-native/policies/auth/apiKeyAuthenticationPolicy.js.map +1 -0
  286. package/dist/react-native/policies/auth/basicAuthenticationPolicy.d.ts +30 -0
  287. package/dist/react-native/policies/auth/basicAuthenticationPolicy.js +31 -0
  288. package/dist/react-native/policies/auth/basicAuthenticationPolicy.js.map +1 -0
  289. package/dist/react-native/policies/auth/bearerAuthenticationPolicy.d.ts +30 -0
  290. package/dist/react-native/policies/auth/bearerAuthenticationPolicy.js +31 -0
  291. package/dist/react-native/policies/auth/bearerAuthenticationPolicy.js.map +1 -0
  292. package/dist/react-native/policies/auth/checkInsecureConnection.d.ts +9 -0
  293. package/dist/react-native/policies/auth/checkInsecureConnection.js +50 -0
  294. package/dist/react-native/policies/auth/checkInsecureConnection.js.map +1 -0
  295. package/dist/react-native/policies/auth/oauth2AuthenticationPolicy.d.ts +31 -0
  296. package/dist/react-native/policies/auth/oauth2AuthenticationPolicy.js +31 -0
  297. package/dist/react-native/policies/auth/oauth2AuthenticationPolicy.js.map +1 -0
  298. package/dist/react-native/policies/retryPolicy.js +0 -1
  299. package/dist/react-native/policies/retryPolicy.js.map +1 -1
  300. package/dist/react-native/policies/throttlingRetryPolicy.d.ts +3 -3
  301. package/dist/react-native/policies/throttlingRetryPolicy.js +3 -3
  302. package/dist/react-native/policies/throttlingRetryPolicy.js.map +1 -1
  303. package/dist/react-native/restError.js +9 -8
  304. package/dist/react-native/restError.js.map +1 -1
  305. package/dist/react-native/util/aborterUtils.d.ts +3 -4
  306. package/dist/react-native/util/aborterUtils.js.map +1 -1
  307. package/dist/react-native/util/file.js +3 -0
  308. package/dist/react-native/util/file.js.map +1 -1
  309. package/dist/react-native/util/helpers.d.ts +1 -2
  310. package/dist/react-native/util/helpers.js.map +1 -1
  311. package/dist/react-native/util/inspect.common.d.ts +1 -1
  312. package/dist/react-native/util/inspect.common.js +1 -1
  313. package/dist/react-native/util/inspect.common.js.map +1 -1
  314. package/dist/react-native/xhrHttpClient.js +1 -1
  315. package/dist/react-native/xhrHttpClient.js.map +1 -1
  316. package/package.json +13 -11
  317. package/dist/browser/abort-controller/AbortError.d.ts.map +0 -1
  318. package/dist/browser/abort-controller/AbortSignalLike.d.ts +0 -19
  319. package/dist/browser/abort-controller/AbortSignalLike.d.ts.map +0 -1
  320. package/dist/browser/abort-controller/AbortSignalLike.js.map +0 -1
  321. package/dist/browser/accessTokenCache.d.ts +0 -40
  322. package/dist/browser/accessTokenCache.d.ts.map +0 -1
  323. package/dist/browser/accessTokenCache.js +0 -32
  324. package/dist/browser/accessTokenCache.js.map +0 -1
  325. package/dist/browser/auth/keyCredential.d.ts +0 -16
  326. package/dist/browser/auth/keyCredential.d.ts.map +0 -1
  327. package/dist/browser/auth/keyCredential.js +0 -12
  328. package/dist/browser/auth/keyCredential.js.map +0 -1
  329. package/dist/browser/auth/tokenCredential.d.ts +0 -71
  330. package/dist/browser/auth/tokenCredential.d.ts.map +0 -1
  331. package/dist/browser/auth/tokenCredential.js +0 -19
  332. package/dist/browser/auth/tokenCredential.js.map +0 -1
  333. package/dist/browser/client/apiVersionPolicy.d.ts.map +0 -1
  334. package/dist/browser/client/clientHelpers.d.ts.map +0 -1
  335. package/dist/browser/client/common.d.ts.map +0 -1
  336. package/dist/browser/client/getClient.d.ts.map +0 -1
  337. package/dist/browser/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
  338. package/dist/browser/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
  339. package/dist/browser/client/keyCredentialAuthenticationPolicy.js +0 -16
  340. package/dist/browser/client/keyCredentialAuthenticationPolicy.js.map +0 -1
  341. package/dist/browser/client/multipart.d.ts.map +0 -1
  342. package/dist/browser/client/operationOptionHelpers.d.ts.map +0 -1
  343. package/dist/browser/client/restError.d.ts.map +0 -1
  344. package/dist/browser/client/sendRequest.d.ts.map +0 -1
  345. package/dist/browser/client/urlHelpers.d.ts.map +0 -1
  346. package/dist/browser/constants.d.ts.map +0 -1
  347. package/dist/browser/createPipelineFromOptions.d.ts.map +0 -1
  348. package/dist/browser/defaultHttpClient-browser.d.mts.map +0 -1
  349. package/dist/browser/fetchHttpClient.d.ts.map +0 -1
  350. package/dist/browser/httpHeaders.d.ts.map +0 -1
  351. package/dist/browser/index.d.ts.map +0 -1
  352. package/dist/browser/interfaces.d.ts.map +0 -1
  353. package/dist/browser/log.d.ts.map +0 -1
  354. package/dist/browser/logger/debug.d.ts.map +0 -1
  355. package/dist/browser/logger/log-browser.d.mts.map +0 -1
  356. package/dist/browser/logger/log.common.d.ts.map +0 -1
  357. package/dist/browser/logger/logger.d.ts.map +0 -1
  358. package/dist/browser/nodeHttpClient.d.ts.map +0 -1
  359. package/dist/browser/pipeline.d.ts.map +0 -1
  360. package/dist/browser/pipelineRequest.d.ts.map +0 -1
  361. package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
  362. package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
  363. package/dist/browser/policies/bearerTokenAuthenticationPolicy.js +0 -107
  364. package/dist/browser/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
  365. package/dist/browser/policies/decompressResponsePolicy-browser.d.mts.map +0 -1
  366. package/dist/browser/policies/defaultRetryPolicy.d.ts.map +0 -1
  367. package/dist/browser/policies/exponentialRetryPolicy.d.ts.map +0 -1
  368. package/dist/browser/policies/formDataPolicy.d.ts.map +0 -1
  369. package/dist/browser/policies/logPolicy.d.ts.map +0 -1
  370. package/dist/browser/policies/multipartPolicy.d.ts.map +0 -1
  371. package/dist/browser/policies/proxyPolicy-browser.d.mts.map +0 -1
  372. package/dist/browser/policies/proxyPolicy.common.d.ts.map +0 -1
  373. package/dist/browser/policies/redirectPolicy.d.ts.map +0 -1
  374. package/dist/browser/policies/retryPolicy.d.ts.map +0 -1
  375. package/dist/browser/policies/systemErrorRetryPolicy.d.ts.map +0 -1
  376. package/dist/browser/policies/throttlingRetryPolicy.d.ts.map +0 -1
  377. package/dist/browser/policies/tlsPolicy.d.ts.map +0 -1
  378. package/dist/browser/policies/userAgentPolicy.d.ts.map +0 -1
  379. package/dist/browser/restError.d.ts.map +0 -1
  380. package/dist/browser/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
  381. package/dist/browser/retryStrategies/retryStrategy.d.ts.map +0 -1
  382. package/dist/browser/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
  383. package/dist/browser/util/aborterUtils.d.ts.map +0 -1
  384. package/dist/browser/util/bytesEncoding-browser.d.mts.map +0 -1
  385. package/dist/browser/util/bytesEncoding.common.d.ts.map +0 -1
  386. package/dist/browser/util/checkEnvironment.d.ts.map +0 -1
  387. package/dist/browser/util/concat-browser.d.mts.map +0 -1
  388. package/dist/browser/util/concat.common.d.ts.map +0 -1
  389. package/dist/browser/util/createAbortablePromise.d.ts.map +0 -1
  390. package/dist/browser/util/delay.d.ts.map +0 -1
  391. package/dist/browser/util/error.d.ts.map +0 -1
  392. package/dist/browser/util/file.d.ts.map +0 -1
  393. package/dist/browser/util/helpers.d.ts.map +0 -1
  394. package/dist/browser/util/inspect-browser.d.mts.map +0 -1
  395. package/dist/browser/util/inspect.common.d.ts.map +0 -1
  396. package/dist/browser/util/object.d.ts.map +0 -1
  397. package/dist/browser/util/random.d.ts.map +0 -1
  398. package/dist/browser/util/sanitizer.d.ts.map +0 -1
  399. package/dist/browser/util/sha256-browser.d.mts.map +0 -1
  400. package/dist/browser/util/sha256.common.d.ts.map +0 -1
  401. package/dist/browser/util/tokenCycler.d.ts +0 -45
  402. package/dist/browser/util/tokenCycler.d.ts.map +0 -1
  403. package/dist/browser/util/tokenCycler.js +0 -162
  404. package/dist/browser/util/tokenCycler.js.map +0 -1
  405. package/dist/browser/util/typeGuards.d.ts.map +0 -1
  406. package/dist/browser/util/userAgent.d.ts.map +0 -1
  407. package/dist/browser/util/userAgentPlatform-browser.d.mts.map +0 -1
  408. package/dist/browser/util/uuidUtils-browser.d.mts.map +0 -1
  409. package/dist/browser/util/uuidUtils.common.d.ts.map +0 -1
  410. package/dist/browser/xhrHttpClient.d.ts.map +0 -1
  411. package/dist/commonjs/abort-controller/AbortError.d.ts.map +0 -1
  412. package/dist/commonjs/abort-controller/AbortSignalLike.d.ts +0 -19
  413. package/dist/commonjs/abort-controller/AbortSignalLike.d.ts.map +0 -1
  414. package/dist/commonjs/abort-controller/AbortSignalLike.js.map +0 -1
  415. package/dist/commonjs/accessTokenCache.d.ts +0 -40
  416. package/dist/commonjs/accessTokenCache.d.ts.map +0 -1
  417. package/dist/commonjs/accessTokenCache.js +0 -36
  418. package/dist/commonjs/accessTokenCache.js.map +0 -1
  419. package/dist/commonjs/auth/keyCredential.d.ts +0 -16
  420. package/dist/commonjs/auth/keyCredential.d.ts.map +0 -1
  421. package/dist/commonjs/auth/keyCredential.js +0 -15
  422. package/dist/commonjs/auth/keyCredential.js.map +0 -1
  423. package/dist/commonjs/auth/tokenCredential.d.ts +0 -71
  424. package/dist/commonjs/auth/tokenCredential.d.ts.map +0 -1
  425. package/dist/commonjs/auth/tokenCredential.js +0 -22
  426. package/dist/commonjs/auth/tokenCredential.js.map +0 -1
  427. package/dist/commonjs/client/apiVersionPolicy.d.ts.map +0 -1
  428. package/dist/commonjs/client/clientHelpers.d.ts.map +0 -1
  429. package/dist/commonjs/client/common.d.ts.map +0 -1
  430. package/dist/commonjs/client/getClient.d.ts.map +0 -1
  431. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
  432. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
  433. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.js +0 -20
  434. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.js.map +0 -1
  435. package/dist/commonjs/client/multipart.d.ts.map +0 -1
  436. package/dist/commonjs/client/operationOptionHelpers.d.ts.map +0 -1
  437. package/dist/commonjs/client/restError.d.ts.map +0 -1
  438. package/dist/commonjs/client/sendRequest.d.ts.map +0 -1
  439. package/dist/commonjs/client/urlHelpers.d.ts.map +0 -1
  440. package/dist/commonjs/constants.d.ts.map +0 -1
  441. package/dist/commonjs/createPipelineFromOptions.d.ts.map +0 -1
  442. package/dist/commonjs/defaultHttpClient.d.ts.map +0 -1
  443. package/dist/commonjs/fetchHttpClient.d.ts.map +0 -1
  444. package/dist/commonjs/httpHeaders.d.ts.map +0 -1
  445. package/dist/commonjs/index.d.ts.map +0 -1
  446. package/dist/commonjs/interfaces.d.ts.map +0 -1
  447. package/dist/commonjs/log.d.ts.map +0 -1
  448. package/dist/commonjs/logger/debug.d.ts.map +0 -1
  449. package/dist/commonjs/logger/log.common.d.ts.map +0 -1
  450. package/dist/commonjs/logger/log.d.ts.map +0 -1
  451. package/dist/commonjs/logger/logger.d.ts.map +0 -1
  452. package/dist/commonjs/nodeHttpClient.d.ts.map +0 -1
  453. package/dist/commonjs/pipeline.d.ts.map +0 -1
  454. package/dist/commonjs/pipelineRequest.d.ts.map +0 -1
  455. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
  456. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
  457. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js +0 -111
  458. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
  459. package/dist/commonjs/policies/decompressResponsePolicy.d.ts.map +0 -1
  460. package/dist/commonjs/policies/defaultRetryPolicy.d.ts.map +0 -1
  461. package/dist/commonjs/policies/exponentialRetryPolicy.d.ts.map +0 -1
  462. package/dist/commonjs/policies/formDataPolicy.d.ts.map +0 -1
  463. package/dist/commonjs/policies/logPolicy.d.ts.map +0 -1
  464. package/dist/commonjs/policies/multipartPolicy.d.ts.map +0 -1
  465. package/dist/commonjs/policies/proxyPolicy.common.d.ts.map +0 -1
  466. package/dist/commonjs/policies/proxyPolicy.d.ts.map +0 -1
  467. package/dist/commonjs/policies/redirectPolicy.d.ts.map +0 -1
  468. package/dist/commonjs/policies/retryPolicy.d.ts.map +0 -1
  469. package/dist/commonjs/policies/systemErrorRetryPolicy.d.ts.map +0 -1
  470. package/dist/commonjs/policies/throttlingRetryPolicy.d.ts.map +0 -1
  471. package/dist/commonjs/policies/tlsPolicy.d.ts.map +0 -1
  472. package/dist/commonjs/policies/userAgentPolicy.d.ts.map +0 -1
  473. package/dist/commonjs/restError.d.ts.map +0 -1
  474. package/dist/commonjs/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
  475. package/dist/commonjs/retryStrategies/retryStrategy.d.ts.map +0 -1
  476. package/dist/commonjs/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
  477. package/dist/commonjs/util/aborterUtils.d.ts.map +0 -1
  478. package/dist/commonjs/util/bytesEncoding.common.d.ts.map +0 -1
  479. package/dist/commonjs/util/bytesEncoding.d.ts.map +0 -1
  480. package/dist/commonjs/util/checkEnvironment.d.ts.map +0 -1
  481. package/dist/commonjs/util/concat.common.d.ts.map +0 -1
  482. package/dist/commonjs/util/concat.d.ts.map +0 -1
  483. package/dist/commonjs/util/createAbortablePromise.d.ts.map +0 -1
  484. package/dist/commonjs/util/delay.d.ts.map +0 -1
  485. package/dist/commonjs/util/error.d.ts.map +0 -1
  486. package/dist/commonjs/util/file.d.ts.map +0 -1
  487. package/dist/commonjs/util/helpers.d.ts.map +0 -1
  488. package/dist/commonjs/util/inspect.common.d.ts.map +0 -1
  489. package/dist/commonjs/util/inspect.d.ts.map +0 -1
  490. package/dist/commonjs/util/object.d.ts.map +0 -1
  491. package/dist/commonjs/util/random.d.ts.map +0 -1
  492. package/dist/commonjs/util/sanitizer.d.ts.map +0 -1
  493. package/dist/commonjs/util/sha256.common.d.ts.map +0 -1
  494. package/dist/commonjs/util/sha256.d.ts.map +0 -1
  495. package/dist/commonjs/util/tokenCycler.d.ts +0 -45
  496. package/dist/commonjs/util/tokenCycler.d.ts.map +0 -1
  497. package/dist/commonjs/util/tokenCycler.js +0 -166
  498. package/dist/commonjs/util/tokenCycler.js.map +0 -1
  499. package/dist/commonjs/util/typeGuards.d.ts.map +0 -1
  500. package/dist/commonjs/util/userAgent.d.ts.map +0 -1
  501. package/dist/commonjs/util/userAgentPlatform.d.ts.map +0 -1
  502. package/dist/commonjs/util/uuidUtils.common.d.ts.map +0 -1
  503. package/dist/commonjs/util/uuidUtils.d.ts.map +0 -1
  504. package/dist/commonjs/xhrHttpClient.d.ts.map +0 -1
  505. package/dist/esm/abort-controller/AbortError.d.ts.map +0 -1
  506. package/dist/esm/abort-controller/AbortSignalLike.d.ts +0 -19
  507. package/dist/esm/abort-controller/AbortSignalLike.d.ts.map +0 -1
  508. package/dist/esm/abort-controller/AbortSignalLike.js.map +0 -1
  509. package/dist/esm/accessTokenCache.d.ts +0 -40
  510. package/dist/esm/accessTokenCache.d.ts.map +0 -1
  511. package/dist/esm/accessTokenCache.js +0 -32
  512. package/dist/esm/accessTokenCache.js.map +0 -1
  513. package/dist/esm/auth/keyCredential.d.ts +0 -16
  514. package/dist/esm/auth/keyCredential.d.ts.map +0 -1
  515. package/dist/esm/auth/keyCredential.js +0 -12
  516. package/dist/esm/auth/keyCredential.js.map +0 -1
  517. package/dist/esm/auth/tokenCredential.d.ts +0 -71
  518. package/dist/esm/auth/tokenCredential.d.ts.map +0 -1
  519. package/dist/esm/auth/tokenCredential.js +0 -19
  520. package/dist/esm/auth/tokenCredential.js.map +0 -1
  521. package/dist/esm/client/apiVersionPolicy.d.ts.map +0 -1
  522. package/dist/esm/client/clientHelpers.d.ts.map +0 -1
  523. package/dist/esm/client/common.d.ts.map +0 -1
  524. package/dist/esm/client/getClient.d.ts.map +0 -1
  525. package/dist/esm/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
  526. package/dist/esm/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
  527. package/dist/esm/client/keyCredentialAuthenticationPolicy.js +0 -16
  528. package/dist/esm/client/keyCredentialAuthenticationPolicy.js.map +0 -1
  529. package/dist/esm/client/multipart.d.ts.map +0 -1
  530. package/dist/esm/client/operationOptionHelpers.d.ts.map +0 -1
  531. package/dist/esm/client/restError.d.ts.map +0 -1
  532. package/dist/esm/client/sendRequest.d.ts.map +0 -1
  533. package/dist/esm/client/urlHelpers.d.ts.map +0 -1
  534. package/dist/esm/constants.d.ts.map +0 -1
  535. package/dist/esm/createPipelineFromOptions.d.ts.map +0 -1
  536. package/dist/esm/defaultHttpClient.d.ts.map +0 -1
  537. package/dist/esm/fetchHttpClient.d.ts.map +0 -1
  538. package/dist/esm/httpHeaders.d.ts.map +0 -1
  539. package/dist/esm/index.d.ts.map +0 -1
  540. package/dist/esm/interfaces.d.ts.map +0 -1
  541. package/dist/esm/log.d.ts.map +0 -1
  542. package/dist/esm/logger/debug.d.ts.map +0 -1
  543. package/dist/esm/logger/log.common.d.ts.map +0 -1
  544. package/dist/esm/logger/log.d.ts.map +0 -1
  545. package/dist/esm/logger/logger.d.ts.map +0 -1
  546. package/dist/esm/nodeHttpClient.d.ts.map +0 -1
  547. package/dist/esm/pipeline.d.ts.map +0 -1
  548. package/dist/esm/pipelineRequest.d.ts.map +0 -1
  549. package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
  550. package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
  551. package/dist/esm/policies/bearerTokenAuthenticationPolicy.js +0 -107
  552. package/dist/esm/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
  553. package/dist/esm/policies/decompressResponsePolicy.d.ts.map +0 -1
  554. package/dist/esm/policies/defaultRetryPolicy.d.ts.map +0 -1
  555. package/dist/esm/policies/exponentialRetryPolicy.d.ts.map +0 -1
  556. package/dist/esm/policies/formDataPolicy.d.ts.map +0 -1
  557. package/dist/esm/policies/logPolicy.d.ts.map +0 -1
  558. package/dist/esm/policies/multipartPolicy.d.ts.map +0 -1
  559. package/dist/esm/policies/proxyPolicy.common.d.ts.map +0 -1
  560. package/dist/esm/policies/proxyPolicy.d.ts.map +0 -1
  561. package/dist/esm/policies/redirectPolicy.d.ts.map +0 -1
  562. package/dist/esm/policies/retryPolicy.d.ts.map +0 -1
  563. package/dist/esm/policies/systemErrorRetryPolicy.d.ts.map +0 -1
  564. package/dist/esm/policies/throttlingRetryPolicy.d.ts.map +0 -1
  565. package/dist/esm/policies/tlsPolicy.d.ts.map +0 -1
  566. package/dist/esm/policies/userAgentPolicy.d.ts.map +0 -1
  567. package/dist/esm/restError.d.ts.map +0 -1
  568. package/dist/esm/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
  569. package/dist/esm/retryStrategies/retryStrategy.d.ts.map +0 -1
  570. package/dist/esm/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
  571. package/dist/esm/util/aborterUtils.d.ts.map +0 -1
  572. package/dist/esm/util/bytesEncoding.common.d.ts.map +0 -1
  573. package/dist/esm/util/bytesEncoding.d.ts.map +0 -1
  574. package/dist/esm/util/checkEnvironment.d.ts.map +0 -1
  575. package/dist/esm/util/concat.common.d.ts.map +0 -1
  576. package/dist/esm/util/concat.d.ts.map +0 -1
  577. package/dist/esm/util/createAbortablePromise.d.ts.map +0 -1
  578. package/dist/esm/util/delay.d.ts.map +0 -1
  579. package/dist/esm/util/error.d.ts.map +0 -1
  580. package/dist/esm/util/file.d.ts.map +0 -1
  581. package/dist/esm/util/helpers.d.ts.map +0 -1
  582. package/dist/esm/util/inspect.common.d.ts.map +0 -1
  583. package/dist/esm/util/inspect.d.ts.map +0 -1
  584. package/dist/esm/util/object.d.ts.map +0 -1
  585. package/dist/esm/util/random.d.ts.map +0 -1
  586. package/dist/esm/util/sanitizer.d.ts.map +0 -1
  587. package/dist/esm/util/sha256.common.d.ts.map +0 -1
  588. package/dist/esm/util/sha256.d.ts.map +0 -1
  589. package/dist/esm/util/tokenCycler.d.ts +0 -45
  590. package/dist/esm/util/tokenCycler.d.ts.map +0 -1
  591. package/dist/esm/util/tokenCycler.js +0 -162
  592. package/dist/esm/util/tokenCycler.js.map +0 -1
  593. package/dist/esm/util/typeGuards.d.ts.map +0 -1
  594. package/dist/esm/util/userAgent.d.ts.map +0 -1
  595. package/dist/esm/util/userAgentPlatform.d.ts.map +0 -1
  596. package/dist/esm/util/uuidUtils.common.d.ts.map +0 -1
  597. package/dist/esm/util/uuidUtils.d.ts.map +0 -1
  598. package/dist/esm/xhrHttpClient.d.ts.map +0 -1
  599. package/dist/react-native/abort-controller/AbortError.d.ts.map +0 -1
  600. package/dist/react-native/abort-controller/AbortSignalLike.d.ts +0 -19
  601. package/dist/react-native/abort-controller/AbortSignalLike.d.ts.map +0 -1
  602. package/dist/react-native/abort-controller/AbortSignalLike.js.map +0 -1
  603. package/dist/react-native/accessTokenCache.d.ts +0 -40
  604. package/dist/react-native/accessTokenCache.d.ts.map +0 -1
  605. package/dist/react-native/accessTokenCache.js +0 -32
  606. package/dist/react-native/accessTokenCache.js.map +0 -1
  607. package/dist/react-native/auth/keyCredential.d.ts +0 -16
  608. package/dist/react-native/auth/keyCredential.d.ts.map +0 -1
  609. package/dist/react-native/auth/keyCredential.js +0 -12
  610. package/dist/react-native/auth/keyCredential.js.map +0 -1
  611. package/dist/react-native/auth/tokenCredential.d.ts +0 -71
  612. package/dist/react-native/auth/tokenCredential.d.ts.map +0 -1
  613. package/dist/react-native/auth/tokenCredential.js +0 -19
  614. package/dist/react-native/auth/tokenCredential.js.map +0 -1
  615. package/dist/react-native/client/apiVersionPolicy.d.ts.map +0 -1
  616. package/dist/react-native/client/clientHelpers.d.ts.map +0 -1
  617. package/dist/react-native/client/common.d.ts.map +0 -1
  618. package/dist/react-native/client/getClient.d.ts.map +0 -1
  619. package/dist/react-native/client/keyCredentialAuthenticationPolicy.d.ts +0 -8
  620. package/dist/react-native/client/keyCredentialAuthenticationPolicy.d.ts.map +0 -1
  621. package/dist/react-native/client/keyCredentialAuthenticationPolicy.js +0 -16
  622. package/dist/react-native/client/keyCredentialAuthenticationPolicy.js.map +0 -1
  623. package/dist/react-native/client/multipart.d.ts.map +0 -1
  624. package/dist/react-native/client/operationOptionHelpers.d.ts.map +0 -1
  625. package/dist/react-native/client/restError.d.ts.map +0 -1
  626. package/dist/react-native/client/sendRequest.d.ts.map +0 -1
  627. package/dist/react-native/client/urlHelpers.d.ts.map +0 -1
  628. package/dist/react-native/constants.d.ts.map +0 -1
  629. package/dist/react-native/createPipelineFromOptions.d.ts.map +0 -1
  630. package/dist/react-native/defaultHttpClient-react-native.d.mts.map +0 -1
  631. package/dist/react-native/fetchHttpClient.d.ts.map +0 -1
  632. package/dist/react-native/httpHeaders.d.ts.map +0 -1
  633. package/dist/react-native/index.d.ts.map +0 -1
  634. package/dist/react-native/interfaces.d.ts.map +0 -1
  635. package/dist/react-native/log.d.ts.map +0 -1
  636. package/dist/react-native/logger/debug.d.ts.map +0 -1
  637. package/dist/react-native/logger/log-react-native.d.mts.map +0 -1
  638. package/dist/react-native/logger/log.common.d.ts.map +0 -1
  639. package/dist/react-native/logger/logger.d.ts.map +0 -1
  640. package/dist/react-native/nodeHttpClient.d.ts.map +0 -1
  641. package/dist/react-native/pipeline.d.ts.map +0 -1
  642. package/dist/react-native/pipelineRequest.d.ts.map +0 -1
  643. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts +0 -99
  644. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts.map +0 -1
  645. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js +0 -107
  646. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js.map +0 -1
  647. package/dist/react-native/policies/decompressResponsePolicy.d.ts.map +0 -1
  648. package/dist/react-native/policies/defaultRetryPolicy.d.ts.map +0 -1
  649. package/dist/react-native/policies/exponentialRetryPolicy.d.ts.map +0 -1
  650. package/dist/react-native/policies/formDataPolicy.d.ts.map +0 -1
  651. package/dist/react-native/policies/logPolicy.d.ts.map +0 -1
  652. package/dist/react-native/policies/multipartPolicy.d.ts.map +0 -1
  653. package/dist/react-native/policies/proxyPolicy-react-native.d.mts.map +0 -1
  654. package/dist/react-native/policies/proxyPolicy.common.d.ts.map +0 -1
  655. package/dist/react-native/policies/redirectPolicy.d.ts.map +0 -1
  656. package/dist/react-native/policies/retryPolicy.d.ts.map +0 -1
  657. package/dist/react-native/policies/systemErrorRetryPolicy.d.ts.map +0 -1
  658. package/dist/react-native/policies/throttlingRetryPolicy.d.ts.map +0 -1
  659. package/dist/react-native/policies/tlsPolicy.d.ts.map +0 -1
  660. package/dist/react-native/policies/userAgentPolicy.d.ts.map +0 -1
  661. package/dist/react-native/restError.d.ts.map +0 -1
  662. package/dist/react-native/retryStrategies/exponentialRetryStrategy.d.ts.map +0 -1
  663. package/dist/react-native/retryStrategies/retryStrategy.d.ts.map +0 -1
  664. package/dist/react-native/retryStrategies/throttlingRetryStrategy.d.ts.map +0 -1
  665. package/dist/react-native/util/aborterUtils.d.ts.map +0 -1
  666. package/dist/react-native/util/bytesEncoding-react-native.d.mts.map +0 -1
  667. package/dist/react-native/util/bytesEncoding.common.d.ts.map +0 -1
  668. package/dist/react-native/util/checkEnvironment.d.ts.map +0 -1
  669. package/dist/react-native/util/concat-react-native.d.mts.map +0 -1
  670. package/dist/react-native/util/concat.common.d.ts.map +0 -1
  671. package/dist/react-native/util/createAbortablePromise.d.ts.map +0 -1
  672. package/dist/react-native/util/delay.d.ts.map +0 -1
  673. package/dist/react-native/util/error.d.ts.map +0 -1
  674. package/dist/react-native/util/file.d.ts.map +0 -1
  675. package/dist/react-native/util/helpers.d.ts.map +0 -1
  676. package/dist/react-native/util/inspect-react-native.d.mts.map +0 -1
  677. package/dist/react-native/util/inspect.common.d.ts.map +0 -1
  678. package/dist/react-native/util/object.d.ts.map +0 -1
  679. package/dist/react-native/util/random.d.ts.map +0 -1
  680. package/dist/react-native/util/sanitizer.d.ts.map +0 -1
  681. package/dist/react-native/util/sha256-react-native.d.mts.map +0 -1
  682. package/dist/react-native/util/sha256.common.d.ts.map +0 -1
  683. package/dist/react-native/util/tokenCycler.d.ts +0 -45
  684. package/dist/react-native/util/tokenCycler.d.ts.map +0 -1
  685. package/dist/react-native/util/tokenCycler.js +0 -162
  686. package/dist/react-native/util/tokenCycler.js.map +0 -1
  687. package/dist/react-native/util/typeGuards.d.ts.map +0 -1
  688. package/dist/react-native/util/userAgent.d.ts.map +0 -1
  689. package/dist/react-native/util/userAgentPlatform-react-native.d.mts.map +0 -1
  690. package/dist/react-native/util/uuidUtils-react-native.d.mts.map +0 -1
  691. package/dist/react-native/util/uuidUtils.common.d.ts.map +0 -1
  692. package/dist/react-native/xhrHttpClient.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"./abort-controller/AbortSignalLike.js\";\n\n/**\n * A HttpHeaders collection represented as a simple JSON object.\n */\nexport type RawHttpHeaders = { [headerName: string]: string };\n\n/**\n * A HttpHeaders collection for input, represented as a simple JSON object.\n */\nexport type RawHttpHeadersInput = Record<string, string | number | boolean>;\n\n/**\n * Represents a set of HTTP headers on a request/response.\n * Header names are treated as case insensitive.\n */\nexport interface HttpHeaders extends Iterable<[string, string]> {\n /**\n * Returns the value of a specific header or undefined if not set.\n * @param name - The name of the header to retrieve.\n */\n get(name: string): string | undefined;\n /**\n * Returns true if the specified header exists.\n * @param name - The name of the header to check.\n */\n has(name: string): boolean;\n /**\n * Sets a specific header with a given value.\n * @param name - The name of the header to set.\n * @param value - The value to use for the header.\n */\n set(name: string, value: string | number | boolean): void;\n /**\n * Removes a specific header from the collection.\n * @param name - The name of the header to delete.\n */\n delete(name: string): void;\n /**\n * Accesses a raw JS object that acts as a simple map\n * of header names to values.\n */\n toJSON(options?: { preserveCase?: boolean }): RawHttpHeaders;\n}\n\n/**\n * A part of the request body in a multipart request.\n */\nexport interface BodyPart {\n /**\n * The headers for this part of the multipart request.\n */\n headers: HttpHeaders;\n\n /**\n * The body of this part of the multipart request.\n */\n body:\n | ((() => ReadableStream<Uint8Array>) | (() => NodeJS.ReadableStream))\n | ReadableStream<Uint8Array>\n | NodeJS.ReadableStream\n | Uint8Array\n | Blob;\n}\n\n/**\n * A request body consisting of multiple parts.\n */\nexport interface MultipartRequestBody {\n /**\n * The parts of the request body.\n */\n parts: BodyPart[];\n\n /**\n * The boundary separating each part of the request body.\n * If not specified, a random boundary will be generated.\n *\n * When specified, '--' will be prepended to the boundary in the request to ensure the boundary follows the specification.\n */\n boundary?: string;\n}\n\n/**\n * Types of bodies supported on the request.\n * NodeJS.ReadableStream and () =\\> NodeJS.ReadableStream is Node only.\n * Blob, ReadableStream<Uint8Array>, and () =\\> ReadableStream<Uint8Array> are browser only.\n */\nexport type RequestBodyType =\n | NodeJS.ReadableStream\n | (() => NodeJS.ReadableStream)\n | ReadableStream<Uint8Array>\n | (() => ReadableStream<Uint8Array>)\n | Blob\n | ArrayBuffer\n | ArrayBufferView\n | FormData\n | string\n | null;\n\n/**\n * An interface compatible with NodeJS's `http.Agent`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface Agent {\n /**\n * Destroy any sockets that are currently in use by the agent.\n */\n destroy(): void;\n /**\n * For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.\n */\n maxFreeSockets: number;\n /**\n * Determines how many concurrent sockets the agent can have open per origin.\n */\n maxSockets: number;\n /**\n * An object which contains queues of requests that have not yet been assigned to sockets.\n */\n requests: unknown;\n /**\n * An object which contains arrays of sockets currently in use by the agent.\n */\n sockets: unknown;\n}\n\n/**\n * Metadata about a request being made by the pipeline.\n */\nexport interface PipelineRequest {\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers: HttpHeaders;\n\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 * Defaults to 0, which disables the timeout.\n */\n timeout: number;\n\n /**\n * Indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.\n * Defaults to false.\n */\n withCredentials: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n * When streamResponseStatusCodes contains the value Number.POSITIVE_INFINITY any status would be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\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 /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * NODEJS ONLY\n *\n * A Node-only option to provide a custom `http.Agent`/`https.Agent`.\n * Does nothing when running in the browser.\n */\n agent?: Agent;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable browser Streams. If this option is set and a response is a stream\n * the response will have a property `browserStream` instead of `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /** Settings for configuring TLS authentication */\n tlsSettings?: TlsSettings;\n}\n\n/**\n * Metadata about a response received by the pipeline.\n */\nexport interface PipelineResponse {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP status code of the response.\n */\n status: number;\n /**\n * The HTTP response headers.\n */\n headers: HttpHeaders;\n\n /**\n * The response body as text (string format)\n */\n bodyAsText?: string | null;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser Blob.\n * Always undefined in node.js.\n */\n blobBody?: Promise<Blob>;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser ReadableStream.\n * Always undefined in node.js.\n */\n browserStreamBody?: ReadableStream<Uint8Array>;\n\n /**\n * NODEJS ONLY\n *\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n */\n readableStreamBody?: NodeJS.ReadableStream;\n}\n\n/**\n * A simple interface for making a pipeline request and receiving a response.\n */\nexport type SendRequest = (request: PipelineRequest) => Promise<PipelineResponse>;\n\n/**\n * The required interface for a client that makes HTTP requests\n * on behalf of a pipeline.\n */\nexport interface HttpClient {\n /**\n * The method that makes the request and returns a response.\n */\n sendRequest: SendRequest;\n}\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// UNBRANDED DIFFERENCE: HttpMethods are defined at the top level in unbranded instead of core-util since we don't\n// need to worry about creating a cyclic dependency\n/**\n * Supported HTTP methods to use when making requests.\n */\nexport type HttpMethods =\n | \"GET\"\n | \"PUT\"\n | \"POST\"\n | \"DELETE\"\n | \"PATCH\"\n | \"HEAD\"\n | \"OPTIONS\"\n | \"TRACE\";\n\n/**\n * Options to configure a proxy for outgoing requests (Node.js only).\n */\nexport interface ProxySettings {\n /**\n * The proxy's host address.\n */\n host: string;\n\n /**\n * The proxy host's port.\n */\n port: number;\n\n /**\n * The user name to authenticate with the proxy, if required.\n */\n username?: string;\n\n /**\n * The password to authenticate with the proxy, if required.\n */\n password?: string;\n}\n\n/**\n * Each form data entry can be a string, Blob, or a File. If you wish to pass a file with a name but do not have\n * access to the File class, you can use the createFile helper to create one.\n */\nexport type FormDataValue = string | Blob | File;\n\n/**\n * A simple object that provides form data, as if from a browser form.\n */\nexport type FormDataMap = { [key: string]: FormDataValue | FormDataValue[] };\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface PipelineRetryOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The amount of delay in milliseconds between retry attempts. Defaults to 1000\n * (1 second). The delay increases exponentially with each retry up to a maximum\n * specified by maxRetryDelayInMs.\n */\n retryDelayInMs?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation. Defaults\n * to 64000 (64 seconds).\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * Represents a certificate credential for authentication.\n */\nexport interface CertificateCredential {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | Buffer | Array<Buffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;\n}\n\n/**\n * Represents a certificate for TLS authentication.\n */\nexport interface TlsSettings {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | Buffer | Array<Buffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.KeyObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface KeyObject {\n /**\n * Private keys in PEM format.\n */\n pem: string | Buffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.PxfObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface PxfObject {\n /**\n * PFX or PKCS12 encoded private key and certificate chain.\n */\n buf: string | Buffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/interfaces.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AuthScheme } from \"./auth/schemes.js\";\n\n/**\n * A HttpHeaders collection represented as a simple JSON object.\n */\nexport type RawHttpHeaders = { [headerName: string]: string };\n\n/**\n * A HttpHeaders collection for input, represented as a simple JSON object.\n */\nexport type RawHttpHeadersInput = Record<string, string | number | boolean>;\n\n/**\n * Represents a set of HTTP headers on a request/response.\n * Header names are treated as case insensitive.\n */\nexport interface HttpHeaders extends Iterable<[string, string]> {\n /**\n * Returns the value of a specific header or undefined if not set.\n * @param name - The name of the header to retrieve.\n */\n get(name: string): string | undefined;\n /**\n * Returns true if the specified header exists.\n * @param name - The name of the header to check.\n */\n has(name: string): boolean;\n /**\n * Sets a specific header with a given value.\n * @param name - The name of the header to set.\n * @param value - The value to use for the header.\n */\n set(name: string, value: string | number | boolean): void;\n /**\n * Removes a specific header from the collection.\n * @param name - The name of the header to delete.\n */\n delete(name: string): void;\n /**\n * Accesses a raw JS object that acts as a simple map\n * of header names to values.\n */\n toJSON(options?: { preserveCase?: boolean }): RawHttpHeaders;\n}\n\n/**\n * A part of the request body in a multipart request.\n */\nexport interface BodyPart {\n /**\n * The headers for this part of the multipart request.\n */\n headers: HttpHeaders;\n\n /**\n * The body of this part of the multipart request.\n */\n body:\n | ((() => ReadableStream<Uint8Array>) | (() => NodeJS.ReadableStream))\n | ReadableStream<Uint8Array>\n | NodeJS.ReadableStream\n | Uint8Array\n | Blob;\n}\n\n/**\n * A request body consisting of multiple parts.\n */\nexport interface MultipartRequestBody {\n /**\n * The parts of the request body.\n */\n parts: BodyPart[];\n\n /**\n * The boundary separating each part of the request body.\n * If not specified, a random boundary will be generated.\n *\n * When specified, '--' will be prepended to the boundary in the request to ensure the boundary follows the specification.\n */\n boundary?: string;\n}\n\n/**\n * Types of bodies supported on the request.\n * NodeJS.ReadableStream and () =\\> NodeJS.ReadableStream is Node only.\n * Blob, ReadableStream<Uint8Array>, and () =\\> ReadableStream<Uint8Array> are browser only.\n */\nexport type RequestBodyType =\n | NodeJS.ReadableStream\n | (() => NodeJS.ReadableStream)\n | ReadableStream<Uint8Array>\n | (() => ReadableStream<Uint8Array>)\n | Blob\n | ArrayBuffer\n | ArrayBufferView\n | FormData\n | string\n | null;\n\n/**\n * An interface compatible with NodeJS's `http.Agent`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface Agent {\n /**\n * Destroy any sockets that are currently in use by the agent.\n */\n destroy(): void;\n /**\n * For agents with keepAlive enabled, this sets the maximum number of sockets that will be left open in the free state.\n */\n maxFreeSockets: number;\n /**\n * Determines how many concurrent sockets the agent can have open per origin.\n */\n maxSockets: number;\n /**\n * An object which contains queues of requests that have not yet been assigned to sockets.\n */\n requests: unknown;\n /**\n * An object which contains arrays of sockets currently in use by the agent.\n */\n sockets: unknown;\n}\n\n/**\n * Metadata about a request being made by the pipeline.\n */\nexport interface PipelineRequest {\n /**\n * List of authentication schemes used for this specific request.\n * These schemes define how the request will be authenticated.\n * If provided, these schemes override the client level authentication schemes.\n *\n * If no auth schemes are provided at client or request level, defaults to no auth.\n */\n authSchemes?: AuthScheme[];\n\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers: HttpHeaders;\n\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 * Defaults to 0, which disables the timeout.\n */\n timeout: number;\n\n /**\n * Indicates whether the user agent should send cookies from the other domain in the case of cross-origin requests.\n * Defaults to false.\n */\n withCredentials: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n * When streamResponseStatusCodes contains the value Number.POSITIVE_INFINITY any status would be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignal;\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 /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n\n /**\n * NODEJS ONLY\n *\n * A Node-only option to provide a custom `http.Agent`/`https.Agent`.\n * Does nothing when running in the browser.\n */\n agent?: Agent;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable browser Streams. If this option is set and a response is a stream\n * the response will have a property `browserStream` instead of `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /** Settings for configuring TLS authentication */\n tlsSettings?: TlsSettings;\n}\n\n/**\n * Metadata about a response received by the pipeline.\n */\nexport interface PipelineResponse {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP status code of the response.\n */\n status: number;\n /**\n * The HTTP response headers.\n */\n headers: HttpHeaders;\n\n /**\n * The response body as text (string format)\n */\n bodyAsText?: string | null;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser Blob.\n * Always undefined in node.js.\n */\n blobBody?: Promise<Blob>;\n\n /**\n * BROWSER ONLY\n *\n * The response body as a browser ReadableStream.\n * Always undefined in node.js.\n */\n browserStreamBody?: ReadableStream<Uint8Array>;\n\n /**\n * NODEJS ONLY\n *\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n */\n readableStreamBody?: NodeJS.ReadableStream;\n}\n\n/**\n * A simple interface for making a pipeline request and receiving a response.\n */\nexport type SendRequest = (request: PipelineRequest) => Promise<PipelineResponse>;\n\n/**\n * The required interface for a client that makes HTTP requests\n * on behalf of a pipeline.\n */\nexport interface HttpClient {\n /**\n * The method that makes the request and returns a response.\n */\n sendRequest: SendRequest;\n}\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// UNBRANDED DIFFERENCE: HttpMethods are defined at the top level in unbranded instead of core-util since we don't\n// need to worry about creating a cyclic dependency\n/**\n * Supported HTTP methods to use when making requests.\n */\nexport type HttpMethods =\n | \"GET\"\n | \"PUT\"\n | \"POST\"\n | \"DELETE\"\n | \"PATCH\"\n | \"HEAD\"\n | \"OPTIONS\"\n | \"TRACE\";\n\n/**\n * Options to configure a proxy for outgoing requests (Node.js only).\n */\nexport interface ProxySettings {\n /**\n * The proxy's host address.\n * Must include the protocol (e.g., http:// or https://).\n */\n host: string;\n\n /**\n * The proxy host's port.\n */\n port: number;\n\n /**\n * The user name to authenticate with the proxy, if required.\n */\n username?: string;\n\n /**\n * The password to authenticate with the proxy, if required.\n */\n password?: string;\n}\n\n/**\n * Each form data entry can be a string, Blob, or a File. If you wish to pass a file with a name but do not have\n * access to the File class, you can use the createFile helper to create one.\n */\nexport type FormDataValue = string | Blob | File;\n\n/**\n * A simple object that provides form data, as if from a browser form.\n */\nexport type FormDataMap = { [key: string]: FormDataValue | FormDataValue[] };\n\n/**\n * Options that control how to retry failed requests.\n */\nexport interface PipelineRetryOptions {\n /**\n * The maximum number of retry attempts. Defaults to 3.\n */\n maxRetries?: number;\n\n /**\n * The amount of delay in milliseconds between retry attempts. Defaults to 1000\n * (1 second). The delay increases exponentially with each retry up to a maximum\n * specified by maxRetryDelayInMs.\n */\n retryDelayInMs?: number;\n\n /**\n * The maximum delay in milliseconds allowed before retrying an operation. Defaults\n * to 64000 (64 seconds).\n */\n maxRetryDelayInMs?: number;\n}\n\n/**\n * Represents a certificate credential for authentication.\n */\nexport interface CertificateCredential {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | Buffer | Array<Buffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;\n}\n\n/**\n * Represents a certificate for TLS authentication.\n */\nexport interface TlsSettings {\n /**\n * Optionally override the trusted CA certificates. Default is to trust\n * the well-known CAs curated by Mozilla. Mozilla's CAs are completely\n * replaced when CAs are explicitly specified using this option.\n */\n ca?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Cert chains in PEM format. One cert chain should be provided per\n * private key. Each cert chain should consist of the PEM formatted\n * certificate for a provided private key, followed by the PEM\n * formatted intermediate certificates (if any), in order, and not\n * including the root CA (the root CA must be pre-known to the peer,\n * see ca). When providing multiple cert chains, they do not have to\n * be in the same order as their private keys in key. If the\n * intermediate certificates are not provided, the peer will not be\n * able to validate the certificate, and the handshake will fail.\n */\n cert?: string | Buffer | Array<string | Buffer> | undefined;\n /**\n * Private keys in PEM format. PEM allows the option of private keys\n * being encrypted. Encrypted keys will be decrypted with\n * options.passphrase. Multiple keys using different algorithms can be\n * provided either as an array of unencrypted key strings or buffers,\n * or an array of objects in the form `{pem: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n key?: string | Buffer | Array<Buffer | KeyObject> | undefined;\n /**\n * Shared passphrase used for a single private key and/or a PFX.\n */\n passphrase?: string | undefined;\n /**\n * PFX or PKCS12 encoded private key and certificate chain. pfx is an\n * alternative to providing key and cert individually. PFX is usually\n * encrypted, if it is, passphrase will be used to decrypt it. Multiple\n * PFX can be provided either as an array of unencrypted PFX buffers,\n * or an array of objects in the form `{buf: <string|buffer>[,passphrase: <string>]}`.\n * The object form can only occur in an array.object.passphrase is optional.\n * Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not.\n */\n pfx?: string | Buffer | Array<string | Buffer | PxfObject> | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.KeyObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface KeyObject {\n /**\n * Private keys in PEM format.\n */\n pem: string | Buffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n\n/**\n * An interface compatible with NodeJS's `tls.PxfObject`.\n * We want to avoid publicly re-exporting the actual interface,\n * since it might vary across runtime versions.\n */\nexport interface PxfObject {\n /**\n * PFX or PKCS12 encoded private key and certificate chain.\n */\n buf: string | Buffer;\n /**\n * Optional passphrase.\n */\n passphrase?: string | undefined;\n}\n"]}
@@ -13,6 +13,7 @@ const AbortError_js_1 = require("./abort-controller/AbortError.js");
13
13
  const httpHeaders_js_1 = require("./httpHeaders.js");
14
14
  const restError_js_1 = require("./restError.js");
15
15
  const log_js_1 = require("./log.js");
16
+ const sanitizer_js_1 = require("./util/sanitizer.js");
16
17
  const DEFAULT_TLS_SETTINGS = {};
17
18
  function isReadableStream(body) {
18
19
  return body && typeof body.pipe === "function";
@@ -73,7 +74,7 @@ class NodeHttpClient {
73
74
  let abortListener;
74
75
  if (request.abortSignal) {
75
76
  if (request.abortSignal.aborted) {
76
- throw new AbortError_js_1.AbortError("The operation was aborted.");
77
+ throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled.");
77
78
  }
78
79
  abortListener = (event) => {
79
80
  if (event.type === "abort") {
@@ -82,8 +83,11 @@ class NodeHttpClient {
82
83
  };
83
84
  request.abortSignal.addEventListener("abort", abortListener);
84
85
  }
86
+ let timeoutId;
85
87
  if (request.timeout > 0) {
86
- setTimeout(() => {
88
+ timeoutId = setTimeout(() => {
89
+ const sanitizer = new sanitizer_js_1.Sanitizer();
90
+ log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`);
87
91
  abortController.abort();
88
92
  }, request.timeout);
89
93
  }
@@ -113,6 +117,9 @@ class NodeHttpClient {
113
117
  body = uploadReportStream;
114
118
  }
115
119
  const res = await this.makeRequest(request, abortController, body);
120
+ if (timeoutId !== undefined) {
121
+ clearTimeout(timeoutId);
122
+ }
116
123
  const headers = getResponseHeaders(res);
117
124
  const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0;
118
125
  const response = {
@@ -197,7 +204,7 @@ class NodeHttpClient {
197
204
  reject(new restError_js_1.RestError(err.message, { code: (_a = err.code) !== null && _a !== void 0 ? _a : restError_js_1.RestError.REQUEST_SEND_ERROR, request }));
198
205
  });
199
206
  abortController.signal.addEventListener("abort", () => {
200
- const abortError = new AbortError_js_1.AbortError("The operation was aborted.");
207
+ const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request.");
201
208
  req.destroy(abortError);
202
209
  reject(abortError);
203
210
  });
@@ -1 +1 @@
1
- {"version":3,"file":"nodeHttpClient.js","sourceRoot":"","sources":["../../src/nodeHttpClient.ts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AAK,QAAQ,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB;IAClC,OAAO,IAAI,cAAc,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as http from \"node:http\";\nimport * as https from \"node:https\";\nimport * as zlib from \"node:zlib\";\nimport { Transform } from \"node:stream\";\nimport { AbortError } from \"./abort-controller/AbortError.js\";\nimport type {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n TlsSettings,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { RestError } from \"./restError.js\";\nimport type { IncomingMessage } from \"node:http\";\nimport { logger } from \"./log.js\";\n\nconst DEFAULT_TLS_SETTINGS = {};\n\nfunction isReadableStream(body: any): body is NodeJS.ReadableStream {\n return body && typeof body.pipe === \"function\";\n}\n\nfunction isStreamComplete(stream: NodeJS.ReadableStream): Promise<void> {\n if (stream.readable === false) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n const handler = (): void => {\n resolve();\n stream.removeListener(\"close\", handler);\n stream.removeListener(\"end\", handler);\n stream.removeListener(\"error\", handler);\n };\n\n stream.on(\"close\", handler);\n stream.on(\"end\", handler);\n stream.on(\"error\", handler);\n });\n}\n\nfunction isArrayBuffer(body: any): body is ArrayBuffer | ArrayBufferView {\n return body && typeof body.byteLength === \"number\";\n}\n\nclass ReportTransform extends Transform {\n private loadedBytes = 0;\n private progressCallback: (progress: TransferProgressEvent) => void;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _transform(chunk: string | Buffer, _encoding: string, callback: Function): void {\n this.push(chunk);\n this.loadedBytes += chunk.length;\n try {\n this.progressCallback({ loadedBytes: this.loadedBytes });\n callback();\n } catch (e: any) {\n callback(e);\n }\n }\n\n constructor(progressCallback: (progress: TransferProgressEvent) => void) {\n super();\n this.progressCallback = progressCallback;\n }\n}\n\n/**\n * A HttpClient implementation that uses Node's \"https\" module to send HTTPS requests.\n * @internal\n */\nclass NodeHttpClient implements HttpClient {\n private cachedHttpAgent?: http.Agent;\n private cachedHttpsAgents: WeakMap<TlsSettings, https.Agent> = new WeakMap();\n\n /**\n * Makes a request over an underlying transport layer and returns the response.\n * @param request - The request to be made.\n */\n public async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const abortController = new AbortController();\n let abortListener: ((event: any) => void) | undefined;\n if (request.abortSignal) {\n if (request.abortSignal.aborted) {\n throw new AbortError(\"The operation was aborted.\");\n }\n\n abortListener = (event: Event) => {\n if (event.type === \"abort\") {\n abortController.abort();\n }\n };\n request.abortSignal.addEventListener(\"abort\", abortListener);\n }\n\n if (request.timeout > 0) {\n setTimeout(() => {\n abortController.abort();\n }, request.timeout);\n }\n\n const acceptEncoding = request.headers.get(\"Accept-Encoding\");\n const shouldDecompress =\n acceptEncoding?.includes(\"gzip\") || acceptEncoding?.includes(\"deflate\");\n\n let body = typeof request.body === \"function\" ? request.body() : request.body;\n if (body && !request.headers.has(\"Content-Length\")) {\n const bodyLength = getBodyLength(body);\n if (bodyLength !== null) {\n request.headers.set(\"Content-Length\", bodyLength);\n }\n }\n\n let responseStream: NodeJS.ReadableStream | undefined;\n try {\n if (body && request.onUploadProgress) {\n const onUploadProgress = request.onUploadProgress;\n const uploadReportStream = new ReportTransform(onUploadProgress);\n uploadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in upload progress\", e);\n });\n if (isReadableStream(body)) {\n body.pipe(uploadReportStream);\n } else {\n uploadReportStream.end(body);\n }\n\n body = uploadReportStream;\n }\n\n const res = await this.makeRequest(request, abortController, body);\n\n const headers = getResponseHeaders(res);\n\n const status = res.statusCode ?? 0;\n const response: PipelineResponse = {\n status,\n headers,\n request,\n };\n\n // Responses to HEAD must not have a body.\n // If they do return a body, that body must be ignored.\n if (request.method === \"HEAD\") {\n // call resume() and not destroy() to avoid closing the socket\n // and losing keep alive\n res.resume();\n return response;\n }\n\n responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res;\n\n const onDownloadProgress = request.onDownloadProgress;\n if (onDownloadProgress) {\n const downloadReportStream = new ReportTransform(onDownloadProgress);\n downloadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in download progress\", e);\n });\n responseStream.pipe(downloadReportStream);\n responseStream = downloadReportStream;\n }\n\n if (\n // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code\n request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) ||\n request.streamResponseStatusCodes?.has(response.status)\n ) {\n response.readableStreamBody = responseStream;\n } else {\n response.bodyAsText = await streamToText(responseStream);\n }\n\n return response;\n } finally {\n // clean up event listener\n if (request.abortSignal && abortListener) {\n let uploadStreamDone = Promise.resolve();\n if (isReadableStream(body)) {\n uploadStreamDone = isStreamComplete(body);\n }\n let downloadStreamDone = Promise.resolve();\n if (isReadableStream(responseStream)) {\n downloadStreamDone = isStreamComplete(responseStream);\n }\n Promise.all([uploadStreamDone, downloadStreamDone])\n .then(() => {\n // eslint-disable-next-line promise/always-return\n if (abortListener) {\n request.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n })\n .catch((e) => {\n logger.warning(\"Error when cleaning up abortListener on httpRequest\", e);\n });\n }\n }\n }\n\n private makeRequest(\n request: PipelineRequest,\n abortController: AbortController,\n body?: RequestBodyType,\n ): Promise<http.IncomingMessage> {\n const url = new URL(request.url);\n\n const isInsecure = url.protocol !== \"https:\";\n\n if (isInsecure && !request.allowInsecureConnection) {\n throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`);\n }\n\n const agent = (request.agent as http.Agent) ?? this.getOrCreateAgent(request, isInsecure);\n const options: http.RequestOptions = {\n agent,\n hostname: url.hostname,\n path: `${url.pathname}${url.search}`,\n port: url.port,\n method: request.method,\n headers: request.headers.toJSON({ preserveCase: true }),\n };\n\n return new Promise<http.IncomingMessage>((resolve, reject) => {\n const req = isInsecure ? http.request(options, resolve) : https.request(options, resolve);\n\n req.once(\"error\", (err: Error & { code?: string }) => {\n reject(\n new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request }),\n );\n });\n\n abortController.signal.addEventListener(\"abort\", () => {\n const abortError = new AbortError(\"The operation was aborted.\");\n req.destroy(abortError);\n reject(abortError);\n });\n if (body && isReadableStream(body)) {\n body.pipe(req);\n } else if (body) {\n if (typeof body === \"string\" || Buffer.isBuffer(body)) {\n req.end(body);\n } else if (isArrayBuffer(body)) {\n req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body));\n } else {\n logger.error(\"Unrecognized body type\", body);\n reject(new RestError(\"Unrecognized body type\"));\n }\n } else {\n // streams don't like \"undefined\" being passed as data\n req.end();\n }\n });\n }\n\n private getOrCreateAgent(request: PipelineRequest, isInsecure: boolean): http.Agent {\n const disableKeepAlive = request.disableKeepAlive;\n\n // Handle Insecure requests first\n if (isInsecure) {\n if (disableKeepAlive) {\n // keepAlive:false is the default so we don't need a custom Agent\n return http.globalAgent;\n }\n\n if (!this.cachedHttpAgent) {\n // If there is no cached agent create a new one and cache it.\n this.cachedHttpAgent = new http.Agent({ keepAlive: true });\n }\n return this.cachedHttpAgent;\n } else {\n if (disableKeepAlive && !request.tlsSettings) {\n // When there are no tlsSettings and keepAlive is false\n // we don't need a custom agent\n return https.globalAgent;\n }\n\n // We use the tlsSettings to index cached clients\n const tlsSettings = request.tlsSettings ?? DEFAULT_TLS_SETTINGS;\n\n // Get the cached agent or create a new one with the\n // provided values for keepAlive and tlsSettings\n let agent = this.cachedHttpsAgents.get(tlsSettings);\n\n if (agent && agent.options.keepAlive === !disableKeepAlive) {\n return agent;\n }\n\n logger.info(\"No cached TLS Agent exist, creating a new Agent\");\n agent = new https.Agent({\n // keepAlive is true if disableKeepAlive is false.\n keepAlive: !disableKeepAlive,\n // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options.\n ...tlsSettings,\n });\n\n this.cachedHttpsAgents.set(tlsSettings, agent);\n return agent;\n }\n }\n}\n\nfunction getResponseHeaders(res: IncomingMessage): HttpHeaders {\n const headers = createHttpHeaders();\n for (const header of Object.keys(res.headers)) {\n const value = res.headers[header];\n if (Array.isArray(value)) {\n if (value.length > 0) {\n headers.set(header, value[0]);\n }\n } else if (value) {\n headers.set(header, value);\n }\n }\n return headers;\n}\n\nfunction getDecodedResponseStream(\n stream: IncomingMessage,\n headers: HttpHeaders,\n): NodeJS.ReadableStream {\n const contentEncoding = headers.get(\"Content-Encoding\");\n if (contentEncoding === \"gzip\") {\n const unzip = zlib.createGunzip();\n stream.pipe(unzip);\n return unzip;\n } else if (contentEncoding === \"deflate\") {\n const inflate = zlib.createInflate();\n stream.pipe(inflate);\n return inflate;\n }\n\n return stream;\n}\n\nfunction streamToText(stream: NodeJS.ReadableStream): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const buffer: Buffer[] = [];\n\n stream.on(\"data\", (chunk) => {\n if (Buffer.isBuffer(chunk)) {\n buffer.push(chunk);\n } else {\n buffer.push(Buffer.from(chunk));\n }\n });\n stream.on(\"end\", () => {\n resolve(Buffer.concat(buffer).toString(\"utf8\"));\n });\n stream.on(\"error\", (e) => {\n if (e && e?.name === \"AbortError\") {\n reject(e);\n } else {\n reject(\n new RestError(`Error reading response as text: ${e.message}`, {\n code: RestError.PARSE_ERROR,\n }),\n );\n }\n });\n });\n}\n\n/** @internal */\nexport function getBodyLength(body: RequestBodyType): number | null {\n if (!body) {\n return 0;\n } else if (Buffer.isBuffer(body)) {\n return body.length;\n } else if (isReadableStream(body)) {\n return null;\n } else if (isArrayBuffer(body)) {\n return body.byteLength;\n } else if (typeof body === \"string\") {\n return Buffer.from(body).length;\n } else {\n return null;\n }\n}\n\n/**\n * Create a new HttpClient instance for the NodeJS environment.\n * @internal\n */\nexport function createNodeHttpClient(): HttpClient {\n return new NodeHttpClient();\n}\n"]}
1
+ {"version":3,"file":"nodeHttpClient.js","sourceRoot":"","sources":["../../src/nodeHttpClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAyXlC,sCAcC;AAMD,oDAEC;;AA7YD,wDAAkC;AAClC,0DAAoC;AACpC,wDAAkC;AAClC,6CAAwC;AACxC,oEAA8D;AAU9D,qDAAqD;AACrD,iDAA2C;AAE3C,qCAAkC;AAClC,sDAAgD;AAEhD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,gBAAgB,CAAC,IAAS;IACjC,OAAO,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC;AACjD,CAAC;AAED,SAAS,gBAAgB,CAAC,MAA6B;IACrD,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAG,GAAS,EAAE;YACzB,OAAO,EAAE,CAAC;YACV,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YACtC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC1B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,IAAS;IAC9B,OAAO,IAAI,IAAI,OAAO,IAAI,CAA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ED,gBAAgB;AAChB,SAAgB,aAAa,CAAC,IAAqB;IACjD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CAAC,CAAC;IACX,CAAC;SAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;SAAM,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAClC,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB;IAClC,OAAO,IAAI,cAAc,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport * as http from \"node:http\";\nimport * as https from \"node:https\";\nimport * as zlib from \"node:zlib\";\nimport { Transform } from \"node:stream\";\nimport { AbortError } from \"./abort-controller/AbortError.js\";\nimport type {\n HttpClient,\n HttpHeaders,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n TlsSettings,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { RestError } from \"./restError.js\";\nimport type { IncomingMessage } from \"node:http\";\nimport { logger } from \"./log.js\";\nimport { Sanitizer } from \"./util/sanitizer.js\";\n\nconst DEFAULT_TLS_SETTINGS = {};\n\nfunction isReadableStream(body: any): body is NodeJS.ReadableStream {\n return body && typeof body.pipe === \"function\";\n}\n\nfunction isStreamComplete(stream: NodeJS.ReadableStream): Promise<void> {\n if (stream.readable === false) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n const handler = (): void => {\n resolve();\n stream.removeListener(\"close\", handler);\n stream.removeListener(\"end\", handler);\n stream.removeListener(\"error\", handler);\n };\n\n stream.on(\"close\", handler);\n stream.on(\"end\", handler);\n stream.on(\"error\", handler);\n });\n}\n\nfunction isArrayBuffer(body: any): body is ArrayBuffer | ArrayBufferView {\n return body && typeof body.byteLength === \"number\";\n}\n\nclass ReportTransform extends Transform {\n private loadedBytes = 0;\n private progressCallback: (progress: TransferProgressEvent) => void;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _transform(chunk: string | Buffer, _encoding: string, callback: Function): void {\n this.push(chunk);\n this.loadedBytes += chunk.length;\n try {\n this.progressCallback({ loadedBytes: this.loadedBytes });\n callback();\n } catch (e: any) {\n callback(e);\n }\n }\n\n constructor(progressCallback: (progress: TransferProgressEvent) => void) {\n super();\n this.progressCallback = progressCallback;\n }\n}\n\n/**\n * A HttpClient implementation that uses Node's \"https\" module to send HTTPS requests.\n * @internal\n */\nclass NodeHttpClient implements HttpClient {\n private cachedHttpAgent?: http.Agent;\n private cachedHttpsAgents: WeakMap<TlsSettings, https.Agent> = new WeakMap();\n\n /**\n * Makes a request over an underlying transport layer and returns the response.\n * @param request - The request to be made.\n */\n public async sendRequest(request: PipelineRequest): Promise<PipelineResponse> {\n const abortController = new AbortController();\n let abortListener: ((event: any) => void) | undefined;\n if (request.abortSignal) {\n if (request.abortSignal.aborted) {\n throw new AbortError(\"The operation was aborted. Request has already been canceled.\");\n }\n\n abortListener = (event: Event) => {\n if (event.type === \"abort\") {\n abortController.abort();\n }\n };\n request.abortSignal.addEventListener(\"abort\", abortListener);\n }\n\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n if (request.timeout > 0) {\n timeoutId = setTimeout(() => {\n const sanitizer = new Sanitizer();\n logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`);\n abortController.abort();\n }, request.timeout);\n }\n\n const acceptEncoding = request.headers.get(\"Accept-Encoding\");\n const shouldDecompress =\n acceptEncoding?.includes(\"gzip\") || acceptEncoding?.includes(\"deflate\");\n\n let body = typeof request.body === \"function\" ? request.body() : request.body;\n if (body && !request.headers.has(\"Content-Length\")) {\n const bodyLength = getBodyLength(body);\n if (bodyLength !== null) {\n request.headers.set(\"Content-Length\", bodyLength);\n }\n }\n\n let responseStream: NodeJS.ReadableStream | undefined;\n try {\n if (body && request.onUploadProgress) {\n const onUploadProgress = request.onUploadProgress;\n const uploadReportStream = new ReportTransform(onUploadProgress);\n uploadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in upload progress\", e);\n });\n if (isReadableStream(body)) {\n body.pipe(uploadReportStream);\n } else {\n uploadReportStream.end(body);\n }\n\n body = uploadReportStream;\n }\n\n const res = await this.makeRequest(request, abortController, body);\n\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n\n const headers = getResponseHeaders(res);\n\n const status = res.statusCode ?? 0;\n const response: PipelineResponse = {\n status,\n headers,\n request,\n };\n\n // Responses to HEAD must not have a body.\n // If they do return a body, that body must be ignored.\n if (request.method === \"HEAD\") {\n // call resume() and not destroy() to avoid closing the socket\n // and losing keep alive\n res.resume();\n return response;\n }\n\n responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res;\n\n const onDownloadProgress = request.onDownloadProgress;\n if (onDownloadProgress) {\n const downloadReportStream = new ReportTransform(onDownloadProgress);\n downloadReportStream.on(\"error\", (e) => {\n logger.error(\"Error in download progress\", e);\n });\n responseStream.pipe(downloadReportStream);\n responseStream = downloadReportStream;\n }\n\n if (\n // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code\n request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) ||\n request.streamResponseStatusCodes?.has(response.status)\n ) {\n response.readableStreamBody = responseStream;\n } else {\n response.bodyAsText = await streamToText(responseStream);\n }\n\n return response;\n } finally {\n // clean up event listener\n if (request.abortSignal && abortListener) {\n let uploadStreamDone = Promise.resolve();\n if (isReadableStream(body)) {\n uploadStreamDone = isStreamComplete(body);\n }\n let downloadStreamDone = Promise.resolve();\n if (isReadableStream(responseStream)) {\n downloadStreamDone = isStreamComplete(responseStream);\n }\n Promise.all([uploadStreamDone, downloadStreamDone])\n .then(() => {\n // eslint-disable-next-line promise/always-return\n if (abortListener) {\n request.abortSignal?.removeEventListener(\"abort\", abortListener);\n }\n })\n .catch((e) => {\n logger.warning(\"Error when cleaning up abortListener on httpRequest\", e);\n });\n }\n }\n }\n\n private makeRequest(\n request: PipelineRequest,\n abortController: AbortController,\n body?: RequestBodyType,\n ): Promise<http.IncomingMessage> {\n const url = new URL(request.url);\n\n const isInsecure = url.protocol !== \"https:\";\n\n if (isInsecure && !request.allowInsecureConnection) {\n throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`);\n }\n\n const agent = (request.agent as http.Agent) ?? this.getOrCreateAgent(request, isInsecure);\n const options: http.RequestOptions = {\n agent,\n hostname: url.hostname,\n path: `${url.pathname}${url.search}`,\n port: url.port,\n method: request.method,\n headers: request.headers.toJSON({ preserveCase: true }),\n };\n\n return new Promise<http.IncomingMessage>((resolve, reject) => {\n const req = isInsecure ? http.request(options, resolve) : https.request(options, resolve);\n\n req.once(\"error\", (err: Error & { code?: string }) => {\n reject(\n new RestError(err.message, { code: err.code ?? RestError.REQUEST_SEND_ERROR, request }),\n );\n });\n\n abortController.signal.addEventListener(\"abort\", () => {\n const abortError = new AbortError(\n \"The operation was aborted. Rejecting from abort signal callback while making request.\",\n );\n req.destroy(abortError);\n reject(abortError);\n });\n if (body && isReadableStream(body)) {\n body.pipe(req);\n } else if (body) {\n if (typeof body === \"string\" || Buffer.isBuffer(body)) {\n req.end(body);\n } else if (isArrayBuffer(body)) {\n req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body));\n } else {\n logger.error(\"Unrecognized body type\", body);\n reject(new RestError(\"Unrecognized body type\"));\n }\n } else {\n // streams don't like \"undefined\" being passed as data\n req.end();\n }\n });\n }\n\n private getOrCreateAgent(request: PipelineRequest, isInsecure: boolean): http.Agent {\n const disableKeepAlive = request.disableKeepAlive;\n\n // Handle Insecure requests first\n if (isInsecure) {\n if (disableKeepAlive) {\n // keepAlive:false is the default so we don't need a custom Agent\n return http.globalAgent;\n }\n\n if (!this.cachedHttpAgent) {\n // If there is no cached agent create a new one and cache it.\n this.cachedHttpAgent = new http.Agent({ keepAlive: true });\n }\n return this.cachedHttpAgent;\n } else {\n if (disableKeepAlive && !request.tlsSettings) {\n // When there are no tlsSettings and keepAlive is false\n // we don't need a custom agent\n return https.globalAgent;\n }\n\n // We use the tlsSettings to index cached clients\n const tlsSettings = request.tlsSettings ?? DEFAULT_TLS_SETTINGS;\n\n // Get the cached agent or create a new one with the\n // provided values for keepAlive and tlsSettings\n let agent = this.cachedHttpsAgents.get(tlsSettings);\n\n if (agent && agent.options.keepAlive === !disableKeepAlive) {\n return agent;\n }\n\n logger.info(\"No cached TLS Agent exist, creating a new Agent\");\n agent = new https.Agent({\n // keepAlive is true if disableKeepAlive is false.\n keepAlive: !disableKeepAlive,\n // Since we are spreading, if no tslSettings were provided, nothing is added to the agent options.\n ...tlsSettings,\n });\n\n this.cachedHttpsAgents.set(tlsSettings, agent);\n return agent;\n }\n }\n}\n\nfunction getResponseHeaders(res: IncomingMessage): HttpHeaders {\n const headers = createHttpHeaders();\n for (const header of Object.keys(res.headers)) {\n const value = res.headers[header];\n if (Array.isArray(value)) {\n if (value.length > 0) {\n headers.set(header, value[0]);\n }\n } else if (value) {\n headers.set(header, value);\n }\n }\n return headers;\n}\n\nfunction getDecodedResponseStream(\n stream: IncomingMessage,\n headers: HttpHeaders,\n): NodeJS.ReadableStream {\n const contentEncoding = headers.get(\"Content-Encoding\");\n if (contentEncoding === \"gzip\") {\n const unzip = zlib.createGunzip();\n stream.pipe(unzip);\n return unzip;\n } else if (contentEncoding === \"deflate\") {\n const inflate = zlib.createInflate();\n stream.pipe(inflate);\n return inflate;\n }\n\n return stream;\n}\n\nfunction streamToText(stream: NodeJS.ReadableStream): Promise<string> {\n return new Promise<string>((resolve, reject) => {\n const buffer: Buffer[] = [];\n\n stream.on(\"data\", (chunk) => {\n if (Buffer.isBuffer(chunk)) {\n buffer.push(chunk);\n } else {\n buffer.push(Buffer.from(chunk));\n }\n });\n stream.on(\"end\", () => {\n resolve(Buffer.concat(buffer).toString(\"utf8\"));\n });\n stream.on(\"error\", (e) => {\n if (e && e?.name === \"AbortError\") {\n reject(e);\n } else {\n reject(\n new RestError(`Error reading response as text: ${e.message}`, {\n code: RestError.PARSE_ERROR,\n }),\n );\n }\n });\n });\n}\n\n/** @internal */\nexport function getBodyLength(body: RequestBodyType): number | null {\n if (!body) {\n return 0;\n } else if (Buffer.isBuffer(body)) {\n return body.length;\n } else if (isReadableStream(body)) {\n return null;\n } else if (isArrayBuffer(body)) {\n return body.byteLength;\n } else if (typeof body === \"string\") {\n return Buffer.from(body).length;\n } else {\n return null;\n }\n}\n\n/**\n * Create a new HttpClient instance for the NodeJS environment.\n * @internal\n */\nexport function createNodeHttpClient(): HttpClient {\n return new NodeHttpClient();\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  import type { FormDataMap, HttpHeaders, HttpMethods, MultipartRequestBody, PipelineRequest, ProxySettings, RequestBodyType, TransferProgressEvent } from "./interfaces.js";
2
- import type { AbortSignalLike } from "./abort-controller/AbortSignalLike.js";
3
2
  /**
4
3
  * Settings to initialize a request.
5
4
  * Almost equivalent to Partial<PipelineRequest>, but url is mandatory.
@@ -69,7 +68,7 @@ export interface PipelineRequestOptions {
69
68
  /**
70
69
  * Used to abort the request later.
71
70
  */
72
- abortSignal?: AbortSignalLike;
71
+ abortSignal?: AbortSignal;
73
72
  /**
74
73
  * Callback which fires upon upload progress.
75
74
  */
@@ -1 +1 @@
1
- {"version":3,"file":"pipelineRequest.js","sourceRoot":"","sources":["../../src/pipelineRequest.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kC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,CAAC;CACF;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,OAA+B;IACnE,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FormDataMap,\n HttpHeaders,\n HttpMethods,\n MultipartRequestBody,\n PipelineRequest,\n ProxySettings,\n RequestBodyType,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport type { AbortSignalLike } from \"./abort-controller/AbortSignalLike.js\";\nimport { randomUUID } from \"./util/uuidUtils.js\";\n\n/**\n * Settings to initialize a request.\n * Almost equivalent to Partial<PipelineRequest>, but url is mandatory.\n */\nexport interface PipelineRequestOptions {\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method?: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers?: HttpHeaders;\n\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 * Defaults to 0, which disables the timeout.\n */\n timeout?: number;\n\n /**\n * If credentials (cookies) should be sent along during an XHR.\n * Defaults to false.\n */\n withCredentials?: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId?: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable use of the Streams API. If this option is set and streaming is used\n * (see `streamResponseStatusCodes`), the response will have a property `browserStream` instead of\n * `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\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 /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n}\n\nclass PipelineRequestImpl implements PipelineRequest {\n public url: string;\n public method: HttpMethods;\n public headers: HttpHeaders;\n public timeout: number;\n public withCredentials: boolean;\n public body?: RequestBodyType;\n public multipartBody?: MultipartRequestBody;\n public formData?: FormDataMap;\n public streamResponseStatusCodes?: Set<number>;\n public enableBrowserStreams: boolean;\n\n public proxySettings?: ProxySettings;\n public disableKeepAlive: boolean;\n public abortSignal?: AbortSignalLike;\n public requestId: string;\n public allowInsecureConnection?: boolean;\n public onUploadProgress?: (progress: TransferProgressEvent) => void;\n public onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n constructor(options: PipelineRequestOptions) {\n this.url = options.url;\n this.body = options.body;\n this.headers = options.headers ?? createHttpHeaders();\n this.method = options.method ?? \"GET\";\n this.timeout = options.timeout ?? 0;\n this.multipartBody = options.multipartBody;\n this.formData = options.formData;\n this.disableKeepAlive = options.disableKeepAlive ?? false;\n this.proxySettings = options.proxySettings;\n this.streamResponseStatusCodes = options.streamResponseStatusCodes;\n this.withCredentials = options.withCredentials ?? false;\n this.abortSignal = options.abortSignal;\n this.onUploadProgress = options.onUploadProgress;\n this.onDownloadProgress = options.onDownloadProgress;\n this.requestId = options.requestId || randomUUID();\n this.allowInsecureConnection = options.allowInsecureConnection ?? false;\n this.enableBrowserStreams = options.enableBrowserStreams ?? false;\n }\n}\n\n/**\n * Creates a new pipeline request with the given options.\n * This method is to allow for the easy setting of default values and not required.\n * @param options - The options to create the request with.\n */\nexport function createPipelineRequest(options: PipelineRequestOptions): PipelineRequest {\n return new PipelineRequestImpl(options);\n}\n"]}
1
+ {"version":3,"file":"pipelineRequest.js","sourceRoot":"","sources":["../../src/pipelineRequest.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA6JlC,sDAEC;AAnJD,qDAAqD;AACrD,sDAAiD;AAkGjD,MAAM,mBAAmB;IAoBvB,YAAY,OAA+B;;QACzC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAA,kCAAiB,GAAE,CAAC;QACtD,IAAI,CAAC,MAAM,GAAG,MAAA,OAAO,CAAC,MAAM,mCAAI,KAAK,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,CAAC,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,gBAAgB,GAAG,MAAA,OAAO,CAAC,gBAAgB,mCAAI,KAAK,CAAC;QAC1D,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;QACnE,IAAI,CAAC,eAAe,GAAG,MAAA,OAAO,CAAC,eAAe,mCAAI,KAAK,CAAC;QACxD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAA,yBAAU,GAAE,CAAC;QACnD,IAAI,CAAC,uBAAuB,GAAG,MAAA,OAAO,CAAC,uBAAuB,mCAAI,KAAK,CAAC;QACxE,IAAI,CAAC,oBAAoB,GAAG,MAAA,OAAO,CAAC,oBAAoB,mCAAI,KAAK,CAAC;IACpE,CAAC;CACF;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,OAA+B;IACnE,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FormDataMap,\n HttpHeaders,\n HttpMethods,\n MultipartRequestBody,\n PipelineRequest,\n ProxySettings,\n RequestBodyType,\n TransferProgressEvent,\n} from \"./interfaces.js\";\nimport { createHttpHeaders } from \"./httpHeaders.js\";\nimport { randomUUID } from \"./util/uuidUtils.js\";\n\n/**\n * Settings to initialize a request.\n * Almost equivalent to Partial<PipelineRequest>, but url is mandatory.\n */\nexport interface PipelineRequestOptions {\n /**\n * The URL to make the request to.\n */\n url: string;\n\n /**\n * The HTTP method to use when making the request.\n */\n method?: HttpMethods;\n\n /**\n * The HTTP headers to use when making the request.\n */\n headers?: HttpHeaders;\n\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 * Defaults to 0, which disables the timeout.\n */\n timeout?: number;\n\n /**\n * If credentials (cookies) should be sent along during an XHR.\n * Defaults to false.\n */\n withCredentials?: boolean;\n\n /**\n * A unique identifier for the request. Used for logging and tracing.\n */\n requestId?: string;\n\n /**\n * The HTTP body content (if any)\n */\n body?: RequestBodyType;\n\n /**\n * Body for a multipart request.\n */\n multipartBody?: MultipartRequestBody;\n\n /**\n * To simulate a browser form post\n */\n formData?: FormDataMap;\n\n /**\n * A list of response status codes whose corresponding PipelineResponse body should be treated as a stream.\n */\n streamResponseStatusCodes?: Set<number>;\n\n /**\n * BROWSER ONLY\n *\n * A browser only option to enable use of the Streams API. If this option is set and streaming is used\n * (see `streamResponseStatusCodes`), the response will have a property `browserStream` instead of\n * `blobBody` which will be undefined.\n *\n * Default value is false\n */\n enableBrowserStreams?: boolean;\n\n /**\n * Proxy configuration.\n */\n proxySettings?: ProxySettings;\n\n /**\n * If the connection should not be reused.\n */\n disableKeepAlive?: boolean;\n\n /**\n * Used to abort the request later.\n */\n abortSignal?: AbortSignal;\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 /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n}\n\nclass PipelineRequestImpl implements PipelineRequest {\n public url: string;\n public method: HttpMethods;\n public headers: HttpHeaders;\n public timeout: number;\n public withCredentials: boolean;\n public body?: RequestBodyType;\n public multipartBody?: MultipartRequestBody;\n public formData?: FormDataMap;\n public streamResponseStatusCodes?: Set<number>;\n public enableBrowserStreams: boolean;\n\n public proxySettings?: ProxySettings;\n public disableKeepAlive: boolean;\n public abortSignal?: AbortSignal;\n public requestId: string;\n public allowInsecureConnection?: boolean;\n public onUploadProgress?: (progress: TransferProgressEvent) => void;\n public onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n constructor(options: PipelineRequestOptions) {\n this.url = options.url;\n this.body = options.body;\n this.headers = options.headers ?? createHttpHeaders();\n this.method = options.method ?? \"GET\";\n this.timeout = options.timeout ?? 0;\n this.multipartBody = options.multipartBody;\n this.formData = options.formData;\n this.disableKeepAlive = options.disableKeepAlive ?? false;\n this.proxySettings = options.proxySettings;\n this.streamResponseStatusCodes = options.streamResponseStatusCodes;\n this.withCredentials = options.withCredentials ?? false;\n this.abortSignal = options.abortSignal;\n this.onUploadProgress = options.onUploadProgress;\n this.onDownloadProgress = options.onDownloadProgress;\n this.requestId = options.requestId || randomUUID();\n this.allowInsecureConnection = options.allowInsecureConnection ?? false;\n this.enableBrowserStreams = options.enableBrowserStreams ?? false;\n }\n}\n\n/**\n * Creates a new pipeline request with the given options.\n * This method is to allow for the easy setting of default values and not required.\n * @param options - The options to create the request with.\n */\nexport function createPipelineRequest(options: PipelineRequestOptions): PipelineRequest {\n return new PipelineRequestImpl(options);\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { PipelinePolicy } from "../pipeline.js";
2
+ import type { Agent } from "../interfaces.js";
3
+ /**
4
+ * Name of the Agent Policy
5
+ */
6
+ export declare const agentPolicyName = "agentPolicy";
7
+ /**
8
+ * Gets a pipeline policy that sets http.agent
9
+ */
10
+ export declare function agentPolicy(agent?: Agent): PipelinePolicy;
11
+ //# sourceMappingURL=agentPolicy.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.agentPolicyName = void 0;
6
+ exports.agentPolicy = agentPolicy;
7
+ /**
8
+ * Name of the Agent Policy
9
+ */
10
+ exports.agentPolicyName = "agentPolicy";
11
+ /**
12
+ * Gets a pipeline policy that sets http.agent
13
+ */
14
+ function agentPolicy(agent) {
15
+ return {
16
+ name: exports.agentPolicyName,
17
+ sendRequest: async (req, next) => {
18
+ // Users may define an agent on the request, honor it over the client level one
19
+ if (!req.agent) {
20
+ req.agent = agent;
21
+ }
22
+ return next(req);
23
+ },
24
+ };
25
+ }
26
+ //# sourceMappingURL=agentPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentPolicy.js","sourceRoot":"","sources":["../../../src/policies/agentPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAalC,kCAWC;AAnBD;;GAEG;AACU,QAAA,eAAe,GAAG,aAAa,CAAC;AAE7C;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO;QACL,IAAI,EAAE,uBAAe;QACrB,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAC/B,+EAA+E;YAC/E,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;YACpB,CAAC;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelinePolicy } from \"../pipeline.js\";\nimport type { Agent } from \"../interfaces.js\";\n\n/**\n * Name of the Agent Policy\n */\nexport const agentPolicyName = \"agentPolicy\";\n\n/**\n * Gets a pipeline policy that sets http.agent\n */\nexport function agentPolicy(agent?: Agent): PipelinePolicy {\n return {\n name: agentPolicyName,\n sendRequest: async (req, next) => {\n // Users may define an agent on the request, honor it over the client level one\n if (!req.agent) {\n req.agent = agent;\n }\n return next(req);\n },\n };\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import type { ApiKeyCredential } from "../../auth/credentials.js";
2
+ import type { AuthScheme } from "../../auth/schemes.js";
3
+ import type { PipelinePolicy } from "../../pipeline.js";
4
+ /**
5
+ * Name of the API Key Authentication Policy
6
+ */
7
+ export declare const apiKeyAuthenticationPolicyName = "apiKeyAuthenticationPolicy";
8
+ /**
9
+ * Options for configuring the API key authentication policy
10
+ */
11
+ export interface ApiKeyAuthenticationPolicyOptions {
12
+ /**
13
+ * The credential used to authenticate requests
14
+ */
15
+ credential: ApiKeyCredential;
16
+ /**
17
+ * Optional authentication schemes to use. If `authSchemes` is provided in both request and policy options, the request options will take precedence.
18
+ */
19
+ authSchemes?: AuthScheme[];
20
+ /**
21
+ * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.
22
+ * CAUTION: Never use this option in production.
23
+ */
24
+ allowInsecureConnection?: boolean;
25
+ }
26
+ /**
27
+ * Gets a pipeline policy that adds API key authentication to requests
28
+ */
29
+ export declare function apiKeyAuthenticationPolicy(options: ApiKeyAuthenticationPolicyOptions): PipelinePolicy;
30
+ //# sourceMappingURL=apiKeyAuthenticationPolicy.d.ts.map
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.apiKeyAuthenticationPolicyName = void 0;
6
+ exports.apiKeyAuthenticationPolicy = apiKeyAuthenticationPolicy;
7
+ const checkInsecureConnection_js_1 = require("./checkInsecureConnection.js");
8
+ /**
9
+ * Name of the API Key Authentication Policy
10
+ */
11
+ exports.apiKeyAuthenticationPolicyName = "apiKeyAuthenticationPolicy";
12
+ /**
13
+ * Gets a pipeline policy that adds API key authentication to requests
14
+ */
15
+ function apiKeyAuthenticationPolicy(options) {
16
+ return {
17
+ name: exports.apiKeyAuthenticationPolicyName,
18
+ async sendRequest(request, next) {
19
+ var _a, _b;
20
+ // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs
21
+ (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options);
22
+ const scheme = (_b = ((_a = request.authSchemes) !== null && _a !== void 0 ? _a : options.authSchemes)) === null || _b === void 0 ? void 0 : _b.find((x) => x.kind === "apiKey");
23
+ // Skip adding authentication header if no API key authentication scheme is found
24
+ if (!scheme) {
25
+ return next(request);
26
+ }
27
+ if (scheme.apiKeyLocation !== "header") {
28
+ throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`);
29
+ }
30
+ request.headers.set(scheme.name, options.credential.key);
31
+ return next(request);
32
+ },
33
+ };
34
+ }
35
+ //# sourceMappingURL=apiKeyAuthenticationPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiKeyAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../src/policies/auth/apiKeyAuthenticationPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAmClC,gEAuBC;AApDD,6EAAsE;AAEtE;;GAEG;AACU,QAAA,8BAA8B,GAAG,4BAA4B,CAAC;AAqB3E;;GAEG;AACH,SAAgB,0BAA0B,CACxC,OAA0C;IAE1C,OAAO;QACL,IAAI,EAAE,sCAA8B;QACpC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,0FAA0F;YAC1F,IAAA,mDAAsB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,MAAM,MAAM,GAAG,MAAA,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,OAAO,CAAC,WAAW,CAAC,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;YAE9F,iFAAiF;YACjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YACD,IAAI,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;gBACvC,MAAM,IAAI,KAAK,CAAC,iCAAiC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;YAC5E,CAAC;YAED,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACzD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ApiKeyCredential } from \"../../auth/credentials.js\";\nimport type { AuthScheme } from \"../../auth/schemes.js\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"../../interfaces.js\";\nimport type { PipelinePolicy } from \"../../pipeline.js\";\nimport { ensureSecureConnection } from \"./checkInsecureConnection.js\";\n\n/**\n * Name of the API Key Authentication Policy\n */\nexport const apiKeyAuthenticationPolicyName = \"apiKeyAuthenticationPolicy\";\n\n/**\n * Options for configuring the API key authentication policy\n */\nexport interface ApiKeyAuthenticationPolicyOptions {\n /**\n * The credential used to authenticate requests\n */\n credential: ApiKeyCredential;\n /**\n * Optional authentication schemes to use. If `authSchemes` is provided in both request and policy options, the request options will take precedence.\n */\n authSchemes?: AuthScheme[];\n /**\n * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.\n * CAUTION: Never use this option in production.\n */\n allowInsecureConnection?: boolean;\n}\n\n/**\n * Gets a pipeline policy that adds API key authentication to requests\n */\nexport function apiKeyAuthenticationPolicy(\n options: ApiKeyAuthenticationPolicyOptions,\n): PipelinePolicy {\n return {\n name: apiKeyAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs\n ensureSecureConnection(request, options);\n\n const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === \"apiKey\");\n\n // Skip adding authentication header if no API key authentication scheme is found\n if (!scheme) {\n return next(request);\n }\n if (scheme.apiKeyLocation !== \"header\") {\n throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`);\n }\n\n request.headers.set(scheme.name, options.credential.key);\n return next(request);\n },\n };\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import type { BasicCredential } from "../../auth/credentials.js";
2
+ import type { AuthScheme } from "../../auth/schemes.js";
3
+ import type { PipelinePolicy } from "../../pipeline.js";
4
+ /**
5
+ * Name of the Basic Authentication Policy
6
+ */
7
+ export declare const basicAuthenticationPolicyName = "bearerAuthenticationPolicy";
8
+ /**
9
+ * Options for configuring the basic authentication policy
10
+ */
11
+ export interface BasicAuthenticationPolicyOptions {
12
+ /**
13
+ * The credential used to authenticate requests
14
+ */
15
+ credential: BasicCredential;
16
+ /**
17
+ * Optional authentication schemes to use. If not provided, schemes from the request will be used.
18
+ */
19
+ authSchemes?: AuthScheme[];
20
+ /**
21
+ * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.
22
+ * CAUTION: Never use this option in production.
23
+ */
24
+ allowInsecureConnection?: boolean;
25
+ }
26
+ /**
27
+ * Gets a pipeline policy that adds basic authentication to requests
28
+ */
29
+ export declare function basicAuthenticationPolicy(options: BasicAuthenticationPolicyOptions): PipelinePolicy;
30
+ //# sourceMappingURL=basicAuthenticationPolicy.d.ts.map
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.basicAuthenticationPolicyName = void 0;
6
+ exports.basicAuthenticationPolicy = basicAuthenticationPolicy;
7
+ const bytesEncoding_js_1 = require("../../util/bytesEncoding.js");
8
+ const checkInsecureConnection_js_1 = require("./checkInsecureConnection.js");
9
+ /**
10
+ * Name of the Basic Authentication Policy
11
+ */
12
+ exports.basicAuthenticationPolicyName = "bearerAuthenticationPolicy";
13
+ /**
14
+ * Gets a pipeline policy that adds basic authentication to requests
15
+ */
16
+ function basicAuthenticationPolicy(options) {
17
+ return {
18
+ name: exports.basicAuthenticationPolicyName,
19
+ async sendRequest(request, next) {
20
+ var _a, _b;
21
+ // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs
22
+ (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options);
23
+ const scheme = (_b = ((_a = request.authSchemes) !== null && _a !== void 0 ? _a : options.authSchemes)) === null || _b === void 0 ? void 0 : _b.find((x) => x.kind === "http" && x.scheme === "basic");
24
+ // Skip adding authentication header if no basic authentication scheme is found
25
+ if (!scheme) {
26
+ return next(request);
27
+ }
28
+ const { username, password } = options.credential;
29
+ const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64");
30
+ request.headers.set("Authorization", `Basic ${headerValue}`);
31
+ return next(request);
32
+ },
33
+ };
34
+ }
35
+ //# sourceMappingURL=basicAuthenticationPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"basicAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../src/policies/auth/basicAuthenticationPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAoClC,8DA2BC;AAzDD,kEAAqF;AACrF,6EAAsE;AAEtE;;GAEG;AACU,QAAA,6BAA6B,GAAG,4BAA4B,CAAC;AAqB1E;;GAEG;AACH,SAAgB,yBAAyB,CACvC,OAAyC;IAEzC,OAAO;QACL,IAAI,EAAE,qCAA6B;QACnC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,0FAA0F;YAC1F,IAAA,mDAAsB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,MAAM,MAAM,GAAG,MAAA,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,OAAO,CAAC,WAAW,CAAC,0CAAE,IAAI,CAC/D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,CACjD,CAAC;YAEF,+EAA+E;YAC/E,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YAED,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAClD,MAAM,WAAW,GAAG,IAAA,qCAAkB,EACpC,IAAA,qCAAkB,EAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,EAAE,OAAO,CAAC,EACtD,QAAQ,CACT,CAAC;YACF,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,SAAS,WAAW,EAAE,CAAC,CAAC;YAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BasicCredential } from \"../../auth/credentials.js\";\nimport type { AuthScheme } from \"../../auth/schemes.js\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"../../interfaces.js\";\nimport type { PipelinePolicy } from \"../../pipeline.js\";\nimport { stringToUint8Array, uint8ArrayToString } from \"../../util/bytesEncoding.js\";\nimport { ensureSecureConnection } from \"./checkInsecureConnection.js\";\n\n/**\n * Name of the Basic Authentication Policy\n */\nexport const basicAuthenticationPolicyName = \"bearerAuthenticationPolicy\";\n\n/**\n * Options for configuring the basic authentication policy\n */\nexport interface BasicAuthenticationPolicyOptions {\n /**\n * The credential used to authenticate requests\n */\n credential: BasicCredential;\n /**\n * Optional authentication schemes to use. If not provided, schemes from the request will be used.\n */\n authSchemes?: AuthScheme[];\n /**\n * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.\n * CAUTION: Never use this option in production.\n */\n allowInsecureConnection?: boolean;\n}\n\n/**\n * Gets a pipeline policy that adds basic authentication to requests\n */\nexport function basicAuthenticationPolicy(\n options: BasicAuthenticationPolicyOptions,\n): PipelinePolicy {\n return {\n name: basicAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs\n ensureSecureConnection(request, options);\n\n const scheme = (request.authSchemes ?? options.authSchemes)?.find(\n (x) => x.kind === \"http\" && x.scheme === \"basic\",\n );\n\n // Skip adding authentication header if no basic authentication scheme is found\n if (!scheme) {\n return next(request);\n }\n\n const { username, password } = options.credential;\n const headerValue = uint8ArrayToString(\n stringToUint8Array(`${username}:${password}`, \"utf-8\"),\n \"base64\",\n );\n request.headers.set(\"Authorization\", `Basic ${headerValue}`);\n return next(request);\n },\n };\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import type { BearerTokenCredential } from "../../auth/credentials.js";
2
+ import type { AuthScheme } from "../../auth/schemes.js";
3
+ import type { PipelinePolicy } from "../../pipeline.js";
4
+ /**
5
+ * Name of the Bearer Authentication Policy
6
+ */
7
+ export declare const bearerAuthenticationPolicyName = "bearerAuthenticationPolicy";
8
+ /**
9
+ * Options for configuring the bearer authentication policy
10
+ */
11
+ export interface BearerAuthenticationPolicyOptions {
12
+ /**
13
+ * The BearerTokenCredential implementation that can supply the bearer token.
14
+ */
15
+ credential: BearerTokenCredential;
16
+ /**
17
+ * Optional authentication schemes to use. If not provided, schemes from the request will be used.
18
+ */
19
+ authSchemes?: AuthScheme[];
20
+ /**
21
+ * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.
22
+ * CAUTION: Never use this option in production.
23
+ */
24
+ allowInsecureConnection?: boolean;
25
+ }
26
+ /**
27
+ * Gets a pipeline policy that adds bearer token authentication to requests
28
+ */
29
+ export declare function bearerAuthenticationPolicy(options: BearerAuthenticationPolicyOptions): PipelinePolicy;
30
+ //# sourceMappingURL=bearerAuthenticationPolicy.d.ts.map
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.bearerAuthenticationPolicyName = void 0;
6
+ exports.bearerAuthenticationPolicy = bearerAuthenticationPolicy;
7
+ const checkInsecureConnection_js_1 = require("./checkInsecureConnection.js");
8
+ /**
9
+ * Name of the Bearer Authentication Policy
10
+ */
11
+ exports.bearerAuthenticationPolicyName = "bearerAuthenticationPolicy";
12
+ /**
13
+ * Gets a pipeline policy that adds bearer token authentication to requests
14
+ */
15
+ function bearerAuthenticationPolicy(options) {
16
+ return {
17
+ name: exports.bearerAuthenticationPolicyName,
18
+ async sendRequest(request, next) {
19
+ var _a, _b;
20
+ // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs
21
+ (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options);
22
+ const scheme = (_b = ((_a = request.authSchemes) !== null && _a !== void 0 ? _a : options.authSchemes)) === null || _b === void 0 ? void 0 : _b.find((x) => x.kind === "http" && x.scheme === "bearer");
23
+ // Skip adding authentication header if no bearer authentication scheme is found
24
+ if (!scheme) {
25
+ return next(request);
26
+ }
27
+ const token = await options.credential.getBearerToken({
28
+ abortSignal: request.abortSignal,
29
+ });
30
+ request.headers.set("Authorization", `Bearer ${token}`);
31
+ return next(request);
32
+ },
33
+ };
34
+ }
35
+ //# sourceMappingURL=bearerAuthenticationPolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bearerAuthenticationPolicy.js","sourceRoot":"","sources":["../../../../src/policies/auth/bearerAuthenticationPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAmClC,gEAyBC;AAtDD,6EAAsE;AAEtE;;GAEG;AACU,QAAA,8BAA8B,GAAG,4BAA4B,CAAC;AAqB3E;;GAEG;AACH,SAAgB,0BAA0B,CACxC,OAA0C;IAE1C,OAAO;QACL,IAAI,EAAE,sCAA8B;QACpC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,0FAA0F;YAC1F,IAAA,mDAAsB,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEzC,MAAM,MAAM,GAAG,MAAA,CAAC,MAAA,OAAO,CAAC,WAAW,mCAAI,OAAO,CAAC,WAAW,CAAC,0CAAE,IAAI,CAC/D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,QAAQ,CAClD,CAAC;YAEF,gFAAgF;YAChF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;YAED,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;gBACpD,WAAW,EAAE,OAAO,CAAC,WAAW;aACjC,CAAC,CAAC;YACH,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BearerTokenCredential } from \"../../auth/credentials.js\";\nimport type { AuthScheme } from \"../../auth/schemes.js\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"../../interfaces.js\";\nimport type { PipelinePolicy } from \"../../pipeline.js\";\nimport { ensureSecureConnection } from \"./checkInsecureConnection.js\";\n\n/**\n * Name of the Bearer Authentication Policy\n */\nexport const bearerAuthenticationPolicyName = \"bearerAuthenticationPolicy\";\n\n/**\n * Options for configuring the bearer authentication policy\n */\nexport interface BearerAuthenticationPolicyOptions {\n /**\n * The BearerTokenCredential implementation that can supply the bearer token.\n */\n credential: BearerTokenCredential;\n /**\n * Optional authentication schemes to use. If not provided, schemes from the request will be used.\n */\n authSchemes?: AuthScheme[];\n /**\n * Allows for connecting to HTTP endpoints instead of enforcing HTTPS.\n * CAUTION: Never use this option in production.\n */\n allowInsecureConnection?: boolean;\n}\n\n/**\n * Gets a pipeline policy that adds bearer token authentication to requests\n */\nexport function bearerAuthenticationPolicy(\n options: BearerAuthenticationPolicyOptions,\n): PipelinePolicy {\n return {\n name: bearerAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n // Ensure allowInsecureConnection is explicitly set when sending request to non-https URLs\n ensureSecureConnection(request, options);\n\n const scheme = (request.authSchemes ?? options.authSchemes)?.find(\n (x) => x.kind === \"http\" && x.scheme === \"bearer\",\n );\n\n // Skip adding authentication header if no bearer authentication scheme is found\n if (!scheme) {\n return next(request);\n }\n\n const token = await options.credential.getBearerToken({\n abortSignal: request.abortSignal,\n });\n request.headers.set(\"Authorization\", `Bearer ${token}`);\n return next(request);\n },\n };\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { PipelineRequest } from "../../interfaces.js";
2
+ /**
3
+ * Ensures that authentication is only allowed over HTTPS unless explicitly allowed.
4
+ * Throws an error if the connection is not secure and not explicitly allowed.
5
+ */
6
+ export declare function ensureSecureConnection(request: PipelineRequest, options: {
7
+ allowInsecureConnection?: boolean;
8
+ }): void;
9
+ //# sourceMappingURL=checkInsecureConnection.d.ts.map