@typespec/ts-http-runtime 0.3.4-alpha.20260302.3 → 0.3.4

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 (295) hide show
  1. package/dist/browser/client/sendRequest.d.ts +10 -1
  2. package/dist/browser/client/sendRequest.js +8 -2
  3. package/dist/browser/client/sendRequest.js.map +1 -1
  4. package/dist/browser/defaultHttpClient.d.ts +1 -1
  5. package/dist/browser/defaultHttpClient.js +1 -1
  6. package/dist/browser/defaultHttpClient.js.map +1 -0
  7. package/dist/browser/index.d.ts +2 -2
  8. package/dist/browser/index.js +0 -2
  9. package/dist/browser/index.js.map +1 -1
  10. package/dist/browser/logger/log.d.ts +1 -1
  11. package/dist/browser/logger/log.js +1 -1
  12. package/dist/browser/logger/log.js.map +1 -0
  13. package/dist/browser/pipelineRequest.d.ts +1 -1
  14. package/dist/browser/pipelineRequest.js.map +1 -1
  15. package/dist/browser/policies/decompressResponsePolicy.d.ts +3 -2
  16. package/dist/browser/policies/decompressResponsePolicy.js +1 -4
  17. package/dist/browser/policies/decompressResponsePolicy.js.map +1 -0
  18. package/dist/browser/policies/internal.d.ts +7 -7
  19. package/dist/browser/policies/internal.js +2 -2
  20. package/dist/browser/policies/internal.js.map +1 -1
  21. package/dist/browser/policies/proxyPolicy.common.d.ts +7 -3
  22. package/dist/browser/policies/proxyPolicy.common.js +2 -2
  23. package/dist/browser/policies/proxyPolicy.common.js.map +1 -1
  24. package/dist/browser/policies/proxyPolicy.d.ts +1 -1
  25. package/dist/browser/policies/proxyPolicy.js +1 -1
  26. package/dist/browser/policies/proxyPolicy.js.map +1 -0
  27. package/dist/browser/policies/redirectPolicy.d.ts +7 -0
  28. package/dist/browser/policies/redirectPolicy.js +13 -4
  29. package/dist/browser/policies/redirectPolicy.js.map +1 -1
  30. package/dist/browser/util/bytesEncoding.d.ts +1 -1
  31. package/dist/browser/util/bytesEncoding.js +1 -1
  32. package/dist/browser/util/bytesEncoding.js.map +1 -0
  33. package/dist/browser/util/concat.common.d.ts +1 -2
  34. package/dist/browser/util/concat.common.js.map +1 -1
  35. package/dist/browser/util/concat.d.ts +1 -1
  36. package/dist/browser/util/concat.js +1 -1
  37. package/dist/browser/util/concat.js.map +1 -0
  38. package/dist/browser/util/inspect.d.ts +1 -1
  39. package/dist/browser/util/inspect.js +1 -1
  40. package/dist/browser/util/inspect.js.map +1 -0
  41. package/dist/browser/util/sha256.d.ts +1 -1
  42. package/dist/browser/util/sha256.js +1 -1
  43. package/dist/browser/util/sha256.js.map +1 -0
  44. package/dist/browser/util/userAgentPlatform.d.ts +1 -1
  45. package/dist/browser/util/userAgentPlatform.js +1 -1
  46. package/dist/browser/util/userAgentPlatform.js.map +1 -0
  47. package/dist/browser/util/uuidUtils.d.ts +1 -1
  48. package/dist/browser/util/uuidUtils.js +1 -1
  49. package/dist/browser/util/uuidUtils.js.map +1 -0
  50. package/dist/commonjs/abort-controller/AbortError.js +30 -40
  51. package/dist/commonjs/abort-controller/AbortError.js.map +7 -1
  52. package/dist/commonjs/auth/credentials.js +36 -25
  53. package/dist/commonjs/auth/credentials.js.map +7 -1
  54. package/dist/commonjs/auth/oauth2Flows.js +15 -5
  55. package/dist/commonjs/auth/oauth2Flows.js.map +7 -1
  56. package/dist/commonjs/auth/schemes.js +15 -5
  57. package/dist/commonjs/auth/schemes.js.map +7 -1
  58. package/dist/commonjs/client/apiVersionPolicy.js +39 -25
  59. package/dist/commonjs/client/apiVersionPolicy.js.map +7 -1
  60. package/dist/commonjs/client/clientHelpers.js +62 -39
  61. package/dist/commonjs/client/clientHelpers.js.map +7 -1
  62. package/dist/commonjs/client/common.js +15 -5
  63. package/dist/commonjs/client/common.js.map +7 -1
  64. package/dist/commonjs/client/getClient.js +170 -82
  65. package/dist/commonjs/client/getClient.js.map +7 -1
  66. package/dist/commonjs/client/multipart.js +119 -110
  67. package/dist/commonjs/client/multipart.js.map +7 -1
  68. package/dist/commonjs/client/operationOptionHelpers.js +36 -21
  69. package/dist/commonjs/client/operationOptionHelpers.js.map +7 -1
  70. package/dist/commonjs/client/restError.js +44 -26
  71. package/dist/commonjs/client/restError.js.map +7 -1
  72. package/dist/commonjs/client/sendRequest.d.ts +10 -1
  73. package/dist/commonjs/client/sendRequest.js +150 -164
  74. package/dist/commonjs/client/sendRequest.js.map +7 -1
  75. package/dist/commonjs/client/urlHelpers.js +124 -131
  76. package/dist/commonjs/client/urlHelpers.js.map +7 -1
  77. package/dist/commonjs/constants.js +30 -8
  78. package/dist/commonjs/constants.js.map +7 -1
  79. package/dist/commonjs/createPipelineFromOptions.js +56 -45
  80. package/dist/commonjs/createPipelineFromOptions.js.map +7 -1
  81. package/dist/commonjs/defaultHttpClient.js +28 -11
  82. package/dist/commonjs/defaultHttpClient.js.map +7 -1
  83. package/dist/commonjs/fetchHttpClient.js +211 -256
  84. package/dist/commonjs/fetchHttpClient.js.map +7 -1
  85. package/dist/commonjs/httpHeaders.js +97 -82
  86. package/dist/commonjs/httpHeaders.js.map +7 -1
  87. package/dist/commonjs/index.d.ts +2 -2
  88. package/dist/commonjs/index.js +67 -36
  89. package/dist/commonjs/index.js.map +7 -1
  90. package/dist/commonjs/interfaces.js +15 -5
  91. package/dist/commonjs/interfaces.js.map +7 -1
  92. package/dist/commonjs/log.js +28 -8
  93. package/dist/commonjs/log.js.map +7 -1
  94. package/dist/commonjs/logger/debug.js +150 -155
  95. package/dist/commonjs/logger/debug.js.map +7 -1
  96. package/dist/commonjs/logger/internal.js +27 -8
  97. package/dist/commonjs/logger/internal.js.map +7 -1
  98. package/dist/commonjs/logger/log.common.js +39 -23
  99. package/dist/commonjs/logger/log.common.js.map +7 -1
  100. package/dist/commonjs/logger/log.js +40 -11
  101. package/dist/commonjs/logger/log.js.map +7 -1
  102. package/dist/commonjs/logger/logger.js +120 -110
  103. package/dist/commonjs/logger/logger.js.map +7 -1
  104. package/dist/commonjs/nodeHttpClient.js +313 -321
  105. package/dist/commonjs/nodeHttpClient.js.map +7 -1
  106. package/dist/commonjs/pipeline.js +190 -247
  107. package/dist/commonjs/pipeline.js.map +7 -1
  108. package/dist/commonjs/pipelineRequest.d.ts +1 -1
  109. package/dist/commonjs/pipelineRequest.js +69 -54
  110. package/dist/commonjs/pipelineRequest.js.map +7 -1
  111. package/dist/commonjs/policies/agentPolicy.js +38 -24
  112. package/dist/commonjs/policies/agentPolicy.js.map +7 -1
  113. package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js +45 -32
  114. package/dist/commonjs/policies/auth/apiKeyAuthenticationPolicy.js.map +7 -1
  115. package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js +50 -32
  116. package/dist/commonjs/policies/auth/basicAuthenticationPolicy.js.map +7 -1
  117. package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js +47 -32
  118. package/dist/commonjs/policies/auth/bearerAuthenticationPolicy.js.map +7 -1
  119. package/dist/commonjs/policies/auth/checkInsecureConnection.js +47 -44
  120. package/dist/commonjs/policies/auth/checkInsecureConnection.js.map +7 -1
  121. package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js +45 -32
  122. package/dist/commonjs/policies/auth/oauth2AuthenticationPolicy.js.map +7 -1
  123. package/dist/commonjs/policies/decompressResponsePolicy.js +38 -25
  124. package/dist/commonjs/policies/decompressResponsePolicy.js.map +7 -1
  125. package/dist/commonjs/policies/defaultRetryPolicy.js +39 -27
  126. package/dist/commonjs/policies/defaultRetryPolicy.js.map +7 -1
  127. package/dist/commonjs/policies/exponentialRetryPolicy.js +43 -26
  128. package/dist/commonjs/policies/exponentialRetryPolicy.js.map +7 -1
  129. package/dist/commonjs/policies/formDataPolicy.js +101 -90
  130. package/dist/commonjs/policies/formDataPolicy.js.map +7 -1
  131. package/dist/commonjs/policies/internal.d.ts +7 -7
  132. package/dist/commonjs/policies/internal.js +94 -48
  133. package/dist/commonjs/policies/internal.js.map +7 -1
  134. package/dist/commonjs/policies/logPolicy.js +49 -35
  135. package/dist/commonjs/policies/logPolicy.js.map +7 -1
  136. package/dist/commonjs/policies/multipartPolicy.js +117 -99
  137. package/dist/commonjs/policies/multipartPolicy.js.map +7 -1
  138. package/dist/commonjs/policies/proxyPolicy.common.d.ts +7 -3
  139. package/dist/commonjs/policies/proxyPolicy.common.js +38 -25
  140. package/dist/commonjs/policies/proxyPolicy.common.js.map +7 -1
  141. package/dist/commonjs/policies/proxyPolicy.js +160 -171
  142. package/dist/commonjs/policies/proxyPolicy.js.map +7 -1
  143. package/dist/commonjs/policies/redirectPolicy.d.ts +7 -0
  144. package/dist/commonjs/policies/redirectPolicy.js +62 -51
  145. package/dist/commonjs/policies/redirectPolicy.js.map +7 -1
  146. package/dist/commonjs/policies/retryPolicy.js +123 -105
  147. package/dist/commonjs/policies/retryPolicy.js.map +7 -1
  148. package/dist/commonjs/policies/systemErrorRetryPolicy.js +46 -31
  149. package/dist/commonjs/policies/systemErrorRetryPolicy.js.map +7 -1
  150. package/dist/commonjs/policies/throttlingRetryPolicy.js +38 -30
  151. package/dist/commonjs/policies/throttlingRetryPolicy.js.map +7 -1
  152. package/dist/commonjs/policies/tlsPolicy.js +38 -24
  153. package/dist/commonjs/policies/tlsPolicy.js.map +7 -1
  154. package/dist/commonjs/policies/userAgentPolicy.js +41 -28
  155. package/dist/commonjs/policies/userAgentPolicy.js.map +7 -1
  156. package/dist/commonjs/restError.js +93 -90
  157. package/dist/commonjs/restError.js.map +7 -1
  158. package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js +63 -62
  159. package/dist/commonjs/retryStrategies/exponentialRetryStrategy.js.map +7 -1
  160. package/dist/commonjs/retryStrategies/retryStrategy.js +15 -5
  161. package/dist/commonjs/retryStrategies/retryStrategy.js.map +7 -1
  162. package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js +58 -69
  163. package/dist/commonjs/retryStrategies/throttlingRetryStrategy.js.map +7 -1
  164. package/dist/commonjs/util/arrayBuffer.js +34 -21
  165. package/dist/commonjs/util/arrayBuffer.js.map +7 -1
  166. package/dist/commonjs/util/bytesEncoding.common.js +83 -100
  167. package/dist/commonjs/util/bytesEncoding.common.js.map +7 -1
  168. package/dist/commonjs/util/bytesEncoding.js +30 -21
  169. package/dist/commonjs/util/bytesEncoding.js.map +7 -1
  170. package/dist/commonjs/util/checkEnvironment.js +45 -44
  171. package/dist/commonjs/util/checkEnvironment.js.map +7 -1
  172. package/dist/commonjs/util/concat.common.d.ts +1 -2
  173. package/dist/commonjs/util/concat.common.js +51 -52
  174. package/dist/commonjs/util/concat.common.js.map +7 -1
  175. package/dist/commonjs/util/concat.js +70 -61
  176. package/dist/commonjs/util/concat.js.map +7 -1
  177. package/dist/commonjs/util/delay.js +31 -21
  178. package/dist/commonjs/util/delay.js.map +7 -1
  179. package/dist/commonjs/util/error.js +33 -17
  180. package/dist/commonjs/util/error.js.map +7 -1
  181. package/dist/commonjs/util/helpers.js +65 -57
  182. package/dist/commonjs/util/helpers.js.map +7 -1
  183. package/dist/commonjs/util/inspect.common.js +27 -7
  184. package/dist/commonjs/util/inspect.common.js.map +7 -1
  185. package/dist/commonjs/util/inspect.js +28 -8
  186. package/dist/commonjs/util/inspect.js.map +7 -1
  187. package/dist/commonjs/util/internal.js +67 -32
  188. package/dist/commonjs/util/internal.js.map +7 -1
  189. package/dist/commonjs/util/object.js +27 -15
  190. package/dist/commonjs/util/object.js.map +7 -1
  191. package/dist/commonjs/util/random.js +30 -22
  192. package/dist/commonjs/util/random.js.map +7 -1
  193. package/dist/commonjs/util/sanitizer.js +157 -148
  194. package/dist/commonjs/util/sanitizer.js.map +7 -1
  195. package/dist/commonjs/util/sha256.common.js +61 -45
  196. package/dist/commonjs/util/sha256.common.js.map +7 -1
  197. package/dist/commonjs/util/sha256.js +32 -22
  198. package/dist/commonjs/util/sha256.js.map +7 -1
  199. package/dist/commonjs/util/typeGuards.js +41 -21
  200. package/dist/commonjs/util/typeGuards.js.map +7 -1
  201. package/dist/commonjs/util/userAgent.js +43 -28
  202. package/dist/commonjs/util/userAgent.js.map +7 -1
  203. package/dist/commonjs/util/userAgentPlatform.js +51 -29
  204. package/dist/commonjs/util/userAgentPlatform.js.map +7 -1
  205. package/dist/commonjs/util/uuidUtils.common.js +43 -39
  206. package/dist/commonjs/util/uuidUtils.common.js.map +7 -1
  207. package/dist/commonjs/util/uuidUtils.js +27 -12
  208. package/dist/commonjs/util/uuidUtils.js.map +7 -1
  209. package/dist/commonjs/xhrHttpClient.js +171 -163
  210. package/dist/commonjs/xhrHttpClient.js.map +7 -1
  211. package/dist/esm/client/sendRequest.d.ts +10 -1
  212. package/dist/esm/client/sendRequest.js +8 -2
  213. package/dist/esm/client/sendRequest.js.map +1 -1
  214. package/dist/esm/index.d.ts +2 -2
  215. package/dist/esm/index.js +0 -2
  216. package/dist/esm/index.js.map +1 -1
  217. package/dist/esm/pipelineRequest.d.ts +1 -1
  218. package/dist/esm/pipelineRequest.js.map +1 -1
  219. package/dist/esm/policies/internal.d.ts +7 -7
  220. package/dist/esm/policies/internal.js +2 -2
  221. package/dist/esm/policies/internal.js.map +1 -1
  222. package/dist/esm/policies/proxyPolicy.common.d.ts +7 -3
  223. package/dist/esm/policies/proxyPolicy.common.js +2 -2
  224. package/dist/esm/policies/proxyPolicy.common.js.map +1 -1
  225. package/dist/esm/policies/redirectPolicy.d.ts +7 -0
  226. package/dist/esm/policies/redirectPolicy.js +13 -4
  227. package/dist/esm/policies/redirectPolicy.js.map +1 -1
  228. package/dist/esm/util/concat.common.d.ts +1 -2
  229. package/dist/esm/util/concat.common.js.map +1 -1
  230. package/dist/react-native/client/sendRequest.d.ts +10 -1
  231. package/dist/react-native/client/sendRequest.js +8 -2
  232. package/dist/react-native/client/sendRequest.js.map +1 -1
  233. package/dist/react-native/defaultHttpClient.d.ts +1 -1
  234. package/dist/react-native/defaultHttpClient.js +1 -1
  235. package/dist/react-native/defaultHttpClient.js.map +1 -0
  236. package/dist/react-native/index.d.ts +2 -2
  237. package/dist/react-native/index.js +0 -2
  238. package/dist/react-native/index.js.map +1 -1
  239. package/dist/react-native/logger/log.d.ts +1 -1
  240. package/dist/react-native/logger/log.js +1 -1
  241. package/dist/react-native/logger/log.js.map +1 -0
  242. package/dist/react-native/pipelineRequest.d.ts +1 -1
  243. package/dist/react-native/pipelineRequest.js.map +1 -1
  244. package/dist/react-native/policies/internal.d.ts +7 -7
  245. package/dist/react-native/policies/internal.js +2 -2
  246. package/dist/react-native/policies/internal.js.map +1 -1
  247. package/dist/react-native/policies/proxyPolicy.common.d.ts +7 -3
  248. package/dist/react-native/policies/proxyPolicy.common.js +2 -2
  249. package/dist/react-native/policies/proxyPolicy.common.js.map +1 -1
  250. package/dist/react-native/policies/proxyPolicy.d.ts +1 -1
  251. package/dist/react-native/policies/proxyPolicy.js +1 -1
  252. package/dist/react-native/policies/proxyPolicy.js.map +1 -0
  253. package/dist/react-native/policies/redirectPolicy.d.ts +7 -0
  254. package/dist/react-native/policies/redirectPolicy.js +13 -4
  255. package/dist/react-native/policies/redirectPolicy.js.map +1 -1
  256. package/dist/react-native/util/bytesEncoding.d.ts +1 -1
  257. package/dist/react-native/util/bytesEncoding.js +1 -1
  258. package/dist/react-native/util/bytesEncoding.js.map +1 -0
  259. package/dist/react-native/util/concat.common.d.ts +1 -2
  260. package/dist/react-native/util/concat.common.js.map +1 -1
  261. package/dist/react-native/util/concat.d.ts +1 -1
  262. package/dist/react-native/util/concat.js +1 -1
  263. package/dist/react-native/util/concat.js.map +1 -0
  264. package/dist/react-native/util/inspect.d.ts +1 -1
  265. package/dist/react-native/util/inspect.js +1 -1
  266. package/dist/react-native/util/inspect.js.map +1 -0
  267. package/dist/react-native/util/sha256.d.ts +1 -1
  268. package/dist/react-native/util/sha256.js +1 -1
  269. package/dist/react-native/util/sha256.js.map +1 -0
  270. package/dist/react-native/util/userAgentPlatform.d.ts +1 -1
  271. package/dist/react-native/util/userAgentPlatform.js +1 -1
  272. package/dist/react-native/util/userAgentPlatform.js.map +1 -0
  273. package/dist/react-native/util/uuidUtils.d.ts +1 -1
  274. package/dist/react-native/util/uuidUtils.js +1 -1
  275. package/dist/react-native/util/uuidUtils.js.map +1 -0
  276. package/package.json +3 -23
  277. package/dist/browser/defaultHttpClient-browser.mjs.map +0 -1
  278. package/dist/browser/logger/log-browser.mjs.map +0 -1
  279. package/dist/browser/policies/decompressResponsePolicy-browser.mjs.map +0 -1
  280. package/dist/browser/policies/proxyPolicy-browser.mjs.map +0 -1
  281. package/dist/browser/util/bytesEncoding-browser.mjs.map +0 -1
  282. package/dist/browser/util/concat-browser.mjs.map +0 -1
  283. package/dist/browser/util/inspect-browser.mjs.map +0 -1
  284. package/dist/browser/util/sha256-browser.mjs.map +0 -1
  285. package/dist/browser/util/userAgentPlatform-browser.mjs.map +0 -1
  286. package/dist/browser/util/uuidUtils-browser.mjs.map +0 -1
  287. package/dist/react-native/defaultHttpClient-react-native.mjs.map +0 -1
  288. package/dist/react-native/logger/log-react-native.mjs.map +0 -1
  289. package/dist/react-native/policies/proxyPolicy-react-native.mjs.map +0 -1
  290. package/dist/react-native/util/bytesEncoding-react-native.mjs.map +0 -1
  291. package/dist/react-native/util/concat-react-native.mjs.map +0 -1
  292. package/dist/react-native/util/inspect-react-native.mjs.map +0 -1
  293. package/dist/react-native/util/sha256-react-native.mjs.map +0 -1
  294. package/dist/react-native/util/userAgentPlatform-react-native.mjs.map +0 -1
  295. package/dist/react-native/util/uuidUtils-react-native.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../../src/util/sha256.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./sha256.common.js\";\n"]}
