@typespec/ts-http-runtime 1.0.0-alpha.20241029.3 → 1.0.0-alpha.20241030.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (553) hide show
  1. package/dist/browser/accessTokenCache.d.ts +1 -1
  2. package/dist/browser/accessTokenCache.d.ts.map +1 -1
  3. package/dist/browser/accessTokenCache.js.map +1 -1
  4. package/dist/browser/auth/tokenCredential.d.ts +2 -2
  5. package/dist/browser/auth/tokenCredential.d.ts.map +1 -1
  6. package/dist/browser/auth/tokenCredential.js.map +1 -1
  7. package/dist/browser/client/apiVersionPolicy.d.ts +2 -2
  8. package/dist/browser/client/apiVersionPolicy.d.ts.map +1 -1
  9. package/dist/browser/client/apiVersionPolicy.js.map +1 -1
  10. package/dist/browser/client/clientHelpers.d.ts +5 -5
  11. package/dist/browser/client/clientHelpers.d.ts.map +1 -1
  12. package/dist/browser/client/clientHelpers.js.map +1 -1
  13. package/dist/browser/client/common.d.ts +6 -6
  14. package/dist/browser/client/common.d.ts.map +1 -1
  15. package/dist/browser/client/common.js.map +1 -1
  16. package/dist/browser/client/getClient.d.ts +3 -3
  17. package/dist/browser/client/getClient.d.ts.map +1 -1
  18. package/dist/browser/client/getClient.js.map +1 -1
  19. package/dist/browser/client/keyCredentialAuthenticationPolicy.d.ts +2 -2
  20. package/dist/browser/client/keyCredentialAuthenticationPolicy.d.ts.map +1 -1
  21. package/dist/browser/client/keyCredentialAuthenticationPolicy.js.map +1 -1
  22. package/dist/browser/client/multipart.d.ts +1 -1
  23. package/dist/browser/client/multipart.d.ts.map +1 -1
  24. package/dist/browser/client/multipart.js.map +1 -1
  25. package/dist/browser/client/operationOptionHelpers.d.ts +1 -1
  26. package/dist/browser/client/operationOptionHelpers.d.ts.map +1 -1
  27. package/dist/browser/client/operationOptionHelpers.js.map +1 -1
  28. package/dist/browser/client/restError.d.ts +1 -1
  29. package/dist/browser/client/restError.d.ts.map +1 -1
  30. package/dist/browser/client/restError.js.map +1 -1
  31. package/dist/browser/client/sendRequest.d.ts +3 -3
  32. package/dist/browser/client/sendRequest.d.ts.map +1 -1
  33. package/dist/browser/client/sendRequest.js.map +1 -1
  34. package/dist/browser/client/urlHelpers.d.ts +1 -1
  35. package/dist/browser/client/urlHelpers.d.ts.map +1 -1
  36. package/dist/browser/client/urlHelpers.js.map +1 -1
  37. package/dist/browser/fetchHttpClient.d.ts +1 -1
  38. package/dist/browser/fetchHttpClient.d.ts.map +1 -1
  39. package/dist/browser/fetchHttpClient.js.map +1 -1
  40. package/dist/browser/httpHeaders.d.ts +1 -1
  41. package/dist/browser/httpHeaders.d.ts.map +1 -1
  42. package/dist/browser/httpHeaders.js.map +1 -1
  43. package/dist/browser/interfaces.d.ts +2 -2
  44. package/dist/browser/interfaces.d.ts.map +1 -1
  45. package/dist/browser/interfaces.js.map +1 -1
  46. package/dist/browser/logger/logger.d.ts +1 -1
  47. package/dist/browser/logger/logger.d.ts.map +1 -1
  48. package/dist/browser/logger/logger.js.map +1 -1
  49. package/dist/browser/nodeHttpClient.d.ts +1 -1
  50. package/dist/browser/nodeHttpClient.d.ts.map +1 -1
  51. package/dist/browser/nodeHttpClient.js.map +1 -1
  52. package/dist/browser/pipeline.d.ts +1 -1
  53. package/dist/browser/pipeline.d.ts.map +1 -1
  54. package/dist/browser/pipeline.js.map +1 -1
  55. package/dist/browser/pipelineRequest.d.ts +3 -3
  56. package/dist/browser/pipelineRequest.d.ts.map +1 -1
  57. package/dist/browser/pipelineRequest.js.map +1 -1
  58. package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts +4 -4
  59. package/dist/browser/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
  60. package/dist/browser/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  61. package/dist/browser/policies/defaultRetryPolicy.d.ts +2 -2
  62. package/dist/browser/policies/defaultRetryPolicy.d.ts.map +1 -1
  63. package/dist/browser/policies/defaultRetryPolicy.js.map +1 -1
  64. package/dist/browser/policies/exponentialRetryPolicy.d.ts +1 -1
  65. package/dist/browser/policies/exponentialRetryPolicy.d.ts.map +1 -1
  66. package/dist/browser/policies/exponentialRetryPolicy.js.map +1 -1
  67. package/dist/browser/policies/formDataPolicy.d.ts +1 -1
  68. package/dist/browser/policies/formDataPolicy.d.ts.map +1 -1
  69. package/dist/browser/policies/formDataPolicy.js.map +1 -1
  70. package/dist/browser/policies/logPolicy.d.ts +2 -2
  71. package/dist/browser/policies/logPolicy.d.ts.map +1 -1
  72. package/dist/browser/policies/logPolicy.js.map +1 -1
  73. package/dist/browser/policies/multipartPolicy.d.ts +1 -1
  74. package/dist/browser/policies/multipartPolicy.d.ts.map +1 -1
  75. package/dist/browser/policies/multipartPolicy.js.map +1 -1
  76. package/dist/browser/policies/redirectPolicy.d.ts +1 -1
  77. package/dist/browser/policies/redirectPolicy.d.ts.map +1 -1
  78. package/dist/browser/policies/redirectPolicy.js.map +1 -1
  79. package/dist/browser/policies/retryPolicy.d.ts +3 -3
  80. package/dist/browser/policies/retryPolicy.d.ts.map +1 -1
  81. package/dist/browser/policies/retryPolicy.js.map +1 -1
  82. package/dist/browser/policies/systemErrorRetryPolicy.d.ts +1 -1
  83. package/dist/browser/policies/systemErrorRetryPolicy.d.ts.map +1 -1
  84. package/dist/browser/policies/systemErrorRetryPolicy.js.map +1 -1
  85. package/dist/browser/policies/throttlingRetryPolicy.d.ts +1 -1
  86. package/dist/browser/policies/throttlingRetryPolicy.d.ts.map +1 -1
  87. package/dist/browser/policies/throttlingRetryPolicy.js.map +1 -1
  88. package/dist/browser/policies/tlsPolicy.d.ts +2 -2
  89. package/dist/browser/policies/tlsPolicy.d.ts.map +1 -1
  90. package/dist/browser/policies/tlsPolicy.js.map +1 -1
  91. package/dist/browser/policies/tracingPolicy.d.ts +1 -1
  92. package/dist/browser/policies/tracingPolicy.d.ts.map +1 -1
  93. package/dist/browser/policies/tracingPolicy.js.map +1 -1
  94. package/dist/browser/policies/userAgentPolicy.d.ts +1 -1
  95. package/dist/browser/policies/userAgentPolicy.d.ts.map +1 -1
  96. package/dist/browser/policies/userAgentPolicy.js.map +1 -1
  97. package/dist/browser/restError.d.ts +1 -1
  98. package/dist/browser/restError.d.ts.map +1 -1
  99. package/dist/browser/restError.js.map +1 -1
  100. package/dist/browser/retryStrategies/exponentialRetryStrategy.d.ts +3 -3
  101. package/dist/browser/retryStrategies/exponentialRetryStrategy.d.ts.map +1 -1
  102. package/dist/browser/retryStrategies/exponentialRetryStrategy.js.map +1 -1
  103. package/dist/browser/retryStrategies/retryStrategy.d.ts +3 -3
  104. package/dist/browser/retryStrategies/retryStrategy.d.ts.map +1 -1
  105. package/dist/browser/retryStrategies/retryStrategy.js.map +1 -1
  106. package/dist/browser/retryStrategies/throttlingRetryStrategy.d.ts +2 -2
  107. package/dist/browser/retryStrategies/throttlingRetryStrategy.d.ts.map +1 -1
  108. package/dist/browser/retryStrategies/throttlingRetryStrategy.js.map +1 -1
  109. package/dist/browser/tracing/instrumenter.d.ts +1 -1
  110. package/dist/browser/tracing/instrumenter.d.ts.map +1 -1
  111. package/dist/browser/tracing/instrumenter.js.map +1 -1
  112. package/dist/browser/tracing/state-browser.d.mts.map +1 -1
  113. package/dist/browser/tracing/state-browser.mjs.map +1 -1
  114. package/dist/browser/tracing/state.d.ts +1 -1
  115. package/dist/browser/tracing/tracingClient.d.ts +1 -1
  116. package/dist/browser/tracing/tracingClient.d.ts.map +1 -1
  117. package/dist/browser/tracing/tracingClient.js.map +1 -1
  118. package/dist/browser/tracing/tracingContext.d.ts +1 -1
  119. package/dist/browser/tracing/tracingContext.d.ts.map +1 -1
  120. package/dist/browser/tracing/tracingContext.js.map +1 -1
  121. package/dist/browser/util/aborterUtils.d.ts +1 -1
  122. package/dist/browser/util/aborterUtils.d.ts.map +1 -1
  123. package/dist/browser/util/aborterUtils.js.map +1 -1
  124. package/dist/browser/util/createAbortablePromise.d.ts +1 -1
  125. package/dist/browser/util/createAbortablePromise.d.ts.map +1 -1
  126. package/dist/browser/util/createAbortablePromise.js.map +1 -1
  127. package/dist/browser/util/helpers.d.ts +2 -2
  128. package/dist/browser/util/helpers.d.ts.map +1 -1
  129. package/dist/browser/util/helpers.js.map +1 -1
  130. package/dist/browser/util/tokenCycler.d.ts +1 -1
  131. package/dist/browser/util/tokenCycler.d.ts.map +1 -1
  132. package/dist/browser/util/tokenCycler.js.map +1 -1
  133. package/dist/browser/xhrHttpClient.d.ts +1 -1
  134. package/dist/browser/xhrHttpClient.d.ts.map +1 -1
  135. package/dist/browser/xhrHttpClient.js.map +1 -1
  136. package/dist/commonjs/accessTokenCache.d.ts +1 -1
  137. package/dist/commonjs/accessTokenCache.d.ts.map +1 -1
  138. package/dist/commonjs/accessTokenCache.js.map +1 -1
  139. package/dist/commonjs/auth/tokenCredential.d.ts +2 -2
  140. package/dist/commonjs/auth/tokenCredential.d.ts.map +1 -1
  141. package/dist/commonjs/auth/tokenCredential.js.map +1 -1
  142. package/dist/commonjs/client/apiVersionPolicy.d.ts +2 -2
  143. package/dist/commonjs/client/apiVersionPolicy.d.ts.map +1 -1
  144. package/dist/commonjs/client/apiVersionPolicy.js.map +1 -1
  145. package/dist/commonjs/client/clientHelpers.d.ts +5 -5
  146. package/dist/commonjs/client/clientHelpers.d.ts.map +1 -1
  147. package/dist/commonjs/client/clientHelpers.js.map +1 -1
  148. package/dist/commonjs/client/common.d.ts +6 -6
  149. package/dist/commonjs/client/common.d.ts.map +1 -1
  150. package/dist/commonjs/client/common.js.map +1 -1
  151. package/dist/commonjs/client/getClient.d.ts +3 -3
  152. package/dist/commonjs/client/getClient.d.ts.map +1 -1
  153. package/dist/commonjs/client/getClient.js.map +1 -1
  154. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.d.ts +2 -2
  155. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.d.ts.map +1 -1
  156. package/dist/commonjs/client/keyCredentialAuthenticationPolicy.js.map +1 -1
  157. package/dist/commonjs/client/multipart.d.ts +1 -1
  158. package/dist/commonjs/client/multipart.d.ts.map +1 -1
  159. package/dist/commonjs/client/multipart.js.map +1 -1
  160. package/dist/commonjs/client/operationOptionHelpers.d.ts +1 -1
  161. package/dist/commonjs/client/operationOptionHelpers.d.ts.map +1 -1
  162. package/dist/commonjs/client/operationOptionHelpers.js.map +1 -1
  163. package/dist/commonjs/client/restError.d.ts +1 -1
  164. package/dist/commonjs/client/restError.d.ts.map +1 -1
  165. package/dist/commonjs/client/restError.js.map +1 -1
  166. package/dist/commonjs/client/sendRequest.d.ts +3 -3
  167. package/dist/commonjs/client/sendRequest.d.ts.map +1 -1
  168. package/dist/commonjs/client/sendRequest.js.map +1 -1
  169. package/dist/commonjs/client/urlHelpers.d.ts +1 -1
  170. package/dist/commonjs/client/urlHelpers.d.ts.map +1 -1
  171. package/dist/commonjs/client/urlHelpers.js.map +1 -1
  172. package/dist/commonjs/defaultHttpClient.d.ts +1 -1
  173. package/dist/commonjs/defaultHttpClient.d.ts.map +1 -1
  174. package/dist/commonjs/defaultHttpClient.js.map +1 -1
  175. package/dist/commonjs/fetchHttpClient.d.ts +1 -1
  176. package/dist/commonjs/fetchHttpClient.d.ts.map +1 -1
  177. package/dist/commonjs/fetchHttpClient.js.map +1 -1
  178. package/dist/commonjs/httpHeaders.d.ts +1 -1
  179. package/dist/commonjs/httpHeaders.d.ts.map +1 -1
  180. package/dist/commonjs/httpHeaders.js.map +1 -1
  181. package/dist/commonjs/interfaces.d.ts +2 -2
  182. package/dist/commonjs/interfaces.d.ts.map +1 -1
  183. package/dist/commonjs/interfaces.js.map +1 -1
  184. package/dist/commonjs/logger/logger.d.ts +1 -1
  185. package/dist/commonjs/logger/logger.d.ts.map +1 -1
  186. package/dist/commonjs/logger/logger.js.map +1 -1
  187. package/dist/commonjs/nodeHttpClient.d.ts +1 -1
  188. package/dist/commonjs/nodeHttpClient.d.ts.map +1 -1
  189. package/dist/commonjs/nodeHttpClient.js.map +1 -1
  190. package/dist/commonjs/pipeline.d.ts +1 -1
  191. package/dist/commonjs/pipeline.d.ts.map +1 -1
  192. package/dist/commonjs/pipeline.js.map +1 -1
  193. package/dist/commonjs/pipelineRequest.d.ts +3 -3
  194. package/dist/commonjs/pipelineRequest.d.ts.map +1 -1
  195. package/dist/commonjs/pipelineRequest.js.map +1 -1
  196. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts +4 -4
  197. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
  198. package/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  199. package/dist/commonjs/policies/decompressResponsePolicy.d.ts +1 -1
  200. package/dist/commonjs/policies/decompressResponsePolicy.d.ts.map +1 -1
  201. package/dist/commonjs/policies/decompressResponsePolicy.js.map +1 -1
  202. package/dist/commonjs/policies/defaultRetryPolicy.d.ts +2 -2
  203. package/dist/commonjs/policies/defaultRetryPolicy.d.ts.map +1 -1
  204. package/dist/commonjs/policies/defaultRetryPolicy.js.map +1 -1
  205. package/dist/commonjs/policies/exponentialRetryPolicy.d.ts +1 -1
  206. package/dist/commonjs/policies/exponentialRetryPolicy.d.ts.map +1 -1
  207. package/dist/commonjs/policies/exponentialRetryPolicy.js.map +1 -1
  208. package/dist/commonjs/policies/formDataPolicy.d.ts +1 -1
  209. package/dist/commonjs/policies/formDataPolicy.d.ts.map +1 -1
  210. package/dist/commonjs/policies/formDataPolicy.js.map +1 -1
  211. package/dist/commonjs/policies/logPolicy.d.ts +2 -2
  212. package/dist/commonjs/policies/logPolicy.d.ts.map +1 -1
  213. package/dist/commonjs/policies/logPolicy.js.map +1 -1
  214. package/dist/commonjs/policies/multipartPolicy.d.ts +1 -1
  215. package/dist/commonjs/policies/multipartPolicy.d.ts.map +1 -1
  216. package/dist/commonjs/policies/multipartPolicy.js.map +1 -1
  217. package/dist/commonjs/policies/redirectPolicy.d.ts +1 -1
  218. package/dist/commonjs/policies/redirectPolicy.d.ts.map +1 -1
  219. package/dist/commonjs/policies/redirectPolicy.js.map +1 -1
  220. package/dist/commonjs/policies/retryPolicy.d.ts +3 -3
  221. package/dist/commonjs/policies/retryPolicy.d.ts.map +1 -1
  222. package/dist/commonjs/policies/retryPolicy.js.map +1 -1
  223. package/dist/commonjs/policies/systemErrorRetryPolicy.d.ts +1 -1
  224. package/dist/commonjs/policies/systemErrorRetryPolicy.d.ts.map +1 -1
  225. package/dist/commonjs/policies/systemErrorRetryPolicy.js.map +1 -1
  226. package/dist/commonjs/policies/throttlingRetryPolicy.d.ts +1 -1
  227. package/dist/commonjs/policies/throttlingRetryPolicy.d.ts.map +1 -1
  228. package/dist/commonjs/policies/throttlingRetryPolicy.js.map +1 -1
  229. package/dist/commonjs/policies/tlsPolicy.d.ts +2 -2
  230. package/dist/commonjs/policies/tlsPolicy.d.ts.map +1 -1
  231. package/dist/commonjs/policies/tlsPolicy.js.map +1 -1
  232. package/dist/commonjs/policies/tracingPolicy.d.ts +1 -1
  233. package/dist/commonjs/policies/tracingPolicy.d.ts.map +1 -1
  234. package/dist/commonjs/policies/tracingPolicy.js.map +1 -1
  235. package/dist/commonjs/policies/userAgentPolicy.d.ts +1 -1
  236. package/dist/commonjs/policies/userAgentPolicy.d.ts.map +1 -1
  237. package/dist/commonjs/policies/userAgentPolicy.js.map +1 -1
  238. package/dist/commonjs/restError.d.ts +1 -1
  239. package/dist/commonjs/restError.d.ts.map +1 -1
  240. package/dist/commonjs/restError.js.map +1 -1
  241. package/dist/commonjs/retryStrategies/exponentialRetryStrategy.d.ts +3 -3
  242. package/dist/commonjs/retryStrategies/exponentialRetryStrategy.d.ts.map +1 -1
  243. package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js.map +1 -1
  244. package/dist/commonjs/retryStrategies/retryStrategy.d.ts +3 -3
  245. package/dist/commonjs/retryStrategies/retryStrategy.d.ts.map +1 -1
  246. package/dist/commonjs/retryStrategies/retryStrategy.js.map +1 -1
  247. package/dist/commonjs/retryStrategies/throttlingRetryStrategy.d.ts +2 -2
  248. package/dist/commonjs/retryStrategies/throttlingRetryStrategy.d.ts.map +1 -1
  249. package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js.map +1 -1
  250. package/dist/commonjs/tracing/instrumenter.d.ts +1 -1
  251. package/dist/commonjs/tracing/instrumenter.d.ts.map +1 -1
  252. package/dist/commonjs/tracing/instrumenter.js.map +1 -1
  253. package/dist/commonjs/tracing/tracingClient.d.ts +1 -1
  254. package/dist/commonjs/tracing/tracingClient.d.ts.map +1 -1
  255. package/dist/commonjs/tracing/tracingClient.js.map +1 -1
  256. package/dist/commonjs/tracing/tracingContext.d.ts +1 -1
  257. package/dist/commonjs/tracing/tracingContext.d.ts.map +1 -1
  258. package/dist/commonjs/tracing/tracingContext.js.map +1 -1
  259. package/dist/commonjs/util/aborterUtils.d.ts +1 -1
  260. package/dist/commonjs/util/aborterUtils.d.ts.map +1 -1
  261. package/dist/commonjs/util/aborterUtils.js.map +1 -1
  262. package/dist/commonjs/util/createAbortablePromise.d.ts +1 -1
  263. package/dist/commonjs/util/createAbortablePromise.d.ts.map +1 -1
  264. package/dist/commonjs/util/createAbortablePromise.js.map +1 -1
  265. package/dist/commonjs/util/helpers.d.ts +2 -2
  266. package/dist/commonjs/util/helpers.d.ts.map +1 -1
  267. package/dist/commonjs/util/helpers.js.map +1 -1
  268. package/dist/commonjs/util/tokenCycler.d.ts +1 -1
  269. package/dist/commonjs/util/tokenCycler.d.ts.map +1 -1
  270. package/dist/commonjs/util/tokenCycler.js.map +1 -1
  271. package/dist/commonjs/xhrHttpClient.d.ts +1 -1
  272. package/dist/commonjs/xhrHttpClient.d.ts.map +1 -1
  273. package/dist/commonjs/xhrHttpClient.js.map +1 -1
  274. package/dist/esm/accessTokenCache.d.ts +1 -1
  275. package/dist/esm/accessTokenCache.d.ts.map +1 -1
  276. package/dist/esm/accessTokenCache.js.map +1 -1
  277. package/dist/esm/auth/tokenCredential.d.ts +2 -2
  278. package/dist/esm/auth/tokenCredential.d.ts.map +1 -1
  279. package/dist/esm/auth/tokenCredential.js.map +1 -1
  280. package/dist/esm/client/apiVersionPolicy.d.ts +2 -2
  281. package/dist/esm/client/apiVersionPolicy.d.ts.map +1 -1
  282. package/dist/esm/client/apiVersionPolicy.js.map +1 -1
  283. package/dist/esm/client/clientHelpers.d.ts +5 -5
  284. package/dist/esm/client/clientHelpers.d.ts.map +1 -1
  285. package/dist/esm/client/clientHelpers.js.map +1 -1
  286. package/dist/esm/client/common.d.ts +6 -6
  287. package/dist/esm/client/common.d.ts.map +1 -1
  288. package/dist/esm/client/common.js.map +1 -1
  289. package/dist/esm/client/getClient.d.ts +3 -3
  290. package/dist/esm/client/getClient.d.ts.map +1 -1
  291. package/dist/esm/client/getClient.js.map +1 -1
  292. package/dist/esm/client/keyCredentialAuthenticationPolicy.d.ts +2 -2
  293. package/dist/esm/client/keyCredentialAuthenticationPolicy.d.ts.map +1 -1
  294. package/dist/esm/client/keyCredentialAuthenticationPolicy.js.map +1 -1
  295. package/dist/esm/client/multipart.d.ts +1 -1
  296. package/dist/esm/client/multipart.d.ts.map +1 -1
  297. package/dist/esm/client/multipart.js.map +1 -1
  298. package/dist/esm/client/operationOptionHelpers.d.ts +1 -1
  299. package/dist/esm/client/operationOptionHelpers.d.ts.map +1 -1
  300. package/dist/esm/client/operationOptionHelpers.js.map +1 -1
  301. package/dist/esm/client/restError.d.ts +1 -1
  302. package/dist/esm/client/restError.d.ts.map +1 -1
  303. package/dist/esm/client/restError.js.map +1 -1
  304. package/dist/esm/client/sendRequest.d.ts +3 -3
  305. package/dist/esm/client/sendRequest.d.ts.map +1 -1
  306. package/dist/esm/client/sendRequest.js.map +1 -1
  307. package/dist/esm/client/urlHelpers.d.ts +1 -1
  308. package/dist/esm/client/urlHelpers.d.ts.map +1 -1
  309. package/dist/esm/client/urlHelpers.js.map +1 -1
  310. package/dist/esm/defaultHttpClient.d.ts +1 -1
  311. package/dist/esm/defaultHttpClient.d.ts.map +1 -1
  312. package/dist/esm/defaultHttpClient.js.map +1 -1
  313. package/dist/esm/fetchHttpClient.d.ts +1 -1
  314. package/dist/esm/fetchHttpClient.d.ts.map +1 -1
  315. package/dist/esm/fetchHttpClient.js.map +1 -1
  316. package/dist/esm/httpHeaders.d.ts +1 -1
  317. package/dist/esm/httpHeaders.d.ts.map +1 -1
  318. package/dist/esm/httpHeaders.js.map +1 -1
  319. package/dist/esm/interfaces.d.ts +2 -2
  320. package/dist/esm/interfaces.d.ts.map +1 -1
  321. package/dist/esm/interfaces.js.map +1 -1
  322. package/dist/esm/logger/logger.d.ts +1 -1
  323. package/dist/esm/logger/logger.d.ts.map +1 -1
  324. package/dist/esm/logger/logger.js.map +1 -1
  325. package/dist/esm/nodeHttpClient.d.ts +1 -1
  326. package/dist/esm/nodeHttpClient.d.ts.map +1 -1
  327. package/dist/esm/nodeHttpClient.js.map +1 -1
  328. package/dist/esm/pipeline.d.ts +1 -1
  329. package/dist/esm/pipeline.d.ts.map +1 -1
  330. package/dist/esm/pipeline.js.map +1 -1
  331. package/dist/esm/pipelineRequest.d.ts +3 -3
  332. package/dist/esm/pipelineRequest.d.ts.map +1 -1
  333. package/dist/esm/pipelineRequest.js.map +1 -1
  334. package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts +4 -4
  335. package/dist/esm/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
  336. package/dist/esm/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  337. package/dist/esm/policies/decompressResponsePolicy.d.ts +1 -1
  338. package/dist/esm/policies/decompressResponsePolicy.d.ts.map +1 -1
  339. package/dist/esm/policies/decompressResponsePolicy.js.map +1 -1
  340. package/dist/esm/policies/defaultRetryPolicy.d.ts +2 -2
  341. package/dist/esm/policies/defaultRetryPolicy.d.ts.map +1 -1
  342. package/dist/esm/policies/defaultRetryPolicy.js.map +1 -1
  343. package/dist/esm/policies/exponentialRetryPolicy.d.ts +1 -1
  344. package/dist/esm/policies/exponentialRetryPolicy.d.ts.map +1 -1
  345. package/dist/esm/policies/exponentialRetryPolicy.js.map +1 -1
  346. package/dist/esm/policies/formDataPolicy.d.ts +1 -1
  347. package/dist/esm/policies/formDataPolicy.d.ts.map +1 -1
  348. package/dist/esm/policies/formDataPolicy.js.map +1 -1
  349. package/dist/esm/policies/logPolicy.d.ts +2 -2
  350. package/dist/esm/policies/logPolicy.d.ts.map +1 -1
  351. package/dist/esm/policies/logPolicy.js.map +1 -1
  352. package/dist/esm/policies/multipartPolicy.d.ts +1 -1
  353. package/dist/esm/policies/multipartPolicy.d.ts.map +1 -1
  354. package/dist/esm/policies/multipartPolicy.js.map +1 -1
  355. package/dist/esm/policies/redirectPolicy.d.ts +1 -1
  356. package/dist/esm/policies/redirectPolicy.d.ts.map +1 -1
  357. package/dist/esm/policies/redirectPolicy.js.map +1 -1
  358. package/dist/esm/policies/retryPolicy.d.ts +3 -3
  359. package/dist/esm/policies/retryPolicy.d.ts.map +1 -1
  360. package/dist/esm/policies/retryPolicy.js.map +1 -1
  361. package/dist/esm/policies/systemErrorRetryPolicy.d.ts +1 -1
  362. package/dist/esm/policies/systemErrorRetryPolicy.d.ts.map +1 -1
  363. package/dist/esm/policies/systemErrorRetryPolicy.js.map +1 -1
  364. package/dist/esm/policies/throttlingRetryPolicy.d.ts +1 -1
  365. package/dist/esm/policies/throttlingRetryPolicy.d.ts.map +1 -1
  366. package/dist/esm/policies/throttlingRetryPolicy.js.map +1 -1
  367. package/dist/esm/policies/tlsPolicy.d.ts +2 -2
  368. package/dist/esm/policies/tlsPolicy.d.ts.map +1 -1
  369. package/dist/esm/policies/tlsPolicy.js.map +1 -1
  370. package/dist/esm/policies/tracingPolicy.d.ts +1 -1
  371. package/dist/esm/policies/tracingPolicy.d.ts.map +1 -1
  372. package/dist/esm/policies/tracingPolicy.js.map +1 -1
  373. package/dist/esm/policies/userAgentPolicy.d.ts +1 -1
  374. package/dist/esm/policies/userAgentPolicy.d.ts.map +1 -1
  375. package/dist/esm/policies/userAgentPolicy.js.map +1 -1
  376. package/dist/esm/restError.d.ts +1 -1
  377. package/dist/esm/restError.d.ts.map +1 -1
  378. package/dist/esm/restError.js.map +1 -1
  379. package/dist/esm/retryStrategies/exponentialRetryStrategy.d.ts +3 -3
  380. package/dist/esm/retryStrategies/exponentialRetryStrategy.d.ts.map +1 -1
  381. package/dist/esm/retryStrategies/exponentialRetryStrategy.js.map +1 -1
  382. package/dist/esm/retryStrategies/retryStrategy.d.ts +3 -3
  383. package/dist/esm/retryStrategies/retryStrategy.d.ts.map +1 -1
  384. package/dist/esm/retryStrategies/retryStrategy.js.map +1 -1
  385. package/dist/esm/retryStrategies/throttlingRetryStrategy.d.ts +2 -2
  386. package/dist/esm/retryStrategies/throttlingRetryStrategy.d.ts.map +1 -1
  387. package/dist/esm/retryStrategies/throttlingRetryStrategy.js.map +1 -1
  388. package/dist/esm/tracing/instrumenter.d.ts +1 -1
  389. package/dist/esm/tracing/instrumenter.d.ts.map +1 -1
  390. package/dist/esm/tracing/instrumenter.js.map +1 -1
  391. package/dist/esm/tracing/state.d.ts +1 -1
  392. package/dist/esm/tracing/state.d.ts.map +1 -1
  393. package/dist/esm/tracing/state.js.map +1 -1
  394. package/dist/esm/tracing/tracingClient.d.ts +1 -1
  395. package/dist/esm/tracing/tracingClient.d.ts.map +1 -1
  396. package/dist/esm/tracing/tracingClient.js.map +1 -1
  397. package/dist/esm/tracing/tracingContext.d.ts +1 -1
  398. package/dist/esm/tracing/tracingContext.d.ts.map +1 -1
  399. package/dist/esm/tracing/tracingContext.js.map +1 -1
  400. package/dist/esm/util/aborterUtils.d.ts +1 -1
  401. package/dist/esm/util/aborterUtils.d.ts.map +1 -1
  402. package/dist/esm/util/aborterUtils.js.map +1 -1
  403. package/dist/esm/util/createAbortablePromise.d.ts +1 -1
  404. package/dist/esm/util/createAbortablePromise.d.ts.map +1 -1
  405. package/dist/esm/util/createAbortablePromise.js.map +1 -1
  406. package/dist/esm/util/helpers.d.ts +2 -2
  407. package/dist/esm/util/helpers.d.ts.map +1 -1
  408. package/dist/esm/util/helpers.js.map +1 -1
  409. package/dist/esm/util/tokenCycler.d.ts +1 -1
  410. package/dist/esm/util/tokenCycler.d.ts.map +1 -1
  411. package/dist/esm/util/tokenCycler.js.map +1 -1
  412. package/dist/esm/xhrHttpClient.d.ts +1 -1
  413. package/dist/esm/xhrHttpClient.d.ts.map +1 -1
  414. package/dist/esm/xhrHttpClient.js.map +1 -1
  415. package/dist/react-native/accessTokenCache.d.ts +1 -1
  416. package/dist/react-native/accessTokenCache.d.ts.map +1 -1
  417. package/dist/react-native/accessTokenCache.js.map +1 -1
  418. package/dist/react-native/auth/tokenCredential.d.ts +2 -2
  419. package/dist/react-native/auth/tokenCredential.d.ts.map +1 -1
  420. package/dist/react-native/auth/tokenCredential.js.map +1 -1
  421. package/dist/react-native/client/apiVersionPolicy.d.ts +2 -2
  422. package/dist/react-native/client/apiVersionPolicy.d.ts.map +1 -1
  423. package/dist/react-native/client/apiVersionPolicy.js.map +1 -1
  424. package/dist/react-native/client/clientHelpers.d.ts +5 -5
  425. package/dist/react-native/client/clientHelpers.d.ts.map +1 -1
  426. package/dist/react-native/client/clientHelpers.js.map +1 -1
  427. package/dist/react-native/client/common.d.ts +6 -6
  428. package/dist/react-native/client/common.d.ts.map +1 -1
  429. package/dist/react-native/client/common.js.map +1 -1
  430. package/dist/react-native/client/getClient.d.ts +3 -3
  431. package/dist/react-native/client/getClient.d.ts.map +1 -1
  432. package/dist/react-native/client/getClient.js.map +1 -1
  433. package/dist/react-native/client/keyCredentialAuthenticationPolicy.d.ts +2 -2
  434. package/dist/react-native/client/keyCredentialAuthenticationPolicy.d.ts.map +1 -1
  435. package/dist/react-native/client/keyCredentialAuthenticationPolicy.js.map +1 -1
  436. package/dist/react-native/client/multipart.d.ts +1 -1
  437. package/dist/react-native/client/multipart.d.ts.map +1 -1
  438. package/dist/react-native/client/multipart.js.map +1 -1
  439. package/dist/react-native/client/operationOptionHelpers.d.ts +1 -1
  440. package/dist/react-native/client/operationOptionHelpers.d.ts.map +1 -1
  441. package/dist/react-native/client/operationOptionHelpers.js.map +1 -1
  442. package/dist/react-native/client/restError.d.ts +1 -1
  443. package/dist/react-native/client/restError.d.ts.map +1 -1
  444. package/dist/react-native/client/restError.js.map +1 -1
  445. package/dist/react-native/client/sendRequest.d.ts +3 -3
  446. package/dist/react-native/client/sendRequest.d.ts.map +1 -1
  447. package/dist/react-native/client/sendRequest.js.map +1 -1
  448. package/dist/react-native/client/urlHelpers.d.ts +1 -1
  449. package/dist/react-native/client/urlHelpers.d.ts.map +1 -1
  450. package/dist/react-native/client/urlHelpers.js.map +1 -1
  451. package/dist/react-native/fetchHttpClient.d.ts +1 -1
  452. package/dist/react-native/fetchHttpClient.d.ts.map +1 -1
  453. package/dist/react-native/fetchHttpClient.js.map +1 -1
  454. package/dist/react-native/httpHeaders.d.ts +1 -1
  455. package/dist/react-native/httpHeaders.d.ts.map +1 -1
  456. package/dist/react-native/httpHeaders.js.map +1 -1
  457. package/dist/react-native/interfaces.d.ts +2 -2
  458. package/dist/react-native/interfaces.d.ts.map +1 -1
  459. package/dist/react-native/interfaces.js.map +1 -1
  460. package/dist/react-native/logger/logger.d.ts +1 -1
  461. package/dist/react-native/logger/logger.d.ts.map +1 -1
  462. package/dist/react-native/logger/logger.js.map +1 -1
  463. package/dist/react-native/nodeHttpClient.d.ts +1 -1
  464. package/dist/react-native/nodeHttpClient.d.ts.map +1 -1
  465. package/dist/react-native/nodeHttpClient.js.map +1 -1
  466. package/dist/react-native/pipeline.d.ts +1 -1
  467. package/dist/react-native/pipeline.d.ts.map +1 -1
  468. package/dist/react-native/pipeline.js.map +1 -1
  469. package/dist/react-native/pipelineRequest.d.ts +3 -3
  470. package/dist/react-native/pipelineRequest.d.ts.map +1 -1
  471. package/dist/react-native/pipelineRequest.js.map +1 -1
  472. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts +4 -4
  473. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.d.ts.map +1 -1
  474. package/dist/react-native/policies/bearerTokenAuthenticationPolicy.js.map +1 -1
  475. package/dist/react-native/policies/decompressResponsePolicy.d.ts +1 -1
  476. package/dist/react-native/policies/decompressResponsePolicy.d.ts.map +1 -1
  477. package/dist/react-native/policies/decompressResponsePolicy.js.map +1 -1
  478. package/dist/react-native/policies/defaultRetryPolicy.d.ts +2 -2
  479. package/dist/react-native/policies/defaultRetryPolicy.d.ts.map +1 -1
  480. package/dist/react-native/policies/defaultRetryPolicy.js.map +1 -1
  481. package/dist/react-native/policies/exponentialRetryPolicy.d.ts +1 -1
  482. package/dist/react-native/policies/exponentialRetryPolicy.d.ts.map +1 -1
  483. package/dist/react-native/policies/exponentialRetryPolicy.js.map +1 -1
  484. package/dist/react-native/policies/formDataPolicy.d.ts +1 -1
  485. package/dist/react-native/policies/formDataPolicy.d.ts.map +1 -1
  486. package/dist/react-native/policies/formDataPolicy.js.map +1 -1
  487. package/dist/react-native/policies/logPolicy.d.ts +2 -2
  488. package/dist/react-native/policies/logPolicy.d.ts.map +1 -1
  489. package/dist/react-native/policies/logPolicy.js.map +1 -1
  490. package/dist/react-native/policies/multipartPolicy.d.ts +1 -1
  491. package/dist/react-native/policies/multipartPolicy.d.ts.map +1 -1
  492. package/dist/react-native/policies/multipartPolicy.js.map +1 -1
  493. package/dist/react-native/policies/redirectPolicy.d.ts +1 -1
  494. package/dist/react-native/policies/redirectPolicy.d.ts.map +1 -1
  495. package/dist/react-native/policies/redirectPolicy.js.map +1 -1
  496. package/dist/react-native/policies/retryPolicy.d.ts +3 -3
  497. package/dist/react-native/policies/retryPolicy.d.ts.map +1 -1
  498. package/dist/react-native/policies/retryPolicy.js.map +1 -1
  499. package/dist/react-native/policies/systemErrorRetryPolicy.d.ts +1 -1
  500. package/dist/react-native/policies/systemErrorRetryPolicy.d.ts.map +1 -1
  501. package/dist/react-native/policies/systemErrorRetryPolicy.js.map +1 -1
  502. package/dist/react-native/policies/throttlingRetryPolicy.d.ts +1 -1
  503. package/dist/react-native/policies/throttlingRetryPolicy.d.ts.map +1 -1
  504. package/dist/react-native/policies/throttlingRetryPolicy.js.map +1 -1
  505. package/dist/react-native/policies/tlsPolicy.d.ts +2 -2
  506. package/dist/react-native/policies/tlsPolicy.d.ts.map +1 -1
  507. package/dist/react-native/policies/tlsPolicy.js.map +1 -1
  508. package/dist/react-native/policies/tracingPolicy.d.ts +1 -1
  509. package/dist/react-native/policies/tracingPolicy.d.ts.map +1 -1
  510. package/dist/react-native/policies/tracingPolicy.js.map +1 -1
  511. package/dist/react-native/policies/userAgentPolicy.d.ts +1 -1
  512. package/dist/react-native/policies/userAgentPolicy.d.ts.map +1 -1
  513. package/dist/react-native/policies/userAgentPolicy.js.map +1 -1
  514. package/dist/react-native/restError.d.ts +1 -1
  515. package/dist/react-native/restError.d.ts.map +1 -1
  516. package/dist/react-native/restError.js.map +1 -1
  517. package/dist/react-native/retryStrategies/exponentialRetryStrategy.d.ts +3 -3
  518. package/dist/react-native/retryStrategies/exponentialRetryStrategy.d.ts.map +1 -1
  519. package/dist/react-native/retryStrategies/exponentialRetryStrategy.js.map +1 -1
  520. package/dist/react-native/retryStrategies/retryStrategy.d.ts +3 -3
  521. package/dist/react-native/retryStrategies/retryStrategy.d.ts.map +1 -1
  522. package/dist/react-native/retryStrategies/retryStrategy.js.map +1 -1
  523. package/dist/react-native/retryStrategies/throttlingRetryStrategy.d.ts +2 -2
  524. package/dist/react-native/retryStrategies/throttlingRetryStrategy.d.ts.map +1 -1
  525. package/dist/react-native/retryStrategies/throttlingRetryStrategy.js.map +1 -1
  526. package/dist/react-native/tracing/instrumenter.d.ts +1 -1
  527. package/dist/react-native/tracing/instrumenter.d.ts.map +1 -1
  528. package/dist/react-native/tracing/instrumenter.js.map +1 -1
  529. package/dist/react-native/tracing/state.d.ts +1 -1
  530. package/dist/react-native/tracing/state.d.ts.map +1 -1
  531. package/dist/react-native/tracing/state.js.map +1 -1
  532. package/dist/react-native/tracing/tracingClient.d.ts +1 -1
  533. package/dist/react-native/tracing/tracingClient.d.ts.map +1 -1
  534. package/dist/react-native/tracing/tracingClient.js.map +1 -1
  535. package/dist/react-native/tracing/tracingContext.d.ts +1 -1
  536. package/dist/react-native/tracing/tracingContext.d.ts.map +1 -1
  537. package/dist/react-native/tracing/tracingContext.js.map +1 -1
  538. package/dist/react-native/util/aborterUtils.d.ts +1 -1
  539. package/dist/react-native/util/aborterUtils.d.ts.map +1 -1
  540. package/dist/react-native/util/aborterUtils.js.map +1 -1
  541. package/dist/react-native/util/createAbortablePromise.d.ts +1 -1
  542. package/dist/react-native/util/createAbortablePromise.d.ts.map +1 -1
  543. package/dist/react-native/util/createAbortablePromise.js.map +1 -1
  544. package/dist/react-native/util/helpers.d.ts +2 -2
  545. package/dist/react-native/util/helpers.d.ts.map +1 -1
  546. package/dist/react-native/util/helpers.js.map +1 -1
  547. package/dist/react-native/util/tokenCycler.d.ts +1 -1
  548. package/dist/react-native/util/tokenCycler.d.ts.map +1 -1
  549. package/dist/react-native/util/tokenCycler.js.map +1 -1
  550. package/dist/react-native/xhrHttpClient.d.ts +1 -1
  551. package/dist/react-native/xhrHttpClient.d.ts.map +1 -1
  552. package/dist/react-native/xhrHttpClient.js.map +1 -1
  553. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { AccessToken } from "./auth/tokenCredential.js";