@@ -6,4 +6,4 @@ export declare function getHeaderName(): string;
6
6
  * @internal
7
7
  */
8
8
  export declare function setPlatformSpecificData(map: Map<string, string>): Promise<void>;
9
- //# sourceMappingURL=userAgentPlatform-browser.d.mts.map
9
+ //# sourceMappingURL=userAgentPlatform.d.ts.map
@@ -58,4 +58,4 @@ export async function setPlatformSpecificData(map) {
58
58
  map.set("EdgeRuntime", `${globalThis.EdgeRuntime} (${osInfo})`);
59
59
  }
60
60
  }
61
- //# sourceMappingURL=userAgentPlatform-browser.mjs.map
61
+ //# sourceMappingURL=userAgentPlatform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userAgentPlatform.js","sourceRoot":"","sources":["../../../src/util/userAgentPlatform.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAgCD,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,cAAc,GAAG;QACrB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,EAAE;QAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,2BAA2B,EAAE;KACvD,CAAC;IAEF,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAsB;IACnD,MAAM,UAAU,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACrF,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;QACzD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,GAAwB;IACpE,MAAM,cAAc,GAAG,UAAU,CAAC,SAAwB,CAAC;IAC3D,IAAI,MAAM,GAAG,SAAS,CAAC;IACvB,IAAI,cAAc,EAAE,aAAa,EAAE,CAAC;QAClC,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,aAAa,CAAC,oBAAoB,CAAC;YAC5E,cAAc;YACd,iBAAiB;SAClB,CAAC,CAAC;QACH,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,IAAI,aAAa,CAAC,eAAe,KAAK,aAAa,CAAC,YAAY,EAAE,CAAC;QAErG,4BAA4B;QAC5B,MAAM,KAAK,GAAG,qBAAqB,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;SAAM,IAAI,cAAc,EAAE,QAAQ,EAAE,CAAC;QACpC,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC;QACjC,MAAM,KAAK,GAAG,cAAc,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,GAAG,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,UAAU,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACtD,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,UAAU,CAAC,WAAW,KAAK,MAAM,GAAG,CAAC,CAAC;IAClE,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n */\nexport function getHeaderName(): string {\n return \"x-ms-useragent\";\n}\n\ninterface BrowserBrand {\n brand: string;\n version: string;\n}\n\ninterface NavigatorEx extends Navigator {\n userAgentData?: {\n brands: BrowserBrand[];\n mobile: boolean;\n platform?: string;\n getHighEntropyValues: (hints: string[]) => Promise<{\n architecture: string;\n bitness: string;\n brands: BrowserBrand[];\n formFactor: string;\n fullVersionList: BrowserBrand[];\n mobile: boolean;\n model: string;\n platform: string;\n platformVersion: string;\n wow64: boolean;\n }>;\n };\n}\n\ndeclare const globalThis: {\n navigator?: NavigatorEx;\n EdgeRuntime?: unknown;\n};\n\nfunction getBrowserInfo(userAgent: string): BrowserBrand | undefined {\n const browserRegexes = [\n { name: \"Firefox\", regex: /Firefox\\/([\\d.]+)/ },\n { name: \"Safari\", regex: /Version\\/([\\d.]+).*Safari/ },\n ];\n\n for (const browser of browserRegexes) {\n const match = userAgent.match(browser.regex);\n if (match) {\n return { brand: browser.name, version: match[1] };\n }\n }\n\n return undefined;\n}\n\nfunction getBrandVersionString(brands: BrowserBrand[]): BrowserBrand | undefined {\n const brandOrder = [\"Google Chrome\", \"Microsoft Edge\", \"Opera\", \"Brave\", \"Chromium\"];\n for (const brand of brandOrder) {\n const foundBrand = brands.find((b) => b.brand === brand);\n if (foundBrand) {\n return foundBrand;\n }\n }\n return undefined;\n}\n\n/**\n * @internal\n */\nexport async function setPlatformSpecificData(map: Map<string, string>): Promise<void> {\n const localNavigator = globalThis.navigator as NavigatorEx;\n let osInfo = \"unknown\";\n if (localNavigator?.userAgentData) {\n const entropyValues = await localNavigator.userAgentData.getHighEntropyValues([\n \"architecture\",\n \"platformVersion\",\n ]);\n osInfo = `${entropyValues.platform} ${entropyValues.platformVersion}; ${entropyValues.architecture}`;\n\n // Get the brand and version\n const brand = getBrandVersionString(localNavigator.userAgentData.brands);\n if (brand) {\n map.set(brand.brand, `${brand.version} (${osInfo})`);\n }\n } else if (localNavigator?.platform) {\n osInfo = localNavigator.platform;\n const brand = getBrowserInfo(localNavigator.userAgent);\n if (brand) {\n map.set(brand.brand, `${brand.version} (${osInfo})`);\n }\n } else if (typeof globalThis.EdgeRuntime === \"string\") {\n map.set(\"EdgeRuntime\", `${globalThis.EdgeRuntime} (${osInfo})`);\n }\n}\n"]}
@@ -4,4 +4,4 @@
4
4
  * @returns RFC4122 v4 UUID.
5
5
  */
6
6
  export declare function randomUUID(): string;
7
- //# sourceMappingURL=uuidUtils-browser.d.mts.map
7
+ //# sourceMappingURL=uuidUtils.d.ts.map
@@ -13,4 +13,4 @@ const uuidFunction = typeof globalThis?.crypto?.randomUUID === "function"
13
13
  export function randomUUID() {
14
14
  return uuidFunction();
15
15
  }
16
- //# sourceMappingURL=uuidUtils-browser.mjs.map
16
+ //# sourceMappingURL=uuidUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuidUtils.js","sourceRoot":"","sources":["../../../src/util/uuidUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAUrD,gEAAgE;AAChE,MAAM,YAAY,GAChB,OAAO,UAAU,EAAE,MAAM,EAAE,UAAU,KAAK,UAAU;IAClD,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;IACtD,CAAC,CAAC,YAAY,CAAC;AAEnB;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,YAAY,EAAE,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { generateUUID } from \"./uuidUtils.common.js\";\n\ninterface Crypto {\n randomUUID(): string;\n}\n\ndeclare const globalThis: {\n crypto: Crypto;\n};\n\n// NOTE: This could be undefined if not used in a secure context\nconst uuidFunction =\n typeof globalThis?.crypto?.randomUUID === \"function\"\n ? globalThis.crypto.randomUUID.bind(globalThis.crypto)\n : generateUUID;\n\n/**\n * Generated Universally Unique Identifier\n *\n * @returns RFC4122 v4 UUID.\n */\nexport function randomUUID(): string {\n return uuidFunction();\n}\n"]}
@@ -1,42 +1,32 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.AbortError = void 0;
6
- /**
7
- * This error is thrown when an asynchronous operation has been aborted.
8
- * Check for this error by testing the `name` that the name property of the
9
- * error matches `"AbortError"`.
10
- *
11
- * @example
12
- * ```ts snippet:ReadmeSampleAbortError
13
- * import { AbortError } from "@typespec/ts-http-runtime";
14
- *
15
- * async function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {
16
- * if (options.abortSignal.aborted) {
17
- * throw new AbortError();
18
- * }
19
- *
20
- * // do async work
21
- * }
22
- *
23
- * const controller = new AbortController();
24
- * controller.abort();
25
- *
26
- * try {
27
- * doAsyncWork({ abortSignal: controller.signal });
28
- * } catch (e) {
29
- * if (e instanceof Error && e.name === "AbortError") {
30
- * // handle abort error here.
31
- * }
32
- * }
33
- * ```
34
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var AbortError_exports = {};
19
+ __export(AbortError_exports, {
20
+ AbortError: () => AbortError
21
+ });
22
+ module.exports = __toCommonJS(AbortError_exports);
35
23
  class AbortError extends Error {
36
- constructor(message) {
37
- super(message);
38
- this.name = "AbortError";
39
- }
24
+ constructor(message) {
25
+ super(message);
26
+ this.name = "AbortError";
27
+ }
40
28
  }
41
- exports.AbortError = AbortError;
42
- //# sourceMappingURL=AbortError.js.map
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ AbortError
32
+ });
@@ -1 +1,7 @@
1
- {"version":3,"file":"AbortError.js","sourceRoot":"","sources":["../../../src/abort-controller/AbortError.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAa,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AALD,gCAKC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This error is thrown when an asynchronous operation has been aborted.\n * Check for this error by testing the `name` that the name property of the\n * error matches `\"AbortError\"`.\n *\n * @example\n * ```ts snippet:ReadmeSampleAbortError\n * import { AbortError } from \"@typespec/ts-http-runtime\";\n *\n * async function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {\n * if (options.abortSignal.aborted) {\n * throw new AbortError();\n * }\n *\n * // do async work\n * }\n *\n * const controller = new AbortController();\n * controller.abort();\n *\n * try {\n * doAsyncWork({ abortSignal: controller.signal });\n * } catch (e) {\n * if (e instanceof Error && e.name === \"AbortError\") {\n * // handle abort error here.\n * }\n * }\n * ```\n */\nexport class AbortError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"AbortError\";\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/abort-controller/AbortError.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This error is thrown when an asynchronous operation has been aborted.\n * Check for this error by testing the `name` that the name property of the\n * error matches `\"AbortError\"`.\n *\n * @example\n * ```ts snippet:ReadmeSampleAbortError\n * import { AbortError } from \"@typespec/ts-http-runtime\";\n *\n * async function doAsyncWork(options: { abortSignal: AbortSignal }): Promise<void> {\n * if (options.abortSignal.aborted) {\n * throw new AbortError();\n * }\n *\n * // do async work\n * }\n *\n * const controller = new AbortController();\n * controller.abort();\n *\n * try {\n * doAsyncWork({ abortSignal: controller.signal });\n * } catch (e) {\n * if (e instanceof Error && e.name === \"AbortError\") {\n * // handle abort error here.\n * }\n * }\n * ```\n */\nexport class AbortError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"AbortError\";\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCO,MAAM,mBAAmB,MAAM;AAAA,EACpC,YAAY,SAAkB;AAC5B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;",
6
+ "names": []
7
+ }
@@ -1,33 +1,44 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.isOAuth2TokenCredential = isOAuth2TokenCredential;
6
- exports.isBearerTokenCredential = isBearerTokenCredential;
7
- exports.isBasicCredential = isBasicCredential;
8
- exports.isApiKeyCredential = isApiKeyCredential;
9
- /**
10
- * Type guard to check if a credential is an OAuth2 token credential.
11
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var credentials_exports = {};
19
+ __export(credentials_exports, {
20
+ isApiKeyCredential: () => isApiKeyCredential,
21
+ isBasicCredential: () => isBasicCredential,
22
+ isBearerTokenCredential: () => isBearerTokenCredential,
23
+ isOAuth2TokenCredential: () => isOAuth2TokenCredential
24
+ });
25
+ module.exports = __toCommonJS(credentials_exports);
12
26
  function isOAuth2TokenCredential(credential) {
13
- return "getOAuth2Token" in credential;
27
+ return "getOAuth2Token" in credential;
14
28
  }
15
- /**
16
- * Type guard to check if a credential is a Bearer token credential.
17
- */
18
29
  function isBearerTokenCredential(credential) {
19
- return "getBearerToken" in credential;
30
+ return "getBearerToken" in credential;
20
31
  }