1
+ import type { AccessToken } from "./auth/tokenCredential.js";
2
2
  /**
3
3
  * Defines the default token refresh buffer duration.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"accessTokenCache.d.ts","sourceRoot":"","sources":["../../src/accessTokenCache.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAgB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IAE3D;;OAEG;IACH,cAAc,IAAI,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,gBAAgB;IAC/D,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,WAAW,CAAC,CAAc;IAElC;;;OAGG;gBACS,oBAAoB,GAAE,MAAoC;IAItE,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;IAI1D,cAAc,IAAI,WAAW,GAAG,SAAS;CAU1C"}
1
+ {"version":3,"file":"accessTokenCache.d.ts","sourceRoot":"","sources":["../../src/accessTokenCache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,2BAA2B,QAAgB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;IAE3D;;OAEG;IACH,cAAc,IAAI,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,gBAAgB;IAC/D,OAAO,CAAC,oBAAoB,CAAS;IACrC,OAAO,CAAC,WAAW,CAAC,CAAc;IAElC;;;OAGG;gBACS,oBAAoB,GAAE,MAAoC;IAItE,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;IAI1D,cAAc,IAAI,WAAW,GAAG,SAAS;CAU1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"accessTokenCache.js","sourceRoot":"","sources":["../../src/accessTokenCache.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAqBtE;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IAInC;;;OAGG;IACH,YAAY,uBAA+B,2BAA2B;QACpE,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAED,cAAc,CAAC,WAAoC;QACjD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,cAAc;QACZ,IACE,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAC7E,CAAC;YACD,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AccessToken } from \"./auth/tokenCredential.js\";\n\n/**\n * Defines the default token refresh buffer duration.\n */\nexport const DefaultTokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes\n\n/**\n * Provides a cache for an AccessToken that was that\n * was returned from a TokenCredential.\n */\nexport interface AccessTokenCache {\n /**\n * Sets the cached token.\n *\n * @param accessToken - The AccessToken to be cached or null to\n * clear the cached token.\n */\n setCachedToken(accessToken: AccessToken | undefined): void;\n\n /**\n * Returns the cached AccessToken or undefined if nothing is cached.\n */\n getCachedToken(): AccessToken | undefined;\n}\n\n/**\n * Provides an AccessTokenCache implementation which clears\n * the cached AccessToken's after the expiresOnTimestamp has\n * passed.\n * @internal\n */\nexport class ExpiringAccessTokenCache implements AccessTokenCache {\n private tokenRefreshBufferMs: number;\n private cachedToken?: AccessToken;\n\n /**\n * Constructs an instance of ExpiringAccessTokenCache with\n * an optional expiration buffer time.\n */\n constructor(tokenRefreshBufferMs: number = DefaultTokenRefreshBufferMs) {\n this.tokenRefreshBufferMs = tokenRefreshBufferMs;\n }\n\n setCachedToken(accessToken: AccessToken | undefined): void {\n this.cachedToken = accessToken;\n }\n\n getCachedToken(): AccessToken | undefined {\n if (\n this.cachedToken &&\n Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp\n ) {\n this.cachedToken = undefined;\n }\n\n return this.cachedToken;\n }\n}\n"]}
1
+ {"version":3,"file":"accessTokenCache.js","sourceRoot":"","sources":["../../src/accessTokenCache.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAqBtE;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IAInC;;;OAGG;IACH,YAAY,uBAA+B,2BAA2B;QACpE,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAED,cAAc,CAAC,WAAoC;QACjD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,cAAc;QACZ,IACE,IAAI,CAAC,WAAW;YAChB,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAC7E,CAAC;YACD,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AccessToken } from \"./auth/tokenCredential.js\";\n\n/**\n * Defines the default token refresh buffer duration.\n */\nexport const DefaultTokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes\n\n/**\n * Provides a cache for an AccessToken that was that\n * was returned from a TokenCredential.\n */\nexport interface AccessTokenCache {\n /**\n * Sets the cached token.\n *\n * @param accessToken - The AccessToken to be cached or null to\n * clear the cached token.\n */\n setCachedToken(accessToken: AccessToken | undefined): void;\n\n /**\n * Returns the cached AccessToken or undefined if nothing is cached.\n */\n getCachedToken(): AccessToken | undefined;\n}\n\n/**\n * Provides an AccessTokenCache implementation which clears\n * the cached AccessToken's after the expiresOnTimestamp has\n * passed.\n * @internal\n */\nexport class ExpiringAccessTokenCache implements AccessTokenCache {\n private tokenRefreshBufferMs: number;\n private cachedToken?: AccessToken;\n\n /**\n * Constructs an instance of ExpiringAccessTokenCache with\n * an optional expiration buffer time.\n */\n constructor(tokenRefreshBufferMs: number = DefaultTokenRefreshBufferMs) {\n this.tokenRefreshBufferMs = tokenRefreshBufferMs;\n }\n\n setCachedToken(accessToken: AccessToken | undefined): void {\n this.cachedToken = accessToken;\n }\n\n getCachedToken(): AccessToken | undefined {\n if (\n this.cachedToken &&\n Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp\n ) {\n this.cachedToken = undefined;\n }\n\n return this.cachedToken;\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { AbortSignalLike } from "../abort-controller/AbortSignalLike.js";
2
- import { TracingContext } from "../tracing/interfaces.js";
1
+ import type { AbortSignalLike } from "../abort-controller/AbortSignalLike.js";
2
+ import type { TracingContext } from "../tracing/interfaces.js";
3
3
  /**
4
4
  * Represents a credential capable of providing an authentication token.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tokenCredential.d.ts","sourceRoot":"","sources":["../../../src/auth/tokenCredential.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC7F;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE;QACf;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;OAEG;IACH,cAAc,CAAC,EAAE;QACf;;WAEG;QACH,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAGhC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,eAAe,CAepF"}
1
+ {"version":3,"file":"tokenCredential.d.ts","sourceRoot":"","sources":["../../../src/auth/tokenCredential.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAC7F;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE;QACf;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;OAEG;IACH,cAAc,CAAC,EAAE;QACf;;WAEG;QACH,cAAc,CAAC,EAAE,cAAc,CAAC;KACjC,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAGhC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,eAAe,CAepF"}
@@ -1 +1 @@
1
- {"version":3,"file":"tokenCredential.js","sourceRoot":"","sources":["../../../src/auth/tokenCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoFlC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAmB;IACnD,mEAAmE;IACnE,gEAAgE;IAChE,sEAAsE;IACtE,qEAAqE;IACrE,sDAAsD;IACtD,MAAM,cAAc,GAAG,UAGtB,CAAC;IACF,OAAO,CACL,cAAc;QACd,OAAO,cAAc,CAAC,QAAQ,KAAK,UAAU;QAC7C,CAAC,cAAc,CAAC,WAAW,KAAK,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACjF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AbortSignalLike } from \"../abort-controller/AbortSignalLike.js\";\nimport { TracingContext } from \"../tracing/interfaces.js\";\n\n/**\n * Represents a credential capable of providing an authentication token.\n */\nexport interface TokenCredential {\n /**\n * Gets the token provided by this credential.\n *\n * This method is called automatically by Azure SDK client libraries. You may call this method\n * directly, but you must also handle token caching and token refreshing.\n *\n * @param scopes - The list of scopes for which the token will have access.\n * @param options - The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;\n}\n\n/**\n * Defines options for TokenCredential.getToken.\n */\nexport interface GetTokenOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: {\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n };\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: {\n /**\n * Tracing Context for the current request.\n */\n tracingContext?: TracingContext;\n };\n /**\n * Claim details to perform the Continuous Access Evaluation authentication flow\n */\n claims?: string;\n /**\n * Indicates whether to enable the Continuous Access Evaluation authentication flow\n */\n enableCae?: boolean;\n /**\n * Allows specifying a tenantId. Useful to handle challenges that provide tenant Id hints.\n */\n tenantId?: string;\n}\n\n/**\n * Represents an access token with an expiration time.\n */\nexport interface AccessToken {\n /**\n * The access token returned by the authentication service.\n */\n token: string;\n\n /**\n * The access token's expiration timestamp in milliseconds, UNIX epoch time.\n */\n expiresOnTimestamp: number;\n\n /**\n * The timestamp when the access token should be refreshed, in milliseconds, UNIX epoch time.\n */\n refreshAfterTimestamp?: number;\n\n // UNBRANDED DIFFERENCE: Unbranded Core does not support PoP (\"Proof-of-Presence\") tokens.\n}\n\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential - The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential: unknown): credential is TokenCredential {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n const castCredential = credential as {\n getToken: unknown;\n signRequest: unknown;\n };\n return (\n castCredential &&\n typeof castCredential.getToken === \"function\" &&\n (castCredential.signRequest === undefined || castCredential.getToken.length > 0)\n );\n}\n"]}
1
+ {"version":3,"file":"tokenCredential.js","sourceRoot":"","sources":["../../../src/auth/tokenCredential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoFlC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAmB;IACnD,mEAAmE;IACnE,gEAAgE;IAChE,sEAAsE;IACtE,qEAAqE;IACrE,sDAAsD;IACtD,MAAM,cAAc,GAAG,UAGtB,CAAC;IACF,OAAO,CACL,cAAc;QACd,OAAO,cAAc,CAAC,QAAQ,KAAK,UAAU;QAC7C,CAAC,cAAc,CAAC,WAAW,KAAK,SAAS,IAAI,cAAc,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CACjF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AbortSignalLike } from \"../abort-controller/AbortSignalLike.js\";\nimport type { TracingContext } from \"../tracing/interfaces.js\";\n\n/**\n * Represents a credential capable of providing an authentication token.\n */\nexport interface TokenCredential {\n /**\n * Gets the token provided by this credential.\n *\n * This method is called automatically by Azure SDK client libraries. You may call this method\n * directly, but you must also handle token caching and token refreshing.\n *\n * @param scopes - The list of scopes for which the token will have access.\n * @param options - The options used to configure any requests this\n * TokenCredential implementation might make.\n */\n getToken(scopes: string | string[], options?: GetTokenOptions): Promise<AccessToken | null>;\n}\n\n/**\n * Defines options for TokenCredential.getToken.\n */\nexport interface GetTokenOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: {\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n };\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: {\n /**\n * Tracing Context for the current request.\n */\n tracingContext?: TracingContext;\n };\n /**\n * Claim details to perform the Continuous Access Evaluation authentication flow\n */\n claims?: string;\n /**\n * Indicates whether to enable the Continuous Access Evaluation authentication flow\n */\n enableCae?: boolean;\n /**\n * Allows specifying a tenantId. Useful to handle challenges that provide tenant Id hints.\n */\n tenantId?: string;\n}\n\n/**\n * Represents an access token with an expiration time.\n */\nexport interface AccessToken {\n /**\n * The access token returned by the authentication service.\n */\n token: string;\n\n /**\n * The access token's expiration timestamp in milliseconds, UNIX epoch time.\n */\n expiresOnTimestamp: number;\n\n /**\n * The timestamp when the access token should be refreshed, in milliseconds, UNIX epoch time.\n */\n refreshAfterTimestamp?: number;\n\n // UNBRANDED DIFFERENCE: Unbranded Core does not support PoP (\"Proof-of-Presence\") tokens.\n}\n\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential - The assumed TokenCredential to be tested.\n */\nexport function isTokenCredential(credential: unknown): credential is TokenCredential {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n const castCredential = credential as {\n getToken: unknown;\n signRequest: unknown;\n };\n return (\n castCredential &&\n typeof castCredential.getToken === \"function\" &&\n (castCredential.signRequest === undefined || castCredential.getToken.length > 0)\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { PipelinePolicy } from "../pipeline.js";
2
- import { ClientOptions } from "./common.js";
1
+ import type { PipelinePolicy } from "../pipeline.js";
2
+ import type { ClientOptions } from "./common.js";
3
3
  export declare const apiVersionPolicyName = "ApiVersionPolicy";
4
4
  /**
5
5
  * Creates a policy that sets the apiVersion as a query parameter on every request
@@ -1 +1 @@
1
- {"version":3,"file":"apiVersionPolicy.d.ts","sourceRoot":"","sources":["../../../src/client/apiVersionPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAgBvE"}
1
+ {"version":3,"file":"apiVersionPolicy.d.ts","sourceRoot":"","sources":["../../../src/client/apiVersionPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAgBvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiVersionPolicy.js","sourceRoot":"","sources":["../../../src/client/apiVersionPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAsB;IACrD,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,oDAAoD;YACpD,wEAAwE;YACxE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC/D,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,OAAO,CAAC,UAAU,EAAE,CAAC;YACtC,CAAC;YAED,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 { PipelinePolicy } from \"../pipeline.js\";\nimport { ClientOptions } from \"./common.js\";\n\nexport const apiVersionPolicyName = \"ApiVersionPolicy\";\n\n/**\n * Creates a policy that sets the apiVersion as a query parameter on every request\n * @param options - Client options\n * @returns Pipeline policy that sets the apiVersion as a query parameter on every request\n */\nexport function apiVersionPolicy(options: ClientOptions): PipelinePolicy {\n return {\n name: apiVersionPolicyName,\n sendRequest: (req, next) => {\n // Use the apiVesion defined in request url directly\n // Append one if there is no apiVesion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && options.apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${options.apiVersion}`;\n }\n\n return next(req);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"apiVersionPolicy.js","sourceRoot":"","sources":["../../../src/client/apiVersionPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAsB;IACrD,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,oDAAoD;YACpD,wEAAwE;YACxE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC/D,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,OAAO,CAAC,UAAU,EAAE,CAAC;YACtC,CAAC;YAED,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 { ClientOptions } from \"./common.js\";\n\nexport const apiVersionPolicyName = \"ApiVersionPolicy\";\n\n/**\n * Creates a policy that sets the apiVersion as a query parameter on every request\n * @param options - Client options\n * @returns Pipeline policy that sets the apiVersion as a query parameter on every request\n */\nexport function apiVersionPolicy(options: ClientOptions): PipelinePolicy {\n return {\n name: apiVersionPolicyName,\n sendRequest: (req, next) => {\n // Use the apiVesion defined in request url directly\n // Append one if there is no apiVesion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && options.apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${options.apiVersion}`;\n }\n\n return next(req);\n },\n };\n}\n"]}
@@ -1,8 +1,8 @@
1
- import { HttpClient } from "../interfaces.js";
2
- import { Pipeline } from "../pipeline.js";
3
- import { TokenCredential } from "../auth/tokenCredential.js";
4
- import { KeyCredential } from "../auth/keyCredential.js";
5
- import { ClientOptions } from "./common.js";
1
+ import type { HttpClient } from "../interfaces.js";
2
+ import type { Pipeline } from "../pipeline.js";
3
+ import type { TokenCredential } from "../auth/tokenCredential.js";
4
+ import type { KeyCredential } from "../auth/keyCredential.js";
5
+ import type { ClientOptions } from "./common.js";
6
6
  /**
7
7
  * Optional parameters for adding a credential policy to the pipeline.
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"clientHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,OAAO,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAChF,OAA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AAU,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,0CAAE,gBAAgB,CAAA,EAAE,CAAC;YAClD,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,SAAS,GAAG,iCAAiC,CACjD,UAAU,EACV,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,0CAAE,gBAAgB,CAC7C,CAAC;QACF,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,UAA4C,EAC5C,UAAyB,EAAE;IAE3B,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEpD,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IACxF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { HttpClient } from \"../interfaces.js\";\nimport { Pipeline } from \"../pipeline.js\";\nimport { bearerTokenAuthenticationPolicy } from \"../policies/bearerTokenAuthenticationPolicy.js\";\nimport { createDefaultHttpClient } from \"../defaultHttpClient.js\";\nimport { createPipelineFromOptions } from \"../createPipelineFromOptions.js\";\nimport { TokenCredential, isTokenCredential } from \"../auth/tokenCredential.js\";\nimport { KeyCredential, isKeyCredential } from \"../auth/keyCredential.js\";\nimport { ClientOptions } from \"./common.js\";\nimport { apiVersionPolicy } from \"./apiVersionPolicy.js\";\nimport { keyCredentialAuthenticationPolicy } from \"./keyCredentialAuthenticationPolicy.js\";\n\nlet cachedHttpClient: HttpClient | undefined;\n\n/**\n * Optional parameters for adding a credential policy to the pipeline.\n */\nexport interface AddCredentialPipelinePolicyOptions {\n /**\n * Options related to the client.\n */\n clientOptions?: ClientOptions;\n /**\n * The credential to use.\n */\n credential?: TokenCredential | KeyCredential;\n}\n\n/**\n * Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added.\n */\nexport function addCredentialPipelinePolicy(\n pipeline: Pipeline,\n endpoint: string,\n options: AddCredentialPipelinePolicyOptions = {},\n): void {\n const { credential, clientOptions } = options;\n if (!credential) {\n return;\n }\n\n if (isTokenCredential(credential)) {\n const tokenPolicy = bearerTokenAuthenticationPolicy({\n credential,\n scopes: clientOptions?.credentials?.scopes ?? `${endpoint}/.default`,\n });\n pipeline.addPolicy(tokenPolicy);\n } else if (isKeyCredential(credential)) {\n if (!clientOptions?.credentials?.apiKeyHeaderName) {\n throw new Error(`Missing API Key Header Name`);\n }\n const keyPolicy = keyCredentialAuthenticationPolicy(\n credential,\n clientOptions?.credentials?.apiKeyHeaderName,\n );\n pipeline.addPolicy(keyPolicy);\n }\n}\n\n/**\n * Creates a default rest pipeline to re-use accross Rest Level Clients\n */\nexport function createDefaultPipeline(\n endpoint: string,\n credential?: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): Pipeline {\n const pipeline = createPipelineFromOptions(options);\n\n pipeline.addPolicy(apiVersionPolicy(options));\n\n addCredentialPipelinePolicy(pipeline, endpoint, { credential, clientOptions: options });\n return pipeline;\n}\n\nexport function getCachedDefaultHttpsClient(): HttpClient {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n\n return cachedHttpClient;\n}\n"]}
1
+ {"version":3,"file":"clientHelpers.js","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],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,aAAa,CAAE,WAAW,0CAAE,gBAAgB,CAC7C,CAAC;QACF,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAgB,EAChB,UAA4C,EAC5C,UAAyB,EAAE;IAE3B,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEpD,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IACxF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,uBAAuB,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpClient } from \"../interfaces.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { bearerTokenAuthenticationPolicy } from \"../policies/bearerTokenAuthenticationPolicy.js\";\nimport { createDefaultHttpClient } from \"../defaultHttpClient.js\";\nimport { createPipelineFromOptions } from \"../createPipelineFromOptions.js\";\nimport type { TokenCredential } from \"../auth/tokenCredential.js\";\nimport { isTokenCredential } from \"../auth/tokenCredential.js\";\nimport type { KeyCredential } from \"../auth/keyCredential.js\";\nimport { isKeyCredential } from \"../auth/keyCredential.js\";\nimport type { ClientOptions } from \"./common.js\";\nimport { apiVersionPolicy } from \"./apiVersionPolicy.js\";\nimport { keyCredentialAuthenticationPolicy } from \"./keyCredentialAuthenticationPolicy.js\";\n\nlet cachedHttpClient: HttpClient | undefined;\n\n/**\n * Optional parameters for adding a credential policy to the pipeline.\n */\nexport interface AddCredentialPipelinePolicyOptions {\n /**\n * Options related to the client.\n */\n clientOptions?: ClientOptions;\n /**\n * The credential to use.\n */\n credential?: TokenCredential | KeyCredential;\n}\n\n/**\n * Adds a credential policy to the pipeline if a credential is provided. If none is provided, no policy is added.\n */\nexport function addCredentialPipelinePolicy(\n pipeline: Pipeline,\n endpoint: string,\n options: AddCredentialPipelinePolicyOptions = {},\n): void {\n const { credential, clientOptions } = options;\n if (!credential) {\n return;\n }\n\n if (isTokenCredential(credential)) {\n const tokenPolicy = bearerTokenAuthenticationPolicy({\n credential,\n scopes: clientOptions?.credentials?.scopes ?? `${endpoint}/.default`,\n });\n pipeline.addPolicy(tokenPolicy);\n } else if (isKeyCredential(credential)) {\n if (!clientOptions?.credentials?.apiKeyHeaderName) {\n throw new Error(`Missing API Key Header Name`);\n }\n const keyPolicy = keyCredentialAuthenticationPolicy(\n credential,\n clientOptions?.credentials?.apiKeyHeaderName,\n );\n pipeline.addPolicy(keyPolicy);\n }\n}\n\n/**\n * Creates a default rest pipeline to re-use accross Rest Level Clients\n */\nexport function createDefaultPipeline(\n endpoint: string,\n credential?: TokenCredential | KeyCredential,\n options: ClientOptions = {},\n): Pipeline {\n const pipeline = createPipelineFromOptions(options);\n\n pipeline.addPolicy(apiVersionPolicy(options));\n\n addCredentialPipelinePolicy(pipeline, endpoint, { credential, clientOptions: options });\n return pipeline;\n}\n\nexport function getCachedDefaultHttpsClient(): HttpClient {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n\n return cachedHttpClient;\n}\n"]}
@@ -1,9 +1,9 @@
1
- import { HttpClient, PipelineRequest, PipelineResponse, RawHttpHeaders, RequestBodyType, TransferProgressEvent, RawHttpHeadersInput } from "../interfaces.js";
2
- import { Pipeline, PipelinePolicy } from "../pipeline.js";
3
- import { AbortSignalLike } from "../abort-controller/AbortSignalLike.js";
4
- import { OperationTracingOptions } from "../tracing/interfaces.js";
5
- import { PipelineOptions } from "../createPipelineFromOptions.js";
6
- import { LogPolicyOptions } from "../policies/logPolicy.js";
1
+ import type { HttpClient, PipelineRequest, PipelineResponse, RawHttpHeaders, RequestBodyType, TransferProgressEvent, RawHttpHeadersInput } from "../interfaces.js";
2
+ import type { Pipeline, PipelinePolicy } from "../pipeline.js";
3
+ import type { AbortSignalLike } from "../abort-controller/AbortSignalLike.js";
4
+ import type { OperationTracingOptions } from "../tracing/interfaces.js";
5
+ import type { PipelineOptions } from "../createPipelineFromOptions.js";
6
+ import type { LogPolicyOptions } from "../policies/logPolicy.js";
7
7
  /**
8
8
  * Shape of the default request parameters, this may be overridden by the specific
9
9
  * request types to provide strong types
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,uBAAuB,CAAC,EAAE,OAAO,CAAC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AAE,eAAe,CAAC;IACzB;;OAEG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,CACxB,MAAM,SAAS,MAAM,IAOnB,MAAM,SAAS,GAAG,MAAM,KAAK,KAAK,MAAM,MAAM,IAAI,MAAM,IAAI,EAAE,GAO9D;IACE,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,wBAAwB;IACzD,GAAG,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC;CACxC,GAGD;CAAE,CAAC;AAEP,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,wBAAwB;AACxB,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B,8FAA8F;IAC9F,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,iNAAiN;AACjN,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n HttpClient,\n PipelineRequest,\n PipelineResponse,\n RawHttpHeaders,\n RequestBodyType,\n TransferProgressEvent,\n RawHttpHeadersInput,\n} from \"../interfaces.js\";\nimport { Pipeline, PipelinePolicy } from \"../pipeline.js\";\nimport { AbortSignalLike } from \"../abort-controller/AbortSignalLike.js\";\nimport { OperationTracingOptions } from \"../tracing/interfaces.js\";\nimport { PipelineOptions } from \"../createPipelineFromOptions.js\";\nimport { LogPolicyOptions } from \"../policies/logPolicy.js\";\n\n/**\n * Shape of the default request parameters, this may be overridden by the specific\n * request types to provide strong types\n */\nexport type RequestParameters = {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /**\n * Sets the accept header to send to the service\n * defaults to 'application/json'. If also a header \"accept\" is set\n * this property will take precedence.\n */\n accept?: string;\n /**\n * Body to send with the request\n */\n body?: unknown;\n /**\n * Query parameters to send with the request\n */\n queryParameters?: Record<string, unknown>;\n /**\n * Set an explicit content-type to send with the request. If also a header \"content-type\" is set\n * this property will take precedence.\n */\n contentType?: string;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n /**\n * Path parameters for custom the base url\n */\n pathParameters?: Record<string, any>;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n};\n\n/**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n// UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError parameter which was provided for backwards compatibility\nexport type RawResponseCallback = (rawResponse: FullOperationResponse, error?: unknown) => void;\n\n/**\n * Wrapper object for http request and response. Deserialized object is stored in\n * the `parsedBody` property when the response body is received in JSON.\n */\nexport interface FullOperationResponse extends PipelineResponse {\n /**\n * The raw HTTP response headers.\n */\n rawHeaders?: RawHttpHeaders;\n\n /**\n * The response body as parsed JSON.\n */\n parsedBody?: RequestBodyType;\n\n /**\n * The request that generated the response.\n */\n request: PipelineRequest;\n}\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n}\n\n/**\n * Options used when creating and sending HTTP requests for this operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that\n * will be applied before the request is sent.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Set to true if the request is sent over HTTP instead of HTTPS\n */\n allowInsecureConnection?: boolean;\n\n /**\n * Set to true if you want to skip encoding the path parameters\n */\n skipUrlEncoding?: boolean;\n}\n\n/**\n * Type to use with pathUnchecked, overrides the body type to any to allow flexibility\n */\nexport type PathUncheckedResponse = HttpResponse & { body: any };\n\n/**\n * Shape of a Rest Level Client\n */\nexport interface Client {\n /**\n * The pipeline used by this client to make requests\n */\n pipeline: Pipeline;\n /**\n * This method will be used to send request that would check the path to provide\n * strong types. When used by the codegen this type gets overridden with the generated\n * types. For example:\n * ```typescript snippet:path_example\n * import { Client, Routes } from \"@typespec/ts-http-runtime\";\n *\n * export type MyClient = Client & {\n * path: Routes;\n * };\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n path: Function;\n /**\n * This method allows arbitrary paths and doesn't provide strong types\n */\n pathUnchecked: PathUnchecked;\n}\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpNodeStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: NodeJS.ReadableStream;\n};\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpBrowserStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: ReadableStream<Uint8Array>;\n};\n\n/**\n * Defines the type for a method that supports getting the response body as\n * a raw stream\n */\nexport type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {\n asNodeStream: () => Promise<HttpNodeStreamResponse>;\n asBrowserStream: () => Promise<HttpBrowserStreamResponse>;\n};\n\n/**\n * Defines the signature for pathUnchecked.\n */\nexport type PathUnchecked = <TPath extends string>(\n path: TPath,\n ...args: PathParameters<TPath>\n) => ResourceMethods<StreamableMethod>;\n\n/**\n * Defines the methods that can be called on a resource\n */\nexport interface ResourceMethods<TResponse = PromiseLike<PathUncheckedResponse>> {\n /**\n * Definition of the GET HTTP method for a resource\n */\n get: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the POST HTTP method for a resource\n */\n post: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PUT HTTP method for a resource\n */\n put: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PATCH HTTP method for a resource\n */\n patch: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the DELETE HTTP method for a resource\n */\n delete: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the HEAD HTTP method for a resource\n */\n head: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the OPTIONS HTTP method for a resource\n */\n options: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the TRACE HTTP method for a resource\n */\n trace: (options?: RequestParameters) => TResponse;\n}\n\n/**\n * Used to configure additional policies added to the pipeline at construction.\n */\nexport interface AdditionalPolicyConfig {\n /**\n * A policy to be added.\n */\n policy: PipelinePolicy;\n /**\n * Determines if this policy be applied before or after retry logic.\n * Only use `perRetry` if you need to modify the request again\n * each time the operation is retried due to retryable service\n * issues.\n */\n position: \"perCall\" | \"perRetry\";\n}\n\n/**\n * General options that a Rest Level Client can take\n */\nexport type ClientOptions = PipelineOptions & {\n /**\n * Credentials information\n */\n credentials?: {\n /**\n * Authentication scopes for AAD\n */\n scopes?: string[];\n /**\n * Heder name for Client Secret authentication\n */\n apiKeyHeaderName?: string;\n };\n\n // UNBRANDED DIFFERENCE: The deprecated baseUrl property is removed in favor of the endpoint property in the unbranded Core package\n\n /**\n * Endpoint for the client\n */\n endpoint?: string;\n /**\n * Options for setting a custom apiVersion.\n */\n apiVersion?: string;\n /**\n * Option to allow calling http (insecure) endpoints\n */\n allowInsecureConnection?: boolean;\n /**\n * Additional policies to include in the HTTP pipeline.\n */\n additionalPolicies?: AdditionalPolicyConfig[];\n /**\n * Specify a custom HttpClient when making requests.\n */\n httpClient?: HttpClient;\n /**\n * Options to configure request/response logging.\n */\n loggingOptions?: LogPolicyOptions;\n};\n\n/**\n * Represents the shape of an HttpResponse\n */\nexport type HttpResponse = {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP response headers.\n */\n headers: RawHttpHeaders;\n /**\n * Parsed body\n */\n body: unknown;\n /**\n * The HTTP status code of the response.\n */\n status: string;\n};\n\n/**\n * Helper type used to detect parameters in a path template\n * text surrounded by \\{\\} will be considered a path parameter\n */\nexport type PathParameters<\n TRoute extends string,\n // This is trying to match the string in TRoute with a template where HEAD/{PARAM}/TAIL\n // for example in the followint path: /foo/{fooId}/bar/{barId}/baz the template will infer\n // HEAD: /foo\n // Param: fooId\n // Tail: /bar/{barId}/baz\n // The above sample path would return [pathParam: string, pathParam: string]\n> = TRoute extends `${infer _Head}/{${infer _Param}}${infer Tail}`\n ? // In case we have a match for the template above we know for sure\n // that we have at least one pathParameter, that's why we set the first pathParam\n // in the tuple. At this point we have only matched up until param, if we want to identify\n // additional parameters we can call RouteParameters recursively on the Tail to match the remaining parts,\n // in case the Tail has more parameters, it will return a tuple with the parameters found in tail.\n // We spread the second path params to end up with a single dimension tuple at the end.\n [\n pathParameter: string | number | PathParameterWithOptions,\n ...pathParameters: PathParameters<Tail>,\n ]\n : // When the path doesn't match the template, it means that we have no path parameters so we return\n // an empty tuple.\n [];\n\n/** A response containing error details. */\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n\n/** The error object. */\nexport interface ErrorModel {\n /** One of a server-defined set of error codes. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details: Array<ErrorModel>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. */\nexport interface InnerError {\n /** One of a server-defined set of error codes. */\n code: string;\n /** Inner error. */\n innererror?: InnerError;\n}\n\n/**\n * An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded.\n */\nexport interface PathParameterWithOptions {\n /**\n * The value of the parameter.\n */\n value: string | number;\n\n /**\n * Whether to allow for reserved characters in the value. If set to true, special characters such as '/' in the parameter's value will not be URL encoded.\n * Defaults to false.\n */\n allowReserved?: boolean;\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/client/common.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpClient,\n PipelineRequest,\n PipelineResponse,\n RawHttpHeaders,\n RequestBodyType,\n TransferProgressEvent,\n RawHttpHeadersInput,\n} from \"../interfaces.js\";\nimport type { Pipeline, PipelinePolicy } from \"../pipeline.js\";\nimport type { AbortSignalLike } from \"../abort-controller/AbortSignalLike.js\";\nimport type { OperationTracingOptions } from \"../tracing/interfaces.js\";\nimport type { PipelineOptions } from \"../createPipelineFromOptions.js\";\nimport type { LogPolicyOptions } from \"../policies/logPolicy.js\";\n\n/**\n * Shape of the default request parameters, this may be overridden by the specific\n * request types to provide strong types\n */\nexport type RequestParameters = {\n /**\n * Headers to send along with the request\n */\n headers?: RawHttpHeadersInput;\n /**\n * Sets the accept header to send to the service\n * defaults to 'application/json'. If also a header \"accept\" is set\n * this property will take precedence.\n */\n accept?: string;\n /**\n * Body to send with the request\n */\n body?: unknown;\n /**\n * Query parameters to send with the request\n */\n queryParameters?: Record<string, unknown>;\n /**\n * Set an explicit content-type to send with the request. If also a header \"content-type\" is set\n * this property will take precedence.\n */\n contentType?: string;\n /** Set to true if the request is sent over HTTP instead of HTTPS */\n allowInsecureConnection?: boolean;\n /** Set to true if you want to skip encoding the path parameters */\n skipUrlEncoding?: boolean;\n /**\n * Path parameters for custom the base url\n */\n pathParameters?: Record<string, any>;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n};\n\n/**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n// UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError parameter which was provided for backwards compatibility\nexport type RawResponseCallback = (rawResponse: FullOperationResponse, error?: unknown) => void;\n\n/**\n * Wrapper object for http request and response. Deserialized object is stored in\n * the `parsedBody` property when the response body is received in JSON.\n */\nexport interface FullOperationResponse extends PipelineResponse {\n /**\n * The raw HTTP response headers.\n */\n rawHeaders?: RawHttpHeaders;\n\n /**\n * The response body as parsed JSON.\n */\n parsedBody?: RequestBodyType;\n\n /**\n * The request that generated the response.\n */\n request: PipelineRequest;\n}\n\n/**\n * The base options type for all operations.\n */\nexport interface OperationOptions {\n /**\n * The signal which can be used to abort requests.\n */\n abortSignal?: AbortSignalLike;\n /**\n * Options used when creating and sending HTTP requests for this operation.\n */\n requestOptions?: OperationRequestOptions;\n /**\n * Options used when tracing is enabled.\n */\n tracingOptions?: OperationTracingOptions;\n\n /**\n * A function to be called each time a response is received from the server\n * while performing the requested operation.\n * May be called multiple times.\n */\n onResponse?: RawResponseCallback;\n}\n\n/**\n * Options used when creating and sending HTTP requests for this operation.\n */\nexport interface OperationRequestOptions {\n /**\n * User defined custom request headers that\n * will be applied before the request is sent.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The number of milliseconds a request can take before automatically being terminated.\n */\n timeout?: number;\n\n /**\n * Callback which fires upon upload progress.\n */\n onUploadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Callback which fires upon download progress.\n */\n onDownloadProgress?: (progress: TransferProgressEvent) => void;\n\n /**\n * Set to true if the request is sent over HTTP instead of HTTPS\n */\n allowInsecureConnection?: boolean;\n\n /**\n * Set to true if you want to skip encoding the path parameters\n */\n skipUrlEncoding?: boolean;\n}\n\n/**\n * Type to use with pathUnchecked, overrides the body type to any to allow flexibility\n */\nexport type PathUncheckedResponse = HttpResponse & { body: any };\n\n/**\n * Shape of a Rest Level Client\n */\nexport interface Client {\n /**\n * The pipeline used by this client to make requests\n */\n pipeline: Pipeline;\n /**\n * This method will be used to send request that would check the path to provide\n * strong types. When used by the codegen this type gets overridden with the generated\n * types. For example:\n * ```typescript snippet:path_example\n * import { Client, Routes } from \"@typespec/ts-http-runtime\";\n *\n * export type MyClient = Client & {\n * path: Routes;\n * };\n * ```\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n path: Function;\n /**\n * This method allows arbitrary paths and doesn't provide strong types\n */\n pathUnchecked: PathUnchecked;\n}\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpNodeStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: NodeJS.ReadableStream;\n};\n\n/**\n * Http Response which body is a NodeJS stream object\n */\nexport type HttpBrowserStreamResponse = HttpResponse & {\n /**\n * Streamable body\n */\n body?: ReadableStream<Uint8Array>;\n};\n\n/**\n * Defines the type for a method that supports getting the response body as\n * a raw stream\n */\nexport type StreamableMethod<TResponse = PathUncheckedResponse> = PromiseLike<TResponse> & {\n asNodeStream: () => Promise<HttpNodeStreamResponse>;\n asBrowserStream: () => Promise<HttpBrowserStreamResponse>;\n};\n\n/**\n * Defines the signature for pathUnchecked.\n */\nexport type PathUnchecked = <TPath extends string>(\n path: TPath,\n ...args: PathParameters<TPath>\n) => ResourceMethods<StreamableMethod>;\n\n/**\n * Defines the methods that can be called on a resource\n */\nexport interface ResourceMethods<TResponse = PromiseLike<PathUncheckedResponse>> {\n /**\n * Definition of the GET HTTP method for a resource\n */\n get: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the POST HTTP method for a resource\n */\n post: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PUT HTTP method for a resource\n */\n put: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the PATCH HTTP method for a resource\n */\n patch: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the DELETE HTTP method for a resource\n */\n delete: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the HEAD HTTP method for a resource\n */\n head: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the OPTIONS HTTP method for a resource\n */\n options: (options?: RequestParameters) => TResponse;\n /**\n * Definition of the TRACE HTTP method for a resource\n */\n trace: (options?: RequestParameters) => TResponse;\n}\n\n/**\n * Used to configure additional policies added to the pipeline at construction.\n */\nexport interface AdditionalPolicyConfig {\n /**\n * A policy to be added.\n */\n policy: PipelinePolicy;\n /**\n * Determines if this policy be applied before or after retry logic.\n * Only use `perRetry` if you need to modify the request again\n * each time the operation is retried due to retryable service\n * issues.\n */\n position: \"perCall\" | \"perRetry\";\n}\n\n/**\n * General options that a Rest Level Client can take\n */\nexport type ClientOptions = PipelineOptions & {\n /**\n * Credentials information\n */\n credentials?: {\n /**\n * Authentication scopes for AAD\n */\n scopes?: string[];\n /**\n * Heder name for Client Secret authentication\n */\n apiKeyHeaderName?: string;\n };\n\n // UNBRANDED DIFFERENCE: The deprecated baseUrl property is removed in favor of the endpoint property in the unbranded Core package\n\n /**\n * Endpoint for the client\n */\n endpoint?: string;\n /**\n * Options for setting a custom apiVersion.\n */\n apiVersion?: string;\n /**\n * Option to allow calling http (insecure) endpoints\n */\n allowInsecureConnection?: boolean;\n /**\n * Additional policies to include in the HTTP pipeline.\n */\n additionalPolicies?: AdditionalPolicyConfig[];\n /**\n * Specify a custom HttpClient when making requests.\n */\n httpClient?: HttpClient;\n /**\n * Options to configure request/response logging.\n */\n loggingOptions?: LogPolicyOptions;\n};\n\n/**\n * Represents the shape of an HttpResponse\n */\nexport type HttpResponse = {\n /**\n * The request that generated this response.\n */\n request: PipelineRequest;\n /**\n * The HTTP response headers.\n */\n headers: RawHttpHeaders;\n /**\n * Parsed body\n */\n body: unknown;\n /**\n * The HTTP status code of the response.\n */\n status: string;\n};\n\n/**\n * Helper type used to detect parameters in a path template\n * text surrounded by \\{\\} will be considered a path parameter\n */\nexport type PathParameters<\n TRoute extends string,\n // This is trying to match the string in TRoute with a template where HEAD/{PARAM}/TAIL\n // for example in the followint path: /foo/{fooId}/bar/{barId}/baz the template will infer\n // HEAD: /foo\n // Param: fooId\n // Tail: /bar/{barId}/baz\n // The above sample path would return [pathParam: string, pathParam: string]\n> = TRoute extends `${infer _Head}/{${infer _Param}}${infer Tail}`\n ? // In case we have a match for the template above we know for sure\n // that we have at least one pathParameter, that's why we set the first pathParam\n // in the tuple. At this point we have only matched up until param, if we want to identify\n // additional parameters we can call RouteParameters recursively on the Tail to match the remaining parts,\n // in case the Tail has more parameters, it will return a tuple with the parameters found in tail.\n // We spread the second path params to end up with a single dimension tuple at the end.\n [\n pathParameter: string | number | PathParameterWithOptions,\n ...pathParameters: PathParameters<Tail>,\n ]\n : // When the path doesn't match the template, it means that we have no path parameters so we return\n // an empty tuple.\n [];\n\n/** A response containing error details. */\nexport interface ErrorResponse {\n /** The error object. */\n error: ErrorModel;\n}\n\n/** The error object. */\nexport interface ErrorModel {\n /** One of a server-defined set of error codes. */\n code: string;\n /** A human-readable representation of the error. */\n message: string;\n /** The target of the error. */\n target?: string;\n /** An array of details about specific errors that led to this reported error. */\n details: Array<ErrorModel>;\n /** An object containing more specific information than the current object about the error. */\n innererror?: InnerError;\n}\n\n/** An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses. */\nexport interface InnerError {\n /** One of a server-defined set of error codes. */\n code: string;\n /** Inner error. */\n innererror?: InnerError;\n}\n\n/**\n * An object that can be passed as a path parameter, allowing for additional options to be set relating to how the parameter is encoded.\n */\nexport interface PathParameterWithOptions {\n /**\n * The value of the parameter.\n */\n value: string | number;\n\n /**\n * Whether to allow for reserved characters in the value. If set to true, special characters such as '/' in the parameter's value will not be URL encoded.\n * Defaults to false.\n */\n allowReserved?: boolean;\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { TokenCredential } from "../auth/tokenCredential.js";
2
- import { KeyCredential } from "../auth/keyCredential.js";
3
- import { Client, ClientOptions } from "./common.js";
1
+ import type { TokenCredential } from "../auth/tokenCredential.js";
2
+ import type { KeyCredential } from "../auth/keyCredential.js";
3
+ import type { Client, ClientOptions } from "./common.js";
4
4
  /**
5
5
  * Creates a client with a default pipeline
6
6
  * @param endpoint - Base endpoint for the client
@@ -1 +1 @@
1
- {"version":3,"file":"getClient.d.ts","sourceRoot":"","sources":["../../../src/client/getClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAmB,MAAM,0BAA0B,CAAC;AAI1E,OAAO,EACL,MAAM,EACN,aAAa,EAMd,MAAM,aAAa,CAAC;AAKrB;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;AAC7E;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,eAAe,GAAG,aAAa,EAC7C,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAAC"}
1
+ {"version":3,"file":"getClient.d.ts","sourceRoot":"","sources":["../../../src/client/getClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EAMd,MAAM,aAAa,CAAC;AAKrB;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC;AAC7E;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,eAAe,GAAG,aAAa,EAC7C,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getClient.js","sourceRoot":"","sources":["../../../src/client/getClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAmB,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;A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YAAY,CACnB,KAA0D;IAE1D,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { TokenCredential, isTokenCredential } from \"../auth/tokenCredential.js\";\nimport { KeyCredential, isKeyCredential } from \"../auth/keyCredential.js\";\nimport { HttpClient, HttpMethods } from \"../interfaces.js\";\nimport { Pipeline } from \"../pipeline.js\";\nimport { createDefaultPipeline } from \"./clientHelpers.js\";\nimport {\n Client,\n ClientOptions,\n HttpBrowserStreamResponse,\n HttpNodeStreamResponse,\n RequestParameters,\n ResourceMethods,\n StreamableMethod,\n} from \"./common.js\";\nimport { sendRequest } from \"./sendRequest.js\";\nimport { buildRequestUrl } from \"./urlHelpers.js\";\nimport { PipelineOptions } from \"../createPipelineFromOptions.js\";\n\n/**\n * Creates a client with a default pipeline\n * @param endpoint - Base endpoint for the client\n * @param options - Client options\n */\nexport function getClient(endpoint: string, options?: ClientOptions): Client;\n/**\n * Creates a client with a default pipeline\n * @param endpoint - Base endpoint for the client\n * @param credentials - Credentials to authenticate the requests\n * @param options - Client options\n */\nexport function getClient(\n endpoint: string,\n credentials?: TokenCredential | KeyCredential,\n options?: ClientOptions,\n): Client;\nexport function getClient(\n endpoint: string,\n credentialsOrPipelineOptions?: (TokenCredential | KeyCredential) | ClientOptions,\n clientOptions: ClientOptions = {},\n): Client {\n let credentials: TokenCredential | KeyCredential | undefined;\n if (credentialsOrPipelineOptions) {\n if (isCredential(credentialsOrPipelineOptions)) {\n credentials = credentialsOrPipelineOptions;\n } else {\n clientOptions = credentialsOrPipelineOptions ?? {};\n }\n }\n\n const pipeline = createDefaultPipeline(endpoint, credentials, clientOptions);\n if (clientOptions.additionalPolicies?.length) {\n for (const { policy, position } of clientOptions.additionalPolicies) {\n // Sign happens after Retry and is commonly needed to occur\n // before policies that intercept post-retry.\n const afterPhase = position === \"perRetry\" ? \"Sign\" : undefined;\n pipeline.addPolicy(policy, {\n afterPhase,\n });\n }\n }\n\n const { allowInsecureConnection, httpClient } = clientOptions;\n const endpointUrl = clientOptions.endpoint ?? endpoint;\n const client = (path: string, ...args: Array<any>): ResourceMethods<StreamableMethod> => {\n const getUrl = (requestOptions: RequestParameters): string =>\n buildRequestUrl(endpointUrl, path, args, { allowInsecureConnection, ...requestOptions });\n\n return {\n get: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"GET\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n post: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"POST\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n put: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"PUT\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n patch: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"PATCH\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n delete: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"DELETE\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n head: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"HEAD\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n options: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"OPTIONS\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n trace: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"TRACE\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n };\n };\n\n return {\n path: client,\n pathUnchecked: client,\n pipeline,\n };\n}\n\nfunction buildOperation(\n method: HttpMethods,\n url: string,\n pipeline: Pipeline,\n options: RequestParameters,\n allowInsecureConnection?: boolean,\n httpClient?: HttpClient,\n): StreamableMethod {\n allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection;\n return {\n then: function (onFulfilled, onrejected) {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection },\n httpClient,\n ).then(onFulfilled, onrejected);\n },\n async asBrowserStream() {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection, responseAsStream: true },\n httpClient,\n ) as Promise<HttpBrowserStreamResponse>;\n },\n async asNodeStream() {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection, responseAsStream: true },\n httpClient,\n ) as Promise<HttpNodeStreamResponse>;\n },\n };\n}\n\nfunction isCredential(\n param: (TokenCredential | KeyCredential) | PipelineOptions,\n): param is TokenCredential | KeyCredential {\n return isKeyCredential(param) || isTokenCredential(param);\n}\n"]}
1
+ {"version":3,"file":"getClient.js","sourceRoot":"","sources":["../../../src/client/getClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAU3D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAoBlD,MAAM,UAAU,SAAS,CACvB,QAAgB,EAChB,4BAAgF,EAChF,gBAA+B,EAAE;;IAEjC,IAAI,WAAwD,CAAC;IAC7D,IAAI,4BAA4B,EAAE,CAAC;QACjC,IAAI,YAAY,CAAC,4BAA4B,CAAC,EAAE,CAAC;YAC/C,WAAW,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,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,MAAM;QACrB,QAAQ;KACT,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CACrB,MAAmB,EACnB,GAAW,EACX,QAAkB,EAClB,OAA0B,EAC1B,uBAAiC,EACjC,UAAuB;;IAEvB,uBAAuB,GAAG,MAAA,OAAO,CAAC,uBAAuB,mCAAI,uBAAuB,CAAC;IACrF,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,EAAE,UAAU;YACrC,OAAO,WAAW,CAChB,MAAM,EACN,GAAG,EACH,QAAQ,kCACH,OAAO,KAAE,uBAAuB,KACrC,UAAU,CACX,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAClC,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,OAAO,WAAW,CAChB,MAAM,EACN,GAAG,EACH,QAAQ,kCACH,OAAO,KAAE,uBAAuB,EAAE,gBAAgB,EAAE,IAAI,KAC7D,UAAU,CAC2B,CAAC;QAC1C,CAAC;QACD,KAAK,CAAC,YAAY;YAChB,OAAO,WAAW,CAChB,MAAM,EACN,GAAG,EACH,QAAQ,kCACH,OAAO,KAAE,uBAAuB,EAAE,gBAAgB,EAAE,IAAI,KAC7D,UAAU,CACwB,CAAC;QACvC,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CACnB,KAA0D;IAE1D,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"../auth/tokenCredential.js\";\nimport { isTokenCredential } from \"../auth/tokenCredential.js\";\nimport type { KeyCredential } from \"../auth/keyCredential.js\";\nimport { isKeyCredential } from \"../auth/keyCredential.js\";\nimport type { HttpClient, HttpMethods } from \"../interfaces.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { createDefaultPipeline } from \"./clientHelpers.js\";\nimport type {\n Client,\n ClientOptions,\n HttpBrowserStreamResponse,\n HttpNodeStreamResponse,\n RequestParameters,\n ResourceMethods,\n StreamableMethod,\n} from \"./common.js\";\nimport { sendRequest } from \"./sendRequest.js\";\nimport { buildRequestUrl } from \"./urlHelpers.js\";\nimport type { PipelineOptions } from \"../createPipelineFromOptions.js\";\n\n/**\n * Creates a client with a default pipeline\n * @param endpoint - Base endpoint for the client\n * @param options - Client options\n */\nexport function getClient(endpoint: string, options?: ClientOptions): Client;\n/**\n * Creates a client with a default pipeline\n * @param endpoint - Base endpoint for the client\n * @param credentials - Credentials to authenticate the requests\n * @param options - Client options\n */\nexport function getClient(\n endpoint: string,\n credentials?: TokenCredential | KeyCredential,\n options?: ClientOptions,\n): Client;\nexport function getClient(\n endpoint: string,\n credentialsOrPipelineOptions?: (TokenCredential | KeyCredential) | ClientOptions,\n clientOptions: ClientOptions = {},\n): Client {\n let credentials: TokenCredential | KeyCredential | undefined;\n if (credentialsOrPipelineOptions) {\n if (isCredential(credentialsOrPipelineOptions)) {\n credentials = credentialsOrPipelineOptions;\n } else {\n clientOptions = credentialsOrPipelineOptions ?? {};\n }\n }\n\n const pipeline = createDefaultPipeline(endpoint, credentials, clientOptions);\n if (clientOptions.additionalPolicies?.length) {\n for (const { policy, position } of clientOptions.additionalPolicies) {\n // Sign happens after Retry and is commonly needed to occur\n // before policies that intercept post-retry.\n const afterPhase = position === \"perRetry\" ? \"Sign\" : undefined;\n pipeline.addPolicy(policy, {\n afterPhase,\n });\n }\n }\n\n const { allowInsecureConnection, httpClient } = clientOptions;\n const endpointUrl = clientOptions.endpoint ?? endpoint;\n const client = (path: string, ...args: Array<any>): ResourceMethods<StreamableMethod> => {\n const getUrl = (requestOptions: RequestParameters): string =>\n buildRequestUrl(endpointUrl, path, args, { allowInsecureConnection, ...requestOptions });\n\n return {\n get: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"GET\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n post: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"POST\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n put: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"PUT\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n patch: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"PATCH\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n delete: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"DELETE\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n head: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"HEAD\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n options: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"OPTIONS\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n trace: (requestOptions: RequestParameters = {}): StreamableMethod => {\n return buildOperation(\n \"TRACE\",\n getUrl(requestOptions),\n pipeline,\n requestOptions,\n allowInsecureConnection,\n httpClient,\n );\n },\n };\n };\n\n return {\n path: client,\n pathUnchecked: client,\n pipeline,\n };\n}\n\nfunction buildOperation(\n method: HttpMethods,\n url: string,\n pipeline: Pipeline,\n options: RequestParameters,\n allowInsecureConnection?: boolean,\n httpClient?: HttpClient,\n): StreamableMethod {\n allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection;\n return {\n then: function (onFulfilled, onrejected) {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection },\n httpClient,\n ).then(onFulfilled, onrejected);\n },\n async asBrowserStream() {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection, responseAsStream: true },\n httpClient,\n ) as Promise<HttpBrowserStreamResponse>;\n },\n async asNodeStream() {\n return sendRequest(\n method,\n url,\n pipeline,\n { ...options, allowInsecureConnection, responseAsStream: true },\n httpClient,\n ) as Promise<HttpNodeStreamResponse>;\n },\n };\n}\n\nfunction isCredential(\n param: (TokenCredential | KeyCredential) | PipelineOptions,\n): param is TokenCredential | KeyCredential {\n return isKeyCredential(param) || isTokenCredential(param);\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { KeyCredential } from "../auth/keyCredential.js";
2
- import { PipelinePolicy } from "../pipeline.js";
1
+ import type { KeyCredential } from "../auth/keyCredential.js";
2
+ import type { PipelinePolicy } from "../pipeline.js";
3
3
  /**
4
4
  * The programmatic identifier of the bearerTokenAuthenticationPolicy.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"keyCredentialAuthenticationPolicy.d.ts","sourceRoot":"","sources":["../../../src/client/keyCredentialAuthenticationPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,qCAAqC,sCAAsC,CAAC;AAEzF,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,aAAa,EACzB,gBAAgB,EAAE,MAAM,GACvB,cAAc,CAQhB"}
1
+ {"version":3,"file":"keyCredentialAuthenticationPolicy.d.ts","sourceRoot":"","sources":["../../../src/client/keyCredentialAuthenticationPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,qCAAqC,sCAAsC,CAAC;AAEzF,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,aAAa,EACzB,gBAAgB,EAAE,MAAM,GACvB,cAAc,CAQhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"keyCredentialAuthenticationPolicy.js","sourceRoot":"","sources":["../../../src/client/keyCredentialAuthenticationPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,mCAAmC,CAAC;AAEzF,MAAM,UAAU,iCAAiC,CAC/C,UAAyB,EACzB,gBAAwB;IAExB,OAAO;QACL,IAAI,EAAE,qCAAqC;QAC3C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACtD,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 { KeyCredential } from \"../auth/keyCredential.js\";\nimport { PipelineRequest, PipelineResponse, SendRequest } from \"../interfaces.js\";\nimport { PipelinePolicy } from \"../pipeline.js\";\n\n/**\n * The programmatic identifier of the bearerTokenAuthenticationPolicy.\n */\nexport const keyCredentialAuthenticationPolicyName = \"keyCredentialAuthenticationPolicy\";\n\nexport function keyCredentialAuthenticationPolicy(\n credential: KeyCredential,\n apiKeyHeaderName: string,\n): PipelinePolicy {\n return {\n name: keyCredentialAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(apiKeyHeaderName, credential.key);\n return next(request);\n },\n };\n}\n"]}
1
+ {"version":3,"file":"keyCredentialAuthenticationPolicy.js","sourceRoot":"","sources":["../../../src/client/keyCredentialAuthenticationPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,mCAAmC,CAAC;AAEzF,MAAM,UAAU,iCAAiC,CAC/C,UAAyB,EACzB,gBAAwB;IAExB,OAAO;QACL,IAAI,EAAE,qCAAqC;QAC3C,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;YACtD,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 { KeyCredential } from \"../auth/keyCredential.js\";\nimport type { PipelineRequest, PipelineResponse, SendRequest } from \"../interfaces.js\";\nimport type { PipelinePolicy } from \"../pipeline.js\";\n\n/**\n * The programmatic identifier of the bearerTokenAuthenticationPolicy.\n */\nexport const keyCredentialAuthenticationPolicyName = \"keyCredentialAuthenticationPolicy\";\n\nexport function keyCredentialAuthenticationPolicy(\n credential: KeyCredential,\n apiKeyHeaderName: string,\n): PipelinePolicy {\n return {\n name: keyCredentialAuthenticationPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n request.headers.set(apiKeyHeaderName, credential.key);\n return next(request);\n },\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BodyPart, MultipartRequestBody, RawHttpHeadersInput } from "../interfaces.js";
1
+ import type { BodyPart, MultipartRequestBody, RawHttpHeadersInput } from "../interfaces.js";
2
2
  /**
3
3
  * Describes a single part in a multipart body.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../src/client/multipart.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA8HD,wBAAgB,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,QAAQ,CAkBlE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,oBAAoB,CAEhF"}
1
+ {"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../../src/client/multipart.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAM5F;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAE9B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA8HD,wBAAgB,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,QAAQ,CAkBlE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,oBAAoB,CAEhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../../src/client/multipart.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;A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AC,CAAC;IAE5D,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEzD,OAAO;QACL,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BodyPart, MultipartRequestBody, RawHttpHeadersInput } from \"../interfaces.js\";\nimport { RestError } from \"../restError.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport { stringToUint8Array } from \"../util/bytesEncoding.js\";\nimport { isBinaryBody } from \"../util/typeGuards.js\";\n\n/**\n * Describes a single part in a multipart body.\n */\nexport interface PartDescriptor {\n /**\n * Content type of this part. If set, this value will be used to set the Content-Type MIME header for this part, although explicitly\n * setting the Content-Type header in the headers bag will override this value. If set to `null`, no content type will be inferred from\n * the body field. Otherwise, the value of the Content-Type MIME header will be inferred based on the type of the body.\n */\n contentType?: string | null;\n\n /**\n * The disposition type of this part (for example, \"form-data\" for parts making up a multipart/form-data request). If set, this value\n * will be used to set the Content-Disposition MIME header for this part, in addition to the `name` and `filename` properties.\n * If the `name` or `filename` properties are set while `dispositionType` is left undefined, `dispositionType` will default to \"form-data\".\n *\n * Explicitly setting the Content-Disposition header in the headers bag will override this value.\n */\n dispositionType?: string;\n\n /**\n * The field name associated with this part. This value will be used to construct the Content-Disposition header,\n * along with the `dispositionType` and `filename` properties, if the header has not been set in the `headers` bag.\n */\n name?: string;\n\n /**\n * The file name of the content if it is a file. This value will be used to construct the Content-Disposition header,\n * along with the `dispositionType` and `name` properties, if the header has not been set in the `headers` bag.\n */\n filename?: string;\n\n /**\n * The multipart headers for this part of the multipart body. Values of the Content-Type and Content-Disposition headers set in the headers bag\n * will take precedence over those computed from the request body or the contentType, dispositionType, name, and filename fields on this object.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The body of this part of the multipart request.\n */\n body?: unknown;\n}\n\ntype MultipartBodyType = BodyPart[\"body\"];\n\ntype HeaderValue = RawHttpHeadersInput[string];\n\n/**\n * Get value of a header in the part descriptor ignoring case\n */\nfunction getHeaderValue(descriptor: PartDescriptor, headerName: string): HeaderValue | undefined {\n if (descriptor.headers) {\n const actualHeaderName = Object.keys(descriptor.headers).find(\n (x) => x.toLowerCase() === headerName.toLowerCase(),\n );\n if (actualHeaderName) {\n return descriptor.headers[actualHeaderName];\n }\n }\n\n return undefined;\n}\n\nfunction getPartContentType(descriptor: PartDescriptor): HeaderValue | undefined {\n const contentTypeHeader = getHeaderValue(descriptor, \"content-type\");\n if (contentTypeHeader) {\n return contentTypeHeader;\n }\n\n // Special value of null means content type is to be omitted\n if (descriptor.contentType === null) {\n return undefined;\n }\n\n if (descriptor.contentType) {\n return descriptor.contentType;\n }\n\n const { body } = descriptor;\n\n if (body === null || body === undefined) {\n return undefined;\n }\n\n if (typeof body === \"string\" || typeof body === \"number\" || typeof body === \"boolean\") {\n return \"text/plain; charset=UTF-8\";\n }\n\n if (body instanceof Blob) {\n return body.type || \"application/octet-stream\";\n }\n\n if (isBinaryBody(body)) {\n return \"application/octet-stream\";\n }\n\n // arbitrary non-text object -> generic JSON content type by default. We will try to JSON.stringify the body.\n return \"application/json; charset=UTF-8\";\n}\n\n/**\n * Enclose value in quotes and escape special characters, for use in the Content-Disposition header\n */\nfunction escapeDispositionField(value: string): string {\n return JSON.stringify(value);\n}\n\nfunction getContentDisposition(descriptor: PartDescriptor): HeaderValue | undefined {\n const contentDispositionHeader = getHeaderValue(descriptor, \"content-disposition\");\n if (contentDispositionHeader) {\n return contentDispositionHeader;\n }\n\n if (\n descriptor.dispositionType === undefined &&\n descriptor.name === undefined &&\n descriptor.filename === undefined\n ) {\n return undefined;\n }\n\n const dispositionType = descriptor.dispositionType ?? \"form-data\";\n\n let disposition = dispositionType;\n if (descriptor.name) {\n disposition += `; name=${escapeDispositionField(descriptor.name)}`;\n }\n\n let filename: string | undefined = undefined;\n if (descriptor.filename) {\n filename = descriptor.filename;\n } else if (typeof File !== \"undefined\" && descriptor.body instanceof File) {\n const filenameFromFile = (descriptor.body as File).name;\n if (filenameFromFile !== \"\") {\n filename = filenameFromFile;\n }\n }\n\n if (filename) {\n disposition += `; filename=${escapeDispositionField(filename)}`;\n }\n\n return disposition;\n}\n\nfunction normalizeBody(body?: unknown, contentType?: HeaderValue): MultipartBodyType {\n if (body === undefined) {\n // zero-length body\n return new Uint8Array([]);\n }\n\n // binary and primitives should go straight on the wire regardless of content type\n if (isBinaryBody(body)) {\n return body;\n }\n if (typeof body === \"string\" || typeof body === \"number\" || typeof body === \"boolean\") {\n return stringToUint8Array(String(body), \"utf-8\");\n }\n\n // stringify objects for JSON-ish content types e.g. application/json, application/merge-patch+json, application/vnd.oci.manifest.v1+json, application.json; charset=UTF-8\n if (contentType && /application\\/(.+\\+)?json(;.+)?/i.test(String(contentType))) {\n return stringToUint8Array(JSON.stringify(body), \"utf-8\");\n }\n\n throw new RestError(`Unsupported body/content-type combination: ${body}, ${contentType}`);\n}\n\nexport function buildBodyPart(descriptor: PartDescriptor): BodyPart {\n const contentType = getPartContentType(descriptor);\n const contentDisposition = getContentDisposition(descriptor);\n const headers = createHttpHeaders(descriptor.headers ?? {});\n\n if (contentType) {\n headers.set(\"content-type\", contentType);\n }\n if (contentDisposition) {\n headers.set(\"content-disposition\", contentDisposition);\n }\n\n const body = normalizeBody(descriptor.body, contentType);\n\n return {\n headers,\n body,\n };\n}\n\nexport function buildMultipartBody(parts: PartDescriptor[]): MultipartRequestBody {\n return { parts: parts.map(buildBodyPart) };\n}\n"]}
1
+ {"version":3,"file":"multipart.js","sourceRoot":"","sources":["../../../src/client/multipart.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAkDrD;;GAEG;AACH,SAAS,cAAc,CAAC,UAA0B,EAAE,UAAkB;IACpE,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACvB,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAC3D,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,WAAW,EAAE,CACpD,CAAC;QACF,IAAI,gBAAgB,EAAE,CAAC;YACrB,OAAO,UAAU,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,kBAAkB,CAAC,UAA0B;IACpD,MAAM,iBAAiB,GAAG,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACrE,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,4DAA4D;IAC5D,IAAI,UAAU,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;QAC3B,OAAO,UAAU,CAAC,WAAW,CAAC;IAChC,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;IAE5B,I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Aa,CAAC,UAA0B;;IACtD,MAAM,WAAW,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC7D,MAAM,OAAO,GAAG,iBAAiB,CAAC,MAAA,UAAU,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAC;IAE5D,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEzD,OAAO;QACL,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BodyPart, MultipartRequestBody, RawHttpHeadersInput } from \"../interfaces.js\";\nimport { RestError } from \"../restError.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport { stringToUint8Array } from \"../util/bytesEncoding.js\";\nimport { isBinaryBody } from \"../util/typeGuards.js\";\n\n/**\n * Describes a single part in a multipart body.\n */\nexport interface PartDescriptor {\n /**\n * Content type of this part. If set, this value will be used to set the Content-Type MIME header for this part, although explicitly\n * setting the Content-Type header in the headers bag will override this value. If set to `null`, no content type will be inferred from\n * the body field. Otherwise, the value of the Content-Type MIME header will be inferred based on the type of the body.\n */\n contentType?: string | null;\n\n /**\n * The disposition type of this part (for example, \"form-data\" for parts making up a multipart/form-data request). If set, this value\n * will be used to set the Content-Disposition MIME header for this part, in addition to the `name` and `filename` properties.\n * If the `name` or `filename` properties are set while `dispositionType` is left undefined, `dispositionType` will default to \"form-data\".\n *\n * Explicitly setting the Content-Disposition header in the headers bag will override this value.\n */\n dispositionType?: string;\n\n /**\n * The field name associated with this part. This value will be used to construct the Content-Disposition header,\n * along with the `dispositionType` and `filename` properties, if the header has not been set in the `headers` bag.\n */\n name?: string;\n\n /**\n * The file name of the content if it is a file. This value will be used to construct the Content-Disposition header,\n * along with the `dispositionType` and `name` properties, if the header has not been set in the `headers` bag.\n */\n filename?: string;\n\n /**\n * The multipart headers for this part of the multipart body. Values of the Content-Type and Content-Disposition headers set in the headers bag\n * will take precedence over those computed from the request body or the contentType, dispositionType, name, and filename fields on this object.\n */\n headers?: RawHttpHeadersInput;\n\n /**\n * The body of this part of the multipart request.\n */\n body?: unknown;\n}\n\ntype MultipartBodyType = BodyPart[\"body\"];\n\ntype HeaderValue = RawHttpHeadersInput[string];\n\n/**\n * Get value of a header in the part descriptor ignoring case\n */\nfunction getHeaderValue(descriptor: PartDescriptor, headerName: string): HeaderValue | undefined {\n if (descriptor.headers) {\n const actualHeaderName = Object.keys(descriptor.headers).find(\n (x) => x.toLowerCase() === headerName.toLowerCase(),\n );\n if (actualHeaderName) {\n return descriptor.headers[actualHeaderName];\n }\n }\n\n return undefined;\n}\n\nfunction getPartContentType(descriptor: PartDescriptor): HeaderValue | undefined {\n const contentTypeHeader = getHeaderValue(descriptor, \"content-type\");\n if (contentTypeHeader) {\n return contentTypeHeader;\n }\n\n // Special value of null means content type is to be omitted\n if (descriptor.contentType === null) {\n return undefined;\n }\n\n if (descriptor.contentType) {\n return descriptor.contentType;\n }\n\n const { body } = descriptor;\n\n if (body === null || body === undefined) {\n return undefined;\n }\n\n if (typeof body === \"string\" || typeof body === \"number\" || typeof body === \"boolean\") {\n return \"text/plain; charset=UTF-8\";\n }\n\n if (body instanceof Blob) {\n return body.type || \"application/octet-stream\";\n }\n\n if (isBinaryBody(body)) {\n return \"application/octet-stream\";\n }\n\n // arbitrary non-text object -> generic JSON content type by default. We will try to JSON.stringify the body.\n return \"application/json; charset=UTF-8\";\n}\n\n/**\n * Enclose value in quotes and escape special characters, for use in the Content-Disposition header\n */\nfunction escapeDispositionField(value: string): string {\n return JSON.stringify(value);\n}\n\nfunction getContentDisposition(descriptor: PartDescriptor): HeaderValue | undefined {\n const contentDispositionHeader = getHeaderValue(descriptor, \"content-disposition\");\n if (contentDispositionHeader) {\n return contentDispositionHeader;\n }\n\n if (\n descriptor.dispositionType === undefined &&\n descriptor.name === undefined &&\n descriptor.filename === undefined\n ) {\n return undefined;\n }\n\n const dispositionType = descriptor.dispositionType ?? \"form-data\";\n\n let disposition = dispositionType;\n if (descriptor.name) {\n disposition += `; name=${escapeDispositionField(descriptor.name)}`;\n }\n\n let filename: string | undefined = undefined;\n if (descriptor.filename) {\n filename = descriptor.filename;\n } else if (typeof File !== \"undefined\" && descriptor.body instanceof File) {\n const filenameFromFile = (descriptor.body as File).name;\n if (filenameFromFile !== \"\") {\n filename = filenameFromFile;\n }\n }\n\n if (filename) {\n disposition += `; filename=${escapeDispositionField(filename)}`;\n }\n\n return disposition;\n}\n\nfunction normalizeBody(body?: unknown, contentType?: HeaderValue): MultipartBodyType {\n if (body === undefined) {\n // zero-length body\n return new Uint8Array([]);\n }\n\n // binary and primitives should go straight on the wire regardless of content type\n if (isBinaryBody(body)) {\n return body;\n }\n if (typeof body === \"string\" || typeof body === \"number\" || typeof body === \"boolean\") {\n return stringToUint8Array(String(body), \"utf-8\");\n }\n\n // stringify objects for JSON-ish content types e.g. application/json, application/merge-patch+json, application/vnd.oci.manifest.v1+json, application.json; charset=UTF-8\n if (contentType && /application\\/(.+\\+)?json(;.+)?/i.test(String(contentType))) {\n return stringToUint8Array(JSON.stringify(body), \"utf-8\");\n }\n\n throw new RestError(`Unsupported body/content-type combination: ${body}, ${contentType}`);\n}\n\nexport function buildBodyPart(descriptor: PartDescriptor): BodyPart {\n const contentType = getPartContentType(descriptor);\n const contentDisposition = getContentDisposition(descriptor);\n const headers = createHttpHeaders(descriptor.headers ?? {});\n\n if (contentType) {\n headers.set(\"content-type\", contentType);\n }\n if (contentDisposition) {\n headers.set(\"content-disposition\", contentDisposition);\n }\n\n const body = normalizeBody(descriptor.body, contentType);\n\n return {\n headers,\n body,\n };\n}\n\nexport function buildMultipartBody(parts: PartDescriptor[]): MultipartRequestBody {\n return { parts: parts.map(buildBodyPart) };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { OperationOptions, RequestParameters } from "./common.js";
1
+ import type { OperationOptions, RequestParameters } from "./common.js";
2
2
  /**
3
3
  * Helper function to convert OperationOptions to RequestParameters
4
4
  * @param options - the options that are used by Modular layer to send the request
@@ -1 +1 @@
1
- {"version":3,"file":"operationOptionHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/operationOptionHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAElE;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAYhG"}
1
+ {"version":3,"file":"operationOptionHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/operationOptionHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEvE;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAYhG"}
@@ -1 +1 @@
1
- {"version":3,"file":"operationOptionHelpers.js","sourceRoot":"","sources":["../../../src/client/operationOptionHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;;GAIG;AACH,MAAM,UAAU,mCAAmC,CAAC,OAAyB;;IAC3E,OAAO;QACL,uBAAuB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,uBAAuB;QACxE,OAAO,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO;QACxC,eAAe,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,eAAe;QACxD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,gBAAgB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,gBAAgB;QAC1D,kBAAkB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,kBAAkB;QAC9D,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,OAAO,oBAAO,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,CAAE;QAC/C,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { OperationOptions, RequestParameters } from \"./common.js\";\n\n/**\n * Helper function to convert OperationOptions to RequestParameters\n * @param options - the options that are used by Modular layer to send the request\n * @returns the result of the conversion in RequestParameters of RLC layer\n */\nexport function operationOptionsToRequestParameters(options: OperationOptions): RequestParameters {\n return {\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n timeout: options.requestOptions?.timeout,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n abortSignal: options.abortSignal,\n onUploadProgress: options.requestOptions?.onUploadProgress,\n onDownloadProgress: options.requestOptions?.onDownloadProgress,\n tracingOptions: options.tracingOptions,\n headers: { ...options.requestOptions?.headers },\n onResponse: options.onResponse,\n };\n}\n"]}
1
+ {"version":3,"file":"operationOptionHelpers.js","sourceRoot":"","sources":["../../../src/client/operationOptionHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;;;GAIG;AACH,MAAM,UAAU,mCAAmC,CAAC,OAAyB;;IAC3E,OAAO;QACL,uBAAuB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,uBAAuB;QACxE,OAAO,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO;QACxC,eAAe,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,eAAe;QACxD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,gBAAgB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,gBAAgB;QAC1D,kBAAkB,EAAE,MAAA,OAAO,CAAC,cAAc,0CAAE,kBAAkB;QAC9D,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,OAAO,oBAAO,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,CAAE;QAC/C,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OperationOptions, RequestParameters } from \"./common.js\";\n\n/**\n * Helper function to convert OperationOptions to RequestParameters\n * @param options - the options that are used by Modular layer to send the request\n * @returns the result of the conversion in RequestParameters of RLC layer\n */\nexport function operationOptionsToRequestParameters(options: OperationOptions): RequestParameters {\n return {\n allowInsecureConnection: options.requestOptions?.allowInsecureConnection,\n timeout: options.requestOptions?.timeout,\n skipUrlEncoding: options.requestOptions?.skipUrlEncoding,\n abortSignal: options.abortSignal,\n onUploadProgress: options.requestOptions?.onUploadProgress,\n onDownloadProgress: options.requestOptions?.onDownloadProgress,\n tracingOptions: options.tracingOptions,\n headers: { ...options.requestOptions?.headers },\n onResponse: options.onResponse,\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { RestError } from "../restError.js";
2
- import { PathUncheckedResponse } from "./common.js";
2
+ import type { PathUncheckedResponse } from "./common.js";
3
3
  /**
4
4
  * Creates a rest error from a PathUnchecked response
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"restError.d.ts","sourceRoot":"","sources":["../../../src/client/restError.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;AAC5E;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"restError.d.ts","sourceRoot":"","sources":["../../../src/client/restError.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;AAC5E;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"restError.js","sourceRoot":"","sources":["../../../src/client/restError.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAWtD,MAAM,UAAU,eAAe,CAC7B,iBAAiD,EACjD,QAAgC;;IAEhC,MAAM,IAAI,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC;IACnF,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC;IACnD,MAAM,OAAO,GACX,OAAO,iBAAiB,KAAK,QAAQ;QACnC,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,CAAC,MAAA,aAAa,CAAC,OAAO,mCAAI,2BAA2B,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1E,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE;QAC5B,UAAU,EAAE,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3C,IAAI,EAAE,aAAa,CAAC,IAAI;QACxB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;KACnC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,kBAAkB,CAAC,QAA+B;;IACzD,OAAO;QACL,OAAO,EAAE,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC5C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,MAAM,EAAE,MAAA,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,mCAAI,CAAC,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE3C,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PipelineResponse } from \"../interfaces.js\";\nimport { RestError } from \"../restError.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport { PathUncheckedResponse } from \"./common.js\";\n\n/**\n * Creates a rest error from a PathUnchecked response\n */\nexport function createRestError(response: PathUncheckedResponse): RestError;\n/**\n * Creates a rest error from an error message and a PathUnchecked response\n */\nexport function createRestError(message: string, response: PathUncheckedResponse): RestError;\nexport function createRestError(\n messageOrResponse: string | PathUncheckedResponse,\n response?: PathUncheckedResponse,\n): RestError {\n const resp = typeof messageOrResponse === \"string\" ? response! : messageOrResponse;\n const internalError = resp.body.error || resp.body;\n const message =\n typeof messageOrResponse === \"string\"\n ? messageOrResponse\n : (internalError.message ?? `Unexpected status code: ${resp.status}`);\n return new RestError(message, {\n statusCode: statusCodeToNumber(resp.status),\n code: internalError.code,\n request: resp.request,\n response: toPipelineResponse(resp),\n });\n}\n\nfunction toPipelineResponse(response: PathUncheckedResponse): PipelineResponse {\n return {\n headers: createHttpHeaders(response.headers),\n request: response.request,\n status: statusCodeToNumber(response.status) ?? -1,\n };\n}\n\nfunction statusCodeToNumber(statusCode: string): number | undefined {\n const status = Number.parseInt(statusCode);\n\n return Number.isNaN(status) ? undefined : status;\n}\n"]}
1
+ {"version":3,"file":"restError.js","sourceRoot":"","sources":["../../../src/client/restError.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAWtD,MAAM,UAAU,eAAe,CAC7B,iBAAiD,EACjD,QAAgC;;IAEhC,MAAM,IAAI,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC;IACnF,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC;IACnD,MAAM,OAAO,GACX,OAAO,iBAAiB,KAAK,QAAQ;QACnC,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,CAAC,MAAA,aAAa,CAAC,OAAO,mCAAI,2BAA2B,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1E,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE;QAC5B,UAAU,EAAE,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3C,IAAI,EAAE,aAAa,CAAC,IAAI;QACxB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;KACnC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,kBAAkB,CAAC,QAA+B;;IACzD,OAAO;QACL,OAAO,EAAE,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC5C,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,MAAM,EAAE,MAAA,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,mCAAI,CAAC,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE3C,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PipelineResponse } from \"../interfaces.js\";\nimport { RestError } from \"../restError.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport type { PathUncheckedResponse } from \"./common.js\";\n\n/**\n * Creates a rest error from a PathUnchecked response\n */\nexport function createRestError(response: PathUncheckedResponse): RestError;\n/**\n * Creates a rest error from an error message and a PathUnchecked response\n */\nexport function createRestError(message: string, response: PathUncheckedResponse): RestError;\nexport function createRestError(\n messageOrResponse: string | PathUncheckedResponse,\n response?: PathUncheckedResponse,\n): RestError {\n const resp = typeof messageOrResponse === \"string\" ? response! : messageOrResponse;\n const internalError = resp.body.error || resp.body;\n const message =\n typeof messageOrResponse === \"string\"\n ? messageOrResponse\n : (internalError.message ?? `Unexpected status code: ${resp.status}`);\n return new RestError(message, {\n statusCode: statusCodeToNumber(resp.status),\n code: internalError.code,\n request: resp.request,\n response: toPipelineResponse(resp),\n });\n}\n\nfunction toPipelineResponse(response: PathUncheckedResponse): PipelineResponse {\n return {\n headers: createHttpHeaders(response.headers),\n request: response.request,\n status: statusCodeToNumber(response.status) ?? -1,\n };\n}\n\nfunction statusCodeToNumber(statusCode: string): number | undefined {\n const status = Number.parseInt(statusCode);\n\n return Number.isNaN(status) ? undefined : status;\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { HttpClient, HttpMethods } from "../interfaces.js";
2
- import { Pipeline } from "../pipeline.js";
3
- import { HttpResponse, RequestParameters } from "./common.js";
1
+ import type { HttpClient, HttpMethods } from "../interfaces.js";
2
+ import type { Pipeline } from "../pipeline.js";
3
+ import type { HttpResponse, RequestParameters } from "./common.js";
4
4
  /**
5
5
  * Helper function to send request used by the client
6
6
  * @param method - method to use to send the request
@@ -1 +1 @@
1
- {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../../src/client/sendRequest.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,WAAW,EAKZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK1C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG9D;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,yBAA8B,EACvC,gBAAgB,CAAC,EAAE,UAAU,GAC5B,OAAO,CAAC,YAAY,CAAC,CAgCvB;AAuCD,MAAM,WAAW,yBAA0B,SAAQ,iBAAiB;IAClE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
1
+ {"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../../src/client/sendRequest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EAKZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAInE;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,yBAA8B,EACvC,gBAAgB,CAAC,EAAE,UAAU,GAC5B,OAAO,CAAC,YAAY,CAAC,CAgCvB;AAuCD,MAAM,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,GAAG,CAAC,IAAI,mCAAI,SAAS,CAAC,WAAW,CAAC;IAClD,OAAO,IAAI,SAAS,CAAC,GAAG,EAAE;QACxB,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,QAAQ,CAAC,MAAM;QAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n HttpClient,\n HttpMethods,\n MultipartRequestBody,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n} from \"../interfaces.js\";\nimport { isRestError, RestError } from \"../restError.js\";\nimport { Pipeline } from \"../pipeline.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport { createPipelineRequest } from \"../pipelineRequest.js\";\nimport { getCachedDefaultHttpsClient } from \"./clientHelpers.js\";\nimport { isReadableStream } from \"../util/typeGuards.js\";\nimport { HttpResponse, RequestParameters } from \"./common.js\";\nimport { PartDescriptor, buildMultipartBody } from \"./multipart.js\";\n\n/**\n * Helper function to send request used by the client\n * @param method - method to use to send the request\n * @param url - url to send the request to\n * @param pipeline - pipeline with the policies to run when sending the request\n * @param options - request options\n * @param customHttpClient - a custom HttpClient to use when making the request\n * @returns returns and HttpResponse\n */\nexport async function sendRequest(\n method: HttpMethods,\n url: string,\n pipeline: Pipeline,\n options: InternalRequestParameters = {},\n customHttpClient?: HttpClient,\n): Promise<HttpResponse> {\n const httpClient = customHttpClient ?? getCachedDefaultHttpsClient();\n const request = buildPipelineRequest(method, url, options);\n\n try {\n const response = await pipeline.sendRequest(httpClient, request);\n const headers = response.headers.toJSON();\n const stream = response.readableStreamBody ?? response.browserStreamBody;\n const parsedBody =\n options.responseAsStream || stream !== undefined ? undefined : getResponseBody(response);\n const body = stream ?? parsedBody;\n\n if (options?.onResponse) {\n options.onResponse({ ...response, request, rawHeaders: headers, parsedBody });\n }\n\n return {\n request,\n headers,\n status: `${response.status}`,\n body,\n };\n } catch (e: unknown) {\n if (isRestError(e) && e.response && options.onResponse) {\n const { response } = e;\n const rawHeaders = response.headers.toJSON();\n // UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError property\n options?.onResponse({ ...response, request, rawHeaders }, e);\n }\n\n throw e;\n }\n}\n\n/**\n * Function to determine the request content type\n * @param options - request options InternalRequestParameters\n * @returns returns the content-type\n */\nfunction getRequestContentType(options: InternalRequestParameters = {}): string {\n return (\n options.contentType ??\n (options.headers?.[\"content-type\"] as string) ??\n getContentType(options.body)\n );\n}\n\n/**\n * Function to determine the content-type of a body\n * this is used if an explicit content-type is not provided\n * @param body - body in the request\n * @returns returns the content-type\n */\nfunction getContentType(body: any): string | undefined {\n if (ArrayBuffer.isView(body)) {\n return \"application/octet-stream\";\n }\n\n if (typeof body === \"string\") {\n try {\n JSON.parse(body);\n return \"application/json; charset=UTF-8\";\n } catch (error: any) {\n // If we fail to parse the body, it is not json\n return undefined;\n }\n }\n // By default return json\n return \"application/json; charset=UTF-8\";\n}\n\nexport interface InternalRequestParameters extends RequestParameters {\n responseAsStream?: boolean;\n}\n\nfunction buildPipelineRequest(\n method: HttpMethods,\n url: string,\n options: InternalRequestParameters = {},\n): PipelineRequest {\n const requestContentType = getRequestContentType(options);\n const { body, multipartBody } = getRequestBody(options.body, requestContentType);\n const hasContent = body !== undefined || multipartBody !== undefined;\n\n const headers = createHttpHeaders({\n ...(options.headers ? options.headers : {}),\n accept: options.accept ?? options.headers?.accept ?? \"application/json\",\n ...(hasContent &&\n requestContentType && {\n \"content-type\": requestContentType,\n }),\n });\n\n return createPipelineRequest({\n url,\n method,\n body,\n multipartBody,\n headers,\n allowInsecureConnection: options.allowInsecureConnection,\n tracingOptions: options.tracingOptions,\n abortSignal: options.abortSignal,\n onUploadProgress: options.onUploadProgress,\n onDownloadProgress: options.onDownloadProgress,\n timeout: options.timeout,\n enableBrowserStreams: true,\n streamResponseStatusCodes: options.responseAsStream\n ? new Set([Number.POSITIVE_INFINITY])\n : undefined,\n });\n}\n\ninterface RequestBody {\n body?: RequestBodyType;\n multipartBody?: MultipartRequestBody;\n}\n\n/**\n * Prepares the body before sending the request\n */\nfunction getRequestBody(body?: unknown, contentType: string = \"\"): RequestBody {\n if (body === undefined) {\n return { body: undefined };\n }\n\n if (typeof FormData !== \"undefined\" && body instanceof FormData) {\n return { body };\n }\n\n if (isReadableStream(body)) {\n return { body };\n }\n\n if (ArrayBuffer.isView(body)) {\n return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };\n }\n\n const firstType = contentType.split(\";\")[0];\n\n switch (firstType) {\n case \"application/json\":\n return { body: JSON.stringify(body) };\n case \"multipart/form-data\":\n if (Array.isArray(body)) {\n return { multipartBody: buildMultipartBody(body as PartDescriptor[]) };\n }\n return { body: JSON.stringify(body) };\n case \"text/plain\":\n return { body: String(body) };\n default:\n if (typeof body === \"string\") {\n return { body };\n }\n return { body: JSON.stringify(body) };\n }\n}\n\n/**\n * Prepares the response body\n */\nfunction getResponseBody(response: PipelineResponse): RequestBodyType | undefined {\n // Set the default response type\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n const firstType = contentType.split(\";\")[0];\n const bodyToParse = response.bodyAsText ?? \"\";\n\n if (firstType === \"text/plain\") {\n return String(bodyToParse);\n }\n // Default to \"application/json\" and fallback to string;\n try {\n return bodyToParse ? JSON.parse(bodyToParse) : undefined;\n } catch (error: any) {\n // If we were supposed to get a JSON object and failed to\n // parse, throw a parse error\n if (firstType === \"application/json\") {\n throw createParseError(response, error);\n }\n\n // We are not sure how to handle the response so we return it as\n // plain text.\n return String(bodyToParse);\n }\n}\n\nfunction createParseError(response: PipelineResponse, err: any): RestError {\n const msg = `Error \"${err}\" occurred while parsing the response body - ${response.bodyAsText}.`;\n const errCode = err.code ?? RestError.PARSE_ERROR;\n return new RestError(msg, {\n code: errCode,\n statusCode: response.status,\n request: response.request,\n response: response,\n });\n}\n"]}
1
+ {"version":3,"file":"sendRequest.js","sourceRoot":"","sources":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QAAQ,CAAC,MAAM;QAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,QAAQ,EAAE,QAAQ;KACnB,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n HttpClient,\n HttpMethods,\n MultipartRequestBody,\n PipelineRequest,\n PipelineResponse,\n RequestBodyType,\n} from \"../interfaces.js\";\nimport { isRestError, RestError } from \"../restError.js\";\nimport type { Pipeline } from \"../pipeline.js\";\nimport { createHttpHeaders } from \"../httpHeaders.js\";\nimport { createPipelineRequest } from \"../pipelineRequest.js\";\nimport { getCachedDefaultHttpsClient } from \"./clientHelpers.js\";\nimport { isReadableStream } from \"../util/typeGuards.js\";\nimport type { HttpResponse, RequestParameters } from \"./common.js\";\nimport type { PartDescriptor } from \"./multipart.js\";\nimport { buildMultipartBody } from \"./multipart.js\";\n\n/**\n * Helper function to send request used by the client\n * @param method - method to use to send the request\n * @param url - url to send the request to\n * @param pipeline - pipeline with the policies to run when sending the request\n * @param options - request options\n * @param customHttpClient - a custom HttpClient to use when making the request\n * @returns returns and HttpResponse\n */\nexport async function sendRequest(\n method: HttpMethods,\n url: string,\n pipeline: Pipeline,\n options: InternalRequestParameters = {},\n customHttpClient?: HttpClient,\n): Promise<HttpResponse> {\n const httpClient = customHttpClient ?? getCachedDefaultHttpsClient();\n const request = buildPipelineRequest(method, url, options);\n\n try {\n const response = await pipeline.sendRequest(httpClient, request);\n const headers = response.headers.toJSON();\n const stream = response.readableStreamBody ?? response.browserStreamBody;\n const parsedBody =\n options.responseAsStream || stream !== undefined ? undefined : getResponseBody(response);\n const body = stream ?? parsedBody;\n\n if (options?.onResponse) {\n options.onResponse({ ...response, request, rawHeaders: headers, parsedBody });\n }\n\n return {\n request,\n headers,\n status: `${response.status}`,\n body,\n };\n } catch (e: unknown) {\n if (isRestError(e) && e.response && options.onResponse) {\n const { response } = e;\n const rawHeaders = response.headers.toJSON();\n // UNBRANDED DIFFERENCE: onResponse callback does not have a second __legacyError property\n options?.onResponse({ ...response, request, rawHeaders }, e);\n }\n\n throw e;\n }\n}\n\n/**\n * Function to determine the request content type\n * @param options - request options InternalRequestParameters\n * @returns returns the content-type\n */\nfunction getRequestContentType(options: InternalRequestParameters = {}): string {\n return (\n options.contentType ??\n (options.headers?.[\"content-type\"] as string) ??\n getContentType(options.body)\n );\n}\n\n/**\n * Function to determine the content-type of a body\n * this is used if an explicit content-type is not provided\n * @param body - body in the request\n * @returns returns the content-type\n */\nfunction getContentType(body: any): string | undefined {\n if (ArrayBuffer.isView(body)) {\n return \"application/octet-stream\";\n }\n\n if (typeof body === \"string\") {\n try {\n JSON.parse(body);\n return \"application/json; charset=UTF-8\";\n } catch (error: any) {\n // If we fail to parse the body, it is not json\n return undefined;\n }\n }\n // By default return json\n return \"application/json; charset=UTF-8\";\n}\n\nexport interface InternalRequestParameters extends RequestParameters {\n responseAsStream?: boolean;\n}\n\nfunction buildPipelineRequest(\n method: HttpMethods,\n url: string,\n options: InternalRequestParameters = {},\n): PipelineRequest {\n const requestContentType = getRequestContentType(options);\n const { body, multipartBody } = getRequestBody(options.body, requestContentType);\n const hasContent = body !== undefined || multipartBody !== undefined;\n\n const headers = createHttpHeaders({\n ...(options.headers ? options.headers : {}),\n accept: options.accept ?? options.headers?.accept ?? \"application/json\",\n ...(hasContent &&\n requestContentType && {\n \"content-type\": requestContentType,\n }),\n });\n\n return createPipelineRequest({\n url,\n method,\n body,\n multipartBody,\n headers,\n allowInsecureConnection: options.allowInsecureConnection,\n tracingOptions: options.tracingOptions,\n abortSignal: options.abortSignal,\n onUploadProgress: options.onUploadProgress,\n onDownloadProgress: options.onDownloadProgress,\n timeout: options.timeout,\n enableBrowserStreams: true,\n streamResponseStatusCodes: options.responseAsStream\n ? new Set([Number.POSITIVE_INFINITY])\n : undefined,\n });\n}\n\ninterface RequestBody {\n body?: RequestBodyType;\n multipartBody?: MultipartRequestBody;\n}\n\n/**\n * Prepares the body before sending the request\n */\nfunction getRequestBody(body?: unknown, contentType: string = \"\"): RequestBody {\n if (body === undefined) {\n return { body: undefined };\n }\n\n if (typeof FormData !== \"undefined\" && body instanceof FormData) {\n return { body };\n }\n\n if (isReadableStream(body)) {\n return { body };\n }\n\n if (ArrayBuffer.isView(body)) {\n return { body: body instanceof Uint8Array ? body : JSON.stringify(body) };\n }\n\n const firstType = contentType.split(\";\")[0];\n\n switch (firstType) {\n case \"application/json\":\n return { body: JSON.stringify(body) };\n case \"multipart/form-data\":\n if (Array.isArray(body)) {\n return { multipartBody: buildMultipartBody(body as PartDescriptor[]) };\n }\n return { body: JSON.stringify(body) };\n case \"text/plain\":\n return { body: String(body) };\n default:\n if (typeof body === \"string\") {\n return { body };\n }\n return { body: JSON.stringify(body) };\n }\n}\n\n/**\n * Prepares the response body\n */\nfunction getResponseBody(response: PipelineResponse): RequestBodyType | undefined {\n // Set the default response type\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n const firstType = contentType.split(\";\")[0];\n const bodyToParse = response.bodyAsText ?? \"\";\n\n if (firstType === \"text/plain\") {\n return String(bodyToParse);\n }\n // Default to \"application/json\" and fallback to string;\n try {\n return bodyToParse ? JSON.parse(bodyToParse) : undefined;\n } catch (error: any) {\n // If we were supposed to get a JSON object and failed to\n // parse, throw a parse error\n if (firstType === \"application/json\") {\n throw createParseError(response, error);\n }\n\n // We are not sure how to handle the response so we return it as\n // plain text.\n return String(bodyToParse);\n }\n}\n\nfunction createParseError(response: PipelineResponse, err: any): RestError {\n const msg = `Error \"${err}\" occurred while parsing the response body - ${response.bodyAsText}.`;\n const errCode = err.code ?? RestError.PARSE_ERROR;\n return new RestError(msg, {\n code: errCode,\n statusCode: response.status,\n request: response.request,\n response: response,\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { PathParameterWithOptions, RequestParameters } from "./common.js";
1
+ import type { PathParameterWithOptions, RequestParameters } from "./common.js";
2
2
  /**
3
3
  * Builds the request url, filling in query and path parameters
4
4
  * @param endpoint - base url which can be a template url