21
- /**
22
- * Type guard to check if a credential is a Basic auth credential.
23
- */
24
32
  function isBasicCredential(credential) {
25
- return "username" in credential && "password" in credential;
33
+ return "username" in credential && "password" in credential;
26
34
  }
27
- /**
28
- * Type guard to check if a credential is an API key credential.
29
- */
30
35
  function isApiKeyCredential(credential) {
31
- return "key" in credential;
36
+ return "key" in credential;
32
37
  }
33
- //# sourceMappingURL=credentials.js.map
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ isApiKeyCredential,
41
+ isBasicCredential,
42
+ isBearerTokenCredential,
43
+ isOAuth2TokenCredential
44
+ });
@@ -1 +1,7 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/auth/credentials.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA6ElC,0DAIC;AAKD,0DAIC;AAKD,8CAEC;AAKD,gDAEC;AA9BD;;GAEG;AACH,SAAgB,uBAAuB,CACrC,UAA4B;IAE5B,OAAO,gBAAgB,IAAI,UAAU,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB,CACrC,UAA4B;IAE5B,OAAO,gBAAgB,IAAI,UAAU,CAAC;AACxC,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,UAA4B;IAC5D,OAAO,UAAU,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC;AAC9D,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,UAA4B;IAC7D,OAAO,KAAK,IAAI,UAAU,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Options used when creating and sending get OAuth 2 requests for this operation.\n */\nexport interface GetOAuth2TokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Options used when creating and sending get bearer token requests for this operation.\n */\nexport interface GetBearerTokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Credential for OAuth2 authentication flows.\n */\nexport interface OAuth2TokenCredential<TFlows extends OAuth2Flow> {\n /**\n * Gets an OAuth2 token for the specified flows.\n * @param flows - The OAuth2 flows to use.\n * @param options - Options for the request.\n * @returns - a valid access token which was obtained through one of the flows specified in `flows`.\n */\n getOAuth2Token(flows: TFlows[], options?: GetOAuth2TokenOptions): Promise<string>;\n}\n\n/**\n * Credential for Bearer token authentication.\n */\nexport interface BearerTokenCredential {\n /**\n * Gets a Bearer token for the specified flows.\n * @param options - Options for the request.\n * @returns - a valid access token.\n */\n getBearerToken(options?: GetBearerTokenOptions): Promise<string>;\n}\n\n/**\n * Credential for HTTP Basic authentication.\n * Provides username and password for basic authentication headers.\n */\nexport interface BasicCredential {\n /** The username for basic authentication. */\n username: string;\n /** The password for basic authentication. */\n password: string;\n}\n\n/**\n * Credential for API Key authentication.\n * Provides an API key that will be used in the request headers.\n */\nexport interface ApiKeyCredential {\n /** The API key for authentication. */\n key: string;\n}\n\n/**\n * Union type of all supported authentication credentials.\n */\nexport type ClientCredential =\n | OAuth2TokenCredential<OAuth2Flow>\n | BearerTokenCredential\n | BasicCredential\n | ApiKeyCredential;\n\n/**\n * Type guard to check if a credential is an OAuth2 token credential.\n */\nexport function isOAuth2TokenCredential(\n credential: ClientCredential,\n): credential is OAuth2TokenCredential<OAuth2Flow> {\n return \"getOAuth2Token\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Bearer token credential.\n */\nexport function isBearerTokenCredential(\n credential: ClientCredential,\n): credential is BearerTokenCredential {\n return \"getBearerToken\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Basic auth credential.\n */\nexport function isBasicCredential(credential: ClientCredential): credential is BasicCredential {\n return \"username\" in credential && \"password\" in credential;\n}\n\n/**\n * Type guard to check if a credential is an API key credential.\n */\nexport function isApiKeyCredential(credential: ClientCredential): credential is ApiKeyCredential {\n return \"key\" in credential;\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/auth/credentials.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Options used when creating and sending get OAuth 2 requests for this operation.\n */\nexport interface GetOAuth2TokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Options used when creating and sending get bearer token requests for this operation.\n */\nexport interface GetBearerTokenOptions {\n /** Abort signal for the request */\n abortSignal?: AbortSignal;\n}\n\n/**\n * Credential for OAuth2 authentication flows.\n */\nexport interface OAuth2TokenCredential<TFlows extends OAuth2Flow> {\n /**\n * Gets an OAuth2 token for the specified flows.\n * @param flows - The OAuth2 flows to use.\n * @param options - Options for the request.\n * @returns - a valid access token which was obtained through one of the flows specified in `flows`.\n */\n getOAuth2Token(flows: TFlows[], options?: GetOAuth2TokenOptions): Promise<string>;\n}\n\n/**\n * Credential for Bearer token authentication.\n */\nexport interface BearerTokenCredential {\n /**\n * Gets a Bearer token for the specified flows.\n * @param options - Options for the request.\n * @returns - a valid access token.\n */\n getBearerToken(options?: GetBearerTokenOptions): Promise<string>;\n}\n\n/**\n * Credential for HTTP Basic authentication.\n * Provides username and password for basic authentication headers.\n */\nexport interface BasicCredential {\n /** The username for basic authentication. */\n username: string;\n /** The password for basic authentication. */\n password: string;\n}\n\n/**\n * Credential for API Key authentication.\n * Provides an API key that will be used in the request headers.\n */\nexport interface ApiKeyCredential {\n /** The API key for authentication. */\n key: string;\n}\n\n/**\n * Union type of all supported authentication credentials.\n */\nexport type ClientCredential =\n | OAuth2TokenCredential<OAuth2Flow>\n | BearerTokenCredential\n | BasicCredential\n | ApiKeyCredential;\n\n/**\n * Type guard to check if a credential is an OAuth2 token credential.\n */\nexport function isOAuth2TokenCredential(\n credential: ClientCredential,\n): credential is OAuth2TokenCredential<OAuth2Flow> {\n return \"getOAuth2Token\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Bearer token credential.\n */\nexport function isBearerTokenCredential(\n credential: ClientCredential,\n): credential is BearerTokenCredential {\n return \"getBearerToken\" in credential;\n}\n\n/**\n * Type guard to check if a credential is a Basic auth credential.\n */\nexport function isBasicCredential(credential: ClientCredential): credential is BasicCredential {\n return \"username\" in credential && \"password\" in credential;\n}\n\n/**\n * Type guard to check if a credential is an API key credential.\n */\nexport function isApiKeyCredential(credential: ClientCredential): credential is ApiKeyCredential {\n return \"key\" in credential;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8EO,SAAS,wBACd,YACiD;AACjD,SAAO,oBAAoB;AAC7B;AAKO,SAAS,wBACd,YACqC;AACrC,SAAO,oBAAoB;AAC7B;AAKO,SAAS,kBAAkB,YAA6D;AAC7F,SAAO,cAAc,cAAc,cAAc;AACnD;AAKO,SAAS,mBAAmB,YAA8D;AAC/F,SAAO,SAAS;AAClB;",
6
+ "names": []
7
+ }
@@ -1,5 +1,15 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=oauth2Flows.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var oauth2Flows_exports = {};
15
+ module.exports = __toCommonJS(oauth2Flows_exports);
@@ -1 +1,7 @@
1
- {"version":3,"file":"oauth2Flows.js","sourceRoot":"","sources":["../../../src/auth/oauth2Flows.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents OAuth2 Authorization Code flow configuration.\n */\nexport interface AuthorizationCodeFlow {\n /** Type of OAuth2 flow */\n kind: \"authorizationCode\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Client Credentials flow configuration.\n */\nexport interface ClientCredentialsFlow {\n /** Type of OAuth2 flow */\n kind: \"clientCredentials\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoints */\n refreshUrl?: string[];\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Implicit flow configuration.\n */\nexport interface ImplicitFlow {\n /** Type of OAuth2 flow */\n kind: \"implicit\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Password flow configuration.\n */\nexport interface PasswordFlow {\n /** Type of OAuth2 flow */\n kind: \"password\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/** Union type of all supported OAuth2 flows */\nexport type OAuth2Flow =\n | AuthorizationCodeFlow\n | ClientCredentialsFlow\n | ImplicitFlow\n | PasswordFlow;\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/auth/oauth2Flows.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Represents OAuth2 Authorization Code flow configuration.\n */\nexport interface AuthorizationCodeFlow {\n /** Type of OAuth2 flow */\n kind: \"authorizationCode\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Client Credentials flow configuration.\n */\nexport interface ClientCredentialsFlow {\n /** Type of OAuth2 flow */\n kind: \"clientCredentials\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoints */\n refreshUrl?: string[];\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Implicit flow configuration.\n */\nexport interface ImplicitFlow {\n /** Type of OAuth2 flow */\n kind: \"implicit\";\n /** Authorization endpoint */\n authorizationUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/**\n * Represents OAuth2 Password flow configuration.\n */\nexport interface PasswordFlow {\n /** Type of OAuth2 flow */\n kind: \"password\";\n /** Token endpoint */\n tokenUrl: string;\n /** Refresh token endpoint */\n refreshUrl?: string;\n /** OAuth2 scopes */\n scopes?: string[];\n}\n\n/** Union type of all supported OAuth2 flows */\nexport type OAuth2Flow =\n | AuthorizationCodeFlow\n | ClientCredentialsFlow\n | ImplicitFlow\n | PasswordFlow;\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,5 +1,15 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=schemes.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var schemes_exports = {};
15
+ module.exports = __toCommonJS(schemes_exports);
@@ -1 +1,7 @@
1
- {"version":3,"file":"schemes.js","sourceRoot":"","sources":["../../../src/auth/schemes.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Represents HTTP Basic authentication scheme.\n * Basic authentication scheme requires a username and password to be provided with each request.\n * The credentials are encoded using Base64 and included in the Authorization header.\n */\nexport interface BasicAuthScheme {\n /** Type of auth scheme */\n kind: \"http\";\n /** Basic authentication scheme */\n scheme: \"basic\";\n}\n\n/**\n * Represents HTTP Bearer authentication scheme.\n * Bearer authentication scheme requires a bearer token to be provided with each request.\n * The token is included in the Authorization header with the \"Bearer\" prefix.\n */\nexport interface BearerAuthScheme {\n /** Type of auth scheme */\n kind: \"http\";\n /** Bearer authentication scheme */\n scheme: \"bearer\";\n}\n\n/**\n * Represents an endpoint or operation that requires no authentication.\n */\nexport interface NoAuthAuthScheme {\n /** Type of auth scheme */\n kind: \"noAuth\";\n}\n\n/**\n * Represents API Key authentication scheme.\n * API Key authentication requires a key to be provided with each request.\n * The key can be provided in different locations: query parameter, header, or cookie.\n */\nexport interface ApiKeyAuthScheme {\n /** Type of auth scheme */\n kind: \"apiKey\";\n /** Location of the API key */\n apiKeyLocation: \"query\" | \"header\" | \"cookie\";\n /** Name of the API key parameter */\n name: string;\n}\n\n/** Represents OAuth2 authentication scheme with specified flows */\nexport interface OAuth2AuthScheme<TFlows extends OAuth2Flow[]> {\n /** Type of auth scheme */\n kind: \"oauth2\";\n /** Supported OAuth2 flows */\n flows: TFlows;\n}\n\n/** Union type of all supported authentication schemes */\nexport type AuthScheme =\n | BasicAuthScheme\n | BearerAuthScheme\n | NoAuthAuthScheme\n | ApiKeyAuthScheme\n | OAuth2AuthScheme<OAuth2Flow[]>;\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/auth/schemes.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { OAuth2Flow } from \"./oauth2Flows.js\";\n\n/**\n * Represents HTTP Basic authentication scheme.\n * Basic authentication scheme requires a username and password to be provided with each request.\n * The credentials are encoded using Base64 and included in the Authorization header.\n */\nexport interface BasicAuthScheme {\n /** Type of auth scheme */\n kind: \"http\";\n /** Basic authentication scheme */\n scheme: \"basic\";\n}\n\n/**\n * Represents HTTP Bearer authentication scheme.\n * Bearer authentication scheme requires a bearer token to be provided with each request.\n * The token is included in the Authorization header with the \"Bearer\" prefix.\n */\nexport interface BearerAuthScheme {\n /** Type of auth scheme */\n kind: \"http\";\n /** Bearer authentication scheme */\n scheme: \"bearer\";\n}\n\n/**\n * Represents an endpoint or operation that requires no authentication.\n */\nexport interface NoAuthAuthScheme {\n /** Type of auth scheme */\n kind: \"noAuth\";\n}\n\n/**\n * Represents API Key authentication scheme.\n * API Key authentication requires a key to be provided with each request.\n * The key can be provided in different locations: query parameter, header, or cookie.\n */\nexport interface ApiKeyAuthScheme {\n /** Type of auth scheme */\n kind: \"apiKey\";\n /** Location of the API key */\n apiKeyLocation: \"query\" | \"header\" | \"cookie\";\n /** Name of the API key parameter */\n name: string;\n}\n\n/** Represents OAuth2 authentication scheme with specified flows */\nexport interface OAuth2AuthScheme<TFlows extends OAuth2Flow[]> {\n /** Type of auth scheme */\n kind: \"oauth2\";\n /** Supported OAuth2 flows */\n flows: TFlows;\n}\n\n/** Union type of all supported authentication schemes */\nexport type AuthScheme =\n | BasicAuthScheme\n | BearerAuthScheme\n | NoAuthAuthScheme\n | ApiKeyAuthScheme\n | OAuth2AuthScheme<OAuth2Flow[]>;\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,27 +1,41 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.apiVersionPolicyName = void 0;
6
- exports.apiVersionPolicy = apiVersionPolicy;
7
- exports.apiVersionPolicyName = "ApiVersionPolicy";
8
- /**
9
- * Creates a policy that sets the apiVersion as a query parameter on every request
10
- * @param options - Client options
11
- * @returns Pipeline policy that sets the apiVersion as a query parameter on every request
12
- */
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var apiVersionPolicy_exports = {};
19
+ __export(apiVersionPolicy_exports, {
20
+ apiVersionPolicy: () => apiVersionPolicy,
21
+ apiVersionPolicyName: () => apiVersionPolicyName
22
+ });
23
+ module.exports = __toCommonJS(apiVersionPolicy_exports);
24
+ const apiVersionPolicyName = "ApiVersionPolicy";
13
25
  function apiVersionPolicy(options) {
14
- return {
15
- name: exports.apiVersionPolicyName,
16
- sendRequest: (req, next) => {
17
- // Use the apiVesion defined in request url directly
18
- // Append one if there is no apiVesion and we have one at client options
19
- const url = new URL(req.url);
20
- if (!url.searchParams.get("api-version") && options.apiVersion) {
21
- req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`;
22
- }
23
- return next(req);
24
- },
25
- };
26
+ return {
27
+ name: apiVersionPolicyName,
28
+ sendRequest: (req, next) => {
29
+ const url = new URL(req.url);
30
+ if (!url.searchParams.get("api-version") && options.apiVersion) {
31
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`;
32
+ }
33
+ return next(req);
34
+ }
35
+ };
26
36
  }
27
- //# sourceMappingURL=apiVersionPolicy.js.map
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ apiVersionPolicy,
40
+ apiVersionPolicyName
41
+ });
@@ -1 +1,7 @@
1
- {"version":3,"file":"apiVersionPolicy.js","sourceRoot":"","sources":["../../../src/client/apiVersionPolicy.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAYlC,4CAgBC;AAvBY,QAAA,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAsB;IACrD,OAAO;QACL,IAAI,EAAE,4BAAoB;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
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/client/apiVersionPolicy.ts"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,MAAM,uBAAuB;AAO7B,SAAS,iBAAiB,SAAwC;AACvE,SAAO;AAAA,IACL,MAAM;AAAA,IACN,aAAa,CAAC,KAAK,SAAS;AAG1B,YAAM,MAAM,IAAI,IAAI,IAAI,GAAG;AAC3B,UAAI,CAAC,IAAI,aAAa,IAAI,aAAa,KAAK,QAAQ,YAAY;AAC9D,YAAI,MAAM,GAAG,IAAI,GAAG,GAClB,MAAM,KAAK,IAAI,aAAa,KAAK,CAAC,EAAE,SAAS,IAAI,MAAM,GACzD,eAAe,QAAQ,UAAU;AAAA,MACnC;AAEA,aAAO,KAAK,GAAG;AAAA,IACjB;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -1,45 +1,68 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.createDefaultPipeline = createDefaultPipeline;
6
- exports.getCachedDefaultHttpsClient = getCachedDefaultHttpsClient;
7
- const defaultHttpClient_js_1 = require("../defaultHttpClient.js");
8
- const createPipelineFromOptions_js_1 = require("../createPipelineFromOptions.js");
9
- const apiVersionPolicy_js_1 = require("./apiVersionPolicy.js");
10
- const credentials_js_1 = require("../auth/credentials.js");
11
- const apiKeyAuthenticationPolicy_js_1 = require("../policies/auth/apiKeyAuthenticationPolicy.js");
12
- const basicAuthenticationPolicy_js_1 = require("../policies/auth/basicAuthenticationPolicy.js");
13
- const bearerAuthenticationPolicy_js_1 = require("../policies/auth/bearerAuthenticationPolicy.js");
14
- const oauth2AuthenticationPolicy_js_1 = require("../policies/auth/oauth2AuthenticationPolicy.js");
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var clientHelpers_exports = {};
19
+ __export(clientHelpers_exports, {
20
+ createDefaultPipeline: () => createDefaultPipeline,
21
+ getCachedDefaultHttpsClient: () => getCachedDefaultHttpsClient
22
+ });
23
+ module.exports = __toCommonJS(clientHelpers_exports);
24
+ var import_defaultHttpClient = require("../defaultHttpClient.js");
25
+ var import_createPipelineFromOptions = require("../createPipelineFromOptions.js");
26
+ var import_apiVersionPolicy = require("./apiVersionPolicy.js");
27
+ var import_credentials = require("../auth/credentials.js");
28
+ var import_apiKeyAuthenticationPolicy = require("../policies/auth/apiKeyAuthenticationPolicy.js");
29
+ var import_basicAuthenticationPolicy = require("../policies/auth/basicAuthenticationPolicy.js");
30
+ var import_bearerAuthenticationPolicy = require("../policies/auth/bearerAuthenticationPolicy.js");
31
+ var import_oauth2AuthenticationPolicy = require("../policies/auth/oauth2AuthenticationPolicy.js");
15
32
  let cachedHttpClient;
16
- /**
17
- * Creates a default rest pipeline to re-use accross Rest Level Clients
18
- */
19
33
  function createDefaultPipeline(options = {}) {
20
- const pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options);
21
- pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options));
22
- const { credential, authSchemes, allowInsecureConnection } = options;
23
- if (credential) {
24
- if ((0, credentials_js_1.isApiKeyCredential)(credential)) {
25
- pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection }));
26
- }
27
- else if ((0, credentials_js_1.isBasicCredential)(credential)) {
28
- pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection }));
29
- }
30
- else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) {
31
- pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection }));
32
- }
33
- else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) {
34
- pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection }));
35
- }
34
+ const pipeline = (0, import_createPipelineFromOptions.createPipelineFromOptions)(options);
35
+ pipeline.addPolicy((0, import_apiVersionPolicy.apiVersionPolicy)(options));
36
+ const { credential, authSchemes, allowInsecureConnection } = options;
37
+ if (credential) {
38
+ if ((0, import_credentials.isApiKeyCredential)(credential)) {
39
+ pipeline.addPolicy(
40
+ (0, import_apiKeyAuthenticationPolicy.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })
41
+ );
42
+ } else if ((0, import_credentials.isBasicCredential)(credential)) {
43
+ pipeline.addPolicy(
44
+ (0, import_basicAuthenticationPolicy.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })
45
+ );
46
+ } else if ((0, import_credentials.isBearerTokenCredential)(credential)) {
47
+ pipeline.addPolicy(
48
+ (0, import_bearerAuthenticationPolicy.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })
49
+ );
50
+ } else if ((0, import_credentials.isOAuth2TokenCredential)(credential)) {
51
+ pipeline.addPolicy(
52
+ (0, import_oauth2AuthenticationPolicy.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })
53
+ );
36
54
  }
37
- return pipeline;
55
+ }
56
+ return pipeline;
38
57
  }
39
58
  function getCachedDefaultHttpsClient() {
40
- if (!cachedHttpClient) {
41
- cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)();
42
- }
43
- return cachedHttpClient;
59
+ if (!cachedHttpClient) {
60
+ cachedHttpClient = (0, import_defaultHttpClient.createDefaultHttpClient)();
61
+ }
62
+ return cachedHttpClient;
44
63
  }
45
- //# sourceMappingURL=clientHelpers.js.map
64
+ // Annotate the CommonJS export names for ESM import in node:
65
+ 0 && (module.exports = {
66
+ createDefaultPipeline,
67
+ getCachedDefaultHttpsClient
68
+ });
@@ -1 +1,7 @@
1
- {"version":3,"file":"clientHelpers.js","sourceRoot":"","sources":["../../../src/client/clientHelpers.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwBlC,sDA2BC;AAED,kEAMC;AAvDD,kEAAkE;AAClE,kFAA4E;AAE5E,+DAAyD;AACzD,2DAKgC;AAChC,kGAA4F;AAC5F,gGAA0F;AAC1F,kGAA4F;AAC5F,kGAA4F;AAE5F,IAAI,gBAAwC,CAAC;AAE7C;;GAEG;AACH,SAAgB,qBAAqB,CAAC,UAAyB,EAAE;IAC/D,MAAM,QAAQ,GAAG,IAAA,wDAAyB,EAAC,OAAO,CAAC,CAAC;IAEpD,QAAQ,CAAC,SAAS,CAAC,IAAA,sCAAgB,EAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC;IACrE,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,IAAA,mCAAkB,EAAC,UAAU,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,SAAS,CAChB,IAAA,0DAA0B,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CACjF,CAAC;QACJ,CAAC;aAAM,IAAI,IAAA,kCAAiB,EAAC,UAAU,CAAC,EAAE,CAAC;YACzC,QAAQ,CAAC,SAAS,CAChB,IAAA,wDAAyB,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CAChF,CAAC;QACJ,CAAC;aAAM,IAAI,IAAA,wCAAuB,EAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAChB,IAAA,0DAA0B,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CACjF,CAAC;QACJ,CAAC;aAAM,IAAI,IAAA,wCAAuB,EAAC,UAAU,CAAC,EAAE,CAAC;YAC/C,QAAQ,CAAC,SAAS,CAChB,IAAA,0DAA0B,EAAC,EAAE,WAAW,EAAE,UAAU,EAAE,uBAAuB,EAAE,CAAC,CACjF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,2BAA2B;IACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,gBAAgB,GAAG,IAAA,8CAAuB,GAAE,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 { createDefaultHttpClient } from \"../defaultHttpClient.js\";\nimport { createPipelineFromOptions } from \"../createPipelineFromOptions.js\";\nimport type { ClientOptions } from \"./common.js\";\nimport { apiVersionPolicy } from \"./apiVersionPolicy.js\";\nimport {\n isApiKeyCredential,\n isBasicCredential,\n isBearerTokenCredential,\n isOAuth2TokenCredential,\n} from \"../auth/credentials.js\";\nimport { apiKeyAuthenticationPolicy } from \"../policies/auth/apiKeyAuthenticationPolicy.js\";\nimport { basicAuthenticationPolicy } from \"../policies/auth/basicAuthenticationPolicy.js\";\nimport { bearerAuthenticationPolicy } from \"../policies/auth/bearerAuthenticationPolicy.js\";\nimport { oauth2AuthenticationPolicy } from \"../policies/auth/oauth2AuthenticationPolicy.js\";\n\nlet cachedHttpClient: HttpClient | undefined;\n\n/**\n * Creates a default rest pipeline to re-use accross Rest Level Clients\n */\nexport function createDefaultPipeline(options: ClientOptions = {}): Pipeline {\n const pipeline = createPipelineFromOptions(options);\n\n pipeline.addPolicy(apiVersionPolicy(options));\n\n const { credential, authSchemes, allowInsecureConnection } = options;\n if (credential) {\n if (isApiKeyCredential(credential)) {\n pipeline.addPolicy(\n apiKeyAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isBasicCredential(credential)) {\n pipeline.addPolicy(\n basicAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isBearerTokenCredential(credential)) {\n pipeline.addPolicy(\n bearerAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isOAuth2TokenCredential(credential)) {\n pipeline.addPolicy(\n oauth2AuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n }\n }\n\n return pipeline;\n}\n\nexport function getCachedDefaultHttpsClient(): HttpClient {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n\n return cachedHttpClient;\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["/mnt/vss/_work/1/s/sdk/core/ts-http-runtime/src/client/clientHelpers.ts"],
4
+ "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 { createDefaultHttpClient } from \"../defaultHttpClient.js\";\nimport { createPipelineFromOptions } from \"../createPipelineFromOptions.js\";\nimport type { ClientOptions } from \"./common.js\";\nimport { apiVersionPolicy } from \"./apiVersionPolicy.js\";\nimport {\n isApiKeyCredential,\n isBasicCredential,\n isBearerTokenCredential,\n isOAuth2TokenCredential,\n} from \"../auth/credentials.js\";\nimport { apiKeyAuthenticationPolicy } from \"../policies/auth/apiKeyAuthenticationPolicy.js\";\nimport { basicAuthenticationPolicy } from \"../policies/auth/basicAuthenticationPolicy.js\";\nimport { bearerAuthenticationPolicy } from \"../policies/auth/bearerAuthenticationPolicy.js\";\nimport { oauth2AuthenticationPolicy } from \"../policies/auth/oauth2AuthenticationPolicy.js\";\n\nlet cachedHttpClient: HttpClient | undefined;\n\n/**\n * Creates a default rest pipeline to re-use accross Rest Level Clients\n */\nexport function createDefaultPipeline(options: ClientOptions = {}): Pipeline {\n const pipeline = createPipelineFromOptions(options);\n\n pipeline.addPolicy(apiVersionPolicy(options));\n\n const { credential, authSchemes, allowInsecureConnection } = options;\n if (credential) {\n if (isApiKeyCredential(credential)) {\n pipeline.addPolicy(\n apiKeyAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isBasicCredential(credential)) {\n pipeline.addPolicy(\n basicAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isBearerTokenCredential(credential)) {\n pipeline.addPolicy(\n bearerAuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n } else if (isOAuth2TokenCredential(credential)) {\n pipeline.addPolicy(\n oauth2AuthenticationPolicy({ authSchemes, credential, allowInsecureConnection }),\n );\n }\n }\n\n return pipeline;\n}\n\nexport function getCachedDefaultHttpsClient(): HttpClient {\n if (!cachedHttpClient) {\n cachedHttpClient = createDefaultHttpClient();\n }\n\n return cachedHttpClient;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,+BAAwC;AACxC,uCAA0C;AAE1C,8BAAiC;AACjC,yBAKO;AACP,wCAA2C;AAC3C,uCAA0C;AAC1C,wCAA2C;AAC3C,wCAA2C;AAE3C,IAAI;AAKG,SAAS,sBAAsB,UAAyB,CAAC,GAAa;AAC3E,QAAM,eAAW,4DAA0B,OAAO;AAElD,WAAS,cAAU,0CAAiB,OAAO,CAAC;AAE5C,QAAM,EAAE,YAAY,aAAa,wBAAwB,IAAI;AAC7D,MAAI,YAAY;AACd,YAAI,uCAAmB,UAAU,GAAG;AAClC,eAAS;AAAA,YACP,8DAA2B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MACjF;AAAA,IACF,eAAW,sCAAkB,UAAU,GAAG;AACxC,eAAS;AAAA,YACP,4DAA0B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MAChF;AAAA,IACF,eAAW,4CAAwB,UAAU,GAAG;AAC9C,eAAS;AAAA,YACP,8DAA2B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MACjF;AAAA,IACF,eAAW,4CAAwB,UAAU,GAAG;AAC9C,eAAS;AAAA,YACP,8DAA2B,EAAE,aAAa,YAAY,wBAAwB,CAAC;AAAA,MACjF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,8BAA0C;AACxD,MAAI,CAAC,kBAAkB;AACrB,2BAAmB,kDAAwB;AAAA,EAC7C;AAEA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -1,5 +1,15 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- //# sourceMappingURL=common.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var common_exports = {};
15
+ module.exports = __toCommonJS(common_exports